/* ── Couleurs ──────────────────────────────────────────────
   Thème orange doux, fonds chauds et neutres. Le logo garde l'orange vif et le vert pomme ;
   ailleurs l'orange est adouci pour se fondre dans la page.
   --primary / --accent : couleurs lisibles en texte (liens, onglets, icônes).
   --brand / --pop      : aplats (boutons, bulles), avec --brand-ink / --pop-ink comme texte posé dessus. */
:root {
  --logo-bg: #ff7a1a;
  --logo-ink: #2b1100;
  --logo-bar: #7ccb2b;
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #f2efea;
  --ink: #221a12;
  --ink-2: #4e4439;
  --ink-3: #6b5f52;
  --line: #e6e0d8;
  --primary: #ad4f1e;
  --primary-soft: #fbefe6;
  --brand: #e9915e;
  --brand-ink: #2b1100;
  --accent: #3a7d0a;
  --accent-soft: #ecf8dd;
  --pop: #7ccb2b;
  --pop-ink: #132b05;
  --ok: #15803d;
  --ok-soft: #e3f4e8;
  --warn: #a16207;
  --warn-soft: #fbf1d6;
  --danger: #c81e1e;
  --danger-soft: #fde6e6;
  /* Graphiques : 4 couleurs catégorielles validées (daltonisme, contraste), puis neutres. */
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-4: #eda100;
  --viz-other: #a39a8f;
  --viz-track: #e3dcd2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(34, 26, 18, .06), 0 4px 16px rgba(34, 26, 18, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15110d;
    --surface: #1f1914;
    --surface-2: #29211a;
    --ink: #f3ece4;
    --ink-2: #c9bcae;
    --ink-3: #a39584;
    --line: #3a3027;
    --primary: #e9a274;
    --primary-soft: #33231a;
    --brand: #c9784a;
    --brand-ink: #1f0e04;
    --accent: #9be15a;
    --accent-soft: #1f3512;
    --pop: #8edc3c;
    --pop-ink: #0f2005;
    --ok: #4ade80;
    --ok-soft: #14301f;
    --warn: #facc15;
    --warn-soft: #332b10;
    --danger: #f87171;
    --danger-soft: #3a1919;
    --viz-1: #3987e5;
    --viz-2: #d95926;
    --viz-3: #199e70;
    --viz-4: #c98500;
    --viz-other: #7a6f63;
    --viz-track: #3a3027;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
img, svg { max-width: 100%; }
/* Taille par défaut des icônes en ligne (spécificité nulle : toute règle explicite l'emporte) */
:where(svg:not(.brand-mark)) { width: 1.15em; height: 1.15em; vertical-align: -.18em; flex: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Structure ─────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.topbar nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topbar nav a { padding: 6px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-weight: 550; }
.topbar nav a:hover, .topbar nav a.active { background: var(--surface-2); color: var(--ink); }

.shell { flex: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.sidebar {
  position: sticky; top: 53px; align-self: start; height: calc(100vh - 53px); overflow-y: auto;
  padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface);
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-weight: 550; margin-bottom: 2px;
}
.sidebar a svg { width: 19px; height: 19px; flex: none; }
.sidebar a:hover { background: var(--surface-2); color: var(--ink); }
.sidebar a.active { background: var(--primary-soft); color: var(--primary); box-shadow: inset 3px 0 0 var(--brand); }
.sidebar .sep { height: 1px; background: var(--line); margin: 10px 4px; }
.sidebar .urgent { color: var(--danger); }
.main { padding: 28px 32px 80px; min-width: 0; max-width: 1120px; width: 100%; margin: 0 auto; }
.main.wide { max-width: none; }

/* Menu du compte (en-tête) */
.menu { position: relative; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-2); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--surface-2); color: var(--ink); }
.menu .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 40; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; background: none; border: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop svg { width: 18px; height: 18px; color: var(--ink-3); }
.menu-pop .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-pop .who { padding: 6px 10px 8px; font-size: .84rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Onglets (sections regroupées) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-3); font-weight: 650; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--primary); border-bottom: 3px solid var(--brand); }

.bottom-nav { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 96px; }
  .topbar { padding: 10px 16px; }
  .topbar nav.desktop-only { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .72rem; color: var(--ink-3); text-decoration: none; padding: 4px 0; }
  .bottom-nav a svg { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  h1 { font-size: 1.45rem; }
}

/* ── Composants ────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--ink-2); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.card h3 { margin-bottom: .35em; }
.muted { color: var(--ink-3); }
.small { font-size: .88rem; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.top { align-items: start; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--pop); border-color: var(--pop); color: var(--pop-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: .86rem; }
.btn.lg { padding: 13px 22px; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { padding: 6px; border: none; background: none; color: var(--ink-3); cursor: pointer; border-radius: 6px; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.check-btn svg { width: 24px; height: 24px; }
.icon-btn.check-btn:hover { color: var(--primary); background: none; }
.list-item.done .check-btn { color: var(--ok); }
@media (max-width: 860px) { .desktop-only { display: none !important; } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-size: .9rem; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--primary); }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
a.chip { text-decoration: none; }
.task-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.task-actions .btn { color: var(--ink-2); }

label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: .84rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 450; margin-bottom: 10px; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.extract-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 2px dashed var(--brand); border-radius: var(--radius); background: var(--primary-soft); cursor: pointer; font-weight: 400; margin-bottom: 4px; }
.extract-box > svg { width: 26px; height: 26px; color: var(--primary); }
.extract-box strong { display: block; color: var(--ink); }
.extract-box .sub { display: block; font-size: .86rem; color: var(--ink-2); }
.extract-box:hover { border-style: solid; }
.extract-box.busy { cursor: progress; }
.extract-box.busy .sub::after { content: ""; animation: dots 1.2s steps(4) infinite; }
.extract-box.done { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.extract-box.error { border-style: solid; border-color: var(--danger); background: var(--danger-soft); }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .84rem; margin: 12px 0 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.more-fields { margin: 4px 0 8px; }
.more-fields > summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 12px; }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink-2); font-size: .92rem; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.primary { background: var(--primary-soft); color: var(--primary); }
.verify-banner { border-radius: 0; text-align: center; }
.verify-banner .btn { margin-left: 6px; }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .6; margin-bottom: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item.done .title { text-decoration: line-through; color: var(--ink-3); }
.list-item > select { width: auto; flex: none; max-width: 45%; padding: 6px 10px; }
.list-item > svg { width: 20px; height: 20px; color: var(--ink-3); margin-top: 2px; }
.emoji-badge { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 1.2rem; line-height: 1; }

/* Accueil connecté */
.hello { margin-bottom: 18px; }
.hello h1 { margin-bottom: 2px; }
.hello p { color: var(--ink-3); margin: 0; }
.ask { padding: 20px; margin-bottom: 16px; position: relative; }
.ask .attachments { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ask .attachments:empty { display: none; }
.ask label { font-size: 1.15rem; font-weight: 750; margin-bottom: 10px; }
.ask textarea { min-height: 72px; font-size: 1.02rem; }
.ask .row { margin-top: 10px; }
.checklist .progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 4px 0 6px; }
.checklist .progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.checklist ol { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: none; }
.checklist .tick { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-3); font-weight: 750; font-size: .88rem; }
.checklist li.done .tick { background: var(--ok-soft); color: var(--ok); }
.checklist li.done strong { text-decoration: line-through; color: var(--ink-3); }
.checklist li .grow { flex: 1; min-width: 0; }
.checklist .sub { display: block; font-size: .86rem; color: var(--ink-3); }
.mini-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.mini-stat:first-of-type { border-top: none; }
.mini-stat strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.mini-stat:hover span { color: var(--primary); }

/* Tutoriel */
.tour { text-align: center; padding: 8px 4px 0; }
.tour .big { width: 64px; height: 64px; border-radius: 18px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.tour .big svg { width: 32px; height: 32px; }
.tour h3 { font-size: 1.25rem; }
.tour p { color: var(--ink-2); max-width: 34em; margin: 0 auto .6em; }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--brand); width: 22px; border-radius: 99px; }

/* Ce qu’Aaron sait de vous */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Menu mobile « Plus » */
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.menu-list a svg { width: 22px; height: 22px; color: var(--ink-3); }
.menu-list a:last-child { border-bottom: none; }
@media (max-width: 860px) {
  /* Suggestions sur une seule ligne défilante au lieu d'une colonne de boutons */
  .ask .chips, .prompts-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ask .chip, .prompts-chips .chip { white-space: nowrap; flex: none; }
  .ask .row.between { flex-direction: column; align-items: stretch; }
  .ask .chips { min-width: 0; max-width: 100%; }
  .ask .row.between .btn { width: 100%; }
}

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.stat .label { color: var(--ink-3); font-size: .88rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--ink-3); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Markdown */
.md { overflow-wrap: anywhere; }
.md > :last-child { margin-bottom: 0; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 .8em; }
.md li + li { margin-top: .25em; }
.md h1, .md h2, .md h3 { margin-top: .9em; }
.md h1 { font-size: 1.3rem; } .md h2 { font-size: 1.15rem; } .md h3 { font-size: 1.02rem; }
.md blockquote { margin: 0 0 .8em; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.md code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md table { margin: 0 0 .8em; font-size: .92rem; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 1em 0; }

/* Modale & toasts */
dialog { border: none; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(10, 15, 25, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 18px 20px; overflow-y: auto; max-height: calc(100vh - 180px); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 860px) { .toasts { bottom: 84px; left: 16px; right: 16px; } }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 550; animation: pop .2s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ── Accueil public ────────────────────────────────────── */
.hero { padding: 48px 0 32px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.025em; line-height: 1.08; margin-bottom: .4em; }
.hero h1 em { font-style: normal; color: var(--primary); text-decoration: underline; text-decoration-color: var(--pop); text-decoration-thickness: .09em; text-underline-offset: .14em; }
.eyebrow { font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.hero-visual { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.hv-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.hv-head .brand-mark { width: 38px; height: 38px; }
.hero-visual .bubble { padding: 10px 14px; border-radius: 14px; margin-bottom: 10px; font-size: .94rem; }
.hero-visual .bubble.user { background: var(--brand); color: var(--brand-ink); margin-left: 18%; border-bottom-right-radius: 4px; }
.hero-visual .bubble.bot { background: var(--surface-2); margin-right: 10%; border-bottom-left-radius: 4px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 20px; } }
.section { padding: 36px 0; }
.section > h2 { font-size: 1.6rem; margin-bottom: .8em; }
.feature svg { width: 30px; height: 30px; color: var(--primary); margin-bottom: 6px; }
.steps { counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps .card::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; margin-bottom: 8px; }
.pricing .card.featured { border: 2px solid var(--brand); }
.pricing .price { font-size: 2rem; font-weight: 800; }
.pricing ul { padding-left: 1.1em; }
.footer { padding: 26px 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .88rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer a { color: var(--ink-3); }
details.faq { border-bottom: 1px solid var(--line); padding: 12px 0; }
details.faq summary { font-weight: 650; cursor: pointer; }
details.faq p { margin: 8px 0 0; color: var(--ink-2); }

/* ── Aides ─────────────────────────────────────────────── */
.aide-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s; }
.aide-card:hover { border-color: var(--brand); }
.aide-card .org { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.aide-card p { color: var(--ink-2); font-size: .93rem; margin: 0; }
.aide-card .badge { align-self: flex-start; }
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.search-bar input { font-size: 1.05rem; padding: 12px 14px; }

/* ── Assistant ─────────────────────────────────────────── */
.chat { display: grid; grid-template-columns: 260px 1fr; height: calc(100vh - 53px); margin: -28px -32px -80px; }
.chat-list { border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 12px; }
.chat-list a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list a:hover { background: var(--surface-2); }
.chat-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
/* Glisser-déposer un document sur la conversation ou la question d'accueil. */
.chat-main.dragging::after, .ask.dragging::after {
  content: attr(data-drop); position: absolute; inset: 8px; z-index: 5; pointer-events: none;
  display: grid; place-items: center; padding: 16px; text-align: center; font-weight: 700;
  border: 2px dashed var(--primary); border-radius: var(--radius); color: var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 92%, transparent);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 18px; }
.chat-inner { max-width: 780px; margin: 0 auto; }
.msg { margin-bottom: 18px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.user .bubble { background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: 16px 16px 4px 16px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.assistant .bubble { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; border-radius: 4px 16px 16px 16px; max-width: 100%; }
.msg.error .bubble { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 12px; }
.msg .attach { font-size: .82rem; margin-top: 4px; color: var(--ink-3); }
.msg .meta { font-size: .76rem; color: var(--ink-3); margin-top: 4px; }
.tool-line { font-size: .84rem; color: var(--ink-3); margin: 4px 0; display: flex; align-items: center; gap: 6px; }
.tool-line svg { width: 15px; height: 15px; }
/* Déroulé d'une réponse : ce qu'Aaron fait en coulisses tient sur une ligne discrète, à déplier. */
.work-wrap { margin: 2px 0 8px; }
.work-wrap:first-child { margin-top: 0; }
.work > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: .8rem; color: var(--ink-3); padding: 2px 10px 2px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); }
.work > summary::-webkit-details-marker { display: none; }
.work > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work > summary::after { content: "▾"; font-size: .7rem; transition: transform .15s; }
.work[open] > summary::after { transform: rotate(180deg); }
.work > summary svg { width: 13px; height: 13px; flex: none; }
.work.live > summary svg { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.work-body { margin: 8px 0 4px 6px; padding: 2px 0 2px 12px; border-left: 2px solid var(--line); }
.work .item-card { margin-top: 6px; }
.tool-line .count { font-weight: 700; color: var(--ink-2); }
.msg.assistant .md + .md, .msg.assistant .work-wrap + .md { margin-top: 4px; }
.item-card.update { border-left-color: var(--ink-3); }
.item-card.update .kind { color: var(--ink-2); }
.item-card.budget { border-left-color: var(--accent); }
.item-card.budget .kind { color: var(--accent); }
.jump { align-self: center; position: relative; z-index: 3; margin: -44px 0 12px; box-shadow: var(--shadow); }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; font-size: .74rem; line-height: 1.3; color: var(--ink-3); }
.composer-foot .disclaimer { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-foot #credits { flex: none; margin-left: auto; }
.credits-left { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.credits-left:hover { color: var(--primary); }
.credits-left svg { width: 12px; height: 12px; color: var(--primary); }
.item-card { margin-top: 10px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); font-size: .92rem; }
.item-card .kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.item-card.opportunity { border-left-color: var(--ok); }
.item-card.opportunity .kind { color: var(--ok); }
.item-card.contract { border-left-color: var(--pop); }
.item-card.contract .kind { color: var(--accent); }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 10px 18px calc(8px + env(safe-area-inset-bottom)); }
.composer .inner { max-width: 780px; margin: 0 auto; }
.composer textarea { min-height: 44px; max-height: 220px; resize: none; padding-right: 12px; line-height: 1.4; }
@media (max-width: 860px) { .composer .disclaimer { display: none; } }
.composer .attachments { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }
.prompts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 18px; }
.prompts button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--ink); }
.prompts button:hover { border-color: var(--brand); }
.prompts button strong { display: block; margin-bottom: 2px; }
.prompts button span { color: var(--ink-3); font-size: .88rem; }
@media (max-width: 860px) {
  .chat { grid-template-columns: 1fr; margin: -18px -16px -96px; height: calc(100vh - 53px - 64px); }
  .chat-list { display: none; }
  .chat-list.open { display: block; position: fixed; inset: 53px 0 64px 0; z-index: 25; }
}


/* Coffre */
.secret { font-family: var(--mono); letter-spacing: .02em; overflow-wrap: anywhere; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--ink-3); cursor: pointer; }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* Urgence */
.urgence-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.urgence-grid button { padding: 18px; font: inherit; font-weight: 650; text-align: left; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.urgence-grid button:hover, .urgence-grid button.active { border-color: var(--danger); background: var(--danger-soft); }
.urgence-grid svg { width: 26px; height: 26px; color: var(--danger); flex: none; }
.numbers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.numbers a { display: block; padding: 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); text-decoration: none; font-weight: 700; text-align: center; }
.numbers a small { display: block; font-weight: 500; font-size: .8rem; }

.loading { padding: 40px; text-align: center; color: var(--ink-3); }
.print-only { display: none; }
@media print {
  .topbar, .sidebar, .bottom-nav, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .print-only { display: block; }
  .card { box-shadow: none; border: none; }
}

/* ── Mon budget ─────────────────────────────────────────── */
.donut { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 600px) { .donut { grid-template-columns: 1fr; } .donut-chart { max-width: 220px; margin: 0 auto; } }
.donut-chart { position: relative; }
.donut > * { min-width: 0; }
.donut-chart svg { width: 100%; height: auto; display: block; }
.donut .slices path { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; }
.donut.focus .slices [data-i]:not(.on) { opacity: .28; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 27%; pointer-events: none; }
.donut-center .label { font-size: .78rem; color: var(--ink-3); line-height: 1.2; }
.donut-center strong { font-size: 1.35rem; letter-spacing: -.02em; }
.donut-legend { list-style: none; margin: 0; padding: 0; }
.donut-legend li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); border-radius: 6px; transition: opacity .15s; }
.donut-legend li:last-child { border-bottom: 0; }
.donut-legend li:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.donut.focus .donut-legend li:not(.on) { opacity: .45; }
.donut-legend .grow { flex: 1; min-width: 0; }
.donut-legend .pc { min-width: 3.2em; text-align: right; }
.swatch { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.swatch.hatch { background: repeating-linear-gradient(45deg, var(--ink-3) 0 1.5px, var(--surface-2) 1.5px 4px); }
.swatch.ring { background: transparent; border: 3px solid var(--accent); border-radius: 50%; }
.donut .saving-arc { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; transition: opacity .15s; }
.donut-legend .eco { min-width: 3.6em; text-align: right; }
.donut-legend .grow { display: flex; flex-direction: column; }
.donut-legend .detail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .donut-legend .pc { display: none; } }
.donut-legend .saving-key { border-bottom: 0; border-top: 1px dashed var(--line); margin-top: 2px; color: var(--ink-2); }
.donut-center .gain { margin-top: 2px; font-size: .74rem; line-height: 1.2; white-space: normal; }
.gain { color: var(--accent); font-weight: 700; white-space: nowrap; }
.savings { list-style: none; margin: 0; padding: 0; }
.saving { padding: 12px 0; border-bottom: 1px solid var(--line); }
.saving:last-child { border-bottom: 0; }
.saving .bar { margin-top: 6px; }
.saving .bar > span { display: block; position: relative; height: 10px; min-width: 6px; border-radius: 4px; background: var(--viz-track); overflow: hidden; }
.saving .bar i { position: absolute; top: 0; right: 0; bottom: 0; background: var(--accent); border-left: 2px solid var(--surface); }
.tips { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }
.more-lines > summary { cursor: pointer; }
.card-head { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.card-head .chips { flex-wrap: nowrap; }
.badge.conf { background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; }
