
/* Carnet styles, following the Carnet design system (Aurora direction).
   Layout: phones (<768px) get a top bar and a floating bottom dock; tablets (768-1099px) an icon rail;
   desktops (>=1100px) the full sidebar with a top bar. Palette: a mist canvas, flat white cards,
   deep night for actions, ember for the one highlight, lilac for routine. The aurora glow is kept
   for the hero and onboarding panels only. Typography: Space Grotesk. */
:root {
  /* Carnet design system, Aurora direction: mist canvas, white cards, deep night actions,
     ember for the one highlight, lilac for routine, electric blue for focus. */
  --canvas: #F3EEFF; --canvas-raised: #E6DDFF; --canvas-line: rgba(18,10,46,.12); --on-canvas-muted: #4A3F6E;
  --dock: #120A2E; --on-dock: #FFFFFF; --on-dock-muted: #B9AEDB; --mark-bg: #120A2E;
  --line-strong: #8B80AE; --focus: #3D6BFF; --electric: #3D6BFF;
  --sage: #C8A8FF; --forest: #120A2E; --cream: #FFFFFF; --lavender: #ECE4FF; --beige: #F5F1FF; --charcoal: #120A2E;
  --navy: #120A2E; --navy-2: #2A1F5C; --cobalt: #120A2E; --lav: #C8A8FF; --lav-soft: #ECE4FF;
  --lime: #FF8A3D; --lemon: #FF8A3D; --on-lime: #120A2E; --wisteria: #D08FEA; --orchid: #EEA0FF; --jordy: #9BC2FF; --peach-fuzz: #FFBE98; --teal: #C8A8FF;
  --bg: #F3EEFF;
  --surface: #FFFFFF;
  --surface-2: #F5F1FF;
  --surface-3: #FAF8FF;
  --ink: #120A2E;
  --ink-2: #2E2452;
  --ink-3: #4A3F6E;
  --ink-2-s: #4A3F6E;
  --ink-3-s: #6B6190;
  --line: #ECE6FA;
  --line-2: #DCD3F2;
  --accent: #120A2E;
  --accent-ink: #FFFFFF;
  --accent-soft: #ECE4FF;
  --peach: #A1402B;
  --peach-soft: #F8E3DC;
  --sand: #8A5A10;
  --sand-soft: #FBEFD8;
  --sage-soft: #E2F2E7;
  --premium: #C8A8FF;
  --premium-ink: #120A2E;
  --premium-soft: #ECE4FF;
  --warn: #8A5A10;
  --warn-soft: #FBEFD8;
  --danger: #A1402B;
  --danger-soft: #F8E3DC;
  --ok: #276B40;
  --ok-soft: #E2F2E7;
  /* Design system: cards are flat; only floating things (dock, sheets, toast) get shadow-float. */
  --shadow: none;
  --shadow-lg: 0 12px 32px -12px rgba(18,10,46,.35);
  --aurora: radial-gradient(circle at 88% 12%, rgba(61,107,255,.6), rgba(61,107,255,0) 45%), radial-gradient(circle at 100% 100%, rgba(255,138,61,.5), rgba(255,138,61,0) 50%), radial-gradient(circle at 62% 58%, rgba(200,168,255,.35), rgba(200,168,255,0) 55%);
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #120A2E; --canvas-raised: #1E1545; --canvas-line: rgba(243,238,255,.14); --on-canvas-muted: #CFC6E6;
    --dock: #0A0620; --on-dock: #F3EEFF; --on-dock-muted: #9F95C4; --mark-bg: #2E2462; --line-strong: #7C70A8; --focus: #C8A8FF;
    --lav: #4B3A8F; --lav-soft: #2E2462; --premium: #4B3A8F; --premium-ink: #F3EEFF; --premium-soft: #2E2462; --sage: #4B3A8F;
    --bg: #120A2E; --surface: #1E1545; --surface-2: #180F3A; --surface-3: #241A50; --ink: #F3EEFF; --ink-2: #D9D1F0; --ink-3: #BDB3D9; --ink-2-s: #D9D1F0; --ink-3-s: #BDB3D9;
    --line: #2E2462; --line-2: #3D3170; --accent: #C8A8FF; --accent-ink: #120A2E; --accent-soft: #2E2462; --sage-soft: #1F3A2A; --peach: #EC9A85; --peach-soft: #42271F; --sand: #E9B866; --sand-soft: #3A2F1C;
    --warn: #E9B866; --warn-soft: #3A2F1C; --danger: #EC9A85; --danger-soft: #42271F; --ok: #8FD6A8; --ok-soft: #1F3A2A;
    --shadow-lg: 0 12px 32px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #120A2E; --canvas-raised: #1E1545; --canvas-line: rgba(243,238,255,.14); --on-canvas-muted: #CFC6E6;
  --dock: #0A0620; --on-dock: #F3EEFF; --on-dock-muted: #9F95C4; --mark-bg: #2E2462; --line-strong: #7C70A8; --focus: #C8A8FF;
  --lav: #4B3A8F; --lav-soft: #2E2462; --premium: #4B3A8F; --premium-ink: #F3EEFF; --premium-soft: #2E2462; --sage: #4B3A8F;
  --bg: #120A2E; --surface: #1E1545; --surface-2: #180F3A; --surface-3: #241A50; --ink: #F3EEFF; --ink-2: #D9D1F0; --ink-3: #BDB3D9; --ink-2-s: #D9D1F0; --ink-3-s: #BDB3D9;
  --line: #2E2462; --line-2: #3D3170; --accent: #C8A8FF; --accent-ink: #120A2E; --accent-soft: #2E2462; --sage-soft: #1F3A2A; --peach: #EC9A85; --peach-soft: #42271F; --sand: #E9B866; --sand-soft: #3A2F1C;
  --warn: #E9B866; --warn-soft: #3A2F1C; --danger: #EC9A85; --danger-soft: #42271F; --ok: #8FD6A8; --ok-soft: #1F3A2A;
  --shadow-lg: 0 12px 32px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.serif { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Shell */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px)); padding: 26px 18px 18px max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 26px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--forest); display: grid; place-items: center; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; display: block; }
.brand-sub { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav > .eyebrow { padding: 0 12px 8px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 12px; color: var(--ink-2); font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav button svg { color: var(--ink-3); }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.nav button[aria-current="page"] svg { color: var(--accent); }
.nav-sub { margin-top: 14px; }
.nav-sub .eyebrow { padding: 0 12px 8px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.cheer { padding: 16px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.cheer svg { color: var(--accent); }
.cheer b { font-size: 13.5px; line-height: 1.35; color: var(--accent); }
.cheer span { font-size: 12px; color: var(--ink-2); }
.plan-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.save-state { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); display: inline-block; }

.deskbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-3); min-width: 0; }
.crumbs b { color: var(--ink); font-weight: 700; }
.deskbar-right { display: flex; align-items: center; gap: 12px; }
.lang-btn { min-width: 40px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.lang-btn:hover { border-color: var(--ink-3); }
.app-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); padding-top: 28px; margin-top: 12px; border-top: 1px solid var(--line); }

.main { min-width: 0; padding-block: 0 64px; }
.main > .wrap { padding-top: 34px; padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.wrap.narrow { max-width: 760px; }
.topbar { display: none; }
.welcome { display: flex; flex-direction: column; gap: 6px; }
.welcome h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.025em; line-height: 1.12; }
.tabbar { display: none; }

.nav .ns { display: none; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .brand-mark { animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }

/* Tablet: icon rail */
@media (min-width: 768px) and (max-width: 1099px) {
  .app { grid-template-columns: 92px minmax(0, 1fr); }
  .side { padding: 18px 8px; align-items: stretch; gap: 16px; }
  .side .brand { justify-content: center; padding: 0; }
  .side .brand-text, .side .plan-chip, .nav-sub .eyebrow, .nav > .eyebrow, .side .cheer, .side .save-state { display: none; }
  .main > .wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); padding-top: 26px; }
  .deskbar { padding-left: 24px; padding-right: 24px; }
  .nav button { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 11px; text-align: center; border-radius: 14px; }
  .nav .nl { display: none; }
  .nav .ns { display: block; line-height: 1.15; }
  .nav-sub { margin-top: 4px; padding-top: 8px; }
  .main { padding-block: 0 48px; }
}

/* Phone: top bar + bottom tabs */
@media (max-width: 767px) {
  .app { display: block; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; }
  .deskbar { display: none; }
  .main { padding-block: 0 calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0px)); }
  .main > .wrap { padding-top: 18px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 16px; }
  .topbar .brand-sub { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; color: var(--ink-3); font-size: 11px; font-weight: 500; border-radius: 12px; min-width: 0; }
  .tabbar button[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar button[aria-current="page"] .tab-ic { background: var(--accent-soft); }
  .tab-ic { width: 44px; height: 28px; border-radius: 14px; display: grid; place-items: center; transition: background .2s; }
  .page-h > .row { width: 100%; }
}
@media (min-width: 1500px) { .wrap { max-width: 1240px; } }

/* Primitives */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-3); box-shadow: none; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h3 { font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; font-weight: 700; font-size: 13px; color: var(--accent); }
.link-btn:hover { text-decoration: underline; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
.g-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
@media (max-width: 960px) { .g-main { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.lg { gap: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.lg { padding: 12px 18px; font-size: 14.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.premium { background: var(--premium); color: var(--premium-ink); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); display: inline-grid; place-items: center; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.sand { background: var(--sand-soft); color: var(--sand); }
.pill.peach { background: var(--peach-soft); color: var(--peach); }
.pill.green { background: var(--accent-soft); color: var(--ok); }
.pill.lav { background: var(--premium-soft); color: var(--premium-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--premium-ink); background: var(--premium-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 0; }
button.lock { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 80px; }
.hint { font-size: 12.5px; color: var(--ink-3); }

.progress { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress.thin { height: 5px; }
.progress.lav > i { background: var(--premium-ink); opacity: .7; }
.progress.over > i { background: var(--danger); }

/* Checkbox */
.check { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--surface); display: inline-grid; place-items: center; flex: none; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; margin: 0; }
.check:hover { border-color: var(--accent); }
.check:checked { background: var(--accent); border-color: var(--accent); }
.check::after { content: ""; width: 11px; height: 6px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .18s cubic-bezier(.3,1.6,.5,1); }
.check:checked::after { transform: rotate(-45deg) scale(1); }
.check:active { transform: scale(.9); }
.check[disabled] { cursor: not-allowed; opacity: .6; }

/* Task rows */
.tasks { display: flex; flex-direction: column; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 15px 2px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task .t-title { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.task.done .t-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.task .t-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }
.task .t-body { margin-top: 8px; font-size: 14px; color: var(--ink-2); max-width: 64ch; display: none; }
.task.open .t-body { display: block; }
.task-main { cursor: pointer; min-width: 0; }
.task.locked .t-title { color: var(--ink-3); }
.task.doc-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.task.flash { animation: flash .7s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.links a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 9px; background: var(--accent-soft); }
.due { font-variant-numeric: tabular-nums; }
.due.over { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warn); font-weight: 600; }
.official { color: var(--ok); font-weight: 600; }

/* Home hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 32px; background: #0E1A4F; color: #FFFFFF; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(250,248,240,.12); z-index: -1; }
.hero::before { width: 420px; height: 420px; right: -60px; top: -40px; }
.hero::after { width: 300px; height: 300px; right: 40px; top: 30px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.1; letter-spacing: -.025em; max-width: 22ch; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero-ring { position: relative; width: 132px; height: 132px; flex: none; display: grid; place-items: center; text-align: center; }
.hero-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hero-ring circle { fill: none; stroke-width: 3; }
.hero-ring .bg { stroke: rgba(250,248,240,.22); }
.hero-ring .fg { stroke: #FAF8F0; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.hero-ring b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-ring span { display: block; font-size: 11px; color: rgba(250,248,240,.8); margin-top: 6px; line-height: 1.3; max-width: 90px; }
.hero .muted { color: rgba(250,248,240,.75); }
.hero .eyebrow { color: rgba(250,248,240,.6); }
.hero-count { display: flex; align-items: baseline; gap: 10px; }
.hero-count b { font-family: var(--font-display); font-weight: 400; font-size: 64px; line-height: .9; font-variant-numeric: tabular-nums; }
.hero .progress { background: rgba(250,248,240,.16); }
.hero .progress > i { background: var(--lime); }
.route { width: 100%; height: auto; max-width: 100%; display: block; }
.hero-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 999px; background: rgba(250,248,240,.12); font-size: 12.5px; font-weight: 600; color: #FAF8F0; border: 0; }
button.hero-chip:hover { background: rgba(250,248,240,.2); }
@media (max-width: 600px) { .doc-row { grid-template-columns: minmax(0, 1fr) !important; } .route { max-height: 150px; } }
@media (max-width: 760px) { .hero { padding: 22px; gap: 16px; } .hero-ring { width: 96px; height: 96px; } .hero-ring b { font-size: 24px; } .hero-ring span { font-size: 10px; max-width: 70px; } .hero::before { width: 260px; height: 260px; } .hero::after { display: none; } }
@media (max-width: 520px) { .hero { padding: 20px; align-items: start; } .hero-ring { width: 78px; height: 78px; } .hero-ring b { font-size: 20px; } .hero-ring span { font-size: 9.5px; margin-top: 3px; } .hero .eyebrow { font-size: 10px; } }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; text-align: left; color: var(--ink); }
button.kpi { cursor: pointer; transition: border-color .15s; }
button.kpi:hover { border-color: var(--line-2); }
.kpi-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi-ic.sand { background: var(--sand-soft); color: var(--sand); }
.kpi-ic.lav { background: var(--premium-soft); color: var(--premium-ink); }
.kpi-ic.peach { background: var(--peach-soft); color: var(--peach); }
.kpi-v { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kpi-v b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-v span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { gap: 10px; } .kpi { padding: 14px; gap: 10px; } .kpi-v { flex-direction: column; align-items: flex-start; gap: 4px; } .kpi-v b { font-size: 24px; } .kpi-v span { white-space: normal; } }

/* Dated list rows */
.dlist { display: flex; flex-direction: column; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; color: inherit; }
.drow:first-child { border-top: 0; padding-top: 4px; }
.drow b { display: block; font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.drow-r strong { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.srow { padding: 16px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: inherit; }
.srow:first-child { border-top: 0; padding-top: 4px; }
.srow .bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-3); }
.srow .bar .progress { width: min(160px, 50%); flex: none; }

.tile { display: flex; flex-direction: column; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); padding: 20px; transition: transform .18s, box-shadow .18s, border-color .18s; color: var(--ink); min-width: 0; }
.tile:hover { border-color: var(--line-2); }
.tile-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile-ic.lav { background: var(--premium-soft); color: var(--premium-ink); }
.tile-ic.beige { background: var(--sand-soft); color: var(--sand); }
.tile h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }

.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -.025em; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink-2); font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 6px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 13px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 7px 13px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.stage { display: flex; flex-direction: column; gap: 4px; }
.stage-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
.ring { width: 42px; height: 42px; flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s; transform: rotate(-90deg); transform-origin: center; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); font-size: 14px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
.notice.lav { background: var(--premium-soft); border-color: transparent; }
.notice.green { background: var(--accent-soft); border-color: transparent; }
.notice svg { flex: none; margin-top: 2px; }
.notice { flex-wrap: wrap; }
.notice > div { flex: 1 1 220px; min-width: 0; }
@media (max-width: 520px) { .notice > div { flex-basis: calc(100% - 34px); } .notice > .btn { margin-left: 30px; } }

.empty { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.empty .serif { font-size: 19px; color: var(--ink); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; max-width: 100%; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"].s-missing { background: var(--danger-soft); color: var(--danger); }
.seg button[aria-pressed="true"].s-progress { background: var(--warn-soft); color: var(--warn); }
.seg button[aria-pressed="true"].s-ready { background: var(--accent-soft); color: var(--ok); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); text-align: center; padding: 4px 0; font-weight: 600; }
.cal .day { min-height: 74px; border-radius: 12px; padding: 6px; background: var(--surface-3); border: 1px solid transparent; display: flex; flex-direction: column; gap: 3px; font-size: 12px; text-align: left; min-width: 0; }
.cal .day.out { opacity: .35; }
.cal .day.today { border-color: var(--accent); }
.cal .day.dep { background: var(--forest); color: #FAF8F0; }
.cal .day .dn { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal .ev { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--ink); font-size: 11px; }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal .ev.ms { background: var(--premium-soft); color: var(--premium-ink); }
.cal .ev.off { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 640px) { .cal .day { min-height: 46px; padding: 4px; } .cal .ev { font-size: 0; height: 6px; padding: 0; border-radius: 3px; } .cal .more { display: none; } }

.tl { position: relative; display: flex; flex-direction: column; gap: 0; padding-left: 26px; }
.tl::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; padding: 10px 0; }
.tl-item::before { content: ""; position: absolute; left: -23px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sage); }
.tl-item.done::before { background: var(--sage); }
.tl-item.ms::before { border-color: var(--premium-ink); background: var(--premium); width: 14px; height: 14px; left: -24px; border-radius: 4px; transform: rotate(45deg); }
.tl-item.dep::before { background: var(--forest); border-color: var(--forest); width: 16px; height: 16px; left: -25px; top: 13px; }
.tl-month { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; font-size: 17px; padding: 16px 0 4px; text-transform: capitalize; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plans { grid-template-columns: minmax(0, 1fr); } }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.plan.pop { background: var(--forest); color: #FAF8F0; border-color: var(--forest); box-shadow: var(--shadow-lg); }
.plan.pop .muted, .plan.pop .faint { color: rgba(250,248,240,.72); }
.plan.pop .feat svg { color: var(--lime); }
.plan .price { font-family: var(--font-display); font-weight: 800; letter-spacing: -.035em; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .badge { position: absolute; top: -11px; left: 22px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.plan .feat { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.plan .feat svg { color: var(--accent); flex: none; margin-top: 2px; }
.plan .tag { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
.plan.pop .tag { color: rgba(250,248,240,.85); }
.cmp td:not(:first-child), .cmp th:not(:first-child) { text-align: center; }
.cmp .grp td { background: var(--surface-3); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.cmp .yes { color: var(--accent); }
.cmp th.popcol, .cmp td.popcol { background: var(--accent-soft); }

/* Modal / sheet */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(28,33,31,.42); display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); animation: fade .18s ease; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); animation: rise .25s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(680px, 100%); }
@media (max-width: 600px) { .scrim { place-items: end center; padding-bottom: 0; } .modal { border-radius: 24px 24px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); max-height: 88vh; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(16px); } }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--charcoal); color: #FAF8F0; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: rise .25s ease; display: flex; gap: 10px; align-items: center; }
@media (max-width: 767px) { .toast { bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); } }

/* Onboarding */
.onb { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.onb-art { background: #0E1A4F; color: #FFFFFF; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; }
.onb-art h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.03em; }
.onb-art h1 em { font-style: normal; color: var(--lime); }
.onb-form { padding-block: 40px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; justify-content: center; }
.onb-inner { width: 100%; max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; animation: rise .3s ease; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-2); }
.steps i.on { background: var(--accent); }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice label { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 13px; transition: border-color .15s, background .15s; }
.choice label b { font-size: 14px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 860px) { .onb { grid-template-columns: minmax(0, 1fr); } .onb-art { padding: 28px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px)); } .onb-art .hide-sm { display: none; } }
@media (max-width: 480px) { .choice { grid-template-columns: minmax(0, 1fr); } }
.gen { display: flex; flex-direction: column; gap: 10px; }
.gen div { display: flex; gap: 10px; align-items: center; opacity: .25; transition: opacity .3s; }
.gen div.on { opacity: 1; }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.bubble { max-width: 84%; padding: 12px 15px; border-radius: 18px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--surface-3); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--ink); }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 480px) { .bar-row { grid-template-columns: 110px minmax(0, 1fr) 40px; } }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--lime); color: #0E1A4F; flex: none; }
.avatar.b { background: var(--premium-soft); color: var(--premium-ink); }

.fade-in { animation: fadeup .35s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeup { from { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* Additions */
.save-state i.err { background: var(--danger); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stage-line { border: 0; background: none; padding: 0; text-align: left; gap: 12px; flex-wrap: nowrap; width: 100%; }
.stage-name { width: 132px; flex: none; }
.hero-route { display: flex; align-items: center; min-width: 0; }
.reminders { background: var(--premium-soft); border-color: transparent; }
.reminder-line { border: 0; background: none; padding: 0; text-align: left; gap: 8px; min-width: 0; flex-wrap: nowrap; }
.rec-card { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.over-text { color: var(--danger); font-weight: 600; }
.warn-text { color: var(--warn); }
.input.mini { padding: 6px 9px; font-size: 13px; width: auto; border-radius: 10px; }
.pack-row { align-items: center; }
.pack-ctl { gap: 6px; flex-wrap: nowrap; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.invite-box { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--premium-soft); }
.invite-code { font-size: 28px; font-weight: 700; letter-spacing: .18em; font-variant-numeric: tabular-nums; color: var(--premium-ink); }
#invite-link { flex: 1; min-width: 0; }
.journey-row { flex-wrap: nowrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); }
.journey-row.on { background: var(--accent-soft); }
.week-grid { display: grid; grid-template-columns: repeat(8, minmax(132px, 1fr)); gap: 8px; min-width: 1100px; }
.week-day { padding: 12px; border-radius: 14px; }
.week-day.first { background: var(--forest); color: #FAF8F0; border-color: var(--forest); }
.week-task { padding: 6px 8px; border-radius: 9px; background: var(--surface-3); }
.week-day.first .week-task { background: rgba(250,248,240,.14); }
.week-task.is-done { text-decoration: line-through; opacity: .6; }
.tl-link { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; }
.tl-link.is-done { color: var(--ink-3); text-decoration: line-through; }
.key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal .ev.dep-ev { background: rgba(250,248,240,.2); color: #FAF8F0; }
.cal-title { font-size: 20px; text-transform: capitalize; }
table.t tr.hl td { background: var(--accent-soft); }
table.t tr.grp td { background: var(--surface-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.cmp { min-width: 680px; }
.cmp td.yes { color: var(--accent); }
.plain { text-transform: none; letter-spacing: 0; }
.h-onb { font-size: 28px; line-height: 1.15; }
.h-onb-lg { font-size: 32px; line-height: 1.1; }
.onb-lead { max-width: 40ch; color: rgba(250,248,240,.78); }
.fs { border: 0; padding: 0; margin: 0; }
.fs legend { margin-bottom: 6px; }
.m-title { font-size: 22px; line-height: 1.2; }
.upsell { background: var(--premium-soft); border-color: transparent; padding: 18px; }
.modal-actions { margin-top: 18px; gap: 8px; justify-content: flex-end; }
.danger-fill { background: var(--danger); color: #fff; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.pricing-hero { gap: 10px; text-align: center; align-items: center; padding: 12px 0 6px; }
.pricing-hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.12; max-width: 22ch; }
.pricing-hero h1 em { font-style: normal; color: var(--accent); }
.code-input { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.lang-seg button { padding: 5px 10px; }
.lang-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); }
.chip[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) {
  .doc-row { grid-template-columns: minmax(0, 1fr) !important; }
  .route { max-height: 150px; }
  .pack-row { grid-template-columns: auto minmax(0, 1fr); }
  .pack-row .pack-ctl { grid-column: 2; }
  .stage-name { width: 104px; }
  .h-onb, .h-onb-lg { font-size: 25px; }
  .card { padding: 18px; }
}
@media (max-width: 640px) {
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid.stats .card { padding: 14px; border-radius: 16px; }
  .grid.stats .stat b { font-size: 20px; }
}
@media (hover: none) { .tile:hover { transform: none; } }

/* ===================================================================
   Carnet layer: everything sits on the mist canvas; work lives on
   flat white cards; deep night for actions and the dock; ember marks
   the one thing that matters now. No borders or shadows on cards.
   =================================================================== */
:focus-visible { outline-color: var(--focus); }

/* Muted text is darker on the canvas and lighter on white surfaces */
.card, .kpi, .tile, .plan, .modal, .notice, .school-card, .board-col, .journey-row, .choice label, .input, .chip, .cv-doc { --ink-2: var(--ink-2-s); --ink-3: var(--ink-3-s); }

/* Sidebar and rail: no panel, just the canvas with a hairline */
@media (min-width: 768px) {
  .app { grid-template-columns: 264px minmax(0, 1fr); }
  .side { margin: 0; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px)); border-radius: 0; border: 0; border-right: 1px solid var(--canvas-line); background: transparent; color: var(--ink); padding: 26px 16px 16px max(16px, env(safe-area-inset-left, 0px)); }
  .side .brand { color: var(--ink); }
  .side .brand-mark { background: var(--mark-bg); box-shadow: none; }
  .side .brand-sub, .side .eyebrow { color: var(--on-canvas-muted); }
  .side .nav button { color: var(--ink); border-radius: 999px; }
  .side .nav button svg { color: var(--ink); }
  .side .nav button:hover { background: var(--canvas-raised); color: var(--ink); }
  .side .nav button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }
  .side .nav button[aria-current="page"] svg { color: var(--accent-ink); }
  .side .cheer { background: var(--canvas-raised); color: var(--ink); border-radius: var(--r-lg); }
  .side .cheer b, .side .cheer svg { color: var(--ink); }
  .side .cheer span { color: var(--on-canvas-muted); }
  .side .plan-chip { background: var(--canvas-raised); border-color: transparent; color: var(--ink); border-radius: var(--r); }
  .side .plan-chip .muted, .side .plan-chip .faint { color: var(--on-canvas-muted); }
  .main > .wrap { padding-left: 32px; padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  .deskbar { margin: 0; border-radius: 0; border: 0; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 16px 32px; top: env(safe-area-inset-top, 0px); }
  .crumbs { color: var(--on-canvas-muted); }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .side { padding: 20px 10px; }
  .side .nav button { border-radius: 20px; }
  .main > .wrap { padding-left: 24px; padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  .deskbar { padding: 14px 24px; }
}

/* Cards: flat white, large radius */
.card, .kpi, .tile, .plan { background: var(--surface); border-color: transparent; box-shadow: none; border-radius: var(--r-lg); }
.card.tint { background: var(--canvas-raised); border-color: transparent; --ink-2: var(--on-canvas-muted); --ink-3: var(--on-canvas-muted); }
.notice { border-radius: var(--r); border-color: transparent; background: var(--surface); }
.notice.green, .notice.lav { background: var(--lav-soft); }
.notice.warn { background: var(--warn-soft); }
button.kpi:hover, .tile:hover { border-color: transparent; background: var(--surface-3); }

/* Headings and numbers */
.welcome h1, .page-h h1 { font-weight: 600; letter-spacing: -.02em; }
.eyebrow { font-weight: 500; letter-spacing: .08em; }
.card-h h3 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.kpi-v b, .stat b { font-weight: 500; letter-spacing: -.02em; }
.link-btn { font-weight: 500; color: var(--ink-3); }
.card .link-btn, .kpi .link-btn { color: var(--ink-3-s); }

/* Hero: deep night block with the aurora glow and the ember highlight */
.hero { background-color: #120A2E; background-image: var(--aurora); color: #FFFFFF; border-radius: var(--r-lg); }
.hero::before { border-color: rgba(200,168,255,.24); background: none; }
.hero::after { border-color: rgba(200,168,255,.16); }
.hero h1 em { color: var(--lime); }
.hero .progress > i { background: var(--lime); }
.hero-ring .bg { stroke: rgba(255,255,255,.16); }
.hero-ring .fg { stroke: var(--lime); }

/* KPI and tool icons */
.kpi-ic, .tile-ic { border-radius: 999px; background: var(--lav-soft); color: var(--ink); }
.kpi-ic.sand { background: var(--dock); color: var(--on-dock); }
.kpi-ic.lav, .tile-ic.lav { background: var(--lav); color: var(--ink); }
.kpi-ic.peach, .tile-ic.beige { background: var(--lime); color: var(--on-lime); }

/* Buttons: pills */
.btn { border-radius: 999px; padding: 11px 20px; font-weight: 500; border-color: var(--line-2); }
.btn.sm { border-radius: 999px; padding: 6px 14px; }
.btn.lg { padding: 13px 22px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: none; }
.btn.primary:hover { filter: none; background: var(--navy-2); }
.btn.premium { background: var(--lime); color: var(--on-lime); border-color: transparent; }
.btn.ghost:hover { background: var(--canvas-raised); }
.card .btn.ghost:hover, .modal .btn.ghost:hover { background: var(--surface-2); }
.icon-btn { border-radius: 999px; color: var(--ink); }
.icon-btn:hover { background: var(--canvas-raised); }
.lang-btn { border-radius: 999px; border: 0; background: var(--canvas-raised); color: var(--ink); }

/* Segmented tabs: aubergine selection in a lavender tray */
.tabs { background: var(--canvas-raised); border: 0; border-radius: 999px; padding: 4px; }
.card .tabs, .modal .tabs { background: var(--surface-2); }
.tabs button { border-radius: 999px; font-weight: 500; color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.seg { border-radius: 999px; border-color: var(--line-strong); }
.seg button { font-weight: 500; }
.seg button[aria-pressed="true"].s-ready { background: var(--ok-soft); color: var(--ok); }

/* Tags, progress, checkboxes, inputs */
.pill { font-weight: 500; }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.lav { background: var(--lav-soft); color: var(--ink); }
.lock { background: var(--lav-soft); color: var(--ink); }
.progress { height: 8px; background: var(--surface-2); }
.progress > i { background: var(--accent); }
.progress.lav > i { background: var(--lav); opacity: 1; }
.check { width: 22px; height: 22px; border-radius: 999px; border-color: var(--line-strong); }
.input, select.input, textarea.input { border-radius: var(--r-sm); border-color: var(--line-strong); }
.input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip { border-color: var(--line-strong); }
.choice label { border-color: var(--line-strong); border-radius: var(--r); }
.links a { border-radius: 999px; background: var(--lav-soft); color: var(--ink); }

/* Calendar and timeline */
.cal .day { border-radius: var(--r); background: var(--surface-2); }
.cal .day.today { border-color: transparent; background: var(--lime); color: var(--on-lime); }
.cal .day.dep { background: var(--dock); color: var(--on-dock); }
.cal .ev { border-radius: 999px; background: var(--lav-soft); }
.cal .ev.ms { background: var(--lav); color: var(--ink); }
.tl-item::before { border-color: var(--lav); }
.tl-item.done::before { background: var(--lav); }
.tl-item.ms::before { border-color: var(--ink); background: var(--lime); }
.tl-item.dep::before { background: var(--dock); border-color: var(--dock); }
.week-day.first { background: var(--dock); color: var(--on-dock); border-color: var(--dock); }
.journey-row { border-radius: var(--r); }

/* Pricing */
.plan.pop { background: var(--dock); border: 0; box-shadow: none; }
.plan.pop .btn.primary { background: var(--lime); color: var(--on-lime); }
.plan.pop .feat svg { color: var(--lime); }
.plan .badge { background: var(--lime); color: var(--on-lime); }

/* Onboarding: aurora story panel, white form */
.onb-art { background-color: #120A2E; background-image: var(--aurora); }
.onb-form { background: var(--surface); }
.avatar { background: var(--lime); color: var(--on-lime); }
.avatar.b { background: var(--lav-soft); color: var(--ink); }

/* Overlays */
.modal { border-radius: var(--r-lg); }
.toast { background: var(--dock); color: var(--on-dock); border-radius: 999px; }
.scrim { background: rgba(31,26,51,.42); }

/* Dark: lift the big blocks off the dark canvas, keeping the aurora glow */
:root[data-theme="dark"] .hero, :root[data-theme="dark"] .onb-art, :root[data-theme="dark"] .plan.pop { background-color: #1E1545; }
:root[data-theme="dark"] .plan.pop .btn.primary { background: var(--lime); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero, :root:not([data-theme="light"]) .onb-art, :root:not([data-theme="light"]) .plan.pop { background-color: #1E1545; }
}

/* Phone chrome: canvas top bar, floating night dock with an ember active tab */
@media (max-width: 767px) {
  .topbar { background: var(--bg); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar { background: var(--dock); border-top: 0; margin: 0 16px calc(12px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; border-radius: 999px; padding: 6px; box-shadow: var(--shadow-lg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabbar button { color: var(--on-dock-muted); border-radius: 999px; }
  .tabbar button[aria-current="page"] { color: var(--on-dock); }
  .tabbar button[aria-current="page"] .tab-ic { background: var(--lime); color: var(--on-lime); }
  .tab-ic { border-radius: 999px; }
  .main { padding-bottom: calc(var(--nav-h) + 44px + env(safe-area-inset-bottom, 0px)); }
}

/* Switch between the Carnet apps (sidebar) */
.app-switch { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink); background: var(--canvas-raised); border: 0; transition: background .15s; }
.app-switch:hover { background: var(--surface); }
.app-switch b { display: block; font-size: 13px; }
.app-switch small { display: block; font-size: 11.5px; opacity: .65; }
@media (min-width: 768px) and (max-width: 1099px) { .side .app-switch span { display: none; } .side .app-switch { justify-content: center; } }

/* Task categories: each kind of task keeps one colour everywhere it appears (tags, calendar,
   progress). Fills are soft so text stays `ink`; the dot carries the full colour. The category
   name is always written next to the colour, so colour is never the only signal. */
:root {
  --cat-visa: #ECE2FF; --cat-visa-dot: #8C6BF0;
  --cat-docs: #E2E9FF; --cat-docs-dot: #3D6BFF;
  --cat-uni: #DDF2F4; --cat-uni-dot: #1E9AA8;
  --cat-housing: #FFE6D6; --cat-housing-dot: #FF8A3D;
  --cat-finance: #E2F2E7; --cat-finance-dot: #2E9A57;
  --cat-health: #FFE0EC; --cat-health-dot: #E0457B;
  --cat-travel: #FFF1C9; --cat-travel-dot: #D9A300;
  --cat-admin: #E8E6F4; --cat-admin-dot: #6B6190;
  --cat-life: #EEF3D6; --cat-life-dot: #8AA12B;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cat-visa: #3A2C78; --cat-docs: #22306B; --cat-uni: #12434A; --cat-housing: #4A2A16; --cat-finance: #1F3A2A;
    --cat-health: #4A1C33; --cat-travel: #43361A; --cat-admin: #2E2A4A; --cat-life: #333A18;
  }
}
:root[data-theme="dark"] {
  --cat-visa: #3A2C78; --cat-docs: #22306B; --cat-uni: #12434A; --cat-housing: #4A2A16; --cat-finance: #1F3A2A;
  --cat-health: #4A1C33; --cat-travel: #43361A; --cat-admin: #2E2A4A; --cat-life: #333A18;
}
[data-cat="visa"] { --cat-bg: var(--cat-visa); --cat-dot: var(--cat-visa-dot); }
[data-cat="docs"] { --cat-bg: var(--cat-docs); --cat-dot: var(--cat-docs-dot); }
[data-cat="uni"] { --cat-bg: var(--cat-uni); --cat-dot: var(--cat-uni-dot); }
[data-cat="housing"] { --cat-bg: var(--cat-housing); --cat-dot: var(--cat-housing-dot); }
[data-cat="finance"] { --cat-bg: var(--cat-finance); --cat-dot: var(--cat-finance-dot); }
[data-cat="health"] { --cat-bg: var(--cat-health); --cat-dot: var(--cat-health-dot); }
[data-cat="travel"] { --cat-bg: var(--cat-travel); --cat-dot: var(--cat-travel-dot); }
[data-cat="admin"] { --cat-bg: var(--cat-admin); --cat-dot: var(--cat-admin-dot); }
[data-cat="life"] { --cat-bg: var(--cat-life); --cat-dot: var(--cat-life-dot); }
.cat-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 18px; background: var(--cat-bg, var(--surface-2)); color: var(--ink); white-space: nowrap; }
.cat-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat-dot, var(--ink-3)); flex: none; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cat-dot, var(--ink-3)); flex: none; }
.cal .ev[data-cat] { background: var(--cat-bg); color: var(--ink); border-radius: 999px; }
.cal .ev.off[data-cat] { font-weight: 600; }
.progress.cat > i { background: var(--cat-dot, var(--accent)); }
.card[data-cat] .ring .fg { stroke: var(--cat-dot); }

/* ===================================================================
   Design system layout: icon rail on iPad, a header with two stats and
   one action, a side column beside the main cards, and a phone dock
   that labels only the active tab.
   =================================================================== */

/* iPad, portrait and landscape: a slim icon rail instead of the labelled sidebar */
@media (min-width: 768px) and (max-width: 1279px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 22px 0 18px; align-items: center; gap: 18px; }
  .side .brand { justify-content: center; padding: 0; }
  .side .brand-text, .side .plan-chip, .side .cheer, .side .save-state, .side .eyebrow, .side .nav .nl, .side .nav .ns, .side .app-switch span { display: none; }
  .side .nav { align-items: center; gap: 10px; }
  .side .nav-sub { margin-top: 6px; padding-top: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .side .nav button { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 999px; background: var(--canvas-raised); }
  .side .nav button[aria-current="page"] { background: var(--accent); }
  .side .side-foot { align-items: center; }
  .side .app-switch { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 999px; }
  .main > .wrap { padding-left: 28px; padding-right: max(28px, env(safe-area-inset-right, 0px)); }
}

/* Home header: title on the left, two stats and one action on the right */
.home-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }
.home-h h1 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.08; font-weight: 700; letter-spacing: -.035em; }
.home-h .muted { margin-top: 4px; }
.home-h-r { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.stats { display: flex; align-items: flex-end; }
.stats > * + * { margin-left: 24px; padding-left: 24px; border-left: 1px solid var(--canvas-line); }
.stat2 { display: flex; flex-direction: column; gap: 2px; }
.stat2 small { font-size: 13px; color: var(--ink-3); }
.stat2 b { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat2 b span { margin-left: 4px; font-size: 15px; font-weight: 500; letter-spacing: 0; }
@media (max-width: 767px) { .home-h-r { width: 100%; justify-content: space-between; align-items: center; } .stat2 b { font-size: 32px; line-height: 36px; } }

/* Side column beside the main cards; stacks under them on narrow screens */
.home-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.home-side, .home-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 960px) { .home-grid { grid-template-columns: minmax(0, 1fr); } .home-side { order: 2; } }

/* Mini month calendar on the canvas */
.minical { background: var(--canvas-raised); border-radius: var(--r-lg); padding: 16px; }
.minical-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 500; font-size: 15px; text-transform: capitalize; }
.minical-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.minical-g .dw { padding-bottom: 6px; font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; }
.minical-g .d { position: relative; display: grid; place-items: center; height: 30px; }
.minical-g .d > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; }
.minical-g .d.wk { background: var(--canvas-line); }
.minical-g .d.wk-s { border-radius: 999px 0 0 999px; }
.minical-g .d.wk-e { border-radius: 0 999px 999px 0; }
.minical-g .d.today > span { background: var(--lime); color: var(--on-lime); font-weight: 600; }
.minical-g .d.dep > span { box-shadow: inset 0 0 0 2px var(--lime); font-weight: 600; }
.minical-g .d.dot::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink); }
.minical-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.minical-key span { display: inline-flex; align-items: center; gap: 6px; }
.minical-key i { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); }
.minical-key i.ring { background: none; box-shadow: inset 0 0 0 2px var(--lime); }
.minical-key i.dot { width: 5px; height: 5px; background: var(--ink); }

/* Stage blocks: done in lilac, the current one in the highlight, upcoming plain */
.phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.phase { display: flex; flex-direction: column; gap: 4px; min-height: 96px; padding: 12px 14px; border: 0; border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-align: left; }
.phase b { font-size: 14px; font-weight: 600; line-height: 1.3; }
.phase small { font-size: 12px; color: var(--ink-3-s); }
.phase.done { background: var(--lav); }
.phase.done small { color: var(--ink); }
.phase.now { background: var(--lime); color: var(--on-lime); }
.phase.now small { color: var(--on-lime); }
.phase .progress { margin-top: auto; height: 6px; background: rgba(18,10,46,.18); }
.phase .progress > i { background: var(--on-lime); }

/* Week calendar: one column per day, deadlines in the highlight, the rest lilac */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); margin: 0 -24px -22px; }
.week-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 210px; padding: 10px 6px 14px; border-left: 1px solid var(--line); }
.week-col:first-child { border-left: 0; }
.week-d { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 6px; font-size: 11px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; }
.week-d b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; font-size: 17px; font-weight: 500; color: var(--ink); text-transform: none; }
.week-col.today .week-d b { background: var(--lime); color: var(--on-lime); }
.wev { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 9px; border: 0; border-radius: 12px; background: var(--lav); color: var(--ink); font-size: 12px; line-height: 16px; font-weight: 500; text-align: left; }
.wev span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.wev small { font-size: 11px; font-weight: 400; }
.wev.deadline { background: var(--lime); color: var(--on-lime); }
.week-nav { display: flex; align-items: center; gap: 6px; }
@media (max-width: 767px) {
  .week { grid-template-columns: minmax(0, 1fr); margin: 0 -18px -18px; }
  .week-col { flex-direction: row; align-items: flex-start; min-height: 0; padding: 10px 14px; border-left: 0; border-top: 1px solid var(--line); }
  .week-col:first-child { border-top: 0; }
  .week-col.empty:not(.today) { display: none; }
  .week-d { flex: none; width: 54px; padding: 0; }
  .week-evs { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
}
.week-evs { display: flex; flex-direction: column; gap: 6px; }

/* Compact checklist rows for side cards */
.mini-list { display: flex; flex-direction: column; }
.mini-list > * { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.35; }
.mini-list > *:first-child { border-top: 0; padding-top: 2px; }
.mini-list .meta { margin-left: auto; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* Budget bars by category */
.bbars { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.bbar-l { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); }
.bbar-l b { font-weight: 500; color: var(--ink); }

/* iPhone dock: icons only, the active tab spells out its name in an ember pill */
@media (max-width: 767px) {
  .tabbar { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 6px; }
  .tabbar button { flex: 0 0 auto; flex-direction: row; gap: 6px; height: 48px; min-width: 48px; padding: 0 12px; justify-content: center; font-size: 0; border-radius: 999px; }
  .tabbar button .tab-ic { width: auto; height: auto; background: none; }
  .tabbar button[aria-current="page"] { font-size: 13px; font-weight: 600; background: var(--lime); color: var(--on-lime); padding: 0 16px; }
  .tabbar button[aria-current="page"] .tab-ic { background: none; color: var(--on-lime); }
}

/* Entry screens (welcome, sign-in, setup) follow the app itself: the canvas ground,
   the story in a rounded deep-night card like the home hero, the form in a white card. */
.onb { background: var(--bg); padding: 16px; gap: 16px; box-sizing: border-box; }
.onb-art { border-radius: var(--r-lg); padding: 44px; }
.onb-art h1 { font-weight: 700; letter-spacing: -.035em; }
.onb-form { background: var(--surface); border-radius: var(--r-lg); }
@media (max-width: 860px) { .onb { padding: 12px; gap: 12px; } .onb-art { padding: 28px 24px; } }
