/* ==========================================================
     MENTOR VÉTO — Design system
     Palette : terracotta + crème + beige chaud
     ========================================================== */
  :root {
    --bg: #FAF6F0;
    --surface: #FFFFFF;
    --surface-alt: #F4ECDF;
    --primary: #C97B3F;
    --primary-dark: #A85F2A;
    --primary-light: #E5A877;
    --accent: #6B4423;
    --text: #2A2520;
    --text-soft: #6B5D4F;
    --text-muted: #9A8B7C;
    --border: #E8DCC4;
    --success: #5C8C5A;
    --success-bg: #E8F0E5;
    --warning: #D4A04C;
    --warning-bg: #FBF3E2;
    --error: #B5564A;
    --error-bg: #F7E3E0;
    --shadow-sm: 0 1px 3px rgba(42, 37, 32, 0.04), 0 1px 2px rgba(42, 37, 32, 0.06);
    --shadow-md: 0 4px 16px rgba(42, 37, 32, 0.06), 0 2px 4px rgba(42, 37, 32, 0.04);
    --shadow-lg: 0 12px 32px rgba(42, 37, 32, 0.08), 0 4px 8px rgba(42, 37, 32, 0.04);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
  }
  .app-shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

  /* HEADER */
  header { padding: 28px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
  .header-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
  .brand { display: flex; align-items: center; gap: 14px; }
  .brand-mark { width: 44px; height: 44px; border-radius: 12px; display: block; box-shadow: var(--shadow-md); }
  .brand-text h1 { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); line-height: 1.1; }
  .brand-text p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
  .header-actions { display: flex; gap: 12px; align-items: center; }

  /* BUTTONS */
  .btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: none; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.18s ease; white-space: nowrap; }
  .btn-primary { background: var(--primary); color: white; box-shadow: 0 1px 3px rgba(201, 123, 63, 0.2); }
  .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201, 123, 63, 0.28); }
  .btn-primary:active { transform: translateY(0); }
  .btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--surface-alt); border-color: var(--primary-light); }
  .btn-ghost { background: transparent; color: var(--text-soft); padding: 8px 14px; }
  .btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
  .btn-large { padding: 14px 26px; font-size: 15px; font-weight: 600; }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

  /* FILTERS BAR */
  .filters { display: flex; gap: 12px; flex-wrap: wrap; background: var(--surface); padding: 16px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
  .filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 180px; }
  .filter-group label { font-size: 12px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
  .filter-group select { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text); cursor: pointer; transition: border-color 0.15s ease; }
  .filter-group select:hover { border-color: var(--primary-light); }
  .filter-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201, 123, 63, 0.12); }

  /* HOME */
  .home-section { background: linear-gradient(135deg, #FFF8EE 0%, #F4ECDF 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 40px; text-align: center; margin-bottom: 32px; box-shadow: var(--shadow-md); }
  .home-section h2 { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-bottom: 10px; }
  .home-section p { color: var(--text-soft); margin-bottom: 28px; max-width: 520px; margin-left: auto; margin-right: auto; }

  /* CASE CARD */
  .case-card { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-md); overflow: hidden; margin-bottom: 24px; }
  .case-header { padding: 24px 28px; background: linear-gradient(135deg, var(--surface-alt) 0%, #FFF5E6 100%); border-bottom: 1px solid var(--border); }
  .case-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); }
  .badge-species { background: var(--primary); color: white; border-color: var(--primary); }
  .badge-system { background: var(--accent); color: white; border-color: var(--accent); }
  .case-header h3 { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
  .case-body { padding: 24px 28px; }
  .case-section { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px dashed var(--border); }
  .case-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
  .case-section h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 10px; }
  .case-section p, .case-section ul { color: var(--text); font-size: 15px; }
  .case-section ul { padding-left: 20px; }
  .case-section ul li { margin-bottom: 4px; }

  /* MODE SELECTOR */
  .mode-selector { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 20px; }
  .mode-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.18s ease; text-align: left; font-family: inherit; color: var(--text); }
  .mode-card:hover { border-color: var(--primary-light); background: var(--surface-alt); transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .mode-card-icon { width: 36px; height: 36px; background: var(--surface-alt); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 18px; }
  .mode-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
  .mode-card-desc { font-size: 13px; color: var(--text-soft); }

  /* EVAL */
  .eval-section { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 28px; box-shadow: var(--shadow-md); margin-bottom: 24px; }
  .eval-step { margin-bottom: 24px; }
  .eval-step h3 { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
  .eval-step p.helper { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }

  .qcm-options { display: flex; flex-direction: column; gap: 10px; }
  .qcm-option { padding: 14px 18px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.15s ease; font-family: inherit; font-size: 14px; color: var(--text); text-align: left; display: flex; align-items: center; gap: 12px; }
  .qcm-option:hover { border-color: var(--primary-light); background: var(--surface-alt); }
  .qcm-option.selected { border-color: var(--primary); background: rgba(201, 123, 63, 0.06); }
  .qcm-option.correct { border-color: var(--success); background: var(--success-bg); }
  .qcm-option.incorrect { border-color: var(--error); background: var(--error-bg); }
  .qcm-option .letter { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--surface-alt); font-weight: 600; font-size: 13px; flex-shrink: 0; }
  .qcm-option.correct .letter { background: var(--success); color: white; }
  .qcm-option.incorrect .letter { background: var(--error); color: white; }
  .qcm-reason { display: none; font-size: 13px; color: var(--error); background: var(--error-bg); border-radius: 8px; padding: 8px 12px; margin-top: 8px; line-height: 1.55; border-left: 3px solid var(--error); }
  .qcm-option.incorrect .qcm-reason { display: block; }

  .free-input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text); resize: vertical; min-height: 90px; transition: border-color 0.15s ease; }
  .free-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201, 123, 63, 0.12); }

  .multi-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
  .multi-option { padding: 12px 14px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; gap: 10px; font-size: 14px; }
  .multi-option:hover { border-color: var(--primary-light); }
  .multi-option.selected { border-color: var(--primary); background: rgba(201, 123, 63, 0.06); }
  .multi-option.correct-pick { border-color: var(--success); background: var(--success-bg); }
  .multi-option.wrong-pick { border-color: var(--error); background: var(--error-bg); }
  .multi-option.missed { border-color: var(--warning); background: var(--warning-bg); border-style: dashed; }
  .multi-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

  /* RESULT / SCORE */
  .score-display { background: linear-gradient(135deg, #FFF8EE 0%, #F4ECDF 100%); border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 36px; text-align: center; margin-bottom: 24px; box-shadow: var(--shadow-md); }
  .score-circle { width: 140px; height: 140px; margin: 0 auto 20px; position: relative; }
  .score-circle svg { transform: rotate(-90deg); }
  .score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .score-value { font-family: 'Fraunces', serif; font-size: 42px; font-weight: 700; color: var(--text); line-height: 1; }
  .score-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

  .score-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 20px; max-width: 600px; margin-left: auto; margin-right: auto; }
  .score-item { background: var(--surface); border-radius: 12px; padding: 14px; border: 1px solid var(--border); }
  .score-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
  .score-item .value { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; color: var(--text); margin-top: 4px; }

  /* FEEDBACK BLOCKS */
  .feedback-block { border-radius: var(--radius); padding: 20px; margin-bottom: 16px; border-left: 4px solid; }
  .feedback-trap { background: var(--warning-bg); border-color: var(--warning); }
  .feedback-tip { background: var(--success-bg); border-color: var(--success); }
  .feedback-ref { background: var(--surface-alt); border-color: var(--accent); }
  .feedback-block h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
  .feedback-block p { color: var(--text); font-size: 14px; }

  /* HISTORY */
  .history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .history-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; cursor: pointer; transition: all 0.15s ease; box-shadow: var(--shadow-sm); }
  .history-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
  .history-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .history-card .title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
  .history-card .date { font-size: 12px; color: var(--text-muted); }
  .score-pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
  .score-pill.high { background: var(--success-bg); color: var(--success); }
  .score-pill.mid { background: var(--warning-bg); color: var(--warning); }
  .score-pill.low { background: var(--error-bg); color: var(--error); }

  .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
  .empty-state h3 { font-family: 'Fraunces', serif; font-size: 20px; color: var(--text-soft); margin-bottom: 8px; }

  .hidden { display: none !important; }
  .actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
  .nav-tabs { display: flex; gap: 4px; margin-bottom: 24px; padding: 4px; background: var(--surface-alt); border-radius: 12px; width: fit-content; }
  .nav-tab { padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-soft); transition: all 0.15s; border: none; background: transparent; font-family: inherit; }
  .nav-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
  .nav-tab:hover:not(.active) { color: var(--text); }

  .stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
  .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
  .stat-card .stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
  .stat-card .stat-value { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; margin-top: 4px; }

  /* PRINT (PDF) */
  @media print {
    body { background: white; color: black; }
    header, .filters, .nav-tabs, .actions-row, .home-section, .eval-section, .score-display { display: none !important; }
    .case-card { display: none !important; }
    .print-only { display: block !important; }
    .app-shell { max-width: 100%; padding: 0; }
    .pdf-page { padding: 30px 40px; font-size: 12pt; line-height: 1.5; }
    .pdf-page h1 { font-family: 'Fraunces', serif; font-size: 24pt; color: #A85F2A; margin-bottom: 8pt; }
    .pdf-page h2 { font-family: 'Fraunces', serif; font-size: 16pt; color: #A85F2A; margin-top: 20pt; margin-bottom: 8pt; border-bottom: 2px solid #C97B3F; padding-bottom: 4pt; }
    .pdf-page h3 { font-size: 12pt; font-weight: 700; color: #6B4423; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 14pt; margin-bottom: 6pt; }
    .pdf-page p, .pdf-page li { font-size: 11pt; }
    .pdf-page ul { padding-left: 20pt; margin: 6pt 0; }
    .pdf-meta { color: #6B5D4F; font-size: 10pt; margin-bottom: 16pt; }
    .pdf-block { background: #FAF6F0; border-left: 3px solid #C97B3F; padding: 10pt 14pt; margin: 8pt 0; page-break-inside: avoid; }
    .pdf-block.warning { background: #FBF3E2; border-color: #D4A04C; }
    .pdf-block.success { background: #E8F0E5; border-color: #5C8C5A; }
    .pdf-footer { margin-top: 20pt; padding-top: 10pt; border-top: 1px solid #E8DCC4; font-size: 9pt; color: #9A8B7C; text-align: center; }
  }
  .print-only { display: none; }

  /* ========== MODE CHOICE (nouvelle home) ========== */
  .mode-choice-header { text-align: center; margin-bottom: 28px; padding-top: 12px; }
  .mode-choice-header h2 { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--text); margin-bottom: 8px; }
  .mode-choice-header p { color: var(--text-soft); font-size: 15px; }

  .mode-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }

  .mcc {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 22px 22px;
    display: flex; flex-direction: column; gap: 14px;
    box-shadow: var(--shadow-md);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  .mcc:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .mcc-consult { border-color: var(--primary); background: linear-gradient(155deg, #FFF9F0 0%, #FFF0DC 100%); }

  .mcc-top { display: flex; align-items: center; gap: 12px; }
  .mcc-icon-wrap { font-size: 28px; line-height: 1; flex-shrink: 0; }
  .mcc-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
  .mcc-badge-consult { color: var(--primary-dark); }

  .mcc-title { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 600; color: var(--text); line-height: 1.25; margin: 0; }
  .mcc-consult .mcc-title { color: var(--accent); }
  .mcc-desc { font-size: 13px; color: var(--text-soft); line-height: 1.65; flex: 1; margin: 0; }
  .mcc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .mcc-tags span { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text-soft); }
  .mcc-consult .mcc-tags span { background: rgba(201,123,63,.1); border-color: rgba(201,123,63,.3); color: var(--primary-dark); }
  .mcc-btn { width: 100%; justify-content: center; margin-top: 4px; min-height: 44px; font-size: 14px; font-weight: 600; }

  .training-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 4px 0; }
  .training-label { font-size: 14px; font-weight: 600; color: var(--text-soft); }

  /* ========== MOBILE ========== */
  @media (max-width: 640px) {
    .home-section { padding: 28px 18px; }
    .home-section h2 { font-size: 22px; }
    .case-header, .case-body, .eval-section, .score-display { padding: 16px; }
    .consult-fields { grid-template-columns: 1fr 1fr; }
    .mode-choice-grid { grid-template-columns: 1fr; gap: 14px; }
    .mode-choice-header h2 { font-size: 24px; }
    .mcc { padding: 22px 18px 18px; gap: 12px; }
    .mcc-title { font-size: 18px; }
    .qcm-option { min-height: 48px; }
    .btn-large { padding: 14px 22px; font-size: 15px; }
    .header-actions { gap: 6px; }
    .btn-ghost { padding: 8px 10px; font-size: 13px; }
    .header-inner { gap: 12px; }
    .brand-text h1 { font-size: 18px; }
    .brand-text p { display: none; }
    .mode-card-desc { font-size: 12px; }
    .consult-section { padding: 16px 18px; }
  }
  /* ── FOOTER PADDING ── */
  main { padding-bottom: 80px; }

  @media (max-width: 400px) {
    .app-shell { padding: 0 14px; }
    header { padding: 18px 0 16px; }
    .mode-choice-grid { gap: 12px; }
  }

  /* ── FIX ANDROID ── */
  @media (max-width: 480px) {
    .header-actions { flex-wrap: nowrap; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .header-actions .btn-ghost { font-size: 12px; padding: 7px 8px; white-space: nowrap; }
    .header-actions .btn-consult-nav { font-size: 12px; padding: 7px 10px; }
    #user-badge-btn { flex-shrink: 0; }
    .brand-mark { width: 36px; height: 36px; font-size: 17px; }
    .brand-text h1 { font-size: 16px; }
    .consult-fields { grid-template-columns: 1fr 1fr; gap: 10px; }
    .score-breakdown { grid-template-columns: 1fr 1fr; }
    .analyse-btns { grid-template-columns: 1fr; }
  }
  * { -webkit-tap-highlight-color: rgba(201,123,63,0.12); }
  body { overscroll-behavior-y: contain; }

  /* ========== MODE CONSULTATION ========== */
  .consult-mode-banner { background: linear-gradient(135deg, #FFF8EE 0%, #F4ECDF 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 20px; box-shadow: var(--shadow-md); }
  .consult-mode-banner h2 { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-bottom: 6px; }
  .consult-mode-banner p { color: var(--text-soft); font-size: 14px; max-width: 560px; }

  .consult-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
  .consult-field-group { display: flex; flex-direction: column; gap: 6px; }
  .consult-field-group label { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }
  .consult-field-group input, .consult-field-group select { padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text); transition: border-color 0.15s; }
  .consult-field-group input:focus, .consult-field-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201,123,63,0.12); }
  .consult-textarea-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
  .consult-textarea-group label { font-size: 11px; font-weight: 700; color: var(--text-soft); text-transform: uppercase; letter-spacing: 0.06em; }

  .loading-indicator { display: flex; align-items: center; gap: 16px; padding: 32px 28px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); color: var(--text-soft); font-size: 15px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
  .spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.75s linear infinite; flex-shrink: 0; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .consult-response-wrap { margin-top: 4px; }
  .consult-response-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
  .consult-response-header h3 { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: var(--text); }

  .consult-section { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px 24px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
  .consult-section-warning { background: var(--warning-bg); border-color: var(--warning); border-left: 4px solid var(--warning); }
  .consult-section-tip { background: var(--success-bg); border-color: var(--success); border-left: 4px solid var(--success); }
  .consult-section-client { background: linear-gradient(135deg, #FFF8EE 0%, #F4ECDF 100%); border-color: var(--primary-light); border-left: 4px solid var(--primary); }
  .consult-section-ref { background: var(--surface-alt); border-left: 4px solid var(--accent); border-color: var(--border); }
  .consult-section-ddx { border-left: 4px solid var(--accent); }
  .consult-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 12px; }
  .consult-section-warning .consult-section-title { color: #b07a1a; }
  .consult-section-tip .consult-section-title { color: var(--success); }
  .consult-section-ref .consult-section-title { color: var(--accent); }
  .consult-section-content { font-size: 14px; color: var(--text); line-height: 1.75; }
  .consult-section-content ul { padding-left: 20px; margin: 8px 0; }
  .consult-section-content li { margin-bottom: 5px; }
  .consult-section-content strong { font-weight: 600; }
  .consult-section-content em { font-style: italic; color: var(--text-soft); }

  .consult-error { background: var(--error-bg); border: 1px solid var(--error); border-radius: var(--radius); padding: 18px 22px; color: var(--error); font-size: 14px; margin-bottom: 16px; }
  .btn-consult-nav { background: var(--primary); color: white; box-shadow: 0 1px 3px rgba(201,123,63,0.25); }
  .btn-consult-nav:hover { background: var(--primary-dark); }

  /* ===== DDx CARDS (expandable) ===== */
  .ddx-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
  .ddx-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s; }
  .ddx-card:hover { box-shadow: var(--shadow-md); }
  .ddx-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; cursor: pointer; user-select: none; }
  .ddx-rank { width: 28px; height: 28px; border-radius: 8px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
  .ddx-card:nth-child(2) .ddx-rank { background: var(--accent); }
  .ddx-card:nth-child(3) .ddx-rank { background: var(--text-soft); }
  .ddx-card:nth-child(n+4) .ddx-rank { background: var(--text-muted); }
  .ddx-name { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; line-height: 1.4; }
  .ddx-prob { background: var(--primary); color: white; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
  .ddx-card:nth-child(2) .ddx-prob { background: var(--accent); }
  .ddx-card:nth-child(3) .ddx-prob { background: var(--text-soft); }
  .ddx-card:nth-child(n+4) .ddx-prob { background: var(--text-muted); }
  .ddx-toggle { margin-left: 4px; background: none; border: 1px solid var(--border); cursor: pointer; font-size: 11px; color: var(--text-muted); padding: 3px 8px; border-radius: 6px; flex-shrink: 0; transition: all 0.15s; }
  .ddx-toggle:hover { background: var(--surface-alt); color: var(--primary); border-color: var(--primary-light); }
  .ddx-card.open .ddx-toggle { color: var(--primary); background: var(--surface-alt); }
  .ddx-justif-short { font-size: 13.5px; color: var(--text-soft); line-height: 1.6; padding-left: 38px; }
  .ddx-justif-full { font-size: 13.5px; color: var(--text); line-height: 1.7; padding: 10px 14px; background: var(--surface-alt); border-radius: 10px; margin-top: 8px; display: none; border-left: 3px solid var(--primary-light); }
  .ddx-card.open .ddx-justif-full { display: block; }
  @media (max-width: 480px) { .ddx-justif-short { padding-left: 0; } }

  /* ===== SECTION CONTENU enrichi ===== */
  .consult-section-content h4 { font-size: 13px; font-weight: 700; color: var(--accent); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
  .consult-section-content p { margin-bottom: 8px; }
  .consult-section-content .c-item { display: flex; gap: 8px; margin-bottom: 6px; align-items: flex-start; }
  .consult-section-content .c-item::before { content: "•"; color: var(--primary); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
  .consult-section-content .c-separator { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }

  /* ===== AFFINER LA RÉPONSE ===== */
  .refine-section { margin-top: 6px; }
  .refine-intro { font-size: 14px; color: var(--text-soft); margin-bottom: 14px; font-style: italic; }
  .refine-q { margin-bottom: 12px; }
  .refine-q label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.45; }
  .refine-input { width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text); transition: border-color 0.15s; }
  .refine-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(201,123,63,0.12); }
  .refine-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .refine-result { margin-top: 16px; background: linear-gradient(135deg, #FFF8EE 0%, #F4ECDF 100%); border: 1px solid var(--primary-light); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 20px 22px; }
  .refine-result-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 12px; }
  .refine-result-content { font-size: 14px; color: var(--text); line-height: 1.75; }

  /* ===== ANALYSE RAPIDE / PROFONDE ===== */
  .analyse-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
  .btn-rapide { background: var(--primary); color: white; }
  .btn-rapide:hover { background: var(--primary-dark); transform: translateY(-1px); }
  .btn-profonde { background: var(--accent); color: white; }
  .btn-profonde:hover { background: #55341a; transform: translateY(-1px); }
  .profonde-questions-card { background: linear-gradient(135deg,#FFF8EE 0%,#F4ECDF 100%); border: 1px solid var(--primary-light); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 22px 24px; margin-top: 16px; }
  .profonde-questions-title { font-family: 'Fraunces',serif; font-size: 17px; font-weight: 600; color: var(--accent); margin-bottom: 6px; }
  .profonde-questions-sub { font-size: 13px; color: var(--text-soft); margin-bottom: 18px; }
  .profonde-q { margin-bottom: 14px; }
  .profonde-q label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
  .profonde-input { width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: inherit; font-size: 14px; color: var(--text); transition: border-color 0.15s; }
  .profonde-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107,68,35,0.12); }
  .streaming-cursor { display: inline-block; width: 2px; height: 15px; background: var(--primary); animation: blink 0.8s step-end infinite; vertical-align: text-bottom; margin-left: 2px; }
  @keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   COMPTES, CRÉDITS ET QUOTAS — ajouté avec le système de comptes
   ============================================================ */
.mv-account { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mv-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
  white-space: nowrap;
}
.mv-chip-btn { cursor: pointer; background: var(--primary); border-color: var(--primary); color: #fff; }
.mv-chip-btn:hover { filter: brightness(1.06); }
button.mv-chip { cursor: pointer; font-family: inherit; }

.mv-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(42, 37, 32, .62); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.mv-modal-box {
  background: var(--surface); border-radius: 20px; padding: 34px 30px;
  max-width: 430px; width: 100%; text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.mv-modal-left { text-align: left; }
.mv-modal-mark { font-size: 42px; margin-bottom: 12px; }
.mv-modal-box h2 { font-family: 'Fraunces', Georgia, serif; font-size: 23px; color: var(--text); margin-bottom: 8px; }
.mv-modal-box > p { color: var(--text-soft); font-size: 14.5px; line-height: 1.6; margin-bottom: 22px; }
.mv-modal-box form { display: flex; flex-direction: column; gap: 10px; }
.mv-modal-box input[type=email] {
  width: 100%; padding: 13px 16px; font-size: 16px; font-family: inherit;
  border: 2px solid var(--border); border-radius: 12px; text-align: center;
  color: var(--text); background: var(--bg); outline: none;
}
.mv-modal-box input[type=email]:focus { border-color: var(--primary); }
.mv-modal-box button[type=submit], .mv-secondary {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--primary); color: #fff;
}
.mv-modal-box button[disabled] { opacity: .6; cursor: default; }
.mv-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); margin-top: 8px; }
.mv-modal-note { margin-top: 14px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.mv-dl { display: flex; flex-direction: column; gap: 0; margin: 4px 0 20px; }
.mv-dl > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.mv-dl > div:last-child { border-bottom: none; }
.mv-dl dt { font-size: 13.5px; color: var(--text-soft); margin: 0; }
.mv-dl dd { font-size: 13.5px; color: var(--text); font-weight: 600; margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.mv-notice {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--radius, 12px); padding: 14px 18px; margin-bottom: 20px;
  font-size: 13.5px; line-height: 1.6; color: var(--text-soft);
}
.mv-notice strong { color: var(--text); }

.limit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius, 12px); padding: 32px 30px; text-align: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.06));
}
.limit-card h3 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; color: var(--text); margin-bottom: 12px; }
.limit-card p { color: var(--text-soft); font-size: 14.5px; line-height: 1.65; max-width: 44ch; margin: 0 auto 22px; }
.limit-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Écran « comment ça marche » (2 étapes, tient sur un téléphone) ---------- */
.mv-chip-q { font-weight: 700; width: 28px; padding: 6px 0; justify-content: center; }

.mv-intro {
  max-width: 500px;
  max-height: min(88vh, 640px);
  display: flex; flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.mv-intro-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 28px 26px 20px;
  -webkit-overflow-scrolling: touch;
}
.mv-intro-body h2 { margin-bottom: 4px; }
.mv-intro-lead { font-size: 14.5px; color: var(--text-soft); margin-bottom: 22px; }
.mv-intro-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.mv-intro-row:last-of-type { margin-bottom: 0; }
.mv-intro-ico { font-size: 20px; line-height: 1.4; flex-shrink: 0; width: 24px; text-align: center; }
.mv-intro-row b { display: block; font-size: 14.5px; color: var(--text); margin-bottom: 3px; }
.mv-intro-row span:not(.mv-intro-ico) { display: block; font-size: 13.5px; color: var(--text-soft); line-height: 1.6; }
.mv-intro-legal {
  margin-top: 20px; padding: 13px 16px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-soft); line-height: 1.6;
}
.mv-intro-legal b { color: var(--text); }

/* Pied toujours visible : le bouton reste atteignable meme sur petit ecran */
.mv-intro-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: var(--surface);
}
.mv-intro-dots { display: flex; gap: 6px; flex: 0 0 auto; }
.mv-intro-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: background .15s;
}
.mv-intro-dots span.on { background: var(--primary); }
.mv-intro-go {
  flex: 1 1 auto; padding: 14px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-family: inherit;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.mv-intro-go:hover { filter: brightness(1.06); }

@media (max-width: 480px) {
  .mv-modal { padding: 12px; align-items: flex-end; }
  .mv-intro { max-height: 82vh; border-radius: 18px; }
  .mv-intro-body { padding: 24px 20px 16px; }
  .mv-intro-foot { padding-inline: 20px; }
}

/* ---------- Connexion : Google en premier, e-mail en secours ---------- */
.mv-google {
  width: 100%; padding: 14px; margin-top: 4px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mv-google:hover { border-color: var(--primary); background: var(--bg); }
.mv-or {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px; color: var(--text-muted); font-size: 12.5px;
}
.mv-or::before, .mv-or::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.mv-email-btn { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; font-weight: 500 !important; }
.mv-email-btn:hover { border-color: var(--primary) !important; }

/* ---------- Pied de page légal ---------- */
.mv-foot {
  max-width: 1100px; margin: 48px auto 0; padding: 22px 24px 36px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
}
.mv-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.mv-foot a { color: var(--text-soft); text-decoration: none; }
.mv-foot a:hover { color: var(--primary); text-decoration: underline; }

/* ---------- Attente : des empreintes qui avancent ---------- */
.mv-thinking {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 44px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
}
.mv-paws { display: flex; align-items: flex-end; gap: 16px; height: 40px; margin-bottom: 6px; }
.mv-paw {
  position: relative; width: 13px; height: 11px;
  border-radius: 50% 50% 46% 46%;
  background: var(--primary); opacity: 0;
  animation: mvPawStep 1.8s infinite ease-in-out;
}
.mv-paw::before {
  content: ""; position: absolute; top: -8px; left: -1px;
  width: 5px; height: 6px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 5px -2.5px 0 var(--primary), 10px -2.5px 0 var(--primary), 15px 0 0 var(--primary);
}
.mv-paw:nth-child(1) { animation-delay: 0s;    transform: translateY(0)    rotate(-10deg); }
.mv-paw:nth-child(2) { animation-delay: .22s;  transform: translateY(-10px) rotate(-3deg); }
.mv-paw:nth-child(3) { animation-delay: .44s;  transform: translateY(0)    rotate(4deg); }
.mv-paw:nth-child(4) { animation-delay: .66s;  transform: translateY(-10px) rotate(11deg); }
@keyframes mvPawStep {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  55%  { opacity: .85; }
  100% { opacity: 0; }
}
.mv-thinking-msg {
  font-family: 'Fraunces', Georgia, serif; font-size: 17px;
  color: var(--text); text-align: center;
}
.mv-thinking-sub {
  font-size: 13.5px; color: var(--text-muted); text-align: center;
  min-height: 1.4em; transition: opacity .2s;
}
@media (prefers-reduced-motion: reduce) {
  .mv-paw { animation: none; opacity: .5; }
}

/* ---------- Zones de réponse extensibles ---------- */
textarea.mv-grow {
  width: 100%; resize: none; overflow-y: auto;
  font-family: inherit; font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; min-height: 44px;
  transition: border-color .15s;
}
textarea.mv-grow:focus { outline: none; border-color: var(--primary); }

/* ---------- Historique : débriefs et cas d'entraînement ---------- */
.history-section-title {
  font-family: 'Fraunces', Georgia, serif; font-size: 18px; font-weight: 600;
  color: var(--text); margin: 28px 0 14px;
}
.history-section-title:first-child { margin-top: 0; }
.badge-debrief {
  background: rgba(201, 123, 63, .13); color: var(--primary);
  border: 1px solid rgba(201, 123, 63, .3);
}
.debrief-card { border-left: 3px solid var(--primary); }

.debrief-replay { margin-bottom: 18px; }
.debrief-replay-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.debrief-replay-case {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px;
}
.debrief-replay-case summary {
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-soft);
}
.debrief-replay-case summary:hover { color: var(--primary); }
.debrief-replay-case > div {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 14.5px; line-height: 1.65; color: var(--text-soft);
}
