/* ============================================================
   NotairIA Design System v3
   ============================================================ */

/* ── 0. LOGO — mode clair / sombre ─────────────────────────── */

/* Light mode : show principal (dark text), hide blanc (white text) */
.logo-full-dark    { display: none !important; }
.logo-full-light   { display: inline-block !important; }
.logo-symbol-dark  { display: none !important; }
.logo-symbol-light { display: inline-block !important; }

/* Dark mode : swap */
html[data-theme="dark"] .logo-full-light   { display: none !important; }
html[data-theme="dark"] .logo-full-dark    { display: inline-block !important; }
html[data-theme="dark"] .logo-symbol-light { display: none !important; }
html[data-theme="dark"] .logo-symbol-dark  { display: inline-block !important; }

/* Monogram light/dark swap */
.monogram-dark  { display: none !important; }
.monogram-light { display: inline-block !important; }
html[data-theme="dark"] .monogram-light { display: none !important; }
html[data-theme="dark"] .monogram-dark  { display: inline-block !important; }

/* ── 1. TOKENS ─────────────────────────────────────────────── */

:root {
  --yellow:      #ffe900;
  --yellow-soft: rgba(255, 233, 0, 0.12);
  --ink:         #111111;
  --muted:       #5f6368;
  --line:        #e0dfe4;
  --surface:     #f2f1f4;
  --paper:       #ffffff;
  --alert:       #d93025;
  --ok:          #1e8e3e;

  --r-pill: 999px;
  --r-lg:   20px;
  --r-md:   14px;
  --r-sm:   10px;

  --shadow-xs: 0 1px 3px rgba(0,0,0,.08);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.07);
  --shadow-md: 0 8px 24px rgba(0,0,0,.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.13);

  --font: "Circular Std", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ── Aliases WowDash ── */
  --primary-600:          var(--ink);
  --primary-50:           rgba(17,17,17,.06);
  --primary-100:          rgba(17,17,17,.10);
  --neutral-50:           var(--surface);
  --neutral-100:          #e5e4ea;
  --neutral-200:          #cccbd3;
  --neutral-300:          #b0afb8;
  --neutral-400:          #8c8b96;
  --neutral-500:          var(--muted);
  --border-color:         var(--line);
  --text-primary-light:   var(--ink);
  --text-secondary-light: var(--muted);
  --white:                var(--paper);
  --bg-color:             var(--surface);
}

html[data-theme="dark"] {
  --ink:     #f0ede8;
  --muted:   #9aa0aa;
  --line:    #3a4150;
  --surface: #1c2230;
  --paper:   #242e3e;

  --primary-600: var(--yellow);
  --primary-50:  rgba(255,233,0,.09);
  --primary-100: rgba(255,233,0,.15);
  --neutral-50:  var(--surface);
  --neutral-100: #2c3545;
  --neutral-200: #38445a;
  --neutral-300: #4a5870;
  --neutral-400: #657088;
  --bg-color:    #161d2a;
}

/* ── 2. RESET & BASE ────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--surface);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body { background-color: #161d2a; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font);
  border: none;
  background: none;
  padding: 0;
}

img { max-width: 100%; display: block; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* ── 3. TYPOGRAPHIE ─────────────────────────────────────────── */

.text-xs  { font-size: 12px !important; }
.text-sm  { font-size: 13px !important; }
.text-md  { font-size: 15px !important; }
.text-lg  { font-size: 17px !important; }
.text-xl  { font-size: 20px !important; }
.text-2xl { font-size: 24px !important; }
.text-3xl { font-size: 30px !important; }

.fw-medium  { font-weight: 500 !important; }
.fw-semibold{ font-weight: 600 !important; }
.fw-bold    { font-weight: 700 !important; }

.text-line-1 {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ── 4. COULEURS ────────────────────────────────────────────── */

.text-primary-light   { color: var(--ink)   !important; }
.text-secondary-light { color: var(--muted) !important; }
.text-primary-600     { color: var(--ink)   !important; }
.text-white           { color: #fff         !important; }
.text-danger,
.text-danger-600      { color: var(--alert) !important; }
.text-success-600     { color: #1e8e3e !important; }
.text-warning-600     { color: #f09c00 !important; }
.text-info-600        { color: #0077cc !important; }

html[data-theme="dark"] .text-primary-600  { color: var(--yellow) !important; }
html[data-theme="dark"] .text-success-600  { color: #34d058 !important; }
html[data-theme="dark"] .text-warning-600  { color: #fbbf24 !important; }
html[data-theme="dark"] .text-info-600     { color: #38bdf8 !important; }

.bg-base           { background-color: var(--paper)   !important; }
.bg-neutral-50     { background-color: var(--surface)  !important; }
.bg-neutral-100    { background-color: var(--neutral-100) !important; }
.bg-neutral-200    { background-color: var(--neutral-200) !important; }
.bg-primary-50     { background-color: var(--primary-50)  !important; }
.bg-primary-100    { background-color: var(--primary-100) !important; }
.bg-primary-600    { background-color: var(--ink)         !important; }

html[data-theme="dark"] .bg-primary-600 { background-color: var(--yellow) !important; }

.bg-success-50  { background-color: rgba(30,142,62,.08)  !important; }
.bg-success-100 { background-color: rgba(30,142,62,.15)  !important; }
.bg-danger-50   { background-color: rgba(217,48,37,.08)  !important; }
.bg-danger-100  { background-color: rgba(217,48,37,.15)  !important; }
.bg-warning-50  { background-color: rgba(240,156,0,.10)  !important; }
.bg-info-50     { background-color: rgba(0,119,204,.08)  !important; }
.bg-info-100    { background-color: rgba(0,119,204,.15)  !important; }

.bg-hover-neutral-100:hover { background-color: var(--surface) !important; }
.bg-hover-danger-50:hover   { background-color: rgba(217,48,37,.08) !important; }

.text-hover-primary-600:hover { color: var(--ink) !important; }
html[data-theme="dark"] .text-hover-primary-600:hover { color: var(--yellow) !important; }

/* ── 5. TAILLES ─────────────────────────────────────────────── */

.w-24-px  { width:  24px !important; }
.w-28-px  { width:  28px !important; }
.w-32-px  { width:  32px !important; }
.w-36-px  { width:  36px !important; }
.w-40-px  { width:  40px !important; }
.w-44-px  { width:  44px !important; }
.w-48-px  { width:  48px !important; }
.w-52-px  { width:  52px !important; }
.w-56-px  { width:  56px !important; }
.w-64-px  { width:  64px !important; }
.w-72-px  { width:  72px !important; }
.w-80-px  { width:  80px !important; }
.w-120-px { width: 120px !important; }

.h-24-px  { height:  24px !important; }
.h-28-px  { height:  28px !important; }
.h-32-px  { height:  32px !important; }
.h-36-px  { height:  36px !important; }
.h-40-px  { height:  40px !important; }
.h-44-px  { height:  44px !important; }
.h-48-px  { height:  48px !important; }
.h-52-px  { height:  52px !important; }
.h-56-px  { height:  56px !important; }
.h-64-px  { height:  64px !important; }
.h-72-px  { height:  72px !important; }
.h-80-px  { height:  80px !important; }
.h-120-px { height: 120px !important; }

.max-w-290-px { max-width: 290px !important; }
.max-w-464-px { max-width: 464px !important; }

/* ── 6. ESPACEMENT ──────────────────────────────────────────── */

.gap-2  { gap:  2px !important; }
.gap-4  { gap:  4px !important; }
.gap-6  { gap:  6px !important; }
.gap-8  { gap:  8px !important; }
.gap-10 { gap: 10px !important; }
.gap-12 { gap: 12px !important; }
.gap-14 { gap: 14px !important; }
.gap-16 { gap: 16px !important; }
.gap-20 { gap: 20px !important; }
.gap-24 { gap: 24px !important; }
.gap-32 { gap: 32px !important; }

.p-6  { padding:  6px !important; }
.p-8  { padding:  8px !important; }
.p-10 { padding: 10px !important; }
.p-12 { padding: 12px !important; }
.p-16 { padding: 16px !important; }
.p-20 { padding: 20px !important; }
.p-24 { padding: 24px !important; }
.p-32 { padding: 32px !important; }

.px-4  { padding-left:  4px !important; padding-right:  4px !important; }
.px-6  { padding-left:  6px !important; padding-right:  6px !important; }
.px-8  { padding-left:  8px !important; padding-right:  8px !important; }
.px-10 { padding-left: 10px !important; padding-right: 10px !important; }
.px-12 { padding-left: 12px !important; padding-right: 12px !important; }
.px-16 { padding-left: 16px !important; padding-right: 16px !important; }
.px-20 { padding-left: 20px !important; padding-right: 20px !important; }
.px-24 { padding-left: 24px !important; padding-right: 24px !important; }

.py-2  { padding-top:  2px !important; padding-bottom:  2px !important; }
.py-4  { padding-top:  4px !important; padding-bottom:  4px !important; }
.py-6  { padding-top:  6px !important; padding-bottom:  6px !important; }
.py-8  { padding-top:  8px !important; padding-bottom:  8px !important; }
.py-10 { padding-top: 10px !important; padding-bottom: 10px !important; }
.py-12 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-16 { padding-top: 16px !important; padding-bottom: 16px !important; }
.py-20 { padding-top: 20px !important; padding-bottom: 20px !important; }
.py-32 { padding-top: 32px !important; padding-bottom: 32px !important; }

.mb-0  { margin-bottom:  0   !important; }
.mb-4  { margin-bottom:  4px !important; }
.mb-6  { margin-bottom:  6px !important; }
.mb-8  { margin-bottom:  8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.mb-20 { margin-bottom: 20px !important; }
.mb-24 { margin-bottom: 24px !important; }
.mb-32 { margin-bottom: 32px !important; }
.mb-40 { margin-bottom: 40px !important; }

.mt-0  { margin-top:  0   !important; }
.mt-2  { margin-top:  2px !important; }
.mt-4  { margin-top:  4px !important; }
.mt-6  { margin-top:  6px !important; }
.mt-8  { margin-top:  8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mt-24 { margin-top: 24px !important; }
.mt-32 { margin-top: 32px !important; }

.me-4  { margin-right:  4px !important; }
.me-8  { margin-right:  8px !important; }
.me-12 { margin-right: 12px !important; }
.me-14 { margin-right: 14px !important; }
.me-16 { margin-right: 16px !important; }

.ms-4  { margin-left:  4px !important; }
.ms-8  { margin-left:  8px !important; }
.ms-12 { margin-left: 12px !important; }
.ms-16 { margin-left: 16px !important; }

.m-8  { margin:  8px !important; }
.m-12 { margin: 12px !important; }
.m-16 { margin: 16px !important; }

.my-8  { margin-top:  8px !important; margin-bottom:  8px !important; }
.my-12 { margin-top: 12px !important; margin-bottom: 12px !important; }
.my-16 { margin-top: 16px !important; margin-bottom: 16px !important; }
.my-24 { margin-top: 24px !important; margin-bottom: 24px !important; }

/* ── 7. BORDER-RADIUS ───────────────────────────────────────── */

.radius-4  { border-radius:  4px !important; }
.radius-6  { border-radius:  6px !important; }
.radius-8  { border-radius:  8px !important; }
.radius-10 { border-radius: 10px !important; }
.radius-12 { border-radius: 12px !important; }
.radius-14 { border-radius: 14px !important; }
.radius-16 { border-radius: 16px !important; }
.radius-18 { border-radius: 18px !important; }
.radius-20 { border-radius: 20px !important; }
.radius-24 { border-radius: 24px !important; }
.radius-28 { border-radius: 28px !important; }

.rotate-180 { transform: rotate(180deg) !important; }

/* ── 8. UTILITAIRES DIVERS ──────────────────────────────────── */
/* NOTE: display, flex, align, justify, position, text-align utilities
   are intentionally NOT redefined here — Bootstrap handles them.
   Redefining them after Bootstrap breaks responsive (d-md-none etc.). */

.cursor-pointer   { cursor: pointer !important; }
.min-w-0          { min-width: 0 !important; }
.object-fit-cover { object-fit: cover !important; }
.overflow-hidden  { overflow: hidden !important; }
.overflow-y-auto  { overflow-y: auto !important; }
.overflow-x-auto  { overflow-x: auto !important; }
.line-height-1    { line-height: 1 !important; }
.resize-none      { resize: none !important; }

/* Border — override Bootstrap's border color with theme-aware var */
.border        { border: 1px solid var(--line) !important; }
.border-top    { border-top:    1px solid var(--line) !important; }
.border-bottom { border-bottom: 1px solid var(--line) !important; }
.border-start  { border-left:   1px solid var(--line) !important; }
.border-end    { border-right:  1px solid var(--line) !important; }
.border-0      { border: none !important; }

.vr {
  display: inline-block;
  width: 1px;
  align-self: stretch;
  background-color: var(--line);
  opacity: 1;
}

/* ── 9. BOUTONS ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-family: var(--font);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  min-height: 40px;
  padding: 0 18px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-sm {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 16px;
}

.btn-primary-600 {
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
}
.btn-primary-600:hover {
  background-color: #2a2a2a;
  border-color: #2a2a2a;
  color: #ffffff;
}

html[data-theme="dark"] .btn-primary-600 {
  background-color: var(--yellow);
  color: #000000;
  border-color: var(--yellow);
}
html[data-theme="dark"] .btn-primary-600:hover {
  background-color: #ffe033;
  border-color: #ffe033;
  color: #000000;
}

.btn-outline-primary-600 {
  background-color: transparent;
  border-color: #111111;
  color: #111111;
}
.btn-outline-primary-600:hover {
  background-color: #111111;
  color: #ffffff;
}

html[data-theme="dark"] .btn-outline-primary-600 {
  border-color: var(--yellow);
  color: var(--yellow);
}
html[data-theme="dark"] .btn-outline-primary-600:hover {
  background-color: var(--yellow);
  color: #000000;
}

.btn-outline-neutral-600 {
  background-color: var(--paper);
  border-color: var(--line);
  color: var(--muted);
}
.btn-outline-neutral-600:hover {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  opacity: 0.7;
  font-size: 18px;
  min-height: unset;
  padding: 4px;
  border-radius: 6px;
}
.btn-close:hover {
  opacity: 1;
  background-color: var(--surface);
  color: var(--ink);
}

/* Bootstrap .btn-primary → design system (settings forms use it) */
.btn-primary {
  background-color: #111111;
  border-color: #111111;
  color: #ffffff;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .show > .btn-primary.dropdown-toggle {
  background-color: #2a2a2a;
  border-color: #2a2a2a;
  color: #ffffff;
}
html[data-theme="dark"] .btn-primary {
  background-color: var(--yellow);
  border-color: var(--yellow);
  color: #000000;
}
html[data-theme="dark"] .btn-primary:hover {
  background-color: #ffe033;
  border-color: #ffe033;
  color: #000000;
}

.btn-danger {
  border-radius: var(--r-pill);
  font-weight: 600;
}

.btn-secondary {
  border-radius: var(--r-pill);
  font-weight: 600;
  background-color: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover {
  background-color: var(--line);
  border-color: var(--line);
  color: var(--ink);
}

/* ── 10. FORMULAIRES ────────────────────────────────────────── */

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,17,17,.10);
}
html[data-theme="dark"] .form-control:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255,233,0,.15);
}
html[data-theme="dark"] .form-control {
  background-color: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .form-control::placeholder { color: var(--muted); }
html[data-theme="dark"] .form-select {
  background-color: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.form-control.border-0 { border-color: transparent; }
.form-control.shadow-none { box-shadow: none; }
.form-control.bg-transparent { background-color: transparent; }

textarea.form-control { resize: vertical; }

.icon-field {
  position: relative;
}
.icon-field .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.icon-field .form-control { padding-left: 40px; }

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}
.toggle-password:hover { color: var(--ink); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--ink);
}
html[data-theme="dark"] .form-check-input { accent-color: var(--yellow); }
.form-check-label { font-size: 14px; color: var(--ink); cursor: pointer; }

/* Override Bootstrap's blue switch track */
.form-switch .form-check-input:checked {
  background-color: var(--ink) !important;
  border-color: var(--ink) !important;
}
html[data-theme="dark"] .form-switch .form-check-input:checked {
  background-color: var(--yellow) !important;
  border-color: var(--yellow) !important;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ── 11. DROPDOWN ───────────────────────────────────────────── */

.dropdown-menu {
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 180px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink);
  border-radius: 8px;
  transition: background-color 0.12s;
  cursor: pointer;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font);
}
.dropdown-item:hover {
  background-color: var(--surface);
  color: var(--ink);
}
.dropdown-item.text-danger:hover {
  background-color: rgba(217,48,37,.08);
  color: var(--alert);
}

.dropdown-divider {
  border-color: var(--line);
  margin: 4px 0;
}

/* ── 12. BADGES ─────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ── 13. MODALS ─────────────────────────────────────────────── */

.modal-content {
  background-color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.modal-backdrop { background-color: rgba(0,0,0,.4); }

/* ── 14. ALERTS ─────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  border: 1px solid transparent;
}

.alert-danger {
  background-color: rgba(217,48,37,.08);
  border-color: rgba(217,48,37,.2);
  color: var(--alert);
}

.alert-success {
  background-color: rgba(30,142,62,.08);
  border-color: rgba(30,142,62,.2);
  color: var(--ok);
}

/* ── 15. SPINNER ────────────────────────────────────────────── */

.spinner-border {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

html[data-theme="dark"] .spinner-border { border-top-color: var(--yellow); }

.spinner-border-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.avatar-loading { animation: pulse 1.4s ease-in-out infinite; }

/* ── 16. CHAT LAYOUT ────────────────────────────────────────── */

.chat-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background-color: var(--paper) !important;
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: width 0.2s, min-width 0.2s;
  z-index: 10;
}

html[data-theme="dark"] .chat-sidebar {
  background-color: var(--surface) !important;
}

.chat-sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.chat-sidebar.collapsed .sidebar-full-only { display: none !important; }

.sidebar-collapsed-only { display: none !important; }
.chat-sidebar.collapsed .sidebar-collapsed-only { display: flex !important; }

.sidebar-icon-btn,
.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.12s, color 0.12s;
}
.sidebar-icon-btn:hover,
.sidebar-toggle-btn:hover {
  background-color: var(--yellow) !important;
  color: #000 !important;
}

/* Brand mark in collapsed sidebar */
.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  flex-shrink: 0;
}
html[data-theme="dark"] .sidebar-brand-mark {
  background: var(--yellow);
  color: #000;
}

/* Dossier list items */
#dossier-list > div {
  border-radius: 10px;
  border: 1px solid transparent;
  margin-bottom: 1px;
  transition: background-color 0.12s;
}
#dossier-list > div:hover {
  background-color: var(--surface) !important;
}

#dossier-list a {
  display: flex;
  align-items: center;
  padding: 6px 10px !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  gap: 8px;
  min-width: 0;
}
#dossier-list a:hover { color: var(--ink); }

/* Dossier actif */
#dossier-list > div.bg-primary-50 {
  background-color: var(--surface) !important;
  border-color: rgba(255,233,0,.40) !important;
  box-shadow: 0 0 0 1px rgba(255,233,0,.14), 0 4px 12px rgba(0,0,0,.05);
}
html[data-theme="dark"] #dossier-list > div.bg-primary-50 {
  background-color: rgba(255,233,0,.09) !important;
  border-color: rgba(255,233,0,.28) !important;
}

#dossier-list > div.bg-primary-50 a {
  color: var(--ink);
  font-weight: 700;
}

/* Chat list */
#chat-list > span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 2px;
  padding: 0 10px;
}
#chat-list > span:first-of-type { margin-top: 2px; }

#chat-list > div {
  border-radius: 10px;
  border: 1px solid transparent;
  margin-bottom: 1px;
  transition: background-color 0.12s;
}
#chat-list > div:hover {
  background-color: var(--surface) !important;
}

#chat-list a {
  display: flex;
  align-items: center;
  padding: 6px 10px !important;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 10px;
  gap: 8px;
  min-width: 0;
}
#chat-list a:hover { color: var(--ink); }

/* Cacher l'icône chat dans les items de liste */
#chat-list a > iconify-icon.flex-shrink-0 { display: none !important; }

/* Conversation active */
#chat-list > div.bg-primary-50 {
  background-color: var(--surface) !important;
  border-color: rgba(17,17,17,.10) !important;
}
html[data-theme="dark"] #chat-list > div.bg-primary-50 {
  background-color: rgba(255,233,0,.08) !important;
  border-color: rgba(255,233,0,.16) !important;
}

#chat-list > div.bg-primary-50 a {
  color: var(--ink);
  font-weight: 600;
}

/* Chat main */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--surface) !important;
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .chat-main {
  background-color: #1c2230 !important;
}

.chat-main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.04;
}

html[data-theme="dark"] .chat-main::before {
  background-image: radial-gradient(rgba(255,255,255,.15) 1px, transparent 1px);
  opacity: 1;
}

.chat-main > * {
  position: relative;
  z-index: 1;
}

/* Model pill */
.chat-main .border.radius-8 {
  background-color: var(--paper);
  border-color: var(--line) !important;
  color: var(--ink);
  font-weight: 600;
}

/* Chat messages */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#chat-messages > div {
  animation: slideIn 0.2s ease;
}

/* Bulle IA */
#chat-messages .bg-neutral-50 {
  background-color: rgba(255,255,255,.95) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-sm);
  border-radius: var(--r-md) !important;
}
html[data-theme="dark"] #chat-messages .bg-neutral-50 {
  background-color: rgba(36,46,62,.95) !important;
  border-color: var(--line) !important;
}

/* Bulle USER */
#chat-messages .bg-primary-50 {
  background-color: #111111 !important;
  border-color: #111111 !important;
  border-radius: var(--r-md) !important;
}
html[data-theme="dark"] #chat-messages .bg-primary-50 {
  background-color: #000000 !important;
  border-color: #000000 !important;
}

#chat-messages .bg-primary-50 .text-primary-light,
#chat-messages .bg-primary-50 .text-secondary-light,
#chat-messages .bg-primary-50 .text-sm,
#chat-messages .bg-primary-50 p,
#chat-messages .bg-primary-50 span {
  color: #ffffff !important;
}
#chat-messages .bg-primary-50 .text-secondary-light {
  color: rgba(255,255,255,.65) !important;
}

/* Avatar NA */
#chat-messages .bg-primary-600.rounded-circle {
  background-color: #111111 !important;
}
#chat-messages .bg-primary-600.rounded-circle .text-white {
  color: var(--yellow) !important;
}
html[data-theme="dark"] #chat-messages .bg-primary-600.rounded-circle {
  background-color: var(--yellow) !important;
}
html[data-theme="dark"] #chat-messages .bg-primary-600.rounded-circle .text-white {
  color: #000000 !important;
}

/* Source cards */
#chat-messages .bg-base.border {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
}

/* Markdown */
.markdown-body {
  font-size: 15px;
  line-height: 1.65;
  color: inherit;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  font-weight: 700;
  color: inherit;
}
.markdown-body p { margin-bottom: 0.75em; }
.markdown-body ul, .markdown-body ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  background-color: var(--surface);
  border-radius: 4px;
  padding: 2px 5px;
}
.markdown-body pre {
  background-color: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 0.75em;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}
.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 0.75em;
}
.markdown-body th {
  background-color: var(--surface);
  padding: 8px 12px;
  font-weight: 600;
  text-align: left;
  border: 1px solid var(--line);
}
.markdown-body td {
  padding: 8px 12px;
  border: 1px solid var(--line);
}
.markdown-body blockquote {
  border-left: 3px solid var(--line);
  margin: 0 0 0.75em;
  padding-left: 12px;
  color: var(--muted);
}
.markdown-body a { color: var(--ink); text-decoration: underline; }
html[data-theme="dark"] .markdown-body a { color: var(--yellow); }

/* Documents panel */
.chat-documents {
  width: 320px;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background-color: var(--paper) !important;
  border-left: 1px solid var(--line) !important;
  overflow: hidden;
}

html[data-theme="dark"] .chat-documents {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
}

/* Document count badge */
.chat-documents .bg-primary-50.text-primary-600 {
  background-color: var(--yellow) !important;
  color: #000000 !important;
  border-radius: 999px;
  font-weight: 700;
}

/* Document item hover */
.chat-documents .bg-hover-neutral-100:hover {
  background-color: var(--surface) !important;
  border-radius: 10px;
}

/* Chat overlay */
.chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,.25);
  z-index: 1040;
}
.chat-overlay.show { display: block; }

/* ── 17. RESPONSIVE CHAT ────────────────────────────────────── */

@media (max-width: 1199px) {
  .chat-documents {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    z-index: 1050;
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .chat-documents.show {
    transform: translateX(0);
  }
}

@media (max-width: 767px) {
  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  .chat-sidebar.show {
    transform: translateX(0);
  }
}

/* ── 18. SETTINGS LAYOUT ────────────────────────────────────── */

/* v7 Settings cards */
.settings-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
}
.settings-card h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 6px;
}
.settings-card p { color: var(--muted); }

.security-card { box-shadow: none; }

.mini-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.mini-heading h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.mini-heading p { font-size: 12px; color: var(--muted); margin: 0; }

html[data-theme="dark"] .settings-card {
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.settings-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.settings-sidebar {
  width: 280px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  background-color: var(--paper) !important;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

html[data-theme="dark"] .settings-sidebar {
  background-color: var(--surface) !important;
}

.settings-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--surface) !important;
  min-width: 0;
}

/* Settings nav items */
.settings-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.12s;
}
.settings-sidebar a:hover {
  background-color: var(--surface);
}

/* Active nav item */
.settings-sidebar a.bg-primary-50 {
  background-color: #111111 !important;
  border-color: rgba(255,233,0,.20) !important;
  border-radius: 12px;
  color: #ffffff !important;
}
.settings-sidebar a.bg-primary-50 iconify-icon:first-of-type {
  color: var(--yellow) !important;
}
.settings-sidebar a.bg-primary-50 span {
  color: #ffffff !important;
}

html[data-theme="dark"] .settings-sidebar a.bg-primary-50 {
  background-color: rgba(255,233,0,.12) !important;
  border-color: rgba(255,233,0,.24) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] .settings-sidebar a.bg-primary-50 span {
  color: var(--ink) !important;
}

/* v7-style active nav item (black + yellow icon) */
.settings-nav-active {
  background-color: var(--ink) !important;
  color: #fff !important;
  border-radius: 10px;
}
.settings-nav-active i {
  color: var(--yellow) !important;
}
.settings-nav-active span {
  color: #fff !important;
}
html[data-theme="dark"] .settings-nav-active {
  background-color: rgba(255,233,0,.14) !important;
  color: var(--ink) !important;
}
html[data-theme="dark"] .settings-nav-active i { color: var(--yellow) !important; }
html[data-theme="dark"] .settings-nav-active span { color: var(--ink) !important; }

/* Back button */
.settings-sidebar .bg-neutral-100.rounded-circle {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
}

.settings-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,.25);
  z-index: 1040;
}
.settings-overlay.show { display: block; }

/* ── 19. AUTH PAGES ─────────────────────────────────────────── */

.auth {
  min-height: 100vh;
  background-color: var(--paper);
}

html[data-theme="dark"] .auth {
  background-color: #161d2a;
}

.auth-left {
  background: linear-gradient(135deg, var(--surface) 0%, var(--neutral-100) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-right {
  background-color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html[data-theme="dark"] .auth-right {
  background-color: var(--surface);
}

.center-border-horizontal {
  position: relative;
  text-align: center;
}
.center-border-horizontal::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--line);
}
.center-border-horizontal span {
  position: relative;
  background-color: var(--paper);
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
}
html[data-theme="dark"] .center-border-horizontal span {
  background-color: var(--surface);
}

/* ── 20. THEME TOGGLE BUTTON ────────────────────────────────── */

[data-theme-toggle] {
  cursor: pointer;
}

/* ── 21. SCROLLBAR ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--neutral-300); }

/* ── 22. UTILITAIRES MANQUANTS (WowDash) ────────────────────── */

/* Padding supplémentaires */
.py-11 { padding-top: 11px !important; padding-bottom: 11px !important; }
.px-32 { padding-left: 32px !important; padding-right: 32px !important; }
.px-56 { padding-left: 56px !important; padding-right: 56px !important; }
.me-24 { margin-right: 24px !important; }
.mb-2  { margin-bottom:  2px !important; }
.mt--50 { margin-top: -50px !important; }

/* Largeurs pourcentage (hors Bootstrap) */
.w-30 { width: 30% !important; }
.w-70 { width: 70% !important; }

/* z-index */
.z-1 { z-index: 1 !important; }

/* ── 23. COULEURS BORDER (WowDash border-{color}-{n}) ───────── */

.border-primary-600 { border-color: var(--ink)   !important; }
.border-danger-600  { border-color: var(--alert) !important; }
.border-danger-200  { border-color: rgba(217,48,37,.25) !important; }
.border-success-200 { border-color: rgba(30,142,62,.25) !important; }
.border-primary-200 { border-color: rgba(17,17,17,.20) !important; }
.br-white           { border-color: var(--paper) !important; }
.border-width-2-px  { border-width: 2px !important; }

html[data-theme="dark"] .border-primary-600 { border-color: var(--yellow) !important; }

/* ── 24. HOVER BACKGROUNDS SUPPLÉMENTAIRES ──────────────────── */

.bg-hover-primary-200:hover { background-color: rgba(17,17,17,.15) !important; }
.bg-hover-danger-200:hover  { background-color: rgba(217,48,37,.12) !important; }
.bg-hover-primary-50:hover  { background-color: var(--primary-50)  !important; }

html[data-theme="dark"] .bg-hover-primary-200:hover { background-color: rgba(255,233,0,.20) !important; }

/* ── 25. COULEURS ALIAS MANQUANTS ───────────────────────────── */

.text-neutral-600  { color: var(--muted) !important; }
.bg-primary-200    { background-color: rgba(17,17,17,.18) !important; }
.bg-success-focus  { background-color: rgba(30,142,62,.10) !important; }
.text-success-main { color: #1a7f3c !important; }
html[data-theme="dark"] .text-success-main { color: #34d058 !important; }

/* ── 26. BOOTSTRAP OUTLINE BUTTONS ─────────────────────────── */

.btn-outline-primary {
  border-color: var(--ink);
  color: var(--ink);
  border-radius: var(--r-pill);
  font-weight: 600;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
html[data-theme="dark"] .btn-outline-primary {
  border-color: var(--yellow);
  color: var(--yellow);
}
html[data-theme="dark"] .btn-outline-primary:hover {
  background-color: var(--yellow);
  color: #000000;
}

.btn-outline-danger { border-radius: var(--r-pill); font-weight: 600; }

.btn-outline-secondary {
  border-color: var(--line);
  color: var(--muted);
  border-radius: var(--r-pill);
  font-weight: 600;
}
.btn-outline-secondary:hover {
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

/* ── 27. DARK MODE — BOOTSTRAP CARDS ───────────────────────── */

html[data-theme="dark"] .card {
  background-color: var(--paper) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
html[data-theme="dark"] .card-header {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--ink);
}
html[data-theme="dark"] .card-body {
  background-color: var(--paper) !important;
  color: var(--ink);
}
html[data-theme="dark"] .card-footer {
  background-color: var(--surface) !important;
  border-color: var(--line) !important;
}

/* ── 28. AVATAR UPLOAD ──────────────────────────────────────── */

.avatar-upload {
  position: relative;
  display: inline-block;
}

.avatar-preview {
  width: 192px;
  height: 192px;
  border-radius: 50%;
  border: 6px solid var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.avatar-preview > div {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: var(--neutral-100);
}

.avatar-edit {
  position: absolute;
  right: 0;
  bottom: 0;
}

html[data-theme="dark"] .avatar-preview {
  border-color: var(--paper);
}

/* ── 29. PUBLIC PAGES & AUTH v6 ─────────────────────────────── */

/* Brand */
.public-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark-v6 {
  width: 42px;
  height: 42px;
  background: var(--yellow);
  color: #000;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  flex: none;
  line-height: 1;
}
html[data-theme="dark"] .brand-mark-v6 {
  background: var(--yellow);
  color: #000;
}
.brand-name-v6 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  display: block;
  line-height: 1.1;
}
.brand-tagline-v6 {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}

/* Public page shell */
.public-page {
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
}
.public-header {
  height: 88px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
    z-index: 100;
}

.public-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}
.public-shell {
  position: relative;
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 52px;
  padding: 44px 72px 72px;
  overflow: hidden;
}
.public-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .14;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}
.public-content {
  position: relative;
  z-index: 1;
}
.public-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.public-title {
  font-size: clamp(38px, 5vw, 76px);
  line-height: .92;
  letter-spacing: -.07em;
  max-width: 720px;
  margin-bottom: 28px;
  color: var(--ink);
}
.public-copy {
  font-size: 20px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 0;
}
.notify-card {
  margin-top: 48px;
  display: grid;
  gap: 14px;
  max-width: 600px;
}
.notify-card strong {
  font-size: 18px;
  color: var(--ink);
}
.notify-form {
  display: flex;
  gap: 12px;
}
.notify-form input {
  min-height: 52px;
  flex: 1;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  padding: 0 18px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.notify-form input:focus {
  border-color: var(--ink);
}
.notify-success,
.notify-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
}
.notify-success {
  background: rgba(30, 142, 62, .1);
  color: var(--ok);
}
.notify-info {
  background: rgba(17, 17, 17, .06);
  color: var(--ink);
}

/* Visual card (landing right column) */
.visual-card-v6 {
  position: relative;
  min-height: 520px;
  border-radius: 32px;
  background: var(--yellow);
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 24px 80px rgba(0,0,0,.08);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 36px;
}
html[data-theme="dark"] .visual-card-v6 {
  background: #050505;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
}
.visual-card-v6::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .2;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 26px 26px;
}
html[data-theme="dark"] .visual-card-v6::before {
  background-image: radial-gradient(rgba(255,255,255,.28) 1px, transparent 1px);
  opacity: .15;
}
.visual-card-inner-v6 {
  position: relative;
  z-index: 1;
  max-width: 400px;
}
.visual-card-v6 h2 {
  font-size: clamp(32px, 3.5vw, 52px);
  line-height: .95;
  letter-spacing: -.06em;
  margin-bottom: 14px;
  color: #000;
}
html[data-theme="dark"] .visual-card-v6 h2 {
  color: #fff;
}
.visual-card-v6 p {
  font-size: 17px;
  line-height: 1.5;
  color: rgba(0,0,0,.6);
  margin-bottom: 0;
}
html[data-theme="dark"] .visual-card-v6 p {
  color: rgba(255,255,255,.65);
}
.floating-cert-v6 {
  position: absolute;
  top: 36px;
  right: 36px;
  z-index: 1;
  width: 106px;
  height: 106px;
  border-radius: 24px;
  background: rgba(255,255,255,.82);
  display: grid;
  place-items: center;
  color: #000;
  font-size: 40px;
  font-weight: 700;
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}
html[data-theme="dark"] .floating-cert-v6 {
  background: rgba(255,233,0,.18);
  color: var(--yellow);
}

/* Public buttons */
.btn-public {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--ink);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  transition: opacity .15s;
}
.btn-public:hover { opacity: .75; color: var(--ink); }
.btn-public.dark {
  background: var(--ink);
  color: var(--paper);
}
html[data-theme="dark"] .btn-public.dark {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}
.btn-public.compact {
  min-height: 40px;
  padding-inline: 16px;
  font-size: 14px;
}

/* Auth layout v6 */
.auth-layout-v6 {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(400px, .85fr);
  background: var(--surface);
}
.auth-visual-v6 {
  position: relative;
  background: var(--yellow);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 60px;
  color: #000;
}
html[data-theme="dark"] .auth-visual-v6 {
  background: #050505;
  color: #fff;
}
.auth-visual-v6::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 28px 28px;
}
.auth-visual-monogram {
  position: absolute;
  top: 48px;
  left: 60px;
  z-index: 1;
}
.auth-visual-monogram img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}
.auth-visual-content-v6 {
  position: relative;
  z-index: 1;
  max-width: 540px;
}
.auth-visual-v6 h2 {
  font-size: clamp(38px, 4.5vw, 64px);
  line-height: .92;
  letter-spacing: -.07em;
  margin-bottom: 18px;
}
.auth-visual-v6 p {
  font-size: 18px;
  line-height: 1.55;
  max-width: 480px;
  margin-bottom: 0;
  opacity: .72;
}
.auth-side-v6 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--paper);
  color: var(--ink);
}
.auth-panel-v6 {
  width: min(100%, 520px);
}
.auth-panel-v6 .public-logo {
  margin-bottom: 52px;
}
.auth-panel-v6 h1 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -.05em;
  margin-bottom: 12px;
  color: var(--ink);
}
.auth-subtitle-v6 {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 30px;
}

/* Auth form inputs */
.input-wrap-v6 {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  color: var(--muted);
  margin-bottom: 14px;
  transition: border-color .15s;
}
.input-wrap-v6:focus-within {
  border-color: var(--ink);
}
html[data-theme="dark"] .input-wrap-v6:focus-within {
  border-color: var(--yellow);
}
.input-wrap-v6 input {
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-family: inherit;
  min-width: 0;
}
.input-wrap-v6 input::placeholder {
  color: var(--muted);
}
.input-wrap-v6 .toggle-eye {
  cursor: pointer;
  user-select: none;
  flex: none;
}

/* Auth form row */
.auth-form-row-v6 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 14px;
}
.auth-checkbox-v6 {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}
.auth-link-v6 {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}
html[data-theme="dark"] .auth-link-v6 {
  color: var(--yellow);
}
.auth-link-v6:hover {
  text-decoration: underline;
}

/* Submit button auth */
.btn-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .15s;
  margin-top: 8px;
}
.btn-auth-submit:hover { opacity: .85; }
html[data-theme="dark"] .btn-auth-submit {
  background: var(--yellow);
  color: #000;
}

/* Form divider */
.form-divider-v6 {
  margin: 22px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}
.form-divider-v6::before,
.form-divider-v6::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

/* Social buttons */
.social-row-v6 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}
.social-btn-v6 {
  min-height: 52px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: border-color .15s;
}
.social-btn-v6:hover { border-color: var(--ink); color: var(--ink); }
html[data-theme="dark"] .social-btn-v6:hover { border-color: var(--yellow); }
.social-btn-v6.disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}
.soon-pill {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.6;
}

/* Auth alert */
.auth-alert {
  background: rgba(217, 48, 37, .08);
  border: 1px solid rgba(217, 48, 37, .25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--alert);
}
.auth-alert p { margin: 0; }

/* Auth bottom */
.auth-bottom-v6 {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* Logout layout */
.logout-layout-v6 {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) minmax(400px, .9fr);
  background: var(--surface);
}
.logout-panel-wrap-v6 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--paper);
}
.logout-panel-v6 {
  width: min(100%, 480px);
}
.logout-panel-v6 .public-logo {
  margin-bottom: 52px;
}
.logout-panel-v6 h1 {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -.05em;
  margin-bottom: 12px;
  color: var(--ink);
}
.logout-panel-v6 > p {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 30px;
}
.logout-actions-v6 {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}
.btn-ghost-v6 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s;
}
.btn-ghost-v6:hover { border-color: var(--ink); color: var(--ink); }

/* Responsive */
@media (max-width: 980px) {
  .public-shell {
    grid-template-columns: 1fr;
    padding: 28px 24px 48px;
    gap: 32px;
    min-height: auto;
  }
  .auth-layout-v6,
  .logout-layout-v6 {
    grid-template-columns: 1fr;
  }
  .auth-visual-v6 {
    min-height: 280px;
    padding: 36px 32px;
  }
  .auth-visual-v6 h2 { font-size: 36px; }
  .auth-side-v6,
  .logout-panel-wrap-v6 {
    padding: 36px 24px;
  }
  .visual-card-v6 {
    min-height: 300px;
  }
}
@media (max-width: 640px) {
  .public-header { padding: 0 18px; }
  .social-row-v6 { grid-template-columns: 1fr; }
  .logout-actions-v6 { flex-direction: column; }
  .btn-auth-submit, .btn-ghost-v6 { min-height: 50px; }
}
/* Grille prénom / nom : 2 colonnes sur ≥480 px, 1 colonne en dessous */
.signup-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
@media (max-width: 480px) {
  .signup-name-row { grid-template-columns: 1fr; }
  .auth-side-v6, .logout-panel-wrap-v6 { padding: 24px 16px; }
  .auth-panel-v6 .public-logo { margin-bottom: 32px; }
}

/* ── 30. SIDEBAR ACTIVE STATES ──────────────────────────────── */

/* Active dossier: yellow filled + black text */
.dossier-active {
  background: var(--yellow) !important;
  border-radius: 10px !important;
}
.dossier-active iconify-icon,
.dossier-active .text-primary-light,
.dossier-active .text-secondary-light,
.dossier-active span {
  color: #000 !important;
}
.dossier-active button iconify-icon {
  color: rgba(0,0,0,.5) !important;
}

/* Active chat: clean yellow (soft bg + yellow border) */
.chat-active {
  background: rgba(255, 233, 0, 0.14) !important;
  outline: 1px solid rgba(255, 233, 0, 0.55);
  border-radius: 10px !important;
}
html[data-theme="dark"] .chat-active {
  background: rgba(255, 233, 0, 0.10) !important;
  outline: 1px solid rgba(255, 233, 0, 0.40);
  border-radius: 10px !important;
}
.chat-active .text-primary-light {
  font-weight: 600;
}
.chat-active iconify-icon {
  color: #a07800 !important;
}
html[data-theme="dark"] .chat-active iconify-icon {
  color: var(--yellow) !important;
}

/* ── 31. CHAT WELCOME SCREEN ────────────────────────────────── */

/* Remove padding from #chat-messages when showing welcome screen */
#chat-messages:has(.chat-welcome) {
  padding: 0 !important;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  padding: 40px 24px;
  overflow: hidden;
}
@media (max-width: 576px) {
  .chat-welcome { padding: 16px 12px; justify-content: flex-start; padding-top: 24px; }
}

/* Parent must be position: relative for absolute child */
#chat-messages {
  position: relative;
}
.chat-welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image: radial-gradient(var(--ink) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.chat-welcome-card {
  position: relative;
  z-index: 1;
  text-align: center;
  width: min(100%, 620px);
  background: var(--paper);
  border-radius: 28px;
  border: 1px solid var(--line);
  padding: 52px 48px 44px;
  box-shadow: 0 20px 64px rgba(0,0,0,.06);
  margin-bottom: 20px;
}
html[data-theme="dark"] .chat-welcome-card {
  box-shadow: 0 20px 64px rgba(0,0,0,.24);
}
.chat-welcome-icon {
  width: 72px;
  height: 72px;
  background: var(--yellow);
  color: #000;
  border-radius: 22px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 32px;
}
.chat-welcome-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.chat-welcome-title {
  font-size: clamp(24px, 3.5vw, 40px);
  line-height: 1;
  letter-spacing: -.05em;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 700;
}
.chat-welcome-copy {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 28px;
}
.chat-welcome-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-welcome-dark {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-welcome-dark:hover { opacity: .82; color: var(--paper); }
html[data-theme="dark"] .btn-welcome-dark {
  background: var(--yellow);
  color: #000;
}
html[data-theme="dark"] .btn-welcome-dark:hover { color: #000; }
.btn-welcome-yellow {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--yellow);
  color: #000;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-welcome-yellow:hover { opacity: .85; color: #000; }
html[data-theme="dark"] .btn-welcome-yellow {
  background: rgba(255,233,0,.15);
  color: var(--yellow);
  border: 1px solid rgba(255,233,0,.35);
}

.chat-welcome-features {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: min(100%, 760px);
}
.chat-feature-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
}
.chat-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 20px;
  color: var(--muted);
}
.chat-feature-card h6 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink);
  letter-spacing: -.02em;
}
.chat-feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .chat-welcome-card { padding: 32px 22px; }
  .chat-welcome-features { grid-template-columns: 1fr; }
}

/* ── 32. CHAT EMPTY STATES (READY / SEARCH) ────────────────── */

.chat-ready-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
}

.chat-ready-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 36px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.07);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle dot pattern inside the card */
.chat-ready-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: .5;
  pointer-events: none;
  border-radius: inherit;
}

/* Yellow gradient wash at top */
.chat-ready-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(255,233,0,.18) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}

.chat-ready-card > * { position: relative; z-index: 1; }

.chat-ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,233,0,.25);
  border: 1px solid rgba(255,233,0,.5);
  color: #7a6900;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.chat-ready-badge i { font-size: 13px; }

.chat-ready-avatar {
  width: 52px;
  height: 52px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 auto 18px;
}
html[data-theme="dark"] .chat-ready-avatar {
  background: var(--yellow);
  color: #000;
}

.chat-ready-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
  margin-bottom: 10px;
}

.chat-ready-copy {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

.chat-ready-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chat-ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .1s;
}
.chat-ready-pill:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
  transform: translateY(-1px);
}
.chat-ready-pill i { font-size: 14px; }

/* Search variant (no-documents state) */
.chat-ready-card--search .chat-ready-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-ready-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .12s, transform .1s;
}
.btn-ready-primary:hover {
  background: #000;
  transform: translateY(-1px);
}
html[data-theme="dark"] .btn-ready-primary {
  background: var(--yellow);
  color: #000;
}

.btn-ready-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .1s;
}
.btn-ready-outline:hover {
  border-color: var(--ink);
  background: var(--surface);
  transform: translateY(-1px);
}

.chat-ready-divider {
  position: relative;
  text-align: center;
  margin: 20px 0 18px;
}
.chat-ready-divider::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.chat-ready-divider span {
  position: relative;
  background: var(--paper);
  padding: 0 12px;
  font-size: 12px;
  color: var(--muted);
}

/* Dark mode */
html[data-theme="dark"] .chat-ready-card {
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
html[data-theme="dark"] .chat-ready-badge {
  background: rgba(255,233,0,.12);
  border-color: rgba(255,233,0,.25);
  color: #c9a800;
}
html[data-theme="dark"] .chat-ready-divider span {
  background: var(--paper);
}

/* ── 33. MESSAGE BUBBLES ─────────────────────────────────────── */

.msg-user {
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px 20px 6px 20px;
  padding: 14px 18px;
  max-width: 68%;
  line-height: 1.6;
}
.msg-user p, .msg-user .text-primary-light {
  color: var(--paper) !important;
  margin-bottom: 0;
}
.msg-user .text-secondary-light {
  color: rgba(255,255,255,.45) !important;
}
html[data-theme="dark"] .msg-user {
  background: var(--yellow);
  color: #000;
}
html[data-theme="dark"] .msg-user p,
html[data-theme="dark"] .msg-user .text-primary-light { color: #000 !important; }
html[data-theme="dark"] .msg-user .text-secondary-light { color: rgba(0,0,0,.45) !important; }

.msg-ia {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px 20px 20px 20px;
  padding: 18px 22px;
  max-width: 78%;
  box-shadow: 0 6px 20px rgba(0,0,0,.04);
}

/* NA avatar */
.na-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
html[data-theme="dark"] .na-avatar {
  background: var(--yellow);
  color: #000;
}

/* ── 34. SETTINGS v7 — SUBSCRIPTION / PRICING ───────────────── */

.pricing-intro {
  margin-bottom: 32px;
}
.pricing-intro h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-bottom: 6px;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}
.billing-toggle strong { color: var(--ink); font-weight: 700; }
.billing-toggle .switch {
  width: 38px;
  height: 22px;
  background: var(--ink);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
html[data-theme="dark"] .billing-toggle .switch {
  background: var(--yellow);
  border: 2px solid rgba(255,233,0,.6);
}
.billing-toggle .switch::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--yellow);
  right: 3px; top: 3px;
  transition: transform .15s;
}
html[data-theme="dark"] .billing-toggle .switch::after {
  background: var(--ink);
  right: 2px; top: 2px;
}
.billing-bonus {
  background: rgba(255,233,0,.25);
  border: 1px solid rgba(255,233,0,.6);
  color: #6a5700;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
html[data-theme="dark"] .billing-bonus {
  background: rgba(255,233,0,.18);
  border-color: rgba(255,233,0,.45);
  color: var(--yellow);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.plan-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 520px;
}
.plan-card.featured {
  background: linear-gradient(180deg, rgba(255,233,0,.18), rgba(255,255,255,.96) 46%);
  border-color: rgba(0,0,0,.18);
  box-shadow: 0 30px 80px rgba(0,0,0,.12);
}
html[data-theme="dark"] .plan-card.featured {
  background: linear-gradient(180deg, rgba(255,233,0,.12), var(--paper) 46%);
  border-color: rgba(255,233,0,.25);
}
.plan-card.disabled { opacity: .55; box-shadow: none; }

.plan-badge {
  position: absolute;
  top: 22px; right: 22px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}

.plan-icon {
  width: 48px; height: 48px;
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.plan-card.featured .plan-icon { background: var(--yellow); }

.plan-meta { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.plan-card h3 { font-size: 24px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 8px; }
.plan-description { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; flex-grow: 1; }

.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan-price strong { font-size: 36px; font-weight: 800; letter-spacing: -.04em; }
.plan-price span { font-size: 15px; color: var(--muted); }
.plan-subprice { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.plan-note { font-size: 12px; color: var(--muted); }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-features li {
  font-size: 14px;
  padding-left: 22px;
  position: relative;
  color: var(--ink);
}
.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}
.plan-features li.unavailable { color: var(--muted); }
.plan-features li.unavailable::before { content: "–"; color: var(--muted); }

.plan-card .button { margin-top: auto; }

/* ── 35. SETTINGS v7 — USAGE / BILLING ──────────────────────── */

.usage-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 900px) {
  .usage-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .usage-kpis { grid-template-columns: 1fr; }
}

.usage-kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}
.usage-kpi::after {
  content: "";
  position: absolute;
  width: 100px; height: 100px;
  border-radius: 999px;
  right: -24px; top: -28px;
  background: rgba(255,233,0,.2);
  pointer-events: none;
}
.usage-kpi > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.usage-kpi strong {
  display: block;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -.05em;
  color: var(--ink);
  margin-bottom: 4px;
}
.usage-kpi p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
@media (max-width: 640px) {
  .usage-grid { grid-template-columns: 1fr; }
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--muted);
}
.progress-row strong { color: var(--ink); font-weight: 700; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--yellow);
  width: 0%;
  transition: width .4s ease;
}

.metric-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
}
.metric-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  font-size: 14px;
  color: var(--muted);
}
.metric-list > div strong { color: var(--ink); font-weight: 700; }

.coming-soon-card {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.coming-soon-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.coming-soon-card p { font-size: 13px; margin-bottom: 12px; }

.cost-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}
.cost-table th,
.cost-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}
.cost-table th {
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cost-table tr:last-child td { border-bottom: none; }
html[data-theme="dark"] .cost-table th { background: var(--surface); color: var(--muted); }

.table-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 16px;
  line-height: 1.6;
}

/* ── Profile summary card (v7) ───────────────────────────────── */
.profile-pattern {
  height: 70px;
  background-image: radial-gradient(var(--yellow) 1.5px, transparent 1.5px);
  background-size: 14px 14px;
  background-color: var(--ink);
  border-radius: 18px 18px 0 0;
  margin: -24px -24px 0;
}
html[data-theme="dark"] .profile-pattern {
  background-color: #000;
}

.avatar-large {
  width: 72px; height: 72px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  border: 4px solid var(--paper);
  margin: -36px auto 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
html[data-theme="dark"] .avatar-large {
  background: var(--yellow);
  color: #000;
  border-color: var(--paper);
}

/* ── 36. DOCUMENT PANEL v7 ───────────────────────────────────── */

/* Panel header */
.doc-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px 12px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 3;
}
.doc-panel-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 2px;
}
.doc-panel-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin: 0;
}
.doc-panel-count {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background: var(--yellow);
  color: #000;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

/* Toolbar with filter pills */
.doc-panel-toolbar {
  display: flex;
  gap: 6px;
  padding: 0 18px 14px;
  position: sticky;
  top: 72px;
  background: var(--paper);
  z-index: 2;
}
.doc-filter-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.doc-filter-btn.active,
.doc-filter-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
html[data-theme="dark"] .doc-filter-btn.active,
html[data-theme="dark"] .doc-filter-btn:hover {
  background: var(--yellow);
  color: #000;
  border-color: var(--yellow);
}
/* Smaller filter pills for the second row */
.doc-filter-btn-sm {
  font-size: 11px;
  padding: 3px 10px;
}

/* Info tooltip bubble */
.doc-info-tooltip {
  width: 260px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  font-size: 11px;
  line-height: 1.6;
}
html[data-theme="dark"] .doc-info-tooltip {
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* Document cards */
.document-card-v7 {
  display: grid;
  grid-template-columns: 44px 1fr 32px;
  gap: 0 12px;
  align-items: start;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 12px 10px;
  background: var(--paper);
  box-shadow: 0 4px 12px rgba(0,0,0,.035);
  transition: box-shadow .12s, border-color .12s;
  cursor: pointer;
}
.document-card-v7:hover {
  border-color: rgba(0,0,0,.18);
  box-shadow: 0 8px 24px rgba(0,0,0,.07);
}
.document-card-v7.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--yellow), 0 10px 24px rgba(0,0,0,.05);
}
.document-card-v7.error-doc { border-color: rgba(217,48,37,.3); }

.doc-icon-v7 {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
html[data-theme="dark"] .doc-icon-v7 { background: rgba(255,255,255,.08); }

.doc-content-v7 h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.doc-content-v7 p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.doc-badge-neutral { background: var(--surface); color: var(--muted); }
.doc-badge-success { background: rgba(30,142,62,.12); color: #1e8e3e; }
.doc-badge-processing { background: var(--yellow); color: #000; }
.doc-badge-error { background: rgba(217,48,37,.12); color: var(--alert); }
.doc-badge-verified { background: rgba(66,133,244,.12); color: #4285f4; }

.doc-actions-v7 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.doc-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .1s, color .1s;
  font-size: 15px;
  padding: 0;
}
.doc-action-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

/* Upload card */
.doc-upload-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 12px 0;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 16px;
  background: transparent;
  transition: border-color .12s, background .12s;
}
.doc-upload-card:hover {
  border-color: var(--ink);
  background: var(--surface);
}
.doc-upload-card strong { font-size: 14px; font-weight: 700; color: var(--ink); }
.doc-upload-card p { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.btn-upload-yellow {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .12s;
}
.btn-upload-yellow:hover { opacity: .85; }

/* Settings topline (sticky page title) */
.settings-topline {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  /* min-height matches sidebar header (p-16 + 36px button + p-16 = 68px) */
  min-height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
html[data-theme="dark"] .settings-topline { background: var(--paper); }

/* Left side: "Espace utilisateur / Page" */
.settings-topline-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-topline-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.settings-topline-sep {
  font-size: 12px;
  color: var(--line);
  user-select: none;
}
.settings-topline-page {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}

/* Right side: "Accueil — Page" breadcrumb */
.settings-topline-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-breadcrumb-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color .12s;
}
.settings-breadcrumb-link:hover { color: var(--ink); }
html[data-theme="dark"] .settings-breadcrumb-link:hover { color: var(--yellow); }
.settings-breadcrumb-sep {
  font-size: 11px;
  color: var(--line);
  user-select: none;
}
.settings-breadcrumb-current {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
html[data-theme="dark"] .settings-breadcrumb-current { color: var(--yellow); }

/* Responsive: profile grid → 1 col on mobile */
.settings-profile-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 768px) {
  .settings-profile-grid { grid-template-columns: 1fr; }
}

/* Responsive: inner form fields → 1 col on mobile */
.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
@media (max-width: 576px) {
  .settings-form-grid { grid-template-columns: 1fr; }
}

/* ── 37. DOCUMENT PANEL — SEARCH GROUPS & CARDS ─────────────── */

/* Section label "RECHERCHES" / "PIÈCES LIÉES" */
.doc-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: 16px 16px 8px;
}

/* Search group card */
.search-group {
  background: var(--surface);
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 20px;
  margin: 0 12px 8px;
  overflow: hidden;
}
html[data-theme="dark"] .search-group {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.08);
}
.search-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.search-group-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(64,249,155,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  color: #00241b;
}
html[data-theme="dark"] .search-group-icon { color: #40f99b; }
.search-group-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}
.search-group-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.search-group-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--yellow);
  color: #000;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: auto;
  flex-shrink: 0;
}
.search-group-chevron {
  font-size: 16px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s;
}
.search-group[open] .search-group-chevron,
.search-group-header[aria-expanded="true"] .search-group-chevron {
  transform: rotate(180deg);
}
.search-group-docs {
  border-top: 1px solid var(--line);
  padding: 8px 0 4px;
}

/* Document card — cleaner version replacing document-card-v7 */
.document-card {
  display: grid;
  grid-template-columns: 38px 1fr 36px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,.08);
  background: var(--paper);
  margin: 0 12px 8px;
  transition: border-color .12s;
}
html[data-theme="dark"] .document-card {
  background: var(--paper);
  border-color: rgba(255,255,255,.08);
}
.document-card:last-child { margin-bottom: 12px; }
.document-card.error {
  border-color: rgba(229,61,0,.3);
  background: rgba(229,61,0,.025);
}
.document-card-sub {
  /* Same as doc-icon-v7 */
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.document-card-content { min-width: 0; }
.document-card-content h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.document-card-content p {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 4px;
}

/* Group doc cards (inside search-group, no outer margin) */
.search-group .document-card {
  margin: 0 0 4px;
  border-radius: 12px;
  border-color: transparent;
  background: rgba(0,0,0,.03);
}
html[data-theme="dark"] .search-group .document-card {
  background: rgba(255,255,255,.04);
  border-color: transparent;
}
.search-group .document-card:last-child { margin-bottom: 0; }
.search-group-docs-inner { padding: 8px 10px 10px; }

/* Badge system aligned to charter */
.doc-badge-registre {
  background: rgba(255,233,0,.25);
  border: 1px solid rgba(255,233,0,.5);
  color: #5a4b00;
}
html[data-theme="dark"] .doc-badge-registre { color: var(--yellow); }

/* Sources accordion (collapsible below AI message) */
.msg-sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.msg-sources summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 0;
  user-select: none;
}
.msg-sources summary::-webkit-details-marker { display: none; }
.msg-sources summary .sources-count {
  font-size: 11px;
  background: var(--surface);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 600;
}
.msg-sources summary .sources-chevron {
  font-size: 14px;
  color: var(--muted);
  margin-left: auto;
  transition: transform .2s;
}
.msg-sources[open] summary .sources-chevron {
  transform: rotate(180deg);
}
.msg-sources-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.msg-source-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 10px;
  max-width: 260px;
}
.msg-source-chip span {
  font-size: 11px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Search log modal — mobile fullscreen */
@media (max-width: 576px) {
  .search-log-dialog {
    margin: 0;
    max-width: 100%;
    height: 100dvh;
  }
  .search-log-dialog .modal-content {
    border-radius: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  .search-log-dialog .modal-body { flex: 1; overflow-y: auto; }
}


/* ===== Credit Balance Widget ===== */
.credit-balance-widget {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    transition: all 0.2s ease;
    cursor: default;
    user-select: none;
    white-space: nowrap;
}

.credit-balance-widget:hover {
    background: var(--line);
    transform: translateY(-1px);
}

.credit-balance-icon {
    font-size: 16px;
    line-height: 1;
}

.credit-balance-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.credit-balance-label {
    opacity: 0.7;
    font-size: 12px;
}

/* Niveau OK : neutre, calme */
.credit-balance-widget.credit-level-ok {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
}

.credit-balance-widget.credit-level-ok .credit-balance-icon {
    color: var(--ink);
}

/* Niveau warning : jaune signature NotairIA — texte toujours sombre, même en dark mode */
.credit-balance-widget.credit-level-warning {
    background: var(--yellow);
    color: #1a1a1a;
    border-color: var(--yellow);
}

.credit-balance-widget.credit-level-warning .credit-balance-icon {
    color: #1a1a1a;
}

.credit-balance-widget.credit-level-warning .credit-balance-label {
    opacity: 0.85;
}

/* Niveau danger : alerte */
.credit-balance-widget.credit-level-danger {
    background: var(--alert);
    color: #ffffff;
    border-color: var(--alert);
    animation: credit-pulse 2s ease-in-out infinite;
}

.credit-balance-widget.credit-level-danger .credit-balance-icon {
    color: #ffffff;
}

.credit-balance-widget.credit-level-danger .credit-balance-label {
    opacity: 0.9;
}

@keyframes credit-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Responsive : sur mobile, masquer le label "crédits" pour gagner de la place */
@media (max-width: 767.98px) {
    .credit-balance-label {
        display: none;
    }
    .credit-balance-widget {
        padding: 6px 10px;
    }
}



/* Plan actuel */
.plan-card.plan-current {
    border: 2px solid var(--yellow);
    background: linear-gradient(180deg, rgba(255, 233, 0, 0.04), transparent);
}

.plan-badge-current {
    background: var(--yellow);
    color: var(--ink);
    font-weight: 700;
}

.plan-badge-popular {
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
}

/* Bouton désactivé propre */
.button-disabled {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--line);
    cursor: not-allowed;
}

.button-outline {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
}

/* Switch ON state */
.billing-toggle .switch.on {
    background: var(--yellow);
}


/* ===== Page publique pricing ===== */
.public-page {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-main {
    flex: 1;
    padding: 0;
}

.pricing-public-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.pricing-hero {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-kicker {
    display: inline-block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.pricing-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
    line-height: 1.1;
}

.pricing-subtitle {
    font-size: 16px;
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.pricing-grid-public {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 991.98px) {
    .pricing-grid-public {
        grid-template-columns: 1fr;
        max-width: 480px;
    }
}

/* Trust signals */
.pricing-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 60px auto 0;
    padding: 32px;
    background: var(--surface);
    border-radius: 16px;
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.trust-item strong {
    font-size: 14px;
    font-weight: 700;
}

.trust-item span {
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 767.98px) {
    .pricing-trust {
        grid-template-columns: 1fr;
    }
}

/* FAQ */
.pricing-faq {
    max-width: 700px;
    margin: 60px auto 0;
}

.pricing-faq h2 {
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.faq-item {
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 16px 0;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.faq-question i {
    transition: transform 0.2s ease;
    color: var(--muted);
}

.faq-answer {
    padding: 0 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

/* Footer public */
.public-footer {
    border-top: 1px solid var(--line);
    padding: 40px 24px;
    margin-top: auto;
}

.public-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.public-footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-footer-name {
    font-weight: 700;
    font-size: 14px;
}

.public-footer-links {
    display: flex;
    gap: 24px;
}

.public-footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
}

.public-footer-links a:hover {
    color: var(--ink);
}

.public-footer-legal {
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 767.98px) {
    .public-footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* Bouton "active" dans la nav */
.btn-public.active {
    background: var(--ink);
    color: var(--paper);
}


/* ===== Header public restructuré ===== */
.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    gap: 32px;
}

/* Logo (gauche) */
.public-logo {
    flex-shrink: 0;
    text-decoration: none;
}

/* Menu de navigation (centre) */
.public-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    margin-left: 32px;
}

.public-menu-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
}

.public-menu-link:hover {
    color: var(--ink);
}

.public-menu-link.active {
    color: var(--ink);
    font-weight: 600;
}

.public-menu-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
}

/* Actions (droite) */
.public-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 767.98px) {
    .public-header {
        padding: 12px 16px;
        gap: 12px;
    }

    .public-menu {
        display: none; /* On cachera le menu sur mobile, hamburger plus tard */
    }

    .public-actions {
        gap: 8px;
    }

    .public-actions .btn-public {
        padding: 8px 12px;
        font-size: 13px;
    }
}


/* ===== Checkout result pages ===== */
.checkout-result-shell {
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 24px;
    text-align: center;
}

.checkout-result-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 48px 32px;
}

.checkout-result-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.checkout-result-icon.success {
    background: rgba(30, 142, 62, 0.12);
    color: var(--ok);
}

.checkout-result-icon.cancel {
    background: var(--surface);
    color: var(--muted);
}

.checkout-result-icon.error {
    background: rgba(217, 48, 37, 0.12);
    color: var(--alert);
}

.checkout-result-card h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.checkout-result-lead {
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 12px;
}

.checkout-result-detail {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 32px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.checkout-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── RAG SOURCES ACCORDION ──────────────────────────────────── */
.rag-sources { border: none; }
.rag-sources summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.rag-sources summary::-webkit-details-marker { display: none; }
.rag-chevron { transition: transform 0.2s ease; }
.rag-sources[open] .rag-chevron { transform: rotate(180deg); }

/* ── MOBILE RESPONSIVENESS — correctifs globaux ─────────────── */

/* iOS : 100dvh respecte la toolbar Safari (fallback 100vh déjà défini inline) */
.chat-layout { height: 100dvh; }

/* Tables markdown : scroll horizontal dans la bulle plutôt qu'overflow de page */
.msg-ia { overflow: hidden; min-width: 0; }
.markdown-body table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Chat header : compact sur mobile, sans overflow */
@media (max-width: 767.98px) {
  #tour-chat-header {
    padding: 8px 12px;
    gap: 6px;
    overflow: hidden;
  }
  #tour-chat-header .text-sm.fw-medium {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .msg-ia, .msg-user { max-width: 90%; }
}



/* ===== Settings Billing Page ===== */

.billing-section {
    margin-bottom: 32px;
}

.billing-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.billing-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.billing-section-icon i {
    font-size: 18px;
}

.billing-section-title h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.billing-section-title p {
    font-size: 13px;
    color: var(--muted);
    margin: 2px 0 0;
}

.billing-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 24px;
}

.billing-card-table {
    padding: 0;
    overflow: hidden;
}

/* Plan row */
.billing-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.billing-plan-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.billing-plan-label {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.billing-plan-price {
    font-size: 14px;
    color: var(--muted);
}

/* Credits row */
.billing-divider {
    height: 1px;
    background: var(--line);
    margin: 20px 0;
}

.billing-credits-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.billing-credit-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--surface);
    border-radius: 8px;
}

.billing-credit-item.billing-credit-total {
    background: var(--yellow);
    color: var(--ink);
}

.billing-credit-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.billing-credit-item.billing-credit-total .billing-credit-label {
    color: var(--ink);
    opacity: 0.75;
}

.billing-credit-item strong {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 767.98px) {
    .billing-credits-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Badges */
.billing-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.billing-badge-ok {
    background: rgba(30, 142, 62, 0.12);
    color: var(--ok);
}

.billing-badge-warning {
    background: rgba(255, 233, 0, 0.4);
    color: #6a5400;
}

.billing-badge-alert {
    background: rgba(217, 48, 37, 0.12);
    color: var(--alert);
}

.billing-badge-neutral {
    background: var(--surface);
    color: var(--muted);
}

/* Notices */
.billing-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
}

.billing-notice i {
    font-size: 16px;
    color: var(--ink);
    opacity: 0.6;
}

.billing-notice-warning {
    background: rgba(255, 233, 0, 0.18);
    color: #6a5400;
}

.billing-notice-warning i {
    color: #6a5400;
    opacity: 1;
}

/* Invoices table */
.billing-table {
    width: 100%;
    border-collapse: collapse;
}

.billing-table th {
    text-align: left;
    padding: 14px 20px;
    background: var(--surface);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.billing-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: middle;
}

.billing-table tr:last-child td {
    border-bottom: none;
}

.billing-table .ta-right {
    text-align: right;
}

.invoice-number {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    color: var(--ink);
}

.billing-tax-detail {
    font-size: 12px;
    color: var(--muted);
}

.invoice-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.15s ease;
    margin-left: 4px;
}

.invoice-action:hover {
    background: var(--surface);
    color: var(--ink);
}

/* Empty state */
.billing-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.billing-empty-state i {
    font-size: 40px;
    color: var(--muted);
    opacity: 0.4;
    display: block;
    margin-bottom: 12px;
}

.billing-empty-state p {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 4px;
}

.billing-empty-state span {
    font-size: 13px;
    color: var(--muted);
}

/* Mobile */
@media (max-width: 767.98px) {
    .billing-table {
        font-size: 13px;
    }

    .billing-table th,
    .billing-table td {
        padding: 12px 14px;
    }

    .billing-plan-row {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* ===== Subscription Status (annulation/reactivation) ===== */

.subscription-status {
    margin-bottom: 32px;
}

.subscription-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 24px 28px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--paper);
}

.subscription-status-card.subscription-status-active {
    background: linear-gradient(180deg, rgba(30, 142, 62, 0.04), transparent);
    border-color: rgba(30, 142, 62, 0.2);
}

.subscription-status-card.subscription-status-canceling {
    background: rgba(255, 233, 0, 0.08);
    border-color: rgba(255, 233, 0, 0.4);
}

.subscription-status-card.subscription-status-pastdue {
    background: rgba(217, 48, 37, 0.05);
    border-color: rgba(217, 48, 37, 0.25);
}

.subscription-status-info {
    flex: 1;
    min-width: 200px;
}

.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.subscription-status-badge i {
    font-size: 14px;
}

.subscription-status-badge-ok {
    background: rgba(30, 142, 62, 0.15);
    color: var(--ok);
}

.subscription-status-badge-warning {
    background: rgba(255, 233, 0, 0.5);
    color: #6a5400;
}

.subscription-status-badge-alert {
    background: rgba(217, 48, 37, 0.15);
    color: var(--alert);
}

.subscription-status-info h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.subscription-status-info p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

/* Bouton danger outline */
.button-outline-danger {
    background: var(--paper);
    color: var(--alert);
    border: 1px solid rgba(217, 48, 37, 0.3);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button-outline-danger:hover {
    background: var(--alert);
    color: #ffffff;
    border-color: var(--alert);
}

@media (max-width: 767.98px) {
    .subscription-status-card {
        flex-direction: column;
        align-items: stretch;
    }

    .subscription-status-card form,
    .subscription-status-card a {
        width: 100%;
    }

    .subscription-status-card button,
    .subscription-status-card a {
        width: 100%;
    }
}


/* ===== Modal NotairIA générique ===== */

.notairia-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

[x-cloak] {
    display: none !important;
}

.notairia-modal {
    background: var(--paper);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px var(--line);
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.notairia-modal-header {
    padding: 32px 28px 20px;
    text-align: center;
}

.notairia-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notairia-modal-icon i {
    font-size: 32px;
}

.notairia-modal-icon-warning {
    background: rgba(217, 48, 37, 0.1);
    color: var(--alert);
}

.notairia-modal-icon-info {
    background: rgba(255, 233, 0, 0.4);
    color: var(--ink);
}

.notairia-modal-icon-success {
    background: rgba(30, 142, 62, 0.1);
    color: var(--ok);
}

.notairia-modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
}

.notairia-modal-header p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.notairia-modal-header p strong {
    color: var(--ink);
    font-weight: 600;
}

.notairia-modal-secondary {
    font-size: 13px !important;
    opacity: 0.8;
}

.notairia-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 28px 28px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.notairia-modal-actions > * {
    flex: 1;
}

.notairia-modal-actions .button {
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

/* Bouton danger plein (différent de outline-danger) */
.button-danger {
    background: var(--alert);
    color: #ffffff;
    border-color: var(--alert);
}

.button-danger:hover {
    background: #b8281e;
    border-color: #b8281e;
}

/* Mobile : actions empilées */
@media (max-width: 480px) {
    .notairia-modal-actions {
        flex-direction: column;
    }
}



/* ===== Toast notifications NotairIA ===== */

#toast-container {
    pointer-events: none;
}

#toast-container > * {
    pointer-events: auto;
}

.toast-message {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.12),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    min-width: 320px;
    max-width: 420px;
    font-size: 14px;
}

.toast-text {
    color: var(--ink);
    font-weight: 500;
    line-height: 1.5;
}

.toast-icon {
    flex-shrink: 0;
}

/* Variante succès — vert NotairIA */
.toast-success {
    border-left: 4px solid var(--ok);
}

.toast-success .toast-icon {
    color: var(--ok);
}

/* Variante erreur — rouge NotairIA */
.toast-error {
    border-left: 4px solid var(--alert);
}

.toast-error .toast-icon {
    color: var(--alert);
}

/* Variante warning — jaune NotairIA */
.toast-warning {
    border-left: 4px solid var(--yellow);
    background: var(--paper);
}

.toast-warning .toast-icon {
    color: #b59200;
}

/* Variante info — neutre */
.toast-info {
    border-left: 4px solid var(--ink);
}

.toast-info .toast-icon {
    color: var(--ink);
    opacity: 0.7;
}

/* Bouton de fermeture */
.toast-close {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.toast-close:hover {
    opacity: 1;
    background: var(--surface);
    color: var(--ink);
}

.toast-close i {
    font-size: 16px;
}

/* Animation d'entrée toast */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile : toasts en bas full-width */
@media (max-width: 575.98px) {
    #toast-container {
        bottom: 16px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
    }

    .toast-message {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}



/* =========================================================================
   Notifications : toasts + dropdown cloche (charte NotairIA jaune/noir)
   ========================================================================= */

/* ===== Toasts ===== */
.notairia-toast {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.12);
    min-width: 320px;
    max-width: 400px;
    overflow: hidden;
    pointer-events: auto;
    color: var(--ink);
}

/* Bord gauche selon le level : on reste dans la charte jaune/noir */
.notairia-toast-success {
    border-left: 4px solid var(--ink);
    background: linear-gradient(90deg, rgba(255, 233, 0, 0.10) 0%, var(--paper) 28%);
}
.notairia-toast-warning {
    border-left: 4px solid var(--yellow);
}
.notairia-toast-error {
    border-left: 4px solid var(--alert);
}
.notairia-toast-info {
    border-left: 4px solid var(--ink);
}

/* Titre et corps du toast */
.notairia-toast-title {
    color: var(--ink);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}
.notairia-toast-body {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}
.notairia-toast-link {
    color: var(--ink);
    font-weight: 500;
    font-size: 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 1px;
    display: inline-block;
}
.notairia-toast-link:hover {
    color: var(--ink);
    border-bottom-color: var(--yellow);
    border-bottom-width: 2px;
}
.notairia-toast-close {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
}
.notairia-toast-close:hover {
    color: var(--ink);
}

/* Icône du toast selon le level */
.notairia-toast-icon-success { color: var(--ink); }
.notairia-toast-icon-warning { color: var(--yellow); }
.notairia-toast-icon-error   { color: var(--alert); }
.notairia-toast-icon-info    { color: var(--ink); }

/* ===== Badge cloche ===== */
.notairia-bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--alert);
    color: #fff;
    border: 2px solid var(--paper);
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: content-box;
}
.notairia-bell-badge-sm {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
    line-height: 12px;
}

/* ===== Items du dropdown cloche ===== */
.notairia-notif-item {
    color: inherit;
    transition: background-color 0.15s ease;
    text-decoration: none;
}
.notairia-notif-item:hover {
    background: var(--surface);
    color: inherit;
}

/* Notification non-lue : on garde le jaune subtil que tu as déjà */
.notairia-notif-unread {
    background: rgba(255, 233, 0, 0.10);
    box-shadow: inset 3px 0 0 var(--yellow);
}
.notairia-notif-unread:hover {
    background: rgba(255, 233, 0, 0.16);
}

/* Point non-lu : noir (charte) au lieu de bleu */
.notairia-notif-unread-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--ink);
    border-radius: 50%;
    margin-top: 6px;
}

/* ===== Dark mode ===== */
[data-theme="dark"] .notairia-toast {
    background: var(--paper);
    border-color: var(--line);
}
[data-theme="dark"] .notairia-bell-badge {
    border-color: var(--paper);
}
[data-theme="dark"] .notairia-notif-unread {
    background: rgba(255, 233, 0, 0.12);
}
[data-theme="dark"] .notairia-notif-unread:hover {
    background: rgba(255, 233, 0, 0.18);
}

/* ===== Responsive : toasts pleine largeur sur mobile ===== */
@media (max-width: 576px) {
    #notification-toast-container {
        bottom: 16px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
    }
    .notairia-toast {
        min-width: auto;
        max-width: none;
    }
}

/* ===== Dropdown cloche : structure et layout ===== */
.notairia-notif-dropdown {
    min-width: 360px;
    max-width: 400px;
    background: var(--paper);
    color: var(--ink);
}

.notairia-notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.notairia-notif-dropdown-header h6 {
    color: var(--ink);
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}
.notairia-notif-dropdown-header button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-underline-offset: 3px;
}
.notairia-notif-dropdown-header button:hover {
    text-decoration-color: var(--ink);
}

.notairia-notif-list {
    max-height: 480px;
    overflow-y: auto;
}

/* Items : flex en ligne, icône à gauche, contenu au centre, dot à droite */
.notairia-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    transition: background-color 0.15s ease;
}
.notairia-notif-item:hover {
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}
.notairia-notif-item:last-child {
    border-bottom: 0;
}

/* Contenu texte de l'item */
.notairia-notif-item-title {
    color: var(--ink);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    margin: 0 0 2px 0;
}
.notairia-notif-item-body {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin: 0 0 2px 0;
}
.notairia-notif-item-time {
    color: var(--muted);
    font-size: 11px;
}

/* Empty state */
.notairia-notif-empty {
    text-align: center;
    padding: 32px 16px;
}
.notairia-notif-empty i {
    font-size: 40px;
    color: var(--muted);
    opacity: 0.5;
}
.notairia-notif-empty p {
    color: var(--muted);
    font-size: 13px;
    margin: 12px 0 0 0;
}

/* ===== Dropdown cloche : responsive ===== */
@media (max-width: 767.98px) {
    /*
     * Sur mobile, le dropdown s'affiche dans la sidebar (qui prend toute la largeur).
     * Le position-fixed est ancré à la sidebar (parent avec transform),
     * donc on positionne en pourcentage de la sidebar.
     */
    .notairia-notif-dropdown-wrapper {
        left: 12px !important;
        right: 12px !important;
        top: 70px !important;
        bottom: 12px !important;
        transform: none !important;
        max-width: none !important;
        width: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    .notairia-notif-dropdown {
        min-width: auto !important;
        max-width: none !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .notairia-notif-list {
        max-height: none !important;
        flex: 1 1 auto !important;
        overflow-y: auto !important;
    }
}


/* ─── Section XX : Topup credits (settings/billing) ─── */
.topup-quick-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.topup-quick-btn {
    flex: 1;
    min-width: 120px;
    padding: 14px 18px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.topup-quick-btn:hover {
    border-color: var(--ink);
    transform: translateY(-1px);
}

.topup-quick-btn-active {
    border-color: var(--ink);
    background: var(--surface);
    color: var(--ink);
}

.topup-custom {
    margin-bottom: 8px;
}

.topup-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.topup-input {
    width: 100%;
    max-width: 200px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
}

.topup-input:focus {
    outline: none;
    border-color: var(--ink);
}

.topup-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.topup-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    color: var(--ink);
}

.topup-total-line strong {
    font-size: 22px;
    color: var(--ink);
}

.topup-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 576px) {
    .topup-quick-btn {
        min-width: 100%;
    }
}


/* Widget solde : variante cliquable (alerte solde bas) */
.credit-balance-widget-link {
    text-decoration: none;
    cursor: pointer;
}

.credit-balance-recharge {
    font-size: 15px;
    margin-left: 2px;
    line-height: 1;
}


/* ===== PAGES LÉGALES (privacy, terms) ===== */

.legal-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 60px 24px 100px;
}

/* En-tête */
.legal-header {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line);
}

.legal-page-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 12px 0 20px;
    color: var(--ink);
}

.legal-page-intro {
    font-size: 15px;
    line-height: 1.65;
    color: var(--muted);
    max-width: 640px;
}

/* Corps */
.legal-body {
    display: flex;
    flex-direction: column;
}

.legal-section {
    padding: 36px 0;
    border-bottom: 1px solid var(--line);
}

.legal-section-last {
    border-bottom: none;
}

.legal-section h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.legal-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin: 20px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.legal-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    margin-bottom: 12px;
}

.legal-section p:last-child {
    margin-bottom: 0;
}

.legal-section a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Liste */
.legal-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-list li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--muted);
    padding-left: 18px;
    position: relative;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    background: var(--yellow);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Notice encadrée */
.legal-notice {
    margin-top: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border-left: 3px solid var(--yellow);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--muted);
}

.legal-notice-strong {
    border-left-color: var(--ink);
    font-size: 14px;
    margin-top: 0;
}

/* Tableau */
.legal-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.legal-table th {
    background: var(--surface);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.legal-table td {
    padding: 12px 16px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    line-height: 1.5;
}

.legal-table tr:last-child td {
    border-bottom: none;
}

/* ===== PAGE À PROPOS ===== */

.about-values {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.about-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
}

.about-value:last-child {
    border-bottom: none;
}

.about-value:hover {
    background: var(--surface);
}

.about-value-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.about-value-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}


.legal-page {
    position: relative;
}

.legal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .04;
    background-image: radial-gradient(var(--ink) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.legal-header,
.legal-body {
    position: relative;
    z-index: 1;
}


/* ===== PAGE À PROPOS ===== */

.about-values {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.about-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s ease;
}

.about-value:last-child {
    border-bottom: none;
}

.about-value:hover {
    background: var(--surface);
}

.about-value-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.about-value-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}
