/* ==========================================================================
   Pragma : une seule feuille de style.
   Structure inspirée de Notion (barre latérale, pages, blocs, callouts) et de
   ChatGPT (conversation en colonne centrée, bulles, barre de saisie en pilule).
   Couleurs reprises de Heycout : ciel presque noir et étoilé, surfaces
   graphite, texte blanc cassé, et un seul accent, le rouge néon, réservé à
   l'action principale, à l'état actif et à la progression. Typo : Inter.
   ========================================================================== */

:root {
  --sky: #050508;
  --side: #0b0b10;
  --surface: rgba(19, 19, 25, .74);
  --surface-2: rgba(32, 32, 40, .86);
  --surface-3: rgba(46, 46, 57, .92);
  --hover: rgba(255, 255, 255, .06);
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .15);
  --text: #f4f4f7;
  --text-2: #c9c9d2;
  --muted: #9a9aa8;
  --faint: #62626e;
  --accent: #ff1e3d;
  --accent-hover: #ff4560;
  --accent-soft: rgba(255, 30, 61, .14);
  --accent-glow: rgba(255, 30, 61, .45);
  --danger: #ff5a6e;
  --danger-soft: rgba(255, 90, 110, .13);
  --r: 12px;
  --shadow-pop: 0 22px 54px rgba(0, 0, 0, .72);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pixel: 'Silkscreen', ui-monospace, monospace;
  --side-w: 252px;
  --col: 720px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--sky); color: var(--text);
  font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}
/* Le ciel étoilé de Heycout, fixe derrière tout. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 18px 42px, rgba(255, 255, 255, .5), transparent),
    radial-gradient(1px 1px at 96px 128px, rgba(255, 255, 255, .38), transparent),
    radial-gradient(1px 1px at 172px 24px, rgba(255, 255, 255, .45), transparent),
    radial-gradient(1px 1px at 58px 196px, rgba(255, 255, 255, .3), transparent),
    radial-gradient(1px 1px at 214px 162px, rgba(255, 255, 255, .4), transparent),
    radial-gradient(1px 1px at 136px 88px, rgba(255, 255, 255, .25), transparent),
    radial-gradient(60% 40% at 50% 0%, rgba(255, 30, 61, .05), transparent 70%);
  background-size: 240px 240px, 240px 240px, 240px 240px, 240px 240px, 240px 240px, 240px 240px, 100% 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.022em; line-height: 1.2; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* --- Boutons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px;
  cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 46px; font-size: 15px; font-weight: 600; width: 100%; border-radius: 10px; }
.btn.danger { color: var(--danger); }
.icon-btn { width: 32px; height: 32px; border-radius: 6px; border: 0; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); padding: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .3; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted) !important; flex: none; }
.fine { font-size: 12.5px; color: var(--faint); margin: 0; text-align: center; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Logo -------------------------------------------------------------------- */
.brand { display: inline-block; width: 92px; height: 42px; font-size: 0; color: transparent; text-decoration: none; }
.brand::before { content: ''; display: block; width: 100%; height: 100%; background: var(--text); -webkit-mask: url(logo.svg) left center / contain no-repeat; mask: url(logo.svg) left center / contain no-repeat; }
.brand .brand-mark { display: none; }
.brand-mark { position: relative; flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--text); display: inline-block; }
.brand-mark::after { content: ''; position: absolute; inset: 4px; background: var(--sky); -webkit-mask: url(mark.svg) center / contain no-repeat; mask: url(mark.svg) center / contain no-repeat; }

/* --- Page d'accueil ------------------------------------------------------------- */
.landing { min-height: 100vh; min-height: 100dvh; }
.land { max-width: 1040px; margin: 0 auto; padding: 48px 24px; display: grid; gap: 56px; grid-template-columns: 1.15fr .85fr; align-items: center; min-height: 100vh; min-height: 100dvh; }
.land-hero .brand { width: 132px; height: 60px; }
.land-hero h1 { font-size: clamp(38px, 5.4vw, 60px); letter-spacing: -.04em; margin: 28px 0 16px; line-height: 1.04; }
.land-hero h1 em { font-style: normal; color: var(--muted); }
.lead { font-size: 17px; color: var(--text-2); max-width: 34em; margin: 0 0 28px; }
.land-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 34em; }
.land-points li { padding-left: 22px; position: relative; color: var(--muted); font-size: 14.5px; }
.land-points li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.land-points strong { color: var(--text); font-weight: 600; }
.land-card { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; padding: 6px; box-shadow: var(--shadow-pop); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, .04); border-radius: 12px; padding: 3px; }
.tabs a { text-align: center; padding: 8px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs a.on { background: var(--surface-3); color: var(--text); }
.auth-form { padding: 18px 16px 16px; display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--muted); }
.field, .auth-form input[type=email], .auth-form input[type=password], .auth-form input[type=text] {
  width: 100%; min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .04); font-size: 15px; font-weight: 400; color: var(--text);
}
.field:focus, .auth-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field option { background: #16161c; }
.auth-form .check { grid-template-columns: auto 1fr; align-items: start; font-weight: 400; gap: 10px; color: var(--muted); }
.auth-form .check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.auth-form .check a { text-decoration: underline; color: var(--text-2); }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 14px; }
.doc { max-width: 680px; margin: 0 auto; padding: 48px 24px 80px; }
.doc h1 { font-size: 40px; margin: 28px 0 16px; }
.doc h2 { font-size: 20px; margin: 28px 0 6px; }
.doc p { color: var(--text-2); }
@media (max-width: 860px) { .land { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; min-height: 0; } }

/* --- Coquille : barre latérale (Notion) + page ------------------------------------ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: rgba(11, 11, 16, .92); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 12px 8px; z-index: 40; overflow-y: auto;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.side-top { padding: 4px 8px 14px; }
.side-top .brand { width: 84px; height: 38px; }
.side-nav { display: grid; gap: 1px; }
.side-nav button, .side-link, .side-quest {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; position: relative;
}
.side-nav button:hover, .side-link:hover, .side-quest:hover { background: var(--hover); color: var(--text); }
.side-nav button[aria-current="page"] { background: rgba(255, 255, 255, .08); color: var(--text); font-weight: 600; }
.side-nav button[aria-current="page"]::before { content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.ico { display: inline-grid; place-items: center; width: 20px; height: 20px; color: var(--faint); flex: none; }
.ico svg { width: 17px; height: 17px; }
.side-nav button[aria-current="page"] .ico { color: var(--text); }
.badge { position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.side-label { font-size: 12px; font-weight: 600; color: var(--faint); padding: 20px 8px 4px; }
.side-quests { display: grid; gap: 1px; }
.side-quest { font-size: 13.5px; }
.q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-ring { --p: 0; flex: none; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); -webkit-mask: radial-gradient(circle, transparent 4.5px, #000 5px); mask: radial-gradient(circle, transparent 4.5px, #000 5px); margin: 0 2px; }
.side-empty { font-size: 13px; color: var(--faint); padding: 4px 8px; }
.side-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 2px; }
.side-hero { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; text-align: left; width: 100%; color: var(--text); }
.side-hero:hover { background: var(--hover); }
.side-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex: none; }
.side-avatar canvas { width: 22px; height: 25px; image-rendering: pixelated; }
.side-hero-txt { display: grid; line-height: 1.25; min-width: 0; }
.side-hero-txt strong { font-size: 13.5px; font-weight: 600; }
.side-hero-txt span { font-size: 12px; color: var(--muted); }

.page { margin-left: var(--side-w); min-height: 100vh; min-height: 100dvh; }
.mob-bar { display: none; }
.scrim { display: none; }
.main { max-width: calc(var(--col) + 48px); margin: 0 auto; padding: 56px 24px 150px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-pop); width: 282px; background: #0b0b10; }
  .side-open .sidebar { transform: none; }
  .side-open .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .55); }
  .page { margin-left: 0; }
  .mob-bar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(5, 5, 8, .85);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
  }
  .mob-bar .icon-btn { width: 38px; height: 38px; color: var(--text); }
  .mob-title { font-weight: 600; font-size: 15px; }
  .main { padding: 22px 16px 160px; }
}

/* --- Titres de page et blocs (Notion) ------------------------------------------------ */
.view-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 28px; }
.view-title h1 { font-size: 36px; letter-spacing: -.035em; }
.view-title .sub { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.view-title .sub::first-letter { text-transform: uppercase; }
.section { margin-top: 36px; }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.section-h h2 { font-size: 14.5px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { .view-title h1 { font-size: 28px; } }

/* --- Message du matin : callout ------------------------------------------------------- */
.callout, .brief { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; }
.speaker { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.speaker .brand-mark { width: 20px; height: 20px; border-radius: 6px; }
.speaker .brand-mark::after { inset: 3px; }
.brief-text { font-size: 17px; line-height: 1.6; margin: 0; white-space: pre-line; color: var(--text); }
.brief-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.brief-min { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r); color: var(--text); }
.brief-min:hover { background: var(--surface-2); }
.brief-min .t { flex: 1; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.question { margin-top: 12px; padding: 12px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.question p { margin: 0 0 8px; font-weight: 600; font-size: 14px; }

/* --- Todo du jour : liste à cocher ------------------------------------------------------- */
.todo { list-style: none; margin: 0; padding: 0; }
.section .card:has(> .todo) { background: transparent; border: 0; border-radius: 0; }
.todo li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--border); align-items: start; }
.todo li:hover { background: rgba(255, 255, 255, .02); }
.todo li > span:last-child { display: none; }
.tick {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--faint); background: transparent; cursor: pointer;
  display: grid; place-items: center; margin-top: 2px; padding: 0; transition: background .12s, border-color .12s, box-shadow .12s;
}
.tick:hover { border-color: var(--text); }
.tick svg { width: 12px; height: 12px; opacity: 0; color: #fff; }
.done .tick { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.done .tick svg { opacity: 1; }
.todo .title { font-weight: 500; line-height: 1.4; }
.done .title { color: var(--faint); text-decoration: line-through; }
.todo .reason { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.todo .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 7px; font-size: 12.5px; color: var(--faint); }
.todo .why { border: 0; background: none; color: var(--text-2); font-size: 12.5px; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 2px; }
.todo .why:hover { color: var(--text); }
.todo .carried { color: var(--danger); font-weight: 600; }
.todo-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 6px 0; font-size: 13px; color: var(--muted); }
.progress-ring { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.minibar { width: 120px; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); transition: width .4s; }

/* --- Personnage ------------------------------------------------------------------ */
.hero-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 14px 16px; }
.hero-stage { width: 76px; height: 76px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 50% 100%, var(--accent-soft), transparent 70%), var(--surface-2); }
.hero-stage canvas { width: 54px; height: 60px; image-rendering: pixelated; }
.hero-class { font-family: var(--pixel); font-size: 11px; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.hero-name { font-size: 18px; font-weight: 700; margin: 2px 0 4px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; }
.hero-meta b { color: var(--text); font-weight: 700; }
.hero-meta strong { color: var(--text-2); }
.xpbar { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); transition: width .6s; }

/* --- Quêtes ------------------------------------------------------------------------ */
.quests { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.quest { padding: 12px 14px; cursor: pointer; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); color: var(--text); }
.quest:hover { background: var(--surface-2); border-color: var(--border-strong); }
.quest .q-title { font-weight: 600; margin: 6px 0 2px; line-height: 1.3; font-size: 14.5px; }
.quest .q-sub { font-size: 12.5px; color: var(--muted); }
.palier { font-size: 11.5px; color: var(--faint); font-weight: 600; letter-spacing: .02em; }
.qbar { height: 4px; border-radius: 99px; background: var(--surface-3); margin-top: 10px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--text) !important; }

/* --- Barre « Demander à Pragma » en bas d'Aujourd'hui ----------------------------------- */
.ask-bar { position: fixed; left: var(--side-w); right: 0; bottom: 0; z-index: 20; padding: 18px 24px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--sky) 50%); pointer-events: none; }
.ask-bar .composer { pointer-events: auto; max-width: var(--col); margin: 0 auto; }
@media (max-width: 900px) { .ask-bar { left: 0; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); } }

/* --- Démo --------------------------------------------------------------------------- */
.demo-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border-radius: var(--r); border: 1px dashed var(--border-strong); font-size: 13px; color: var(--muted); }

/* --- Propositions (l'IA propose, l'humain décide) ------------------------------------ */
.proposal { padding: 16px; border: 1px solid rgba(255, 30, 61, .45); border-radius: var(--r); background: linear-gradient(180deg, rgba(255, 30, 61, .07), var(--surface) 60%); margin-top: 16px; }
.proposal h3 { font-size: 15.5px; margin: 6px 0; }
.proposal p { margin: 6px 0; color: var(--text-2); font-size: 14px; }
.proposal ul { margin: 8px 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.proposal .kind { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.proposal .actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

/* --- Mon plan : blocs dépliables ------------------------------------------------------ */
.goal { margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.goal-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 14px; cursor: pointer; align-items: center; }
.goal-head:hover { background: rgba(255, 255, 255, .02); }
.goal-num { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--text); font-weight: 700; font-size: 12.5px; background: var(--surface-3) !important; }
.goal-head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.goal-head .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.goal-head .qbar { margin-top: 8px; }
.goal-body { padding: 4px 16px 16px 52px; border-top: 1px solid var(--border); }
.estimate { margin: 14px 0; padding: 12px 14px; border-radius: 8px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); font-size: 14.5px; color: var(--text-2); }
.path { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.path::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--border-strong); }
.stage { position: relative; padding: 0 0 16px 32px; }
.stage-node { position: absolute; left: 0; top: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--sky); border: 1.5px solid var(--faint); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.stage.done .stage-node { background: var(--text); border-color: var(--text); color: var(--sky); }
.stage.active .stage-node { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent-glow); }
.stage.blocked .stage-node { border-color: var(--danger); color: var(--danger); }
.stage h4 { margin: 0; font-size: 14.5px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stage.todo h4, .stage.vague h4 { color: var(--muted); font-weight: 500; }
.stage p { margin: 3px 0 0; font-size: 13.5px; color: var(--text-2); }
.stage .vague-note { font-size: 12.5px; color: var(--faint); font-style: italic; }
.tag-active { background: var(--accent-soft); color: var(--accent); }
.tag-blocked { background: var(--danger-soft); color: var(--danger); }
.tag-reroute { background: var(--surface-3); color: var(--text); font-weight: 600; }
.tasks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 6px; font-size: 14px; }
.tasks li:hover { background: var(--hover); }
.tasks .tick { width: 16px; height: 16px; margin-top: 0; }
.tasks li.done span { color: var(--faint); text-decoration: line-through; }
.tasks .t-actions { margin-left: auto; opacity: 0; display: flex; }
.tasks li:hover .t-actions, .tasks li:focus-within .t-actions { opacity: 1; }
.sources { margin-top: 8px; display: grid; gap: 3px; font-size: 13px; }
.sources a { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 2px; color: var(--text-2); }
.sources .note { color: var(--faint); }
.goal-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.move { display: flex; flex-direction: column; }
.move .icon-btn { width: 26px; height: 20px; }
@media (max-width: 900px) { .goal-body { padding-left: 16px; } }

/* --- Conversation (ChatGPT) ------------------------------------------------------------ */
.chat-page { max-width: var(--col); margin: 0 auto; }
.chat-thread { display: flex; flex-direction: column; gap: 22px; padding-bottom: 130px; }
.msg { line-height: 1.65; word-wrap: break-word; white-space: pre-wrap; }
.msg.assistant { display: grid; grid-template-columns: 24px 1fr; gap: 14px; align-items: start; font-size: 15.5px; color: var(--text); }
.msg.assistant .brand-mark { margin-top: 2px; }
.msg-body a { text-decoration: underline; }
.msg .kind { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 2px; }
.msg.user { align-self: flex-end; max-width: 78%; background: var(--surface-3); padding: 10px 16px; border-radius: 20px; font-size: 15.5px; }
.msg-extra { margin-left: 38px; }
.msg-extra .proposal { margin-top: 0; }
.chat-sugg { margin-left: 38px; }
.chat-sugg .btn, .chat-empty .btn, .onb-form .btn { border-radius: 99px; background: transparent; color: var(--text-2); }
.chat-sugg .btn:hover, .chat-empty .btn:hover, .onb-form .btn:hover { background: var(--hover); color: var(--text); }
.typing { display: flex; gap: 5px; padding: 8px 0 8px 38px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.typing-label { font-size: 13px; color: var(--muted); margin: -14px 0 0 38px; }
.chat-empty { text-align: center; padding: 14vh 0 0; }
.chat-empty h1 { font-size: 30px; margin-bottom: 8px; }
.chat-empty p { color: var(--muted); margin: 0 0 22px; }
.chat-empty .options { justify-content: center; }
.chat-bottom { position: fixed; left: var(--side-w); right: 0; bottom: 0; padding: 14px 24px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--sky) 40%); }
.chat-bottom .composer { max-width: var(--col); margin: 0 auto 8px; }
@media (max-width: 900px) {
  .chat-bottom { left: 0; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .msg.assistant { grid-template-columns: 1fr; gap: 6px; }
  .msg-extra, .chat-sugg, .typing, .typing-label { margin-left: 0; padding-left: 0; }
  .chat-empty { padding-top: 8vh; }
}

.composer { display: flex; align-items: end; gap: 6px; padding: 6px 6px 6px 18px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 26px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.composer:focus-within { border-color: rgba(255, 255, 255, .28); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 9px 0; font-size: 15.5px; max-height: 160px; min-height: 40px; line-height: 1.45; outline: none; color: var(--text); }
.composer textarea::placeholder { color: var(--faint); }
.composer .send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; margin-bottom: 2px; transition: background .12s, box-shadow .12s; }
.composer .send:not(:disabled):hover { background: var(--accent-hover); box-shadow: 0 0 18px var(--accent-glow); }
.composer .send:disabled { background: var(--surface-3); color: var(--faint); cursor: default; }
.composer .send svg, .composer .mic svg { width: 18px; height: 18px; }
.composer .mic { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; margin-bottom: 2px; }
.composer .mic:hover { background: var(--hover); }
.composer .mic.rec { background: var(--accent); color: #fff; }

/* --- Onboarding (même langage que la conversation) --------------------------------------- */
.onb { max-width: var(--col); margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 0 20px; }
.onb-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; background: rgba(5, 5, 8, .85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.onb-head .brand { width: 84px; height: 38px; }
.onb-meta { display: flex; align-items: center; gap: 12px; }
.onb-step { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.steps { display: flex; gap: 4px; }
.steps i { width: 14px; height: 4px; border-radius: 99px; background: var(--surface-3); }
.steps i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.onb .thread { display: flex; flex-direction: column; gap: 20px; padding: 28px 0 170px; }
.onb .msg.assistant { display: block; font-size: 17px; line-height: 1.6; }
.onb .typing { padding-left: 0; }
.onb-form { margin-top: -6px; }
.onb-dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--sky) 40%); }
.onb-dock .composer { max-width: var(--col); margin: 0 auto; }
@media (max-width: 480px) { .onb-step { display: none; } .steps i { width: 10px; } }

/* Onboarding en plein écran : une question par écran, en QCM */
.onb-full { display: flex; flex-direction: column; }
.onb-full .onb-head { border-bottom: 0; }
.onb-bar { position: sticky; top: 62px; z-index: 5; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.onb-bar i { display: block; width: 0; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); transition: width .45s ease; }
.onb-stage { flex: 1; display: flex; }
.onb-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 40px 0 64px; animation: onb-in .35s ease both; }
@keyframes onb-in { from { opacity: 0; transform: translateY(14px); } }
.qcm { display: flex; flex-direction: column; gap: 14px; }
.onb-reaction { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.onb-q { margin: 0 0 10px; font-size: clamp(26px, 5vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.qcm-hint { font-size: 13px; color: var(--faint); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.chips .chip { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; font-size: 15.5px; text-align: left; cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s; }
.chips .chip:hover:not(:disabled) { background: var(--hover); border-color: var(--text-2); }
.chips .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.chips .chip:disabled { opacity: .4; cursor: default; }
.chips .chip-key { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 700; color: var(--muted); }
.chips .chip[aria-pressed="true"] .chip-key { background: var(--accent); border-color: var(--accent); color: #fff; }
.onb-input { min-height: 54px; font-size: 18px; }
.onb-detail { min-height: 48px; }
textarea.onb-detail { padding: 12px; resize: vertical; }
.qcm-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.qcm-foot .btn.big { width: auto; min-width: 180px; padding: 0 22px; }
.qcm-foot .typing { padding: 0; }
.qcm-foot .typing i { background: #fff; }
.onb-summary { margin: 0; font-size: clamp(18px, 2.6vw, 22px); line-height: 1.55; }
.onb-goals { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.onb-goals li { padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
@media (max-width: 560px) {
  .onb-screen { justify-content: flex-start; padding-top: 28px; }
  .qcm-foot { position: sticky; bottom: 0; padding: 12px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--sky) 30%); }
  .qcm-foot .btn.big { flex: 1; min-width: 0; }
}

.building { padding: 40px 0 60px; }
.building h1 { font-size: 32px; margin: 24px 0 8px; }
.building .lead { font-size: 15.5px; }
.build-list { list-style: none; padding: 0; margin: 24px 0; display: grid; border-top: 1px solid var(--border); }
.build-list li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 14px 4px; align-items: start; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; }
.build-list .state { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.build-list .state.wait { border: 1.5px solid var(--faint); }
.build-list .state.run { border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.build-list .state.ok { background: var(--text); color: var(--sky); }
.build-list .state.err { background: var(--danger); color: #fff; }
.build-list .state svg { width: 12px; height: 12px; }
.build-list .b-msg { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.build-list .b-est { font-size: 14px; margin-top: 4px; color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Réglages et bilan ------------------------------------------------------------- */
.settings { display: grid; gap: 30px; }
.settings .card { padding: 0; border: 0; background: transparent; }
.settings h2 { font-size: 14.5px; font-weight: 600; padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.row label { font-weight: 500; font-size: 14.5px; }
.row .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .04); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-weight: 500; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.facts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; max-height: 380px; overflow: auto; }
.facts li { display: flex; gap: 10px; align-items: start; padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }
.facts .cat { font-size: 11.5px; font-weight: 600; color: var(--faint); min-width: 90px; padding-top: 2px; text-transform: uppercase; letter-spacing: .04em; }
.facts li span:nth-child(2) { flex: 1; color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.stat span { font-size: 12.5px; color: var(--muted); }
#review-body .thread { display: flex; flex-direction: column; gap: 18px; }
#review-body .msg.assistant { display: block; }

/* --- Palier franchi, fenêtres, messages ------------------------------------------------ */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); background: #131319; border: 1px solid var(--border-strong); border-radius: 14px; padding: 20px; box-shadow: var(--shadow-pop); animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal h2 { font-size: 18px; margin-bottom: 14px; }
.modal label { color: var(--muted) !important; }
.modal textarea.field { min-height: 96px; padding: 10px 12px; resize: vertical; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.levelup { position: relative; width: min(400px, 100%); text-align: center; padding: 30px 24px 22px; background: #131319; border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-pop), 0 0 80px rgba(255, 30, 61, .18); animation: pop .3s ease-out; overflow: hidden; }
.levelup .rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 30, 61, .08) 0 10deg, transparent 10deg 20deg); animation: spin 24s linear infinite; }
.levelup > *:not(.rays) { position: relative; }
.levelup canvas { width: 112px; height: 126px; image-rendering: pixelated; }
.levelup .lv { font-family: var(--pixel); font-size: 13px; color: var(--accent); margin-top: 10px; }
.levelup h2 { font-size: 26px; margin: 6px 0; }
.levelup p { color: var(--text-2); margin: 6px 0 18px; }
.sparks i { position: absolute; width: 5px; height: 5px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); animation: spark 1.1s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 120; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-pop); animation: fade .2s; max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.hero-stage canvas, .side-avatar canvas, .levelup canvas { filter: grayscale(1) brightness(1.15); }
