/* ============================================================
   CUSTOM PROPERTIES
============================================================ */
:root {
  --c-bg:          #F7F8FA;
  --c-surface:     #FFFFFF;
  --c-primary:     #264b21;
  --c-primary-hv:  #1d4714;
  --c-accent:      #c9a95f;
  --c-text:        #0F172A;
  --c-muted:       #64748B;
  --c-subtle:      #94A3B8;
  --c-border:      #E8ECF1;
  --c-border-md:   #E3E8EE;
  --c-primary-tint:#EEF4EA;
  --c-success:     #16A34A;
  --c-danger:      #DC2626;

  --sp-1:  4px;  --sp-2:  8px;  --sp-3:  12px;
  --sp-4:  16px; --sp-6:  24px; --sp-8:  32px;
  --sp-12: 48px; --sp-16: 64px;

  --ff-display: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --ff-ui:      'Inter', 'Segoe UI', system-ui, sans-serif;

  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;

  --sh-sm: 0 1px 3px rgba(15, 23, 42, .07);
  --sh-md: 0 2px 8px rgba(15, 23, 42, .09),
           0 1px 2px rgba(15, 23, 42, .04);

  --content-max: 960px;
  --header-h: 64px;
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--ff-ui); background: var(--c-bg); color: var(--c-text); min-height: 100vh; line-height: 1.5; }
img, svg { display: block; }
input, button, select { font: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================
   HEADER
============================================================ */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: var(--sp-4);
  height: var(--header-h);
  padding: 0 var(--sp-8);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--sh-sm);
}

.brand-mark {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: block;
}

.brand-info { display: flex; flex-direction: column; gap: 1px; }

.brand-name {
  font-size: .68rem; font-weight: 500;
  color: var(--c-muted);
  letter-spacing: .08em; text-transform: uppercase;
}

.app-title {
  font-family: var(--ff-display);
  font-size: 1.1rem; font-weight: 400;
  letter-spacing: .01em;
}

/* ============================================================
   STEPPER
============================================================ */
.stepper {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 var(--sp-8);
}

.step-list {
  display: flex; list-style: none;
  max-width: var(--content-max);
  margin: 0 auto;
}

.step {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: .8rem; font-weight: 500;
  color: var(--c-subtle);
  position: relative;
  transition: color .2s;
}

.step + .step::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 16px;
  background: var(--c-border);
}

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 600;
  border: 1.5px solid var(--c-border-md);
  color: var(--c-subtle);
  transition: all .2s;
  flex-shrink: 0;
}

.step.is-active { color: var(--c-primary); }
.step.is-active .step-num {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-surface);
}

.step.is-done { color: var(--c-muted); }
.step.is-done .step-num {
  background: var(--c-primary-tint);
  border-color: var(--c-primary);
  color: var(--c-primary);
  font-size: 0;
}
.step.is-done .step-num::after {
  content: '✓';
  font-size: .65rem;
}

/* ============================================================
   MAIN LAYOUT
============================================================ */
.main-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-8);
}

.section.is-visible { animation: sectionIn .25s ease-out both; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-header { margin-bottom: var(--sp-8); }

.section-header h2 {
  font-family: var(--ff-display);
  font-size: 1.75rem; font-weight: 400;
  letter-spacing: .01em;
  margin-bottom: var(--sp-1);
}

.section-desc { font-size: .875rem; color: var(--c-muted); }

.section-footer {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-top: var(--sp-8);
}

.section-footer--center { justify-content: center; }

.footer-hint { font-size: .8rem; color: var(--c-subtle); }

/* ============================================================
   UPLOAD ZONE
============================================================ */
.upload-zone {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-12) var(--sp-8);
  background: var(--c-surface);
  border: 1.5px dashed var(--c-border-md);
  border-radius: var(--r-lg);
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  box-shadow: var(--sh-sm);
}

.upload-zone:hover,
.upload-zone:focus-visible {
  border-color: var(--c-primary);
  background: var(--c-primary-tint);
  outline: none;
}

.upload-zone.drag-over {
  border-color: var(--c-primary);
  background: var(--c-primary-tint);
  box-shadow: 0 0 0 3px rgba(38, 75, 33, 0.15);
}

.upload-icon { width: 48px; height: 48px; color: var(--c-accent); margin-bottom: var(--sp-2); }
.upload-main { font-size: 1rem; font-weight: 500; }
.upload-sub  { font-size: .875rem; color: var(--c-muted); }

.file-link {
  color: var(--c-primary); font-weight: 500;
  cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}

.file-chosen {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-primary-tint);
  border-radius: var(--r-md);
  margin-top: var(--sp-4);
}

.file-chosen svg { width: 18px; height: 18px; color: var(--c-primary); flex-shrink: 0; }

.filename {
  font-size: .875rem; font-weight: 500;
  color: var(--c-primary);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   CONFIG PANEL
============================================================ */
.config-panel { margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }

.config-block {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-6);
  box-shadow: var(--sh-sm);
}

.config-label {
  display: block;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: var(--sp-3);
}

/* Advanced details */
.config-toggle {
  cursor: pointer; user-select: none;
  list-style: none; margin-bottom: 0;
}

.config-toggle::-webkit-details-marker { display: none; }

.config-toggle::after {
  content: '▾';
  display: inline-block;
  margin-left: var(--sp-2);
  font-size: .65rem; color: var(--c-subtle);
  transition: transform .2s;
}

details[open] .config-toggle::after { transform: rotate(180deg); }

.sliders-grid { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4); }
.slider-row   { display: flex; flex-direction: column; gap: var(--sp-2); }

.slider-meta  { display: flex; justify-content: space-between; align-items: baseline; }
.slider-name  { font-size: .8rem; font-weight: 500; color: var(--c-muted); }
.slider-val   { font-size: .875rem; font-weight: 700; color: var(--c-primary); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  border-radius: 2px; background: var(--c-border-md);
  cursor: pointer; outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid var(--c-surface);
  box-shadow: 0 0 0 1px var(--c-border-md);
  cursor: pointer;
  transition: transform .15s;
}

input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(38, 75, 33, 0.25);
}

/* ============================================================
   BUTTONS
============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--c-primary);
  color: #FFFFFF;
  border: none; border-radius: var(--r-md);
  font-size: .875rem; font-weight: 600;
  cursor: pointer; letter-spacing: .01em;
  transition: background .15s, transform .1s;
}

.btn-primary:hover:not(:disabled) { background: var(--c-primary-hv); }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled,
.btn-primary[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
  border-radius: var(--r-md);
  font-size: .8rem; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}

.btn-secondary:hover { background: var(--c-primary-tint); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: transparent;
  color: var(--c-muted);
  border: 1.5px solid var(--c-border-md);
  border-radius: var(--r-md);
  font-size: .875rem; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-inline {
  background: none; border: none;
  color: var(--c-primary);
  font-size: .8rem; font-weight: 500;
  cursor: pointer; padding: 0 var(--sp-2);
  text-decoration: underline; text-underline-offset: 2px;
}

/* ============================================================
   ERROR BANNER
============================================================ */
.error-banner {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--r-md);
  font-size: .875rem;
  color: var(--c-danger);
}

/* ============================================================
   PROGRESS
============================================================ */
.progress-block {
  max-width: 560px; margin: 0 auto;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  box-shadow: var(--sh-md);
}

.progress-counter {
  display: flex; align-items: baseline; justify-content: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-6);
}

.prog-current {
  font-family: var(--ff-display);
  font-size: 3.5rem; font-weight: 400;
  color: var(--c-primary); line-height: 1;
  font-variant-numeric: tabular-nums;
}

.prog-sep  { font-size: 1.5rem; color: var(--c-border-md); }
.prog-total { font-size: 1.5rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.prog-unit  { font-size: .875rem; color: var(--c-subtle); margin-left: var(--sp-2); }

.progress-track {
  height: 6px; background: var(--c-border);
  border-radius: 3px; overflow: hidden;
  margin-bottom: var(--sp-4);
  role: progressbar;
}

.progress-fill {
  height: 100%; background: var(--c-primary);
  border-radius: 3px; width: 0%;
  transition: width .5s ease-out;
}

.progress-status { font-size: .8rem; color: var(--c-subtle); }

/* ============================================================
   VALIDATION — TABS + CARDS
============================================================ */
.val-tabs {
  display: flex; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  border-bottom: 2px solid var(--c-border);
  padding-bottom: 0;
}

.val-tab {
  padding: var(--sp-2) var(--sp-4);
  font-size: .875rem; font-weight: 500;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer; color: var(--c-muted);
  display: flex; align-items: center; gap: var(--sp-2);
  transition: color .15s;
}

.val-tab:hover { color: var(--c-text); }
.val-tab.is-active { color: var(--c-text); border-bottom-color: var(--c-primary); }

.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; font-size: .7rem; font-weight: 700;
  color: #fff;
}
.badge-orange { background: #d97706; }
.badge-red    { background: #dc2626; }

.val-panel { display: block; }
.val-panel.hidden { display: none; }

.panel-hint {
  font-size: .8rem; color: var(--c-muted);
  margin-bottom: var(--sp-4);
  background: var(--c-primary-tint);
  border-left: 3px solid var(--c-primary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.empty-panel {
  font-size: .85rem; color: var(--c-subtle);
  padding: var(--sp-6); text-align: center;
}
.empty-panel.hidden { display: none; }

.cards-list { display: flex; flex-direction: column; gap: var(--sp-4); }

/* Client card */
.client-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  border-left: 4px solid transparent;
}
.card-code2 { border-left-color: #d97706; }
.card-code3 { border-left-color: #dc2626; }

.card-hd {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #FBFCFD;
  border-bottom: 1px solid var(--c-border);
}

.card-code {
  font-family: monospace; font-size: .8rem; font-weight: 700;
  background: var(--c-primary-tint); color: var(--c-primary);
  padding: 1px var(--sp-2); border-radius: var(--r-sm);
  flex-shrink: 0;
}
.card-name {
  font-weight: 600; font-size: .9rem; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-strat {
  font-size: .72rem; font-weight: 500; text-transform: uppercase;
  color: var(--c-muted); flex-shrink: 0;
}
.card-gravite {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  padding: 2px var(--sp-2); border-radius: var(--r-sm);
  background: #fee2e2; color: #dc2626; flex-shrink: 0;
}

/* Correction table inside card */
.corr-table {
  width: 100%; border-collapse: collapse;
  font-size: .82rem;
}

.corr-table thead tr {
  background: #F7F8FA;
}
.corr-table th {
  padding: var(--sp-1) var(--sp-3);
  text-align: left; font-weight: 600;
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
}
.corr-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.corr-table tr:last-child td { border-bottom: none; }

.cf-field { font-weight: 600; color: var(--c-text); min-width: 110px; }
.cf-sap   { color: var(--c-muted); font-size: .8rem; }
.cf-arrow { text-align: center; color: var(--c-subtle); font-size: .9rem; width: 28px; }
.cf-api   { color: var(--c-primary); font-weight: 500; }
.cf-action { width: 110px; }

/* Warning row (VERIFIER) */
.warn-row td { background: #FBFCFD; }
.warn-arrow { color: #d97706 !important; }
.warn-val   { color: #b45309 !important; }
.warn-lbl {
  font-size: .75rem; font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 2px var(--sp-2);
  border-radius: var(--r-sm);
}

/* Checkbox label */
.check-lbl {
  display: flex; align-items: center; gap: var(--sp-2);
  cursor: pointer; font-size: .8rem; color: var(--c-text);
}
.check-lbl input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: var(--c-primary);
}

/* Code3 anomaly list */
.anomaly-list {
  list-style: none; padding: var(--sp-3) var(--sp-4);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.anomaly-list li {
  font-size: .82rem; color: #991b1b;
  padding: 2px 0;
}
.anomaly-list li::before { content: '✕  '; font-size: .7rem; }

.card-empty-msg {
  font-size: .82rem; color: var(--c-subtle);
  padding: var(--sp-3) var(--sp-4);
}

/* ============================================================
   ANOMALY TABLE
============================================================ */
.table-wrap {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden; overflow-x: auto;
}

.anomaly-table {
  width: 100%; border-collapse: collapse;
  font-size: .8rem;
  table-layout: fixed;
}

.anomaly-table col.c-client   { width: 96px; }
.anomaly-table col.c-field    { width: 112px; }
.anomaly-table col.c-sap      { width: 176px; }
.anomaly-table col.c-api      { width: 176px; }
.anomaly-table col.c-score    { width: 68px; }
.anomaly-table col.c-code     { width: 168px; }
.anomaly-table col.c-decision { width: 128px; }

.anomaly-table thead {
  position: sticky; top: var(--header-h);
  z-index: 10; background: var(--c-bg);
}

.anomaly-table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-muted); white-space: nowrap;
  border-bottom: 1px solid var(--c-border);
}

.anomaly-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid #EEF1F5;
  vertical-align: middle;
}

.anomaly-table tbody tr:hover td { background: #F7F8FA; }
.anomaly-table tbody tr:last-child td { border-bottom: none; }

.col-score { text-align: center; }

.cell-clip {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.client-code {
  font-size: .72rem; font-weight: 600;
  color: var(--c-muted); font-variant-numeric: tabular-nums;
}

.field-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  background: #E8ECF1;
  border-radius: var(--r-sm);
  font-size: .68rem; font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.val-sap { color: var(--c-muted); }
.val-api { color: var(--c-primary); font-weight: 500; }

.score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 22px;
  border-radius: var(--r-sm);
  font-size: .72rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-high { background: #DCFCE7; color: #15803D; }
.score-mid  { background: #FEF3C7;  color: #B45309; }
.score-low  { background: #FEE2E2;  color: #B91C1C; }
.score-none { background: var(--c-bg); color: var(--c-subtle); }

.code-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  background: #F7F8FA;
  border-radius: var(--r-sm);
  font-size: .65rem; font-weight: 600;
  color: var(--c-muted); letter-spacing: .02em;
  white-space: nowrap;
}

.decision-btns { display: flex; gap: var(--sp-1); }

.btn-oui, .btn-non {
  flex: 1; padding: 3px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: .72rem; font-weight: 700;
  cursor: pointer; border: 1.5px solid;
  transition: background .1s, color .1s;
  white-space: nowrap;
}

.btn-oui { background: transparent; color: var(--c-success); border-color: var(--c-success); }
.btn-oui:hover, .btn-oui.active { background: #DCFCE7; color: #166534; }

.btn-non { background: transparent; color: var(--c-danger); border-color: var(--c-danger); }
.btn-non:hover, .btn-non.active { background: #FEE2E2; color: #991B1B; }

.auto-badge {
  display: inline-block; padding: 2px var(--sp-2);
  background: var(--c-primary-tint); border-radius: var(--r-sm);
  font-size: .7rem; font-weight: 600; color: var(--c-primary);
}

.table-empty {
  padding: var(--sp-12) var(--sp-8);
  text-align: center; color: var(--c-subtle);
  font-size: .875rem;
}

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: var(--sp-1); margin-top: var(--sp-4);
  flex-wrap: wrap;
}

.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 var(--sp-2);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--c-border-md);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-muted);
  font-size: .8rem; font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}

.page-btn:hover:not(:disabled) { border-color: var(--c-primary); color: var(--c-primary); }
.page-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #FFFFFF; cursor: default; }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

.page-ellipsis { color: var(--c-subtle); font-size: .8rem; padding: 0 2px; }

/* ============================================================
   STATS STRIP
============================================================ */
.stats-strip {
  display: flex; gap: var(--sp-4);
  margin-bottom: var(--sp-8); flex-wrap: wrap;
}

.stat-card {
  flex: 1; min-width: 140px;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
}

.stat-label {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: var(--sp-2);
}

.stat-value {
  font-family: var(--ff-display);
  font-size: 2.25rem; font-weight: 400;
  line-height: 1; font-variant-numeric: tabular-nums;
}

.stat-value.v-primary { color: var(--c-primary); }
.stat-value.v-accent  { color: var(--c-accent); }
.stat-value.v-ok      { color: #2a7d4f; }
.stat-value.v-warn    { color: #b45309; }

.stat-sub {
  font-size: .75rem; color: var(--c-muted);
  margin-top: var(--sp-1); font-variant-numeric: tabular-nums;
}

/* ============================================================
   DOWNLOADS
============================================================ */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-8);
}

.dl-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px var(--sp-4);
  align-items: center;
  padding: var(--sp-6);
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1.5px solid var(--c-border);
  box-shadow: var(--sh-sm);
  transition: border-color .2s, box-shadow .2s;
}

.dl-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--sh-md);
}

.dl-title { grid-column: 1; grid-row: 1; font-weight: 600; font-size: .9rem; }
.dl-desc  { grid-column: 1; grid-row: 2; font-size: .75rem; color: var(--c-subtle); }

.dl-arrow {
  grid-column: 2; grid-row: 1 / 3;
  font-size: 1.3rem; color: var(--c-accent);
  transition: transform .2s;
}

.dl-card:hover .dl-arrow { transform: translateY(3px); }

/* ============================================================
   BREAKDOWN
============================================================ */
.breakdown {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-6);
}

.breakdown-title {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: var(--sp-4);
}

.breakdown-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.breakdown-row { display: flex; align-items: center; gap: var(--sp-3); }

.breakdown-code {
  font-size: .72rem; font-weight: 500; color: var(--c-muted);
  width: 200px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.breakdown-bar-wrap {
  flex: 1; height: 5px;
  background: var(--c-border);
  border-radius: 3px; overflow: hidden;
}

.breakdown-bar {
  height: 100%; background: var(--c-accent);
  border-radius: 3px; min-width: 4px;
}

.breakdown-count {
  font-size: .78rem; font-weight: 700;
  color: var(--c-text); min-width: 3ch;
  text-align: right; font-variant-numeric: tabular-nums;
}

/* ============================================================
   ANOMALY GROUPS — validation groupée par code
============================================================ */
.anomaly-group {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: var(--sp-3);
  border-left: 4px solid #d97706;
}

.group-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4);
  background: #FBFCFD;
  border-bottom: 1px solid var(--c-border);
}

.group-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: var(--sp-1) 0;
  color: var(--c-text);
  min-width: 0;
}

.group-toggle-btn:hover .group-title { color: var(--c-primary); }

.group-toggle-icon {
  font-size: .6rem;
  color: var(--c-muted);
  display: inline-block;
  width: 14px;
  flex-shrink: 0;
}

.group-title {
  font-size: .88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-actions {
  display: flex;
  gap: var(--sp-1);
  flex-shrink: 0;
}

.btn-group {
  padding: 3px var(--sp-3);
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
  border-radius: var(--r-sm);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s;
}

.btn-group:hover { background: var(--c-primary-tint); }

.btn-group-inv {
  color: var(--c-muted);
  border-color: var(--c-border-md);
}

.btn-group-inv:hover {
  background: var(--c-bg);
  color: var(--c-text);
  border-color: var(--c-muted);
}

.group-body.is-collapsed { display: none; }

.group-info-note {
  font-size: .8rem;
  color: #92400e;
  background: #fef3c7;
  border-left: 3px solid #d97706;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: var(--sp-3) var(--sp-4);
}

.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.group-table thead tr { background: #F7F8FA; }

.group-table th {
  padding: var(--sp-1) var(--sp-3);
  text-align: left;
  font-weight: 600;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
}

.group-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.group-table tr:last-child td { border-bottom: none; }
.group-table tbody tr:hover td { background: #FBFCFD; }

.grt-client { width: 90px; }
.grt-nom    { min-width: 150px; }

.grt-nom-inner {
  display: block;
  word-break: break-word;
}

.grt-sap { color: var(--c-muted); font-size: .8rem; }
.grt-api { color: var(--c-primary); font-weight: 500; }
.grt-action { width: 86px; }

/* Token-level diff */
.tok-common  { color: var(--c-subtle); }
.tok-removed { color: var(--c-danger); text-decoration: line-through; }
.tok-added   { color: var(--c-success); font-weight: 600; }

/* Numéro client cliquable — copie presse-papier */
.copy-btn {
  border: none;
  cursor: pointer;
  position: relative;
  transition: opacity .15s;
}
.copy-btn:hover { opacity: .75; }

.copy-btn.copy-success {
  background: #DCFCE7;
  color: #166534;
}
.copy-btn.copy-success::after {
  content: 'Copié';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .62rem;
  font-weight: 600;
  font-family: var(--ff-ui);
  background: #14532D;
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  pointer-events: none;
  z-index: 10;
}

.info-badge {
  display: inline-block;
  padding: 2px var(--sp-2);
  background: #fef3c7;
  border-radius: var(--r-sm);
  font-size: .7rem;
  font-weight: 600;
  color: #92400e;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .app-header { padding: 0 var(--sp-4); }
  .stepper    { padding: 0 var(--sp-4); }
  .main-content { padding: var(--sp-8) var(--sp-4); }
  .step-label { display: none; }
  .step { padding: var(--sp-3) var(--sp-4); }
  .section-footer { flex-direction: column; align-items: flex-start; }
  .stats-strip { gap: var(--sp-2); }
  .downloads { grid-template-columns: 1fr; }
  .breakdown-code { width: 130px; }
}
