@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ===== Variables ===== */
:root {
  --black:    #161616;
  --white:    #FFFFFF;
  --offwhite: #F6F6F6;
  --gray:     #8E8E8E;
  --yellow:   #FFD815;
  --violet:   #8572FC;
  --orange:   #FF623A;
  --red:      #F94E5F;
  --blue:     #7BBDFF;
  --pink:     #F380FF;
  --green:    #22C55E;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 999px;

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  --container-max: 1280px;
  --header-h: 60px;
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--black);
  background: var(--offwhite);
  min-height: 100vh;
}
a { color: var(--black); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ===== Typography ===== */
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 800; line-height: 1.1;  letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 1rem;     font-weight: 700; line-height: 1.4; }
p  { margin-bottom: 0; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--black);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.header-logo { display: flex; align-items: center; gap: var(--space-sm); text-decoration: none; }
.header-logo svg { height: 30px; width: auto; }
.header-title { color: var(--white); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.5; }
.nav { display: flex; align-items: center; gap: var(--space-lg); }
.nav-link {
  color: rgba(255,255,255,0.65);
  font-size: 0.9375rem; font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--white); text-decoration: none; }

/* ===== Layout ===== */
.page-main { padding: var(--space-xl) 0 var(--space-2xl); }
.container  { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-xl); }
.page-header { margin-bottom: var(--space-xl); }
.breadcrumb {
  font-size: 0.8125rem; color: var(--gray); margin-bottom: var(--space-sm);
  display: flex; align-items: center; gap: var(--space-xs);
}
.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--black); text-decoration: underline; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-lg); }
.flex   { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.flex-wrap { flex-wrap: wrap; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ===== Card ===== */
.card {
  background: var(--white);
  border: 1px solid rgba(22,22,22,0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.card-sm { padding: var(--space-md); }
.card--yellow { background: var(--yellow); }
.card--dark   { background: var(--black); color: var(--white); border-color: rgba(255,255,255,0.1); }

.section-intro { border-left: 3px solid var(--yellow); padding-left: var(--space-md); margin-bottom: var(--space-lg); }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  font-size: 0.75rem; font-weight: 600; line-height: 1;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge--gray    { background: rgba(142,142,142,0.15); color: #555; }
.badge--yellow  { background: var(--yellow);  color: var(--black); }
.badge--blue    { background: rgba(123,189,255,0.2); color: #1a6aa3; }
.badge--orange  { background: rgba(255,98,58,0.15);  color: #c43200; }
.badge--violet  { background: rgba(133,114,252,0.15);color: #5a40e0; }
.badge--pink    { background: rgba(243,128,255,0.15);color: #a300b8; }
.badge--red     { background: rgba(249,78,95,0.15);  color: #c40024; }
.badge--green   { background: rgba(34,197,94,0.15);  color: #15803d; }

/* Status audit */
.badge--audit_vierge        { background: rgba(142,142,142,0.15); color: #555; }
.badge--analyse_draft        { background: rgba(123,189,255,0.2);  color: #1a6aa3; }
.badge--relecture_eteam      { background: rgba(255,98,58,0.15);   color: #c43200; }
.badge--pret_brief           { background: rgba(133,114,252,0.15); color: #5a40e0; }
.badge--pret_ppt             { background: rgba(243,128,255,0.15); color: #a300b8; }
.badge--valide_client_ready  { background: var(--yellow);          color: var(--black); }

/* Confidence */
.badge--observable       { background: rgba(34,197,94,0.15);   color: #15803d; }
.badge--probable         { background: rgba(255,98,58,0.15);   color: #c43200; }
.badge--non_observable   { background: rgba(142,142,142,0.15); color: #555; }
.badge--confirmed_client { background: rgba(123,189,255,0.2);  color: #1a6aa3; }

/* Obs status */
.badge--proposed_by_tool    { background: rgba(142,142,142,0.15); color: #555; }
.badge--modified_by_eteam   { background: rgba(255,98,58,0.15);   color: #c43200; }
.badge--validated_by_eteam  { background: rgba(34,197,94,0.15);   color: #15803d; }
.badge--rejected_by_eteam   { background: rgba(249,78,95,0.15);   color: #c40024; }

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 11px 22px;
  background: var(--yellow); color: var(--black);
  font-size: 0.9375rem; font-weight: 700; line-height: 1;
  border: 2px solid var(--yellow); border-radius: var(--radius-sm);
  text-decoration: none; transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: #f0ca00; border-color: #f0ca00; text-decoration: none; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 11px 22px;
  background: transparent; color: var(--black);
  font-size: 0.9375rem; font-weight: 700; line-height: 1;
  border: 2px solid var(--black); border-radius: var(--radius-sm);
  text-decoration: none; transition: background 0.15s;
  white-space: nowrap;
}
.btn-secondary:hover { background: rgba(22,22,22,0.05); text-decoration: none; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: 6px 12px;
  background: transparent; color: var(--gray);
  font-size: 0.875rem; font-weight: 500; line-height: 1;
  border: 1.5px solid rgba(22,22,22,0.15); border-radius: var(--radius-sm);
  text-decoration: none; transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--black); border-color: var(--black); background: rgba(22,22,22,0.04); text-decoration: none; }

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-danger  { border-color: var(--red);    color: var(--red); }
.btn-danger:hover  { background: rgba(249,78,95,0.08); }
.btn-success { border-color: var(--green);  color: #15803d; }
.btn-success:hover { background: rgba(34,197,94,0.08); }

/* ===== Forms ===== */
.form-group   { margin-bottom: var(--space-md); }
.form-label   { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 6px; color: var(--black); }
.form-hint    { display: block; font-size: 0.8125rem; color: var(--gray); margin-top: 4px; }
.form-error   { display: block; font-size: 0.8125rem; color: var(--red); margin-top: 4px; font-weight: 500; }

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--offwhite);
  color: var(--black);
  font-family: inherit; font-size: 1rem;
  border: 1.5px solid rgba(22,22,22,0.15);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.form-input    { height: 48px; padding: 0 var(--space-md); }
.form-textarea { min-height: 100px; padding: var(--space-sm) var(--space-md); line-height: 1.6; resize: vertical; }
.form-select   { height: 48px; padding: 0 var(--space-md); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238E8E8E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--yellow); background: var(--white); }
.form-input-sm { height: 36px; font-size: 0.875rem; }

/* ===== Flash messages ===== */
.flash {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: 0.9375rem; font-weight: 500;
}
.flash--success { background: rgba(34,197,94,0.12); color: #15803d; border: 1px solid rgba(34,197,94,0.3); }
.flash--error   { background: rgba(249,78,95,0.1);  color: #c40024; border: 1px solid rgba(249,78,95,0.3); }

/* ===== Score display ===== */
.score-hero {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: var(--space-sm);
}
.score-number { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.score-max    { font-size: 1.5rem;  font-weight: 600; color: var(--gray); }
.score-level  { display: block; font-size: 0.9375rem; font-weight: 700; color: var(--gray); margin-top: 4px; }
.score-raw    { font-size: 0.8125rem; color: var(--gray); margin-top: 2px; }

/* Pillar bars */
.pillar-table { width: 100%; border-collapse: collapse; }
.pillar-table td, .pillar-table th { padding: 8px 12px; vertical-align: middle; }
.pillar-table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); text-align: left; border-bottom: 1px solid rgba(22,22,22,0.08); }
.pillar-table tr:not(:last-child) td { border-bottom: 1px solid rgba(22,22,22,0.06); }
.pillar-name { font-size: 0.9375rem; font-weight: 500; }
.pillar-score-text { font-size: 0.875rem; font-weight: 700; white-space: nowrap; width: 60px; text-align: right; }
.pillar-bar-cell { width: 220px; }
.pillar-bar {
  position: relative; height: 8px;
  background: rgba(22,22,22,0.08);
  border-radius: 4px; overflow: hidden;
}
.pillar-bar-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--yellow); border-radius: 4px;
  transition: width 0.5s cubic-bezier(.25,.8,.25,1);
}
.pillar-pct { font-size: 0.8125rem; color: var(--gray); width: 44px; text-align: right; }

/* ===== Status flow ===== */
.status-flow {
  display: flex; align-items: center;
  gap: 0;
  margin: var(--space-lg) 0;
}
.status-step {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 8px 14px;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}
.status-step--done   { color: var(--black); }
.status-step--active { color: var(--black); background: var(--yellow); border-radius: var(--radius-sm); }
.status-step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(22,22,22,0.2);
  flex-shrink: 0;
}
.status-step--done .status-step-dot   { background: var(--black); }
.status-step--active .status-step-dot { background: var(--black); }
.status-step-arrow { color: rgba(22,22,22,0.2); font-size: 0.875rem; padding: 0 2px; }

/* ===== Guards box ===== */
.guards-box {
  background: rgba(255,216,21,0.12);
  border: 1px solid rgba(255,216,21,0.5);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
}
.guards-box-title { font-size: 0.875rem; font-weight: 700; margin-bottom: var(--space-sm); }
.guards-list { list-style: none; }
.guards-list li { font-size: 0.875rem; padding: 3px 0; color: #7a5800; }
.guards-list li::before { content: '⚠ '; }

/* ===== Observations ===== */
.obs-group { border: none; }
.obs-group-header {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) 0;
  cursor: pointer;
  list-style: none;
  border-bottom: 2px solid var(--black);
  margin-bottom: var(--space-md);
}
.obs-group-header::-webkit-details-marker { display: none; }
.obs-group-title { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; flex: 1; }
.obs-group-score { font-size: 0.875rem; font-weight: 700; color: var(--gray); }

.obs-card {
  background: var(--white);
  border: 1px solid rgba(22,22,22,0.1);
  border-left: 4px solid var(--gray);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: opacity 0.2s;
}
.obs-card.obs-confidence--observable      { border-left-color: var(--green); }
.obs-card.obs-confidence--probable        { border-left-color: var(--orange); }
.obs-card.obs-confidence--non_observable  { border-left-color: var(--gray); }
.obs-card.obs-confidence--confirmed_client{ border-left-color: var(--blue); }
.obs-card.obs-status--rejected_by_eteam   { opacity: 0.45; }
.obs-card.obs-status--validated_by_eteam  { border-left-color: var(--green); }

.obs-body    { padding: var(--space-md) var(--space-lg); }
.obs-meta    { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); flex-wrap: wrap; }
.obs-id      { font-size: 0.75rem; font-weight: 600; color: var(--gray); font-family: monospace; }
.obs-text    { font-size: 0.9375rem; font-weight: 600; margin-bottom: var(--space-sm); }

.obs-preuve {
  background: var(--offwhite);
  border-left: 3px solid rgba(22,22,22,0.15);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  color: #444;
}
.obs-preuve-label { font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); margin-bottom: 2px; }
.obs-preuve a { color: var(--gray); font-size: 0.8125rem; }

.obs-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-bottom: var(--space-md); }
@media (max-width: 768px) { .obs-fields { grid-template-columns: 1fr; } }
.obs-field-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); margin-bottom: 3px; }
.obs-field-value { font-size: 0.9rem; line-height: 1.5; }

.obs-actions {
  display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
  padding: var(--space-sm) var(--space-lg);
  background: var(--offwhite);
  border-top: 1px solid rgba(22,22,22,0.07);
}

/* obs edit (details) */
.obs-edit-toggle { list-style: none; }
.obs-edit-toggle::-webkit-details-marker { display: none; }
.obs-edit summary { cursor: pointer; }
.obs-edit-form {
  background: var(--white);
  border-top: 1px solid rgba(22,22,22,0.1);
  padding: var(--space-lg);
}
.obs-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
@media (max-width: 768px) { .obs-edit-grid { grid-template-columns: 1fr; } }

/* ===== Data table ===== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; padding: 10px 16px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray);
  border-bottom: 1.5px solid rgba(22,22,22,0.12);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(22,22,22,0.06); vertical-align: middle; font-size: 0.9375rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(22,22,22,0.02); }
.data-table .col-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .col-score { font-weight: 800; font-size: 1.1rem; }
.data-table .col-actions { white-space: nowrap; }

/* ===== Signals box ===== */
.signals-box { background: var(--offwhite); border-radius: var(--radius-md); padding: var(--space-md) var(--space-lg); }
.signals-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.signal-true  { background: rgba(249,78,95,0.1);  color: #c40024; border-radius: var(--radius-sm); padding: 4px 10px; font-size: 0.8125rem; font-weight: 600; }
.signal-null  { color: var(--gray); font-size: 0.8125rem; font-style: italic; }

/* ===== Meta info ===== */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-md); }
.meta-item-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); margin-bottom: 3px; }
.meta-item-value { font-size: 0.9375rem; font-weight: 500; word-break: break-all; }

/* ===== Empty state ===== */
.empty-state {
  text-align: center; padding: var(--space-2xl) var(--space-xl);
  color: var(--gray);
}
.empty-state h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--black); }

/* ===== Loading overlay ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(246,246,246,0.92);
  display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-lg);
}
.loading-overlay.visible { display: flex; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(22,22,22,0.1);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.loading-text { font-size: 1rem; font-weight: 600; color: var(--black); }
.loading-sub  { font-size: 0.875rem; color: var(--gray); }

/* ===== Light version (public) ===== */
.light-page {
  min-height: 100vh;
  background: var(--offwhite);
  display: flex; flex-direction: column;
}
.light-header {
  background: var(--black);
  padding: var(--space-lg) var(--space-xl);
  display: flex; align-items: center; gap: var(--space-md);
}
.light-header svg { height: 28px; width: auto; }
.light-hero {
  background: var(--black); color: var(--white);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
}
.light-hero h1 { color: var(--white); margin-bottom: var(--space-md); }
.light-hero p  { color: rgba(255,255,255,0.65); max-width: 560px; margin: 0 auto; }
.light-content { max-width: 680px; margin: 0 auto; padding: var(--space-2xl) var(--space-xl); width: 100%; }
.light-footer {
  background: var(--black); color: rgba(255,255,255,0.45);
  text-align: center; padding: var(--space-lg);
  font-size: 0.8125rem; margin-top: auto;
}

/* Checklist signals (light version) */
.checklist { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); }
.checklist-item {
  display: flex; align-items: flex-start; gap: var(--space-md);
  padding: var(--space-md);
  background: var(--white); border: 1px solid rgba(22,22,22,0.1);
  border-radius: var(--radius-md);
}
.checklist-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 1px; }
.checklist-label { font-size: 0.9375rem; font-weight: 600; }
.checklist-detail { font-size: 0.8125rem; color: var(--gray); margin-top: 2px; }
.score-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background: var(--yellow); color: var(--black);
  font-weight: 800; font-size: 1.25rem;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
}

/* ===== Utilities ===== */
.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.8125rem; }
.text-muted { color: var(--gray); }
.text-bold  { font-weight: 700; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider    { border: none; border-top: 1px solid rgba(22,22,22,0.1); margin: var(--space-lg) 0; }
.label-section { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray); margin-bottom: var(--space-sm); }

/* ===== Pillar nav bar ===== */
.pillar-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  background: var(--offwhite);
  border-bottom: 2px solid rgba(22,22,22,0.1);
  margin: 0 calc(-1 * var(--space-xl));
  padding: 0 var(--space-xl);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-lg);
}
.pillar-nav::-webkit-scrollbar { display: none; }
.pillar-nav-inner {
  display: flex;
  min-width: max-content;
}
.pillar-nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--gray);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.pillar-nav-item:hover { color: var(--black); border-bottom-color: rgba(22,22,22,0.3); text-decoration: none; }
.pillar-nav-item.complete { color: var(--black); border-bottom-color: var(--yellow); }
.pillar-nav-count {
  font-size: 0.75rem; font-weight: 700;
  background: rgba(22,22,22,0.08);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.pillar-nav-item.complete .pillar-nav-count { background: var(--yellow); color: var(--black); }

/* ===== Observation progress bar ===== */
.obs-progress {
  display: flex; align-items: center; gap: var(--space-md);
}
.obs-progress-bar-wrap {
  flex: 1; height: 10px;
  background: rgba(22,22,22,0.08);
  border-radius: 5px; overflow: hidden;
}
.obs-progress-bar-fill {
  height: 100%; background: var(--yellow); border-radius: 5px;
  transition: width 0.5s cubic-bezier(.25,.8,.25,1), background 0.3s;
}
.obs-progress-label {
  font-size: 0.875rem; font-weight: 800;
  white-space: nowrap; min-width: 48px; text-align: right;
}

/* ===== Collapsed observation card ===== */
.obs-card--collapsed .obs-preuve,
.obs-card--collapsed .obs-fields,
.obs-card--collapsed details.obs-edit { display: none; }
.obs-card--collapsed .obs-body { padding-bottom: var(--space-sm); }
.obs-card--collapsed .obs-actions { padding: var(--space-xs) var(--space-lg); gap: var(--space-sm); }
.obs-expand-btn { display: none; }
.obs-card--collapsed .obs-expand-btn { display: inline-flex; }
.obs-card--collapsed .btn-success,
.obs-card--collapsed .btn-danger { display: none; }

/* ===== Print / PDF export ===== */
@media print {
  .header, .nav, .status-flow, .obs-actions, details.obs-edit,
  .pillar-nav, .obs-progress, .guards-box .label-section,
  .page-header .flex-between > div:last-child,
  .btn-primary, .btn-secondary, .btn-ghost { display: none !important; }
  .container { padding: 0; max-width: 100%; }
  .card { border: 1px solid #ddd; break-inside: avoid; page-break-inside: avoid; }
  .obs-card { break-inside: avoid; }
  .obs-card--collapsed .obs-preuve,
  .obs-card--collapsed .obs-fields { display: block !important; }
  body { font-size: 12px; background: #fff; }
}

/* ===== Workflow statut ===== */
.workflow-card {
  background: var(--white);
  border: 1px solid rgba(22,22,22,0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-xl); flex-wrap: wrap;
}
.workflow-steps {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none; flex: 1;
  min-width: 0;
}
.workflow-steps::-webkit-scrollbar { display: none; }
.workflow-step {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  font-size: 0.8125rem; font-weight: 600;
  color: var(--gray); white-space: nowrap; border-radius: var(--radius-sm);
}
.workflow-step--done    { color: var(--black); }
.workflow-step--current { background: var(--yellow); color: var(--black); }
.workflow-step--future  { color: rgba(22,22,22,0.3); }
.workflow-arrow { color: rgba(22,22,22,0.18); padding: 0 3px; font-size: 0.75rem; flex-shrink: 0; }
.workflow-actions { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }

/* ===== Export button states ===== */
.btn-export-ready {
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 10px 18px;
  background: var(--green); color: #fff;
  font-size: 0.875rem; font-weight: 700; line-height: 1;
  border: 2px solid var(--green); border-radius: var(--radius-sm);
  text-decoration: none; transition: opacity 0.15s; white-space: nowrap;
}
.btn-export-ready:hover { opacity: 0.85; text-decoration: none; }
.btn-export-disabled {
  display: inline-flex; align-items: center;
  padding: 10px 18px;
  background: transparent; color: var(--gray);
  font-size: 0.875rem; font-weight: 600; line-height: 1;
  border: 2px solid rgba(22,22,22,0.15); border-radius: var(--radius-sm);
  cursor: not-allowed; white-space: nowrap;
}

/* ===== Sticky progress bar (full-width) ===== */
.obs-sticky-progress {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--white);
  border-bottom: 1px solid rgba(22,22,22,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 8px var(--space-xl);
  display: flex; align-items: center; gap: var(--space-md);
}
/* Spacer qui compense la hauteur de la barre fixed (~42px) */
.obs-progress-spacer { height: 42px; }
/* Pillar nav se positionne sous la barre fixed */
.pillar-nav { top: calc(var(--header-h) + 42px); }

/* ===== Score breakdown ===== */
.score-breakdown { display: flex; gap: var(--space-lg); }
.score-breakdown-row { display: flex; flex-direction: column; gap: 2px; }
.score-breakdown-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); }
.score-breakdown-val { font-size: 1.125rem; font-weight: 700; }

/* Score signals in card */
.score-signals { background: rgba(255,98,58,0.07); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); }
.score-signals-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); margin-bottom: 6px; }
.score-signal-item { font-size: 0.875rem; color: #c43200; padding: 2px 0; }

/* ===== Loading overlay — checkpoints ===== */
.loading-card {
  text-align: left;
  max-width: 460px;
  width: 90vw;
}
.loading-header {
  display: flex; align-items: center; gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.loading-header h3 { margin: 0; font-size: 1.125rem; }

.loading-steps {
  list-style: none;
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: var(--space-lg);
  position: relative;
}
/* Ligne verticale de connexion */
.loading-steps::before {
  content: '';
  position: absolute;
  left: 10px; top: 20px;
  width: 2px;
  height: calc(100% - 20px);
  background: rgba(22,22,22,0.08);
}

.loading-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  color: rgba(22,22,22,0.3);
  transition: color 0.3s;
}
.loading-step.step--done   { color: var(--black); }
.loading-step.step--active { color: var(--black); }

/* Dot / spinner / checkmark */
.loading-step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(22,22,22,0.15);
  background: var(--offwhite);
  flex-shrink: 0;
  position: relative; z-index: 1;
  transition: border-color 0.3s, background 0.3s;
}
.loading-step.step--active .loading-step-dot {
  border-color: var(--yellow);
  border-top-color: transparent;
  background: transparent;
  animation: spin 0.75s linear infinite;
}
.loading-step.step--done .loading-step-dot {
  background: var(--green);
  border-color: var(--green);
}
/* Checkmark via pseudo */
.loading-step.step--done .loading-step-dot::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border: 2.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.loading-step-content { padding-top: 1px; }
.loading-step-label {
  display: block;
  font-size: 0.9375rem; font-weight: 500;
  line-height: 1.4;
}
.loading-step.step--active .loading-step-label { font-weight: 700; }
.loading-step-sub {
  display: block;
  font-size: 0.8125rem; color: var(--gray);
  margin-top: 3px;
}

.loading-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8125rem; color: var(--gray);
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(22,22,22,0.08);
}
.loading-elapsed {
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--black);
  font-size: 0.875rem;
}

/* ===== Crawl coverage table ===== */
.crawl-table {
  width: 100%; border-collapse: collapse; font-size: 0.8125rem;
}
.crawl-table th {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gray);
  padding: 6px 10px; border-bottom: 1.5px solid rgba(22,22,22,0.08);
  text-align: left;
}
.crawl-table td {
  padding: 7px 10px; border-bottom: 1px solid rgba(22,22,22,0.05);
  vertical-align: middle;
}
.crawl-table tr:last-child td { border-bottom: none; }
.crawl-url { max-width: 420px; }
.crawl-url a { font-size: 0.75rem; color: var(--gray); word-break: break-all; }
.crawl-url a:hover { color: var(--black); }
.crawl-failed { border-top: 1px solid rgba(22,22,22,0.06); padding-top: var(--space-sm); }
.crawl-failed-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 4px 0;
}

/* ===== Options avancées (formulaire nouvel audit) ===== */
.form-advanced { margin-top: var(--space-lg); }
.form-advanced-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--gray);
  cursor: pointer; list-style: none; user-select: none;
}
.form-advanced-toggle:hover { color: var(--black); }
.form-advanced-toggle::before { content: '▸'; font-size: 0.75rem; transition: transform 0.15s; }
details[open] .form-advanced-toggle::before { transform: rotate(90deg); }
.form-advanced-body { margin-top: var(--space-md); }
