    :root {
      --brand: rgb(216, 0, 21);
      --brand-light: rgba(216, 0, 21, 0.10);
      --brand-dark: rgb(184, 0, 15);
      --accent: #e85d24;
      --success: #1a7a4a;
      --success-light: #e6f5ed;
      --warn: #b45309;
      --warn-light: #fef3c7;
      --muted: #6b7280;
      --border: #d1d5db;
      --radius: 8px;
      --font-mono: 'Courier New', monospace;
    }

    * {
      box-sizing: border-box;
    }

    body {
      background: #f3f6fb;
      min-height: 100vh;
      font-family: system-ui, -apple-system, sans-serif;
    }

    /* ── Header ── */
    .app-header {
      background: white;
      color: black;
      padding: 0.75rem 1.5rem;
      display: flex;
      align-items: center;
      gap: 1rem;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .app-header .logo {
      font-size: 1.1rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      flex-shrink: 0;
    }

    .app-header .logo span {
      color: var(--brand);
    }

    .app-header .subtitle {
      font-size: 0.78rem;
      color: #1b1314;
      flex-grow: 1;
    }

    /* ── Main container ── */
    .container {
      max-width: 960px;
      margin: 0 auto;
      padding: 1.5rem 1rem;
    }

    /* ── Card ── */
    .card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 1.25rem;
      margin-bottom: 1rem;
    }

    .card-title {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 0.75rem;
    }

    .card-title.toggleable {
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
      transition: color 0.15s;
    }

    .card-title.toggleable:hover {
      color: var(--brand-dark);
    }

    /* ── Drop zones ── */
    .drop-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .drop-zone {
      border: 2px dashed var(--border);
      border-radius: var(--radius);
      padding: 1.25rem 1rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.18s ease;
      background: #fafafa;
      position: relative;
      min-height: 110px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
    }

    .drop-zone:hover,
    .drop-zone.drag-over {
      border-color: var(--brand);
      background: var(--brand-light);
    }

    .drop-zone.loaded {
      border-color: var(--success);
      background: var(--success-light);
    }

    .drop-zone input[type=file] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
    }

    .drop-icon {
      font-size: 1.8rem;
      line-height: 1;
    }

    .drop-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--brand-dark);
    }

    .drop-hint {
      font-size: 0.7rem;
      color: var(--muted);
    }

    .drop-filename {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--success);
      word-break: break-all;
      padding: 0 0.5rem;
    }

    /* ── Settings row ── */
    .settings-row {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 0.75rem;
      align-items: center;
    }

    @media (max-width: 680px) {
      .settings-row {
        grid-template-columns: 1fr;
      }

      .drop-row {
        grid-template-columns: 1fr;
      }
    }

    .field label {
      display: block;
      font-size: 0.7rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 0.3rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .field input[type=text],
    .field input[type=number] {
      width: 100%;
      padding: 0.4rem 0.6rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      font-size: 0.82rem;
      background: #fff;
      color: inherit;
      margin-bottom: 0;
    }

    .field input:focus {
      outline: 2px solid var(--brand);
      border-color: transparent;
    }

    /* ── Run button ── */
    .run-btn-wrapper {
      padding-top: 1.25rem;
      /* Compense la hauteur exacte du label du champ voisin */
    }

    @media (max-width: 680px) {
      .run-btn-wrapper {
        padding-top: 0;
        /* Supprime la compensation sur mobile quand c'est empilé */
      }
    }

    .run-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      background: var(--brand);
      color: #fff;
      border: none;
      border-radius: var(--radius);
      padding: 0.6rem 1.4rem;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s;
      white-space: nowrap;
      width: 100%;
      /* height: 31px; */
      /* Calqué sur la hauteur totale du champ input texte */
      margin-bottom: 0;




    }

    .run-btn:hover:not(:disabled) {
      background: var(--brand-dark);
    }

    .run-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .run-btn.running {
      background: var(--warn);
    }

    /* ── Progress ── */
    .progress-section {
      margin-bottom: 1rem;
    }

    .progress-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.4rem;
    }

    .progress-step-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: var(--brand-dark);
    }

    .progress-pct {
      font-size: 0.75rem;
      color: var(--muted);
      font-variant-numeric: tabular-nums;
    }

    .progress-track {
      height: 8px;
      background: #e5e7eb;
      border-radius: 99px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      border-radius: 99px;
      background: linear-gradient(90deg, var(--brand) 0%, #4a90e2 100%);
      transition: width 0.3s ease;
    }

    .progress-fill.done {
      background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
    }

    .progress-fill.error {
      background: #ef4444;
    }

    /* ── Steps indicator ── */
    .steps-bar {
      display: flex;
      gap: 0.3rem;
      margin-top: 0.6rem;
    }

    .step-pill {
      flex: 1;
      height: 4px;
      border-radius: 99px;
      background: #e5e7eb;
      transition: background 0.25s;
    }

    .step-pill.active {
      background: var(--brand);
    }

    .step-pill.done {
      background: var(--success);
    }

    .step-pill.error {
      background: #ef4444;
    }

    /* ── Log ── */
    .log-box {
      background: #0f1923;
      border-radius: var(--radius);
      padding: 0.75rem 1rem;
      font-family: var(--font-mono);
      font-size: 0.72rem;
      line-height: 1.65;
      max-height: 200px;
      overflow-y: auto;
      color: #c8d6e8;
    }

    .log-box .log-info {
      color: #7eb3f5;
    }

    .log-box .log-ok {
      color: #4ade80;
    }

    .log-box .log-warn {
      color: #fbbf24;
    }

    .log-box .log-error {
      color: #f87171;
    }

    .log-box .log-dim {
      color: #4a6480;
    }

    /* ── Download ── */
    .download-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      background: var(--success);
      color: #fff;
      border: none;
      border-radius: var(--radius);
      padding: 0.6rem 1.4rem;
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s;
      text-decoration: none;
    }

    .download-btn:hover {
      background: #145c38;
    }

    .download-btn:disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }

    /* ── Stats chips ── */
    .stats-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0.75rem;
    }

    .stat-chip {
      background: var(--brand-light);
      color: var(--brand-dark);
      border-radius: 99px;
      padding: 0.2rem 0.7rem;
      font-size: 0.72rem;
      font-weight: 600;
    }

    .stat-chip.ok {
      background: var(--success-light);
      color: var(--success);
    }

    .stat-chip.warn {
      background: var(--warn-light);
      color: var(--warn);
    }

    progress {
      display: none;
    }
