/* MAX · black void, chrome, nothing extra. */
:root {
  --bg: #000;
  --fg: #ececec;
  --dim: #9a9a9a; /* secondary text: ≥4.5:1 on black */
  --faint: #474747;
  --line: rgba(var(--ink), 0.09);
  --line-strong: rgba(var(--ink), 0.22);
  --accent: #ececec;
  --ok: #b9f5d4;
  --error: #ff6b6b;
  /* brushed chrome: bright edge, dark band, bright again */
  --chrome: linear-gradient(180deg, #ffffff 0%, #d8d8d8 28%, #6e6e6e 50%, #cfcfcf 66%, #ffffff 100%);
  --chrome-edge: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.08) 40%, rgba(255,255,255,.35) 70%, rgba(255,255,255,.06));
  --display: "Archivo", system-ui, sans-serif;
  --ui: "Archivo", system-ui, sans-serif;
  --mono: "Archivo", system-ui, sans-serif;
  --ink: 255, 255, 255;
  --on-chrome: #000;
  --fg-strong: #fff;
  --s0: #050505; --s1: #0b0b0b; --s2: #121212; --s3: #161616; --s4: #222;
  --scrim: rgba(0,0,0,.8); --scrim-strong: rgba(0,0,0,.9); --glass: rgba(12,12,12,.92);
  --shadow-c: rgba(0,0,0,.7); --shadow: 0 30px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

/* Light mode: white paper, graphite chrome, the same minimal language. */
:root[data-theme="light"] {
  --bg: #f4f4f2;
  --fg: #111;
  --dim: #5c5c5c; /* ≥4.5:1 on porcelain */
  --faint: #a9a9a6;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.24);
  --accent: #111;
  --ok: #157a46;
  --error: #c62828;
  --chrome: linear-gradient(180deg, #4a4a4a 0%, #121212 30%, #7a7a7a 50%, #1a1a1a 68%, #3c3c3c 100%);
  --chrome-edge: linear-gradient(135deg, rgba(0,0,0,.35), rgba(0,0,0,.06) 40%, rgba(0,0,0,.25) 70%, rgba(0,0,0,.05));
  --ink: 0, 0, 0;
  --on-chrome: #fff;
  --fg-strong: #000;
  --s0: #fbfbfa; --s1: #ffffff; --s2: #f0f0ee; --s3: #ebebe8; --s4: #dcdcd8;
  --scrim: rgba(244,244,242,.82); --scrim-strong: rgba(244,244,242,.92); --glass: rgba(255,255,255,.92);
  --shadow-c: rgba(0,0,0,.12); --shadow: 0 24px 48px rgba(0,0,0,.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); }
body { color: var(--fg); font: 400 15px/1.5 var(--ui); font-variant-numeric: tabular-nums; font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* One soft light behind the orb. */
.void { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 55% 40% at 50% 42%, rgba(var(--ink), .05), transparent 70%); }
.screen { position: relative; z-index: 1; height: 100dvh; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; }
.screen.center { justify-content: center; align-items: center; padding: 16px; }

/* Chrome type */
.chrome { background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mega { margin: 0; font: 900 clamp(76px, 26vw, 140px)/0.86 var(--display); font-stretch: 125%; letter-spacing: -0.02em; text-align: center; }
.sub { margin: 0; min-height: 1.4em; text-align: center; font: 500 11px var(--mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); }
.btn { font: 700 12px var(--display); font-stretch: 125%; letter-spacing: 0.34em; text-transform: uppercase; background: var(--chrome); color: var(--on-chrome); border: 0; border-radius: 999px; padding: 16px 20px; width: 100%; }
.btn.ghost { background: none; color: var(--fg); border: 1px solid var(--line-strong); }
.btn:active { opacity: 0.8; }
.error { color: var(--error); margin: 0; font-size: 13px; text-align: center; }
input, textarea, select { font: 400 16px var(--ui); color: var(--fg); background: rgba(var(--ink), .03); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; width: 100%; -webkit-user-select: text; user-select: text; }
input::placeholder, textarea::placeholder { color: var(--faint); letter-spacing: 0.06em; }
textarea { resize: vertical; line-height: 1.55; min-height: 340px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--line-strong); }
.login, .boot { width: min(380px, 100%); display: grid; gap: 18px; }
.login .mega, .boot .mega { margin-bottom: 14px; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 12px) 18px 10px; }
.top-right { display: flex; gap: 2px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: none; border: 0; color: var(--fg); opacity: 0.8; }
.icon-btn:active { opacity: 0.5; }
.icon-btn.small { width: 36px; height: 36px; border: 1px solid var(--line); }
#voice-toggle .mute { display: none; }
#voice-toggle[aria-pressed="false"] .mute { display: inline; }
#voice-toggle[aria-pressed="false"] .wave { display: none; }
#voice-toggle[aria-pressed="false"] { opacity: 0.35; }
.player-badge { display: flex; align-items: stretch; background: none; border: 0; padding: 0; border-radius: 999px; overflow: hidden; font: 700 12px var(--display); font-stretch: 125%; letter-spacing: 0.16em; box-shadow: 0 0 0 1px var(--line-strong) inset; }
.player-badge .lv { padding: 8px 11px; }
.player-badge .lv b { font-weight: 900; }
.player-badge .rk { padding: 8px 12px; min-width: 34px; text-align: center; background: var(--chrome); color: var(--on-chrome); }
.xp-line { height: 1px; background: var(--line); margin: 0 18px; }
.xp-line i { display: block; height: 100%; width: 0; background: var(--fg); transition: width 0.8s ease; }

/* Stage */
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; }
.chapter { margin: 0; font: 500 10.5px var(--mono); letter-spacing: 0.26em; text-transform: uppercase; color: var(--faint); }
.orb-btn { background: none; border: 0; padding: 0; border-radius: 50%; width: min(70vw, 42dvh, 340px); aspect-ratio: 1; }
.orb-btn canvas { width: 100%; height: 100%; display: block; }
.caption { display: grid; gap: 8px; justify-items: center; text-align: center; min-height: 5.6em; max-width: 540px; background: none; border: 0; padding: 0; }
.speaker { font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.42em; color: var(--dim); }
.caption-text { font: 300 19px/1.45 var(--ui); letter-spacing: -0.005em; color: var(--fg); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.status { margin: 0; color: var(--faint); font: 500 10.5px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.next-line { display: flex; align-items: baseline; gap: 10px; max-width: min(100%, 480px); margin-top: 4px; padding: 9px 16px; background: none; border: 0; border-radius: 999px; box-shadow: 0 0 0 1px var(--line) inset; font: 300 13px var(--ui); }
.next-label { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: 0.32em; text-transform: uppercase; color: var(--dim); }
.next-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-count { font: 500 11px var(--mono); color: var(--dim); }
.dots { display: flex; gap: 5px; }

/* Bottom */
.bottom { padding: 6px 18px calc(env(safe-area-inset-bottom) + 14px); }
.controls { display: flex; align-items: center; gap: 8px; }
.controls label.icon-btn { cursor: pointer; flex: none; }
.text-form { flex: 1; }
.text-form input { border-radius: 999px; }
.chip { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: 0.26em; text-transform: uppercase; padding: 0 15px; height: 42px; border-radius: 999px; background: none; border: 1px solid var(--line-strong); color: var(--dim); flex: none; }
.chip[aria-pressed="true"] { color: var(--on-chrome); background: var(--chrome); border-color: transparent; }
.attachments { display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto; }
.attachments .thumb { position: relative; flex: none; }
.attachments img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-strong); display: block; }
.attachments button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--fg); color: var(--on-chrome); font-size: 13px; line-height: 22px; padding: 0; }

/* Drawers */
.drawer { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; max-width: 680px; margin: 0 auto; height: 90dvh; display: flex; flex-direction: column; background: var(--s0); border-radius: 24px 24px 0 0; box-shadow: 0 -1px 0 var(--line-strong), 0 -30px 60px var(--shadow-c); animation: up 0.3s cubic-bezier(.2,.8,.2,1); -webkit-user-select: text; user-select: text; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 18px 10px; }
.drawer-head > div { display: flex; gap: 8px; align-items: center; }
.drawer-head h2 { margin: 0; font: 900 30px/1 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px calc(env(safe-area-inset-bottom) + 28px); display: grid; gap: 12px; align-content: start; }
.hint { margin: 0; color: var(--dim); font-size: 13.5px; }
.hint.ok { color: var(--ok); }
.log { flex: 1; overflow-y: auto; padding: 8px 18px calc(env(safe-area-inset-bottom) + 20px); display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 90%; white-space: pre-wrap; word-wrap: break-word; }
.msg .who { display: block; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: 0.3em; color: var(--dim); margin-bottom: 4px; }
.msg.user { align-self: flex-end; text-align: right; color: var(--dim); }
.msg.assistant, .msg.consult { align-self: flex-start; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.note { align-self: center; color: var(--faint); font: 500 11px var(--mono); text-align: center; }
#memory-body h3, #mission-body h3, .page-body h3, #daily-panel h3, #path-body h3, #money-body h3 { font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.32em; color: var(--dim); text-transform: uppercase; margin: 24px 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
#mission-body h3 small, .page-body h3 small, #path-body h3 small, #money-body h3 small { font: 500 11px var(--mono); letter-spacing: 0.04em; color: var(--fg); text-transform: none; }
#memory-body ul { list-style: none; padding: 0; margin: 0; display: grid; }
#memory-body li { border-bottom: 1px solid var(--line); padding: 11px 0; display: flex; gap: 8px; justify-content: space-between; align-items: start; font-size: 14.5px; }
#memory-body li button { background: none; border: 0; color: var(--faint); padding: 0 4px; }
.add-note { display: flex; gap: 8px; margin-top: 10px; }

/* Board rows */
.quick-add { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.quick-add #qa-title { grid-column: 2 / 4; }
.quick-add #qa-due { grid-column: 1 / 3; }
select { font: 500 14px var(--ui); height: 48px; padding: 0 12px; }
.goal { margin-bottom: 14px; }
.goal-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 7px; gap: 8px; }
.goal-top b { font: 700 11px var(--display); font-stretch: 112%; text-transform: uppercase; letter-spacing: 0.12em; }
.goal-top span { color: var(--dim); font: 500 12px var(--mono); }
.bar { height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.bar i { display: block; height: 100%; background: var(--chrome); }
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.row .t { flex: 1; min-width: 0; }
.row .t div { overflow-wrap: anywhere; }
.row .meta { font: 500 11.5px var(--mono); color: var(--dim); margin-top: 3px; }
.row .meta .late { color: var(--error); }
.row .meta .p1 { color: var(--fg); }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; padding: 0; }
.check:active, .check.on { background: var(--chrome); border-color: transparent; }
.stage-btn { flex: none; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg); background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 11px; }
.del { flex: none; background: none; border: 0; color: var(--faint); padding: 0 2px; font-size: 14px; }
.pipeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; text-align: center; margin-bottom: 8px; }
.pipeline div { background: var(--s0); padding: 9px 2px; }
.pipeline b { display: block; font: 800 17px var(--display); font-stretch: 112%; }
.pipeline span { font: 500 8px var(--mono); color: var(--dim); text-transform: uppercase; display: block; overflow: hidden; text-overflow: ellipsis; }
.empty-hint { color: var(--dim); font-size: 14px; margin: 0; }
.content-item { display: grid; }
.content-details { border-left: 1px solid var(--line-strong); margin: 0 0 6px; padding: 4px 0 12px 12px; display: grid; gap: 4px; }
.content-details b { font: 500 9px var(--mono); letter-spacing: 0.24em; color: var(--dim); text-transform: uppercase; margin-top: 8px; }
.content-details p { margin: 0; white-space: pre-wrap; font-size: 14.5px; }
.content-details .chip { justify-self: start; margin-top: 10px; height: 36px; }
.late-text { color: var(--error) !important; }

/* Panels: graphite glass with a chrome hairline */
.sys-window { position: relative; border-radius: 20px; padding: 16px 18px; background: linear-gradient(180deg, rgba(var(--ink), .05), rgba(var(--ink), .015)); }
.sys-window::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--chrome-edge); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.sys-head { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 12px; font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.32em; text-transform: uppercase; }
.sys-tag { font: 500 10px var(--mono); letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.quest { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.quest:last-of-type { border-bottom: 0; }
.quest .q { flex: 1; min-width: 0; }
.quest .q div { font-size: 14.5px; }
.quest .q small { font: 500 10.5px var(--mono); color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.quest.done .q div { color: var(--faint); text-decoration: line-through; }
.daily-foot { margin-top: 10px; font: 500 11px var(--mono); color: var(--dim); }

/* Status overlay */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: var(--scrim); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.status-window { width: min(420px, 100%); max-height: 90dvh; overflow-y: auto; background: var(--s0); animation: pop .3s cubic-bezier(.2,.9,.2,1.2); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.st-name { font: 900 28px/1 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-title { font: 500 10px var(--mono); letter-spacing: 0.24em; color: var(--dim); text-transform: uppercase; margin-top: 8px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; margin: 16px 0; }
.st-grid > div { background: var(--s1); padding: 11px 13px; }
.st-grid small { display: block; font: 500 9px var(--mono); letter-spacing: 0.22em; color: var(--dim); text-transform: uppercase; }
.st-grid b { font: 900 24px var(--display); font-stretch: 125%; }
.st-xp { margin-bottom: 6px; display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--dim); }
.st-xpbar { height: 2px; background: var(--line); border-radius: 2px; }
.st-xpbar i { display: block; height: 100%; background: var(--chrome); }
.stats { display: grid; gap: 10px; margin-top: 18px; }
.stat { display: grid; grid-template-columns: 92px 1fr 32px; align-items: center; gap: 10px; }
.stat span { font: 500 10px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; }
.stat b { font: 800 13px var(--display); font-stretch: 112%; text-align: right; }
.recent { margin-top: 18px; display: grid; gap: 6px; font: 500 11.5px var(--mono); color: var(--dim); }
.recent div { display: flex; justify-content: space-between; gap: 10px; }
.recent b { color: var(--fg); font-weight: 400; flex: none; }

/* Notifications */
.toasts { position: fixed; z-index: 40; top: calc(env(safe-area-inset-top) + 64px); left: 0; right: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { width: min(360px, 100%); padding: 11px 16px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: toast 3.6s ease forwards; }
.toast .sys-head { margin: 0 0 4px; color: var(--dim); }
.toast .tx { font-size: 13.5px; }
.toast .tx b { font: 900 14px var(--display); font-stretch: 125%; margin-right: 8px; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.levelup { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: var(--scrim-strong); animation: fade .3s ease; }
.levelup-inner { text-align: center; display: grid; gap: 10px; padding: 16px; }
.levelup-title { font: 900 clamp(48px, 15vw, 96px)/0.9 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; animation: slam .6s cubic-bezier(.2,.9,.2,1.3); }
@keyframes slam { from { transform: scale(1.4); opacity: 0; } }
.levelup-level { font: 500 13px var(--mono); letter-spacing: 0.3em; color: var(--dim); }
.levelup-level b { font: 900 26px var(--display); font-stretch: 125%; color: var(--fg); }
.levelup-rank { font: 500 11px var(--mono); letter-spacing: 0.3em; color: var(--fg); text-transform: uppercase; }

/* Path */
.path-hero { display: grid; gap: 6px; padding: 4px 0; }
.path-chapter { font: 500 10px var(--mono); letter-spacing: 0.24em; color: var(--dim); text-transform: uppercase; }
.path-title { font: 900 32px/1 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.path-line { color: var(--dim); font-size: 14px; }
.path-rank { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--dim); margin-top: 10px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pillar { background: none; border: 1px solid var(--line); border-radius: 18px; padding: 16px 6px 14px; display: grid; justify-items: center; gap: 6px; }
.pillar .pn { font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.26em; text-transform: uppercase; }
.pillar .pv { font: 900 22px var(--display); font-stretch: 112%; }
.pillar-view { display: grid; gap: 8px; }
.pillar-view .hero { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 0 4px; }
.pillar-view .hero .pn { font: 900 30px var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pillar-view .hero p { margin: 0; color: var(--dim); font: 500 10px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.badge { border: 1px solid var(--line); border-radius: 16px; padding: 12px 13px; display: grid; gap: 5px; }
.badge .bn { font: 800 12px var(--display); font-stretch: 112%; letter-spacing: 0.08em; text-transform: uppercase; }
.badge .bt { font: 500 9px var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.badge .bp { font: 500 11px var(--mono); color: var(--dim); }
.badge.locked { opacity: 0.45; }
.badge.t1 .bt { color: #d0a07a; } .badge.t2 .bt { color: #e6e6ec; } .badge.t3 .bt { color: #ecd28a; } .badge.t4 .bt { color: #ffffff; }
.badge.t3, .badge.t4 { border-color: var(--line-strong); }
.timeline { display: grid; border-left: 1px solid var(--line); margin-left: 4px; }
.beat { position: relative; padding: 0 0 18px 18px; }
.beat::before { content: ""; position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--dim); }
.beat.rank::before, .beat.badge::before, .beat.release::before { background: var(--chrome); border-color: transparent; }
.beat .bd { font: 500 10px var(--mono); letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase; }
.beat .bh { font: 800 13px var(--display); font-stretch: 112%; letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }
.beat .bx { color: var(--dim); font-size: 13px; margin-top: 2px; }

/* Profile panels */
.notify { display: grid; gap: 12px; margin-bottom: 6px; }
.notify .sys-head { margin: -2px 0 0; }
.push-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.push-times label { display: grid; gap: 6px; font: 500 9px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.push-times input { padding: 10px; font: 500 16px var(--mono); }
.push-actions { display: flex; gap: 8px; }
.push-actions .chip { flex: 1; }
.device { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.device:last-child { border-bottom: 0; }
.device-info { flex: 1; min-width: 0; }
.device-name { font-size: 14px; overflow-wrap: anywhere; }
.device-meta { font: 500 11px var(--mono); color: var(--dim); margin-top: 2px; }
.device .chip { height: 34px; color: var(--error); border-color: rgba(255,107,107,.4); }
.siri-key { font: 500 12px var(--mono) !important; color: var(--fg) !important; background: rgba(var(--ink), .04); padding: 8px; border-radius: 10px; user-select: all; -webkit-user-select: all; }
.conn { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.conn:first-of-type { border-top: 0; padding-top: 0; }
.conn-head { display: flex; justify-content: space-between; gap: 10px; font: 800 11px var(--display); font-stretch: 112%; letter-spacing: 0.12em; text-transform: uppercase; }
.conn-head span:last-child { font: 500 11px var(--mono); color: var(--dim); text-transform: none; letter-spacing: 0; }
.conn-line { margin: 0; font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.conn-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.conn-buttons .chip { height: 36px; color: var(--fg); }
.upkeep { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 7px; }
.up-head { display: flex; justify-content: space-between; font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 4px; }
.up-head span:last-child { color: var(--dim); font: 500 10px var(--mono); letter-spacing: 0.06em; }
.up-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.up-row b { font: 800 14px var(--display); font-stretch: 112%; }
.up-row.total { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.up-sub, .up-hint { font: 500 11px var(--mono); color: var(--dim); }
.up-bar { margin: -2px 0 4px; }
.up-net { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 13px; margin-top: 4px; border: 1px solid currentColor; border-radius: 14px; }
.up-net span { font: 500 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.up-net b { font: 900 20px var(--display); font-stretch: 112%; }
.up-net.pos { color: var(--ok); }
.up-net.neg { color: var(--fg); }

@media (max-height: 700px) { .caption { min-height: 4.4em; } .caption-text { font-size: 16px; -webkit-line-clamp: 3; } }
@media (prefers-reduced-motion: reduce) { .toast, .levelup-title, .status-window, .drawer { animation: none; } }

/* Cards: releases and projects */
.card { border: 1px solid var(--line); border-radius: 18px; padding: 14px 15px; display: grid; gap: 8px; margin-bottom: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: none; border: 0; padding: 0; text-align: left; }
.card-title { font: 800 13px var(--display); font-stretch: 112%; letter-spacing: 0.06em; text-transform: uppercase; }
.card-big { font: 900 22px var(--display); font-stretch: 125%; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; flex: none; }
.card-meta { font: 500 11px var(--mono); color: var(--dim); }
.card-meta.warn, .card-meta.health-at-risk, .card-meta.health-overdue { color: var(--error); }
.card-next { font-size: 13.5px; color: var(--fg); }
.done-row .t div { color: var(--faint); text-decoration: line-through; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 6px; }
.inline-form select { grid-column: 1 / 3; }
.inline-form input[type="date"] { height: 42px; padding: 0 12px; }
.inline-form .chip { height: 42px; color: var(--fg); }
.backup-list { display: grid; }
.backup-list .device .chip { color: var(--fg); border-color: var(--line-strong); }

/* Library */
.lib-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.lib-pick { display: grid; place-items: center; width: auto; padding: 0 20px; height: 48px; cursor: pointer; }
.lib-chip { display: grid; place-items: center; cursor: pointer; }
.lib-note { display: grid; gap: 8px; }
.lib-note textarea { resize: vertical; min-height: 0; height: 140px; }
#lib-list h3 { font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.32em; color: var(--dim); text-transform: uppercase; margin: 24px 0 4px; display: flex; justify-content: space-between; }
#lib-list .device .chip { color: var(--dim); border-color: var(--line-strong); height: 32px; padding: 0 12px; }

/* Boot sequence: light line, letters come into focus, chrome sheen, tagline */
.boot { position: relative; z-index: 1; }
.boot-light { position: absolute; left: 50%; top: 50%; width: 0; height: 2px; box-shadow: 0 0 18px rgba(var(--ink), .6); transform: translate(-50%, -64px); background: linear-gradient(90deg, transparent, rgba(var(--ink), .9) 45%, var(--fg-strong) 50%, rgba(var(--ink), .9) 55%, transparent); opacity: 0; pointer-events: none; z-index: 0; }
#boot-mark.split { background: none; color: inherit; }
#boot-mark .ch { display: inline-block; background: linear-gradient(100deg, transparent 0 42%, rgba(var(--ink), .95) 50%, transparent 58% 100%), var(--chrome); background-size: 320% 100%, 100% 100%; background-position: 160% 0, 0 0; background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; color: transparent; }
#boot-mark::after { content: ""; position: absolute; inset: -45% -18%; background: radial-gradient(closest-side, rgba(var(--ink), .4), transparent 70%); opacity: 0; pointer-events: none; z-index: -1; }
#boot-mark { position: relative; }
.boot-tag { margin: -6px 0 0; min-height: 1.2em; text-align: center; font: 600 10px var(--mono); letter-spacing: 0.5em; text-transform: uppercase; color: var(--fg); opacity: 0; }
#boot.booting .boot-light { animation: bootLine 1.5s cubic-bezier(.3,.6,.2,1) both; }
#boot.booting #boot-mark .ch { animation: chIn 1.35s cubic-bezier(.2,.7,.1,1) both, sheen 1.2s cubic-bezier(.4,0,.2,1) 1.6s both, sheen 1.4s cubic-bezier(.4,0,.2,1) 3.4s both; animation-delay: calc(.3s + var(--i) * .22s), 1.6s, 3.4s; }
#boot.booting #boot-mark { animation: markGlow 2.2s ease-in-out 1.5s both; }
#boot.booting #boot-mark::after { animation: bloom 2.6s ease-out .5s both; }
#boot.booting .boot-tag.show { animation: tagIn 1.1s cubic-bezier(.2,.8,.2,1) both; }
#boot.booting #boot-sub:not(.granted) { animation: fadeSoft 3s ease both; }
@keyframes bootLine { 0% { width: 0; opacity: 0; } 25% { opacity: 1; } 70% { width: min(92vw, 640px); opacity: .8; } 100% { width: min(100vw, 680px); opacity: 0; } }
@keyframes chIn { 0% { opacity: 0; filter: blur(22px); transform: translateY(22px) scale(1.45); } 55% { opacity: 1; filter: blur(2px); transform: translateY(-3px) scale(.98); } 100% { opacity: 1; filter: none; transform: none; } }
@keyframes sheen { from { background-position: 160% 0, 0 0; } to { background-position: -60% 0, 0 0; } }
@keyframes bloom { 0% { opacity: 0; transform: scale(.5); } 35% { opacity: 1; transform: scale(1.05); } 70% { opacity: .75; } 100% { opacity: .45; transform: scale(1.2); } }
@keyframes markGlow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(var(--ink), 0)); } 40% { filter: drop-shadow(0 0 26px rgba(var(--ink), .55)) drop-shadow(0 0 60px rgba(var(--ink), .25)); } }
@keyframes tagIn { 0% { opacity: 0; letter-spacing: 1.1em; filter: blur(6px); } 100% { opacity: 1; letter-spacing: 0.5em; filter: none; } }
@keyframes fadeSoft { 0% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #boot.booting .boot-light, #boot.booting #boot-mark::after, #boot.booting #boot-mark { animation: none; }
  #boot.booting #boot-mark .ch { animation: fadeSoft .6s ease both; }
  #boot.booting .boot-tag.show { animation: fadeSoft .6s ease both; }
}

/* Access granted */
#boot-sub.granted { color: var(--fg); letter-spacing: 0.42em; animation: granted 1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes granted { 0% { opacity: 0; letter-spacing: 0.9em; filter: blur(4px); } 100% { opacity: 1; letter-spacing: 0.42em; filter: none; } }

/* Plans */
.plan .card-head > span:first-child { display: grid; gap: 3px; min-width: 0; }
.plan-goal { text-transform: none; }
.plan.finished { opacity: .6; }
.plan.paused .bar i { opacity: .4; }
.plan-body { display: grid; gap: 0; margin-top: 2px; }
.plan-why { margin: 0 0 6px; color: var(--dim); font-size: 13.5px; }
.plan-step { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.plan-step .check { margin-top: 1px; }
.plan-step-t { flex: 1; font-size: 14.5px; line-height: 1.4; }
.plan-step-t small { display: block; font: 500 11px var(--mono); color: var(--dim); margin-top: 2px; }
.plan-step-t small.late { color: var(--error); }
.plan-step.done .plan-step-t { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.plan-step.next .plan-step-t { color: var(--fg); font-weight: 500; }
.plan-step.next .check { border-color: var(--fg); }
.plan-note { padding-top: 6px; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.plan-new { margin: 4px 0 8px; }
.plan-new summary { list-style: none; display: inline-block; cursor: pointer; }
.plan-new summary::-webkit-details-marker, .plan-fold summary::-webkit-details-marker { display: none; }
.plan-new form { margin-top: 10px; }
.plan-fold { margin: 6px 0 4px; }
.plan-fold summary { list-style: none; cursor: pointer; padding: 8px 0; letter-spacing: .14em; text-transform: uppercase; }

/* Brain selector */
.provider-chip { margin: -6px 0 0; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.provider-chip.local { color: var(--fg); border-color: var(--line-strong); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 12px 0; font: 700 10px var(--display); font-stretch: 125%; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim); }
.seg button[aria-checked="true"] { background: var(--chrome); color: var(--on-chrome); }
#brain-unavailable ul { margin: 6px 0 0; padding-left: 18px; }
#brain-unavailable li { margin: 2px 0; }

/* Deep mode */
.msg.deep details summary { cursor: pointer; font-weight: 500; list-style: none; }
.msg.deep details summary::after { content: "  · tap to read"; color: var(--dim); font: 500 11px var(--mono); }
.msg.deep details[open] summary::after { content: ""; }
.msg.deep .deep-body { white-space: pre-wrap; margin-top: 10px; color: var(--fg); font-size: 14px; line-height: 1.55; -webkit-user-select: text; user-select: text; }

/* Onboarding */
.onboard { width: min(520px, 100%); display: grid; gap: 16px; }
.ob-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ob-mark { font: 900 22px var(--display); font-stretch: 125%; letter-spacing: 0.02em; }
.ob-step { font: 500 10px var(--mono); letter-spacing: 0.3em; color: var(--dim); }
.ob-q { margin: 0; font: 300 clamp(24px, 6.5vw, 32px)/1.2 var(--ui); letter-spacing: -0.01em; animation: fadeSoft .6s ease both; }
.ob-hint { margin-top: -6px; }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chips .chip { height: 36px; }
.ob-chips .chip[aria-pressed="true"] { color: var(--on-chrome); background: var(--chrome); border-color: transparent; }
.ob-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.onboard.calibrating .ob-q { animation: pulseText 1.6s ease-in-out infinite; }
@keyframes pulseText { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.dev-kind { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
#ob-a { min-height: 0; height: 48px; resize: none; }

/* Crew (multiplayer) */
.crew-icon { position: relative; }
.crew-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 8px rgba(var(--ink), .8); }
.crew-pill { margin: -4px 0 0; background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 14px; font: 500 11px var(--mono); letter-spacing: .14em; color: var(--fg); font-variant-numeric: tabular-nums; }
.crew-head-right { display: flex; align-items: center; gap: 10px; }
.crew-members { display: flex; }
.crew-members span { width: 28px; height: 28px; margin-left: -6px; border-radius: 50%; display: grid; place-items: center; font: 700 9px var(--display); font-stretch: 125%; background: var(--s2); border: 1px solid var(--line-strong); color: var(--dim); position: relative; }
.crew-members span.on { color: var(--on-chrome); background: var(--chrome); border-color: transparent; }
.crew-timer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.crew-timer:last-child { border-bottom: 0; }
.crew-timer .t-time { font: 900 34px/1 var(--display); font-stretch: 125%; font-variant-numeric: tabular-nums; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crew-timer .t-title { font-size: 14px; }
.crew-timer .t-meta { grid-column: 1 / -1; }
.crew-timer.done .t-time { opacity: .4; }
.crew-timer-form { display: grid; gap: 8px; margin-top: 6px; }
.crew-presets { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crew-presets .chip { height: 36px; padding: 0 12px; }
.crew-presets input { width: 70px; height: 36px; padding: 0 10px; }
.crew-start { width: auto; flex: 1; padding: 0 14px; height: 40px; }
.crew-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 10px; border-bottom: 1px solid var(--line); }
.crew-tabs button { background: none; border: 0; padding: 10px 0; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); border-bottom: 2px solid transparent; }
.crew-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.crew-tabs b { margin-left: 5px; font: 500 9px var(--mono); color: var(--fg); }
.crew-thread { display: grid; gap: 8px; max-height: 48vh; overflow-y: auto; padding: 4px 0 8px; }
.cmsg { max-width: 85%; justify-self: start; padding: 9px 12px; border-radius: 14px; background: rgba(var(--ink), .05); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.cmsg.mine { justify-self: end; background: rgba(var(--ink), .12); }
.cmsg.max { border-color: var(--line-strong); background: linear-gradient(180deg, rgba(var(--ink), .08), rgba(var(--ink), .02)); }
.cmsg .who { display: block; font: 700 8.5px var(--display); font-stretch: 125%; letter-spacing: .28em; color: var(--dim); text-transform: uppercase; margin-bottom: 3px; }
.cmsg .when { display: block; font: 500 9.5px var(--mono); color: var(--faint); margin-top: 4px; }
.crew-compose { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 6px; }
.crew-compose.stack { grid-template-columns: 1fr; }
.crew-compose textarea { min-height: 0; height: 70px; resize: vertical; }
.crew-row { display: flex; gap: 8px; }
.crew-row .btn { width: auto; flex: 1; }
.crew-typing { margin: 2px 0 0; }
.cupd { padding: 11px 0; border-bottom: 1px solid var(--line); }
.cupd .meta { font: 500 10.5px var(--mono); color: var(--dim); margin-bottom: 3px; }
.cupd.important .meta::after { content: "  · IMPORTANT"; color: var(--fg); }
.cupd p { margin: 0; font-size: 14.5px; white-space: pre-wrap; }
.ctask { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ctask .who { margin-left: auto; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .1em; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 7px; }
.ctask.done .t { color: var(--faint); text-decoration: line-through; }
.cdm { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--fg); }
.cdm .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--display); font-stretch: 125%; border: 1px solid var(--line-strong); }
.cdm .n { flex: 1; font-size: 15px; }
.cdm b { font: 500 10px var(--mono); }

/* Onboarding as a conversation */
#onboard { justify-content: stretch; padding: 16px; }
#onboard .onboard { height: 100%; display: flex; flex-direction: column; gap: 14px; width: min(560px, 100%); margin: 0 auto; }
.ob-intro { margin: auto 0; display: grid; gap: 14px; text-align: center; }
.ob-kicker { margin: 0; font: 600 10px var(--mono); letter-spacing: .4em; text-transform: uppercase; color: var(--dim); }
.ob-movement { margin: 0; font: 900 clamp(40px, 13vw, 72px)/0.95 var(--display); font-stretch: 125%; text-transform: uppercase; animation: chIn 1.2s cubic-bezier(.2,.7,.1,1) both; }
.ob-mission { margin: 0; font: 300 17px/1.5 var(--ui); color: var(--fg); animation: fadeSoft 1.2s ease .4s both; }
.ob-stats { margin: 0; font: 600 10px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); animation: fadeSoft 1.2s ease .7s both; }
.ob-intro .chip { justify-self: center; }
.ob-convo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.ob-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.ob-line { max-width: 88%; font-size: 16px; line-height: 1.45; white-space: pre-wrap; animation: fadeSoft .5s ease both; }
.ob-line.max { align-self: flex-start; font: 300 19px/1.4 var(--ui); }
.ob-line.max::before { content: "MAX"; display: block; font: 700 8.5px var(--display); font-stretch: 125%; letter-spacing: .32em; color: var(--dim); margin-bottom: 4px; }
.ob-line.you { align-self: flex-end; padding: 10px 14px; border-radius: 16px; background: rgba(var(--ink), .08); border: 1px solid var(--line); }
.ob-input { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: end; }
.ob-mic { --lv: 0; width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; display: grid; place-items: center; box-shadow: 0 0 0 calc(var(--lv) * 14px) rgba(var(--ink), .12); transition: box-shadow .1s; }
.ob-mic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ob-mic.on { background: var(--chrome); color: var(--on-chrome); border-color: transparent; }
.ob-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.ob-form textarea { min-height: 0; height: 48px; resize: none; }
.ob-input.typing { grid-template-columns: 1fr; }
.ob-under { display: flex; justify-content: space-between; align-items: center; min-height: 20px; }
.ob-state { font: 500 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.link-btn { background: none; border: 0; color: var(--dim); font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; padding: 6px 0 6px 14px; }
.ob-line.calibrating { animation: pulseText 1.6s ease-in-out infinite; }
#mission-text { min-height: 0; height: 110px; }

/* Crusade banner, fans, voice messages */
.crew-crusade { margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 0% 0%, rgba(var(--ink), .07), transparent 60%); }
.crew-crusade .cc-name { font: 900 20px/1 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crew-crusade .cc-stats { margin-top: 6px; font: 500 10.5px var(--mono); letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.crew-crusade .cc-you { margin-top: 6px; font-size: 13px; color: var(--dim); }
.crew-compose.voice { grid-template-columns: auto 1fr auto; align-items: center; }
.crew-mic { height: 42px; min-width: 42px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--fg); display: inline-flex; align-items: center; gap: 6px; font: 500 11px var(--mono); }
.crew-mic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.crew-mic.rec { background: var(--chrome); color: var(--on-chrome); border-color: transparent; }
.crew-mic.rec span::before { content: "● "; }
.vmsg { display: flex; align-items: center; gap: 10px; }
.vmsg button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--fg); display: grid; place-items: center; flex: none; }
.vmsg .bars { flex: 1; height: 18px; min-width: 90px; background: repeating-linear-gradient(90deg, rgba(var(--ink), .55) 0 2px, transparent 2px 5px); mask: linear-gradient(90deg, #000 var(--p, 0%), rgba(0,0,0,.35) var(--p, 0%)); -webkit-mask: linear-gradient(90deg, #000 var(--p, 0%), rgba(0,0,0,.35) var(--p, 0%)); border-radius: 3px; }
.vmsg .dur { font: 500 10.5px var(--mono); color: var(--dim); }
.vtext { display: block; margin-top: 6px; color: var(--dim); font-size: 13.5px; font-style: italic; }

/* Developer team */
#dev-notes { min-height: 0; height: 96px; }
.devreq { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.devreq .t { font-size: 14.5px; }
.devreq details summary { cursor: pointer; font: 600 9.5px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); list-style: none; }
.devreq pre { margin: 6px 0 0; white-space: pre-wrap; font: 400 12px/1.5 var(--mono); color: var(--fg); background: rgba(var(--ink), .04); border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-height: 260px; overflow: auto; -webkit-user-select: text; user-select: text; }
.devreq .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.devreq .acts .chip { height: 32px; padding: 0 12px; }
.devreq.done { opacity: .55; }
#people-list .device { flex-wrap: wrap; } #people-list .device .device-info { flex-basis: 100%; }

/* Minimal, voice-first */
.menu-overlay { place-items: end stretch; padding: 0; }
.menu-sheet { width: min(520px, 100%); margin: 0 auto; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--s1); border-top: 1px solid var(--line-strong); display: grid; gap: 2px; animation: sheetUp .28s cubic-bezier(.2,.8,.2,1) both; }
/* Phones: the menu is taller than a small screen. Cap it below the notch and let it scroll on its own. */
.menu-sheet { max-height: calc(100dvh - max(16px, env(safe-area-inset-top)) - 8px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; align-content: start; }
.menu-heading { display: flex; justify-content: flex-end; position: sticky; top: 0; z-index: 1; background: var(--s1); }
.menu-heading .icon-btn { min-width: 44px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .menu-sheet { animation: none; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-row { display: flex; align-items: center; gap: 16px; padding: 15px 14px; background: none; border: 0; border-radius: 14px; color: var(--fg); font: 400 17px var(--ui); text-align: left; width: 100%; }
.menu-row:active { background: rgba(var(--ink), .06); }
.menu-row svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.menu-row span { flex: 1; }
.menu-row b { font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 14px; }
#voice-toggle[aria-pressed="false"] { opacity: 1; }
.voice-row { justify-content: flex-end; }
.voice-row #kbd-btn { margin-right: auto; }
.voice-hint { position: absolute; left: 50%; transform: translateX(-50%); font: 600 9.5px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--faint); pointer-events: none; white-space: nowrap; }
.voice-row { position: relative; }
.caption-text:empty { display: none; }
/* Text only (voice off): his words must show somewhere, so the caption stays on whatever the captions setting. */
body:not(.captions):not(.voice-off) .caption-text { display: none; }

/* Onboarding, voice first: no transcript unless asked */
.ob-convo.talk .ob-log { display: none; }
.ob-convo.talk.show-text .ob-log { display: flex; }
.ob-convo.talk .ob-input { grid-template-columns: 1fr; justify-items: center; margin: auto 0 0; }
.ob-convo.talk .ob-form { display: none; }
.ob-convo.talk .ob-mic { width: 132px; height: 132px; margin: 0 auto; }
.ob-convo.talk .ob-mic svg { width: 40px; height: 40px; }
.ob-convo.talk .ob-hint { text-align: center; }
.ob-convo.talk .ob-chips { justify-content: center; }
.ob-talkstate { display: none; margin: auto 0 0; text-align: center; font: 300 22px/1.35 var(--ui); color: var(--fg); min-height: 3em; }
.ob-convo.talk .ob-talkstate { display: block; }
.ob-convo.talk.show-text .ob-talkstate { display: none; }
.vtoggle { background: none; border: 0; padding: 6px 0 0; color: var(--dim); font: 600 9px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; display: block; }

/* Studio (untitled-inspired, inside Max's black + chrome) */
.studio .drawer-body { padding-bottom: 120px; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; }
.st-card { display: grid; gap: 8px; background: none; border: 0; padding: 0; text-align: left; color: var(--fg); position: relative; }
.st-art { aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--s2); border: 1px solid var(--line); position: relative; display: grid; place-items: center; }
.st-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-art .st-blank { font: 900 28px var(--display); font-stretch: 125%; color: var(--s4); }
.st-art .st-quick { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 12px; background: var(--glass); border: 0; color: var(--fg-strong); display: grid; place-items: center; font-size: 15px; backdrop-filter: blur(6px); }
.st-card .t { font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.st-card .o { font-size: 13px; color: var(--dim); display: flex; gap: 6px; align-items: center; }
.st-section { font: 700 10px var(--display); font-stretch: 125%; letter-spacing: .32em; color: var(--dim); text-transform: uppercase; margin: 28px 0 12px; }
.st-back { margin-bottom: 14px; }
.st-cover { display: grid; place-items: center; aspect-ratio: 1; width: min(78%, 360px); margin: 0 auto 18px; border-radius: 20px; overflow: hidden; background: var(--s2); border: 1px solid var(--line); color: var(--dim); font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; cursor: pointer; box-shadow: var(--shadow); }
.st-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-cover.readonly { cursor: default; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.st-name { margin: 0; font: 800 28px/1.05 var(--display); font-stretch: 105%; text-transform: uppercase; overflow-wrap: anywhere; }
.st-meta { margin: 6px 0 0; color: var(--dim); font-size: 14px; }
.st-play { width: 60px; height: 60px; flex: none; border-radius: 18px; border: 0; background: var(--fg-strong); color: var(--bg); font-size: 22px; display: grid; place-items: center; }
.st-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 18px 0 6px; }
.st-add { display: grid; place-items: center; height: 50px; border-radius: 14px; background: rgba(var(--ink), .06); border: 1px solid var(--line); font-size: 15px; cursor: pointer; }
.st-tracks { display: grid; }
.st-row { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; color: var(--fg); text-align: left; width: 100%; }
.st-row .n { color: var(--dim); font-size: 15px; text-align: center; }
.st-row .tt { font-size: 16px; overflow-wrap: anywhere; }
.st-row .tt small { display: block; color: var(--dim); font-size: 13px; margin-top: 3px; }
.st-row.playing .tt { color: var(--fg-strong); }
.st-row.playing .n::before { content: "▶"; font-size: 11px; }
.st-row.playing .n span { display: none; }
.st-row .cc { font: 500 11px var(--mono); color: var(--dim); }
.st-row .more { background: none; border: 0; color: var(--fg); font-size: 18px; padding: 4px 6px; letter-spacing: 2px; }
.st-up { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.st-up .bar { margin-top: 6px; }
.mini-player { display: grid; grid-template-columns: 44px 1fr auto 40px; align-items: center; gap: 10px; margin: 0 16px 8px; padding: 8px 10px; border-radius: 22px; background: var(--s2); border: 1px solid var(--line-strong); color: var(--fg); text-align: left; }
.mp-cover { width: 44px; height: 44px; border-radius: 50%; background: var(--s4) center/cover; }
.mp-text { min-width: 0; }
.mp-text b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-text small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-wave { width: 110px; height: 28px; }
.mp-toggle { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fg-strong); color: var(--bg); font-size: 13px; }
.player-overlay { place-items: stretch; padding: 0; background: var(--s0); z-index: 30; }
.player { width: min(560px, 100%); margin: 0 auto; height: 100%; overflow-y: auto; padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.player-close { align-self: center; }
.pl-card { border-radius: 26px; background: var(--s3); border: 1px solid var(--line); padding: 22px 18px 18px; display: grid; gap: 14px; text-align: center; }
.pl-title { font: 500 21px var(--ui); text-transform: uppercase; letter-spacing: .01em; }
.pl-sub { color: var(--dim); font-size: 15px; margin-top: -8px; }
.pl-cover { width: min(86%, 380px); aspect-ratio: 1; margin: 6px auto; border-radius: 18px; background: var(--s4) center/cover; box-shadow: var(--shadow); }
.pl-wave { width: 100%; height: 64px; cursor: pointer; touch-action: none; }
.pl-time { font: 500 14px var(--mono); color: var(--fg); }
.pl-controls { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.pl-controls button { background: none; border: 0; color: var(--fg); font-size: 26px; width: 52px; height: 52px; display: grid; place-items: center; }
.pl-controls .pl-main { width: 72px; height: 72px; font-size: 34px; }
.pl-controls .pl-small { font: 500 14px var(--mono); }
.pl-controls .pl-small[aria-pressed="true"] { color: var(--fg-strong); text-shadow: 0 0 10px rgba(var(--ink), .8); }
.pl-tabs { display: flex; gap: 6px; align-items: center; border-radius: 999px; padding: 4px; background: var(--s2); border: 1px solid var(--line); }
.pl-tabs button { flex: 1; background: none; border: 0; border-radius: 999px; padding: 10px 0; color: var(--dim); font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; }
.pl-tabs button[aria-selected="true"] { background: rgba(var(--ink), .1); color: var(--fg); }
.pl-dl { color: var(--dim); font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; padding: 0 10px; text-decoration: none; }
.pl-pane { border-radius: 22px; background: var(--s2); border: 1px solid var(--line); padding: 12px 14px; }
.pl-q { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 9px 0; background: none; border: 0; color: var(--fg); text-align: left; width: 100%; }
.pl-q .c { width: 44px; height: 44px; border-radius: 10px; background: var(--s4) center/cover; }
.pl-q small { display: block; color: var(--dim); font-size: 12.5px; }
.pl-q.on b { color: var(--fg-strong); }
#pl-notes-text { min-height: 220px; background: transparent; border: 0; padding: 0; font: 400 14px/1.6 var(--mono); }
.pl-c { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pl-c .ts { font: 500 11px var(--mono); color: var(--fg); background: rgba(var(--ink), .08); border: 0; border-radius: 6px; padding: 2px 6px; margin-right: 6px; }
.pl-c small { color: var(--dim); margin-left: 6px; }
.share-sheet { gap: 10px; padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
.share-title { font: 800 16px var(--display); font-stretch: 112%; text-transform: uppercase; padding: 4px 6px 6px; }
.menu-row.danger { color: #ff6b6b; }

/* Learning: reflections and Max's own proposals */
.reflect-box { display: grid; gap: 8px; padding: 2px 0 10px; border-bottom: 1px solid var(--line); }
.reflect-box .rf { font-size: 14px; line-height: 1.45; }
.reflect-box .rf small { display: block; font: 500 10.5px var(--mono); color: var(--dim); margin-bottom: 2px; letter-spacing: .06em; }
.devreq.proposed { border-left: 2px solid var(--fg); padding-left: 10px; }

/* Asking once for notifications */
.push-ask { position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; padding: 16px 16px 14px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line-strong); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); animation: sheetUp .3s cubic-bezier(.2,.8,.2,1) both; }
.push-ask p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; }
.push-ask-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.push-ask-row .btn { width: auto; padding: 12px 18px; }

/* Meetings and crew invites */
.crew-pill.live { border-color: var(--fg); }
.crew-pill.live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--error); vertical-align: 1px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.meeting { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.meeting:first-child { border-top: 0; }
.meeting .m-title { font-size: 15px; }
.meeting .m-meta { grid-column: 1; font: 500 11px var(--mono); color: var(--dim); letter-spacing: .04em; }
.meeting .m-act { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.meeting.live .m-title::before { content: "LIVE · "; color: var(--error); font: 700 10px var(--display); letter-spacing: .2em; }
.meeting .m-notes { grid-column: 1 / -1; font-size: 13px; color: var(--dim); white-space: pre-wrap; }
.crew-check { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--dim); }
.crew-check input { width: auto; }
.crew-invite { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.crew-invite small { grid-column: 1; color: var(--dim); font: 500 11px var(--mono); }
.crew-invite .m-act { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; }
.push-ask-row .chip { height: 40px; }
#people-invite-form { margin-bottom: 10px; }

/* Goals engine: today's calls, effort meters, outcome ladders, tonight's lesson */
:root { --on-track: #9aa577; --drifting: #b8a06a; --off-track: #bb5c40; }
.engine { display: grid; gap: 12px; margin-bottom: 14px; }
.engine .sys-head b { font-weight: 500; color: var(--dim); }
.call { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.call:first-of-type { border-top: 0; }
.call .c-label { font-size: 15px; }
.call.answered .c-label { color: var(--dim); text-decoration: line-through; }
.call.deferred .c-label { color: var(--off-track); }
.call .c-act { display: flex; gap: 6px; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; }
.meter .m-name { font-size: 14.5px; }
.meter .m-state { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; }
.meter .m-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter .m-bar i { display: block; height: 100%; border-radius: inherit; }
.meter .m-meta { grid-column: 1 / -1; font: 500 11px var(--mono); color: var(--dim); }
.meter.on .m-state { color: var(--on-track); } .meter.on .m-bar i { background: var(--on-track); }
.meter.drift .m-state { color: var(--drifting); } .meter.drift .m-bar i { background: var(--drifting); }
.meter.off .m-state { color: var(--off-track); } .meter.off .m-bar i { background: var(--off-track); }
.ladder { padding: 8px 0; }
.ladder .l-rungs { display: flex; gap: 4px; margin-top: 6px; }
.ladder .l-rungs span { flex: 1; text-align: center; padding: 4px 0; border-radius: 8px; border: 1px solid var(--line); font: 500 10.5px var(--mono); color: var(--dim); }
.ladder .l-rungs span.hit { border-color: var(--drifting); color: var(--fg); }
.lesson .l-title { font-size: 15px; margin: 2px 0 4px; }
.lesson .l-drill { font-size: 13.5px; color: var(--dim); line-height: 1.5; }
.lesson .l-act { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.links-list { display: grid; gap: 6px; max-height: 46dvh; overflow-y: auto; margin-bottom: 10px; }
.links-list a { color: var(--fg); text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.call .c-act .chip { height: 32px; padding: 0 12px; font-size: 9.5px; }
.call { padding: 6px 0; }

/* Lifeline */
.lifeline { margin: 0 0 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); }
.lifeline-btn { width: 100%; padding: 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; color: var(--fg); font: 700 12px var(--display); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; }
.lifeline-btn:active { background: rgba(var(--ink), .08); }
.lifeline .hint { margin: 8px 0 0; }
.lifeline summary { cursor: pointer; list-style: none; }
.lifeline-who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* Producer Year */
.program .p-quarter { font-size: 15px; margin-bottom: 2px; }
.program .p-focus { font-size: 13.5px; color: var(--dim); line-height: 1.45; }
.program .p-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.program .p-links a { text-decoration: none; }
.program .p-next { font: 500 11.5px var(--mono); color: var(--dim); margin: 6px 0; }
.program .p-ritual { display: grid; gap: 4px; margin-top: 6px; }
.program .p-ritual label { display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.program .p-ritual input { width: auto; }
a.chip { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 14px; text-decoration: none; color: var(--fg); line-height: 1; }

/* Voices and the journey */
.voices-list { display: grid; gap: 10px; }
.voice-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: center; }
.voice-row b { font: 700 11px var(--display); font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; }
.voice-row select { padding: 10px 12px; font-size: 14px; }
.journey .j-phase { font-size: 15px; margin: 2px 0 6px; }
.journey .j-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 10px; }
.journey .j-steps span { height: 3px; border-radius: 3px; background: var(--line); }
.journey .j-steps span.on { background: var(--fg); }
.journey .j-areas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.journey .j-areas span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font: 500 11px var(--mono); color: var(--dim); }
.journey .j-areas span.known { color: var(--fg); border-color: var(--line-strong); }
.journey details { margin-top: 8px; }
.journey pre { white-space: pre-wrap; font: 400 13px/1.5 var(--ui); color: var(--dim); }

/* Round Table mode: a faint ultraviolet ring around the orb while it's on */
body.round-table .orb-btn { filter: drop-shadow(0 0 22px rgba(123, 92, 255, .28)); }
.replay-btn { margin: -2px auto 0; height: 30px; padding: 0 14px; font-size: 9.5px; }

/* Continue card and memory review */
.continue-card { display: flex; align-items: stretch; gap: 6px; width: min(420px, calc(100% - 32px)); margin: 0 auto 8px; }
.continue-go { flex: 1; text-align: left; background: none; border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; display: grid; gap: 2px; color: var(--fg); }
.continue-go small { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.continue-go span { font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.continue-go em { font: normal 500 11px var(--mono); color: var(--dim); }
.continue-x { width: 40px; border-radius: 16px; border: 1px solid var(--line); background: none; color: var(--dim); }
.memory-items { display: grid; gap: 8px; margin-bottom: 10px; max-height: 40dvh; overflow-y: auto; }
.memory-items label { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.memory-items input[type=checkbox] { width: auto; margin-top: 12px; }
.memory-items textarea { min-height: 0; font-size: 14px; padding: 9px 11px; }
#memory-body li .mem-edit { margin-left: 6px; }
.mem-mode { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.j-learned { display: grid; gap: 6px; margin-top: 8px; }
.j-insight { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px; align-items: center; font-size: 13.5px; }
.j-insight em { font: normal 500 10px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.j-insight .chip { height: 28px; padding: 0 10px; font-size: 9px; }

/* Conversations: sessions, saved responses, message actions */
.menu-label { padding: 6px 16px 2px; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
.session-chip { margin: -4px auto 0; background: none; border: 0; padding: 2px 10px; font: 500 11px var(--mono); letter-spacing: .08em; color: var(--dim); max-width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-chip::before { content: "Session · "; color: var(--faint); }
.drawer-head #chat-back { margin-right: 6px; }
.chats-head-right { display: flex; gap: 6px; }
.chats-home { display: grid; gap: 12px; align-content: start; }
.chats-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.chat-list { display: grid; gap: 4px; }
.chat-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-radius: 14px; background: none; border: 0; color: var(--fg); text-align: left; width: 100%; }
.chat-row:active { background: rgba(var(--ink), .06); }
.chat-row .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(var(--ink), .06); border: 1px solid var(--line); }
.chat-row.active .ic { border-color: var(--line-strong); background: rgba(var(--ink), .12); }
.chat-row .t { font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chat-row .d { font: 500 11.5px var(--mono); color: var(--dim); margin-top: 2px; }
.chat-row .pin { background: none; border: 0; color: var(--faint); padding: 8px; font-size: 15px; }
.chat-row .pin.on { color: var(--fg); }
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-bar { display: flex; gap: 6px; align-items: center; padding: 0 18px 8px; }
.chat-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: var(--fg); font: 600 15px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 0; }
.chat-name::after { content: " ✎"; color: var(--faint); font-size: 12px; }
.msg .acts { display: flex; gap: 6px; margin-top: 6px; }
.msg .acts button { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font: 600 10px var(--display); font-stretch: 125%; letter-spacing: .16em; padding: 5px 10px; text-transform: uppercase; }
.msg .acts button.on { color: var(--fg); border-color: var(--line-strong); }
.saved-row { padding: 12px 4px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.saved-row .meta { font: 500 11px var(--mono); color: var(--dim); }
.saved-row .txt { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.saved-row.open .txt { -webkit-line-clamp: unset; display: block; }
.saved-row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
#log-panel .drawer-head h2 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#log-panel .drawer-head { gap: 8px; }
.chat-row .pin { opacity: .35; }
.chat-row .pin.on { opacity: 1; }
.chat-row .pin.on svg path:first-child { fill: currentColor; }

/* Money */
.money-hero { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(var(--ink), .04); }
.money-hero .k { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.money-hero .big { font: 800 30px/1.05 var(--display); font-stretch: 110%; }
.money-hero .msub { font-size: 13.5px; color: var(--dim); line-height: 1.45; }
.stage-track { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 6px; }
.stage-track span { height: 6px; border-radius: 3px; background: rgba(var(--ink), .1); }
.stage-track span.on { background: var(--fg); }
.stage-track span.now { background: var(--fg); box-shadow: 0 0 0 2px rgba(var(--ink), .18); }
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.money-stat { padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.money-stat b { display: block; font: 700 18px var(--ui); }
.money-stat small { color: var(--dim); font-size: 12px; }
.money-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.money-row .amt { font: 600 14px var(--mono); }
.money-row .x { background: none; border: 0; color: var(--faint); font-size: 16px; padding: 4px 6px; }
.money-row small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.goal-card { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.goal-card .head { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.goal-card .bar { height: 6px; border-radius: 3px; background: rgba(var(--ink), .1); overflow: hidden; }
.goal-card .bar i { display: block; height: 100%; background: var(--fg); }
.goal-card .meta { font: 500 12px var(--mono); color: var(--dim); }
.goal-card ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--dim); }
.plan-step { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-bottom: 0; color: var(--fg); text-align: left; font-size: 14.5px; width: 100%; }
.plan-step .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; }
.plan-step.done { color: var(--dim); text-decoration: line-through; }
.money-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.money-add { display: grid; grid-template-columns: 1fr 110px auto; gap: 8px; }
.money-add select { grid-column: 1 / 4; }
.money-note { font-size: 12px; color: var(--faint); line-height: 1.5; }

/* The next unlock (Quests) */
.unlock { border: 1px solid var(--line-strong); border-radius: 18px; padding: 16px; display: grid; gap: 10px; margin-bottom: 10px; background: rgba(var(--ink), .03); }
.unlock .k { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.unlock .lev { font: 700 18px/1.3 var(--ui); }
.unlock p { margin: 0; font-size: 14px; line-height: 1.5; }
.unlock .gap { color: var(--dim); }
.unlock .routes { display: grid; gap: 8px; }
.unlock .route { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; }
.unlock .route.rec { border-color: var(--line-strong); }
.unlock .route .ln { display: block; color: var(--dim); margin-top: 3px; }
.unlock .route b { display: block; font-size: 14px; margin-bottom: 2px; }
.unlock .route .rec-tag { font: 700 9px var(--display); letter-spacing: .2em; text-transform: uppercase; margin-left: 6px; color: var(--dim); }
.unlock ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.5; }
.lev-tag { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--dim); white-space: nowrap; }
.lev-tag.high { color: var(--fg); border-color: var(--line-strong); }

/* Presentation stage (maxdemo, onboarding beats, the Read) */
.pres { position: fixed; inset: 0; z-index: 60; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 14px) 22px calc(env(safe-area-inset-bottom) + 18px); overflow: hidden; }
.show-glow { position: absolute; inset: -20% -20% auto; height: 70%; background: radial-gradient(closest-side, rgba(var(--ink), .09), transparent 70%); pointer-events: none; animation: showGlow 9s ease-in-out infinite alternate; }
@keyframes showGlow { from { transform: translateY(-4%) scale(1); } to { transform: translateY(6%) scale(1.15); } }
.show-top { display: flex; align-items: center; gap: 12px; position: relative; }
.show-top .ob-step { margin-left: auto; }
.show-slide { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; position: relative; max-width: 560px; width: 100%; margin: 0 auto; min-height: 0; overflow-y: auto; }
.show-slide.enter > * { animation: showIn .7s cubic-bezier(.2, .7, .2, 1) both; }
.show-slide.enter > *:nth-child(2) { animation-delay: .08s; }
.show-slide.enter > *:nth-child(3) { animation-delay: .16s; }
.show-slide.enter > *:nth-child(4) { animation-delay: .24s; }
.show-slide.enter > *:nth-child(5) { animation-delay: .32s; }
@keyframes showIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.show-kicker { margin: 0; font: 700 10px var(--display); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.show-title { margin: 0; font: 900 clamp(28px, 8vw, 44px)/1.04 var(--display); font-stretch: 112%; text-transform: none; letter-spacing: -.01em; }
.show-big { overflow-wrap: anywhere; font: 900 clamp(38px, 12.5vw, 84px)/1 var(--display); font-stretch: 110%; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.show-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.show-lines li { font-size: 16.5px; line-height: 1.45; padding-left: 18px; position: relative; color: var(--fg); }
.show-lines li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); opacity: .5; }
.show-try { display: grid; gap: 8px; }
.show-try small { font: 700 9px var(--display); letter-spacing: .26em; text-transform: uppercase; color: var(--faint); }
.show-try #show-try-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.show-try .chip { text-transform: none; letter-spacing: .01em; font: 500 13px var(--ui); }
.show-bottom { display: grid; gap: 12px; position: relative; max-width: 560px; width: 100%; margin: 0 auto; }
.show-dots { display: flex; gap: 5px; justify-content: center; }
.show-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(var(--ink), .18); transition: width .3s, background .3s; }
.show-dots i.on { width: 20px; background: var(--fg); }
.show-ctrl { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; }
.show-nextbtn { height: 46px; }
.read-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.read-actions .btn { flex: 1; min-width: 140px; }
.read #read-answer { width: 100%; font: 16px/1.5 var(--ui); border-radius: 16px; padding: 14px; border: 1px solid var(--line); background: rgba(var(--ink), .04); color: var(--fg); resize: vertical; }
.read-question { font-size: clamp(24px, 6.6vw, 34px); }
.read-work { align-items: center; text-align: center; }
.read-pulse { display: flex; gap: 10px; }
.read-pulse i { width: 14px; height: 14px; border-radius: 50%; background: var(--fg); animation: readPulse 1.2s ease-in-out infinite; }
.read-pulse i:nth-child(2) { animation-delay: .2s; }
.read-pulse i:nth-child(3) { animation-delay: .4s; }
@keyframes readPulse { 0%, 100% { opacity: .2; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.read-summary { margin: 0; font-size: 15px; line-height: 1.55; color: var(--dim); }
/* Abundance: bottom line and Max's power */
.bl-card { padding: 16px; border-radius: 18px; border: 1px solid var(--line-strong); display: grid; gap: 8px; }
.bl-card .k { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.bl-card .big { font: 800 24px/1.1 var(--display); font-stretch: 110%; }
.bl-card .bar { position: relative; height: 8px; border-radius: 4px; background: rgba(var(--ink), .1); overflow: visible; }
.bl-card .bar i { display: block; height: 100%; border-radius: 4px; background: var(--fg); }
.bl-card .bar b { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--dim); }
.bl-card .blsub { font-size: 13px; color: var(--dim); line-height: 1.45; }
.power-card { padding: 14px 16px; border-radius: 18px; border: 1px dashed var(--line-strong); display: grid; gap: 6px; font-size: 13.5px; line-height: 1.45; }
.power-card .k { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.power-card b { font-size: 16px; }

/* Onboarding: the same orb as home, drifting through peaceful hues */
.ob-orb { background: none; border: 0; padding: 0; border-radius: 50%; width: min(58vw, 30dvh, 270px); aspect-ratio: 1; margin: 0 auto; flex: none; }
.ob-orb canvas { width: 100%; height: 100%; display: block; }
.ob-caption { margin: 0 auto; max-width: 30em; min-height: 2.8em; text-align: center; font: 300 19px/1.42 var(--ui); color: var(--fg); animation: fadeSoft .5s ease both; }
.ob-caption small { display: block; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
#onboard .ob-intro { margin: 0; gap: 8px; }
#onboard .ob-movement { font-size: clamp(28px, 9vw, 46px); }
#onboard .ob-mission { font-size: 15px; }
.ob-convo .ob-log { display: none; }
.ob-convo.show-text .ob-log { display: flex; }
.ob-convo.talk .ob-mic { display: none; }
.ob-convo .ob-talkstate { display: block; margin: 0; min-height: 1.4em; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ob-convo.talk .ob-talkstate { margin: 0; }
.ob-convo.talk .ob-input { margin: 0; }

/* Doc cards */
.doc-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 14px; margin: 6px 0; }
.doc-card .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--ink), .07); font: 800 9px var(--display); letter-spacing: .1em; }
.doc-card .t { font-size: 14.5px; line-height: 1.3; }
.doc-card small { display: block; color: var(--dim); font: 500 11px var(--mono); margin-top: 2px; }
/* Crew: who's on what right now, one project with many hands */
.crew-now { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.crew-now .k { font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.crew-now .row { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; font-size: 14px; line-height: 1.35; }
.crew-now .row i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 9px var(--display); font-style: normal; background: var(--s2); border: 1px solid var(--line-strong); }
.crew-now .row i.on { background: var(--chrome); color: var(--on-chrome); border-color: transparent; }
.crew-now .row small { display: block; color: var(--dim); font: 500 11px var(--mono); }
.crew-now form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.streams { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.streams span { font: 600 11px var(--ui); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); }
.streams span.mine { background: var(--chrome); color: var(--on-chrome); border-color: transparent; }
.activity { display: grid; gap: 4px; margin: 6px 0; font-size: 12.5px; color: var(--dim); line-height: 1.4; }
.activity b { color: var(--fg); font-weight: 600; }

.doc-card { grid-template-columns: 40px 1fr; }
.doc-card .doc-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.doc-card .doc-acts .chip { height: 32px; padding: 0 12px; }

/* Home mode: you and your partner */
.home-card { width: min(420px, calc(100% - 32px)); margin: 0 auto 8px; border-radius: 18px; padding: 12px 14px; border: 1px solid rgba(214, 160, 130, .55); background: linear-gradient(135deg, rgba(232, 180, 150, .14), rgba(232, 180, 150, .04)); display: grid; gap: 6px; text-align: left; }
.home-card .k { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .26em; text-transform: uppercase; color: #b07a5e; }
.home-card .line { font-size: 14px; line-height: 1.4; }
.home-card .line small { color: var(--dim); font: 500 11px var(--mono); margin-left: 4px; }
.home-card .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.home-card .acts .chip { height: 30px; padding: 0 12px; }

/* Home screen words appear and leave softly */
.status { transition: opacity .9s ease; }
.status.in { animation: fadeSoft .6s ease both; }
.status.fade { opacity: 0; }
.caption-text { transition: opacity 1.2s ease; }
.caption-text.fade { opacity: 0; }
#replay-btn { transition: opacity .8s ease; }
#replay-btn.fade { opacity: 0; pointer-events: none; }
.home-card .love { font-size: 15px; color: #b0644a; }

/* Captions: small, quiet, typed out */
.caption-text { font: 300 15px/1.4 var(--ui); -webkit-line-clamp: 2; color: var(--dim); max-width: 26em; margin: 0 auto; }
@media (max-height: 700px) { .caption-text { font-size: 14px; } }

.show-deeper { position: absolute; left: 22px; bottom: calc(env(safe-area-inset-bottom) + 92px); width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 50% 50%, #000 0 54%, transparent 55%), conic-gradient(from 30deg, #fff, #8a8a8a, #2a2a2a, #d8d8d8, #fff, #6d6d6d, #1c1c1c, #bdbdbd, #fff); box-shadow: 0 0 18px rgba(var(--ink), .25); animation: deeperPulse 2.8s ease-in-out infinite; z-index: 2; }
.show-deeper::after { content: "Go deeper"; position: absolute; left: 56px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
@keyframes deeperPulse { 0%, 100% { box-shadow: 0 0 10px rgba(var(--ink), .18); } 50% { box-shadow: 0 0 24px rgba(var(--ink), .38); } }

.asg-row { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line, rgba(127,127,127,.2)); }
.asg-row .chip { justify-self: start; }

/* ---------- Pages: a section's areas side by side (swipe or tap the rail) ---------- */
:root { --code: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; --sys: 205, 228, 255; }
:root[data-theme="light"] { --sys: 0, 0, 0; }
.drawer > .pager { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pager-rail { display: flex; gap: 22px; padding: 2px 18px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.pager-rail::-webkit-scrollbar { display: none; }
.pager-rail button { flex: none; position: relative; background: none; border: 0; padding: 10px 0 12px; color: var(--faint); font: 700 9.5px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; transition: color .25s ease; }
.pager-rail button i { font: 400 9px var(--code); font-style: normal; letter-spacing: 0; margin-right: 7px; opacity: .65; }
.pager-rail button[aria-selected="true"] { color: var(--fg); }
.pager-rail button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.pager-rail button[aria-selected="true"]::after { transform: scaleX(1); }
.pager-rail b { margin-left: 6px; font: 500 9px var(--code); color: var(--fg); }
.pager-rail b:empty { display: none; }
.pager-track { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.pager-track::-webkit-scrollbar { display: none; }
.page { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; overflow-y: auto; overscroll-behavior-y: contain; padding: 12px 18px calc(env(safe-area-inset-bottom) + 32px); display: flex; flex-direction: column; gap: 12px; }
.page[hidden] { display: none; }
.page-tag { display: flex; justify-content: space-between; font: 400 10px var(--code); letter-spacing: .06em; color: var(--faint); text-transform: uppercase; padding-bottom: 2px; }
.page-body { display: grid; gap: 12px; align-content: start; }
.page-body > h3:first-child { margin-top: 4px !important; }
.page .engine { margin-bottom: 0; }
.page > .empty-hint, .page-body > .empty-hint { padding: 28px 0; text-align: center; color: var(--faint); }

/* ---------- Quests: the System (Solo Leveling), told in our monochrome ---------- */
.system .sys-window { background: linear-gradient(180deg, rgba(var(--sys), .05), rgba(var(--sys), .012)); box-shadow: 0 0 0 1px rgba(var(--sys), .05) inset, 0 0 32px -14px rgba(var(--sys), .35); }
.system .sys-head > span:first-child::before { content: "[ "; color: var(--faint); }
.system .sys-head > span:first-child::after { content: " ]"; color: var(--faint); }
.system .sys-head b, .system .sys-head > span + span { font: 400 10px var(--code); letter-spacing: .02em; text-transform: none; color: var(--dim); }
.system .page-body h3 { border-top: 1px solid var(--line); padding-top: 14px; }
.system .page-body h3:first-child { border-top: 0; padding-top: 0; }
.system .daily-foot { font: 400 10.5px var(--code); color: var(--dim); }

.quest-hero { display: grid; justify-items: center; gap: 10px; padding: 6px 0 4px; }
.qh-orbit { position: relative; width: min(74vw, 280px); aspect-ratio: 1; display: grid; place-items: center; }
.qh-orbit::before { content: ""; position: absolute; inset: -2%; border-radius: 50%; border: 1px dashed var(--line); }
.qh-ring { width: 72%; height: 72%; transform: rotate(-90deg); overflow: visible; }
.qh-track { fill: none; stroke: var(--line); stroke-width: 2; }
.qh-fill { fill: none; stroke: var(--fg); stroke-width: 2.4; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(var(--sys), .45)); }
.qh-tick { stroke: var(--faint); stroke-width: .8; }
.qh-core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; }
.qh-core b { font: 300 44px/1 var(--ui); letter-spacing: -.02em; }
.qh-core small, .qh-sat small { font: 700 8.5px var(--display); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); }
.qh-sat { position: absolute; top: 9%; width: 64px; height: 64px; border-radius: 50%; display: grid; place-content: center; gap: 1px; text-align: center; color: var(--fg); background: radial-gradient(circle at 35% 30%, rgba(var(--ink), .14), rgba(var(--ink), .02) 60%); border: 1px solid var(--line-strong); padding: 0; }
.qh-sat.left { left: -2%; }
.qh-sat.right { right: -2%; }
.qh-sat b { font: 500 13px var(--code); }
.qh-sat small { letter-spacing: .2em; font-size: 7px; }
.qh-line { width: 100%; display: flex; justify-content: space-between; font: 400 10.5px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .04em; }
.quest-hero.cleared .qh-fill { stroke: var(--ok); }
.quest-hero.cleared .qh-state { color: var(--ok); }

/* ---------- Crew: the squad in orbit, chat pages that fill the screen ---------- */
.orbit { position: relative; width: min(84vw, 340px); aspect-ratio: 1; margin: 0 auto; flex: none; }
.orbit[hidden] { display: none; }
.orbit-ring { position: absolute; inset: 9%; border-radius: 50%; border: 1px dashed var(--line-strong); animation: spin 120s linear infinite; }
.orbit-core { position: absolute; left: 50%; top: 50%; width: 44%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 0; background: none; padding: 0; color: var(--fg); display: grid; place-content: center; text-align: center; gap: 2px; }
.orbit-core .sphere { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 26%, #fff 0%, #d9d9d9 12%, #6b6b6b 38%, #1a1a1a 62%, #000 74%), #000; box-shadow: inset 0 -10px 24px rgba(255,255,255,.12), 0 18px 40px rgba(0,0,0,.6); animation: breathe 6s ease-in-out infinite; }
.orbit-core b, .orbit-core small { position: relative; text-shadow: 0 1px 8px rgba(0,0,0,.9); }
.orbit-core b { font: 900 13px var(--display); font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; color: #fff; }
.orbit-core small { font: 400 9.5px var(--code); color: rgba(255,255,255,.75); }
.orbit-sat { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); background: none; border: 0; padding: 0; display: grid; justify-items: center; gap: 3px; color: var(--fg); width: 96px; animation: bob 5s ease-in-out infinite; animation-delay: var(--d); }
.orbit-sat .dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--display); font-stretch: 125%; background: var(--s2); border: 1px solid var(--line-strong); color: var(--dim); transition: transform .2s ease; }
.orbit-sat.on .dot { color: var(--fg); border-color: hsla(var(--h), 70%, 78%, .9); box-shadow: 0 0 0 4px hsla(var(--h), 70%, 70%, .10), 0 0 22px hsla(var(--h), 80%, 70%, .45); }
.orbit-sat.me .dot { background: var(--chrome); color: var(--on-chrome); border-color: transparent; }
.orbit-sat:active .dot { transform: scale(.92); }
.orbit-sat b { font: 600 11.5px var(--ui); }
.orbit-sat small { font: 400 9.5px var(--code); color: var(--dim); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.025; } }
@keyframes spin { to { rotate: 360deg; } }
.chat-page { padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
.chat-page .crew-thread { flex: 1; max-height: none; min-height: 0; }
.chat-page #crew-dm-view:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.chat-page .crew-compose { flex: none; }
.crew .pager-rail button[aria-selected="true"] { color: var(--fg); }
details.fold > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary > span:first-child::after { content: "  +"; color: var(--faint); }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold[open] > summary > span:first-child::after { content: "  −"; }
@media (prefers-reduced-motion: reduce) { .orbit-ring, .orbit-sat, .orbit-core .sphere { animation: none; } .pager-rail button::after, .qh-fill { transition: none; } }
#crew-panel .crew-members { display: none; } /* the squad orbit shows everyone */
.crew-row { flex-wrap: wrap; }
.crew-row .btn { min-width: 96px; }
.pager-rail { gap: 16px; justify-content: space-between; }
.pager-rail button { letter-spacing: .17em; font-size: 9px; }
.orbit-core .sphere { background: radial-gradient(circle at 30% 22%, #fff 0%, #cfcfcf 9%, #5e5e5e 28%, #161616 52%, #000 70%), #000; }

/* Home nudges: only the active one is on screen; it eases in and dissolves out. */
.stage .nudge:not(.nudge-on) { display: none !important; }
.stage .nudge.nudge-on { animation: nudge-in .7s cubic-bezier(.2,.8,.2,1) both; }
.stage .nudge.nudge-out { animation: nudge-out .65s ease forwards; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes nudge-out { to { opacity: 0; transform: translateY(-4px); filter: blur(8px); } }
.nudge-dots { display: flex; gap: 5px; padding: 8px 10px; background: none; border: 0; opacity: .7; }
.nudge-dots[hidden] { display: none; }
.nudge-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
@media (prefers-reduced-motion: reduce) { .stage .nudge.nudge-on, .stage .nudge.nudge-out { animation-duration: .01s; } }
.pager-rail { gap: 12px; }
.pager-rail button { letter-spacing: .13em; font-size: 8.5px; }
.pager-rail button i { margin-right: 5px; }
/* When the home stage holds more than fits, it never rides up under the header. */
.stage { justify-content: safe center; overflow: hidden; }
/* The active nudge floats just above the Next line, so nothing else on the stage moves. */
.stage { position: relative; }
.stage .nudge.nudge-on { position: absolute; left: 0; right: 0; bottom: 62px; z-index: 2; margin: 0 auto; }
.stage .continue-card.nudge-on .continue-go, .stage .continue-card.nudge-on .continue-x { background: var(--bg); }
.stage .home-card.nudge-on { width: min(420px, calc(100% - 36px)); background: var(--bg); }
.stage:has(.nudge-on) #replay-btn { visibility: hidden; }

/* Circadian theme: a slow cross-fade when the day turns (or the person switches). */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after { transition: background-color 2.2s ease, color 2.2s ease, border-color 2.2s ease, box-shadow 2.2s ease, fill 2.2s ease, stroke 2.2s ease !important; }

/* ---------- CELESTIAL UI · environment (public/environment.js) ---------- */
#sky, #sky-fade { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#sky-fade { opacity: 0; }
.void { z-index: 0; }

/* ---------- CELESTIAL UI · motion tokens ---------- */
:root {
  --ease-out: cubic-bezier(.2, .8, .2, 1);   /* things arriving */
  --ease-in: cubic-bezier(.4, 0, .8, .4);    /* things leaving */
  --t-quick: 180ms; --t-base: 320ms; --t-slow: 600ms; --t-env: 2400ms;
  /* springs (stiffness 170, damping 26) are in public/spatial.js for anything the finger moves */
}

/* ---------- CELESTIAL UI · spaces ---------- */
#app { will-change: transform, opacity; transform-origin: 50% 40%; }
.stage { touch-action: none; }
html, body { overscroll-behavior: none; }
#crew-panel.spatial { top: 0; bottom: 0; left: 0; right: 0; height: auto; max-width: none; border-radius: 0; animation: none; box-shadow: none; z-index: 12; transform: translate3d(100%,0,0); will-change: transform; background: linear-gradient(180deg, rgba(0,0,0,.5), rgba(0,0,0,.28) 40%, rgba(0,0,0,.6)); padding-top: env(safe-area-inset-top); }
:root[data-theme="light"] #crew-panel.spatial { background: linear-gradient(180deg, rgba(247,246,243,.72), rgba(247,246,243,.5) 40%, rgba(247,246,243,.8)); }
#crew-panel.spatial > .pager, #crew-panel.spatial .drawer-head { max-width: 680px; width: 100%; margin: 0 auto; }
#crew-panel.spatial .drawer-head { padding-top: 14px; }

.nav-layer { position: fixed; inset: 0; z-index: 15; display: grid; grid-template-rows: auto 1fr auto auto; gap: 18px; padding: calc(env(safe-area-inset-top) + 22px) 22px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,.7) 70%, rgba(0,0,0,.35)); will-change: transform, opacity; }
:root[data-theme="light"] .nav-layer { background: linear-gradient(180deg, rgba(247,246,243,.95), rgba(247,246,243,.78) 70%, rgba(247,246,243,.4)); }
.nav-layer[hidden] { display: none; }
.nav-tag { display: flex; justify-content: space-between; font: 400 10px var(--code); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav-primary { display: flex; justify-content: center; align-items: center; gap: min(10vw, 56px); }
.nav-body { display: grid; justify-items: center; gap: 8px; background: none; border: 0; color: var(--fg); padding: 0; }
.nav-body[hidden] { display: none; }
.nav-sphere { width: min(30vw, 128px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.95), rgba(210,210,210,.75) 10%, rgba(95,95,95,.6) 32%, rgba(20,20,20,.95) 60%, #000 74%); box-shadow: inset 0 -10px 24px rgba(255,255,255,.1), 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px rgba(0,0,0,.6); transition: transform var(--t-quick) var(--ease-out); }
.nav-sphere svg { width: 30%; height: 30%; fill: none; stroke: #fff; stroke-width: 1.4; opacity: .9; }
.nav-body:active .nav-sphere { transform: scale(.94); }
.nav-body b { font: 700 11px var(--display); font-stretch: 125%; letter-spacing: .3em; text-transform: uppercase; }
.nav-body small { font: 400 10px var(--code); color: var(--dim); }
.nav-orbit { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.nav-orbit button { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 11px 14px; }
.nav-grip { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.spatial-hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 64px); text-align: center; font: 400 10px var(--code); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); pointer-events: none; animation: nudge-in var(--t-slow) var(--ease-out) both; transition: opacity var(--t-slow) ease; }
.spatial-hint.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #app { will-change: auto; } }

/* ---------- CELESTIAL UI · the Crusade solar system (public/orbit.js) ---------- */
.orbit.system-view { width: min(92vw, 400px); aspect-ratio: 1; touch-action: manipulation; }
.orbit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-core-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40%; aspect-ratio: 1; border-radius: 50%; background: none; border: 0; padding: 0; display: grid; place-content: center; gap: 3px; text-align: center; z-index: 6; }
.orbit-core-label b { font: 900 12px var(--display); font-stretch: 125%; letter-spacing: .2em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 10px rgba(0,0,0,.95), 0 0 2px rgba(0,0,0,.8); }
.orbit-core-label small { font: 400 9.5px var(--code); color: rgba(255,255,255,.78); text-shadow: 0 1px 8px rgba(0,0,0,.95); }
.orbit-body { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 2px; width: 100px; background: none; border: 0; padding: 0; color: var(--fg); will-change: transform, opacity; transition: opacity var(--t-base) ease; }
.ob-hit { width: var(--hit, 44px); height: var(--hit, 44px); border-radius: 50%; display: grid; place-items: center; }
.ob-hit i { font: 700 9px var(--display); font-style: normal; font-stretch: 125%; color: rgba(255,255,255,.85); text-shadow: 0 1px 6px rgba(0,0,0,.9); }
.orbit-body.me .ob-hit i { color: #111; text-shadow: none; }
.orbit-body b { font: 600 11.5px var(--ui); text-shadow: 0 1px 8px var(--bg); }
.orbit-body small { font: 400 9.5px var(--code); color: var(--dim); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 8px var(--bg); }
.orbit-body:not(.on):not(.me) b { color: var(--dim); }
.orbit-body:focus-visible .ob-hit { outline: 1px solid var(--fg); outline-offset: 3px; }

.member-card { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); z-index: 20; max-width: 520px; margin: 0 auto; padding: 16px 16px 14px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px var(--shadow-c); display: grid; gap: 10px; animation: nudge-in var(--t-base) var(--ease-out) both; }
.mc-top { display: flex; align-items: center; gap: 12px; }
.mc-body { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--display); font-stretch: 125%; color: rgba(255,255,255,.9); background: radial-gradient(circle at 32% 28%, hsl(var(--h) 30% 88%), hsl(var(--h) 22% 45%) 30%, hsl(var(--h) 28% 12%) 75%, #000); }
.mc-body.on { box-shadow: 0 0 0 3px hsla(var(--h), 70%, 72%, .14), 0 0 22px hsla(var(--h), 80%, 70%, .45); }
.mc-body.me { background: var(--chrome); color: var(--on-chrome); }
.mc-id { flex: 1; display: grid; }
.mc-id b { font: 600 16px var(--ui); }
.mc-id small { font: 400 10px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.mc-x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--dim); }
.mc-now { margin: 0; font-size: 14px; line-height: 1.4; }
.mc-acts { display: grid; gap: 4px; font: 400 11px var(--code); color: var(--dim); }
.mc-acts:empty { display: none; }
.mc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mc-actions .btn { width: auto; flex: 1; }

/* ---------- ETHR · DMT's music space (public/ethr.js) ---------- */
.ethr-space, .ethr-player { position: fixed; inset: 0; z-index: 14; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); overflow: hidden; -webkit-user-select: text; user-select: text; }
.ethr-space { opacity: 0; transform: scale(.975); transition: opacity var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-out); }
.ethr-space.open { opacity: 1; transform: none; }
.ethr-space.leaving { opacity: 0; transform: scale(.985); transition-duration: var(--t-base); }
.ethr-atmos { position: absolute; inset: -20%; background: center / cover no-repeat; filter: blur(70px) saturate(1.1); opacity: .32; pointer-events: none; transition: background-image var(--t-slow) ease, opacity var(--t-slow) ease; }
:root[data-theme="light"] .ethr-atmos { opacity: .22; }
.ethr-atmos::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0%, var(--bg) 62%); }
.ethr-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 18px 8px; max-width: 760px; width: 100%; margin: 0 auto; }
.ethr-mark { flex: 1; display: flex; align-items: baseline; gap: 8px; }
.ethr-mark b { font: 900 15px var(--display); font-stretch: 125%; letter-spacing: .42em; }
.ethr-mark small { font: 400 10px var(--code); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.ethr-top-r { display: flex; gap: 8px; align-items: center; }
.ethr-view { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 18px calc(env(safe-area-inset-bottom) + 120px); max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.ethr-view.in > * { animation: nudge-in var(--t-slow) var(--ease-out) both; }
.ethr-view.in > *:nth-child(2) { animation-delay: 60ms; } .ethr-view.in > *:nth-child(3) { animation-delay: 120ms; } .ethr-view.in > *:nth-child(n+4) { animation-delay: 180ms; }
.ethr-hero, .ethr-release { display: grid; gap: 18px; }
.ethr-art { width: 100%; aspect-ratio: 1; background: var(--s2) center / cover no-repeat; border-radius: 4px; box-shadow: 0 40px 80px -30px var(--shadow-c); cursor: pointer; }
.ethr-art.blank, .ethr-cover.blank { background: radial-gradient(circle at 30% 25%, rgba(var(--ink), .14), rgba(var(--ink), .03) 60%); }
.ethr-hero-meta { display: grid; gap: 6px; }
.ethr-kicker { margin: 0; font: 400 10px var(--code); letter-spacing: .1em; color: var(--dim); }
.ethr-title { margin: 0; font: 900 clamp(32px, 9vw, 58px)/.95 var(--display); font-stretch: 125%; letter-spacing: -.01em; text-transform: uppercase; }
.ethr-title.sm { font-size: clamp(24px, 6vw, 34px); }
.ethr-sub { margin: 0; font: 500 16px var(--ui); color: var(--fg); }
.ethr-meta { margin: 0; font: 400 11px var(--code); color: var(--dim); letter-spacing: .04em; text-transform: uppercase; }
.ethr-meta.warn { color: var(--error); }
.ethr-count { margin: 4px 0; font: 300 28px var(--code); letter-spacing: .04em; }
.ethr-count.sm { font-size: 12px; margin: 0; color: var(--dim); }
.ethr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ethr-actions .btn { width: auto; padding: 0 26px; }
.ethr-play { min-width: 120px; }
.ethr-desc { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg); max-width: 60ch; }
.ethr-h { margin: 0 0 10px; font: 700 10px var(--display); font-stretch: 125%; letter-spacing: .32em; text-transform: uppercase; color: var(--dim); }
.ethr-shelf { display: grid; gap: 2px; }
.ethr-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.ethr-row::-webkit-scrollbar { display: none; }
.ethr-tile { position: relative; flex: none; width: 148px; display: grid; gap: 4px; text-align: left; background: none; border: 0; padding: 0; color: var(--fg); scroll-snap-align: start; }
.ethr-cover { width: 100%; aspect-ratio: 1; background: var(--s2) center / cover no-repeat; border-radius: 3px; }
.ethr-cover.sm { width: 44px; height: 44px; flex: none; }
.ethr-tile b { font: 600 13.5px var(--ui); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ethr-tile small { font: 400 10.5px var(--code); color: var(--dim); }
.ethr-lock { position: absolute; top: 8px; left: 8px; font: 700 8px var(--display); font-stretch: 125%; letter-spacing: .22em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 5px 8px; border-radius: 999px; }
.ethr-line { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; color: var(--fg); font: 400 14.5px var(--ui); }
.ethr-line small { font: 400 10.5px var(--code); color: var(--dim); }
.ethr-line .n { font: 400 11px var(--code); color: var(--dim); }
.ethr-line.now span:not(.n) { color: var(--fg-strong); font-weight: 600; }
.ethr-line.static { cursor: default; }
.ethr-line.btnlike { grid-template-columns: 1fr; }
.ethr-tracks { list-style: none; margin: 0; padding: 0; }
.ethr-track button { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 0; color: var(--fg); font: 400 15.5px var(--ui); }
.ethr-track .n { font: 400 11px var(--code); color: var(--dim); }
.ethr-track .d { font: 400 11px var(--code); color: var(--dim); }
.ethr-track em { color: var(--dim); font-style: normal; }
.ethr-track i { font: 700 7.5px var(--display); font-style: normal; letter-spacing: .2em; text-transform: uppercase; border: 1px solid var(--line-strong); color: var(--dim); border-radius: 3px; padding: 2px 4px; margin-left: 8px; vertical-align: 2px; }
.ethr-track.locked .t { color: var(--dim); }
.ethr-track.now .t { font-weight: 600; }
.ethr-prose { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.65; color: var(--fg); }
.ethr-prose.lyrics { font-size: 18px; line-height: 1.7; font-weight: 300; }
.ethr-empty { margin: 0; color: var(--dim); text-align: center; padding: 40px 0; }
.ethr-hero.empty { padding: 18vh 0 0; text-align: left; }
.ethr-notify.quiet { justify-self: start; }
.ethr-preview-bar { margin: 0; font: 400 10.5px var(--code); text-transform: uppercase; letter-spacing: .08em; color: var(--on-chrome); background: var(--chrome); border-radius: 999px; padding: 6px 12px; justify-self: start; }
.ethr-video { position: absolute; inset: 0; z-index: 5; background: #000; display: grid; place-items: center; }
.ethr-video video { width: 100%; max-height: 100%; }
.ethr-video button { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; z-index: 2; color: #fff; }
@media (min-width: 720px) { .ethr-hero, .ethr-release { grid-template-columns: 320px 1fr; align-items: end; } }

/* the mini player, above the voice controls everywhere in MAX */
.ethr-mini { display: grid; grid-template-columns: 40px 1fr 36px; grid-template-rows: auto 2px; column-gap: 12px; align-items: center; margin: 0 16px 8px; padding: 8px 10px 6px; border: 0; border-radius: 18px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 0 0 1px var(--line-strong); color: var(--fg); text-align: left; position: relative; z-index: 3; }
.ethr-mini[hidden] { display: none; }
.ethr-mini .ethr-cover.sm { width: 40px; height: 40px; grid-row: 1; }
.ethr-mini .m-txt { display: grid; min-width: 0; }
.ethr-mini b { font: 600 13.5px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ethr-mini small { font: 400 10.5px var(--code); color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ethr-mini .m-toggle { font-size: 13px; text-align: center; }
.ethr-mini .m-prog { grid-column: 1 / -1; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; margin-top: 6px; }
.ethr-mini .m-prog i { display: block; height: 100%; background: var(--fg); width: 0; transition: width .25s linear; }

/* full-screen listening */
.ethr-player { z-index: 16; transform: translateY(100%); transition: transform var(--t-slow) var(--ease-out); }
.ethr-player.open { transform: none; }
.p-art-wrap { position: relative; z-index: 1; width: min(78vw, 46vh, 440px); aspect-ratio: 1; margin: 6px auto 0; }
.p-art { width: 100%; height: 100%; background: var(--s2) center / cover no-repeat; border-radius: 4px; box-shadow: 0 50px 90px -30px var(--shadow-c); transform-origin: 50% 60%; }
.p-art.playing { animation: ethr-breathe 14s ease-in-out infinite alternate; }
@keyframes ethr-breathe { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.035) rotate(.6deg); } }
.p-meta { position: relative; z-index: 1; text-align: center; padding: 18px 24px 4px; }
.p-title { margin: 0; font: 800 22px var(--display); font-stretch: 112%; letter-spacing: .01em; }
.p-artist { margin: 4px 0 0; font: 400 11px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.p-badge { margin: 8px 0 0; display: inline-block; font: 700 8px var(--display); letter-spacing: .26em; text-transform: uppercase; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 9px; color: var(--dim); }
.p-wave { position: relative; z-index: 1; width: min(88vw, 520px); height: 54px; margin: 14px auto 0; display: block; cursor: pointer; touch-action: none; }
.p-time { position: relative; z-index: 1; width: min(88vw, 520px); margin: 4px auto 0; display: flex; justify-content: space-between; font: 400 10.5px var(--code); color: var(--dim); }
.p-ctrl { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; gap: min(7vw, 34px); margin-top: 14px; }
.p-ctrl button { background: none; border: 0; color: var(--fg); width: 44px; height: 44px; display: grid; place-items: center; position: relative; }
.p-ctrl svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.p-ctrl .p-shuffle, .p-ctrl .p-repeat { color: var(--faint); }
.p-ctrl .on { color: var(--fg); }
.p-ctrl .p-repeat i { position: absolute; right: 6px; top: 6px; font: 700 8px var(--code); font-style: normal; }
.p-ctrl .p-play { width: 72px; height: 72px; border-radius: 50%; background: var(--chrome); color: var(--on-chrome); font-size: 20px; box-shadow: 0 16px 40px -12px var(--shadow-c); transition: transform var(--t-quick) var(--ease-out); }
.p-ctrl .p-play:active { transform: scale(.94); }
.p-fav svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.p-fav.on svg { fill: currentColor; }
.p-tabs { position: relative; z-index: 1; display: flex; justify-content: center; gap: 22px; margin-top: 18px; border-bottom: 1px solid var(--line); max-width: 520px; width: calc(100% - 36px); margin-left: auto; margin-right: auto; }
.p-tabs button { background: none; border: 0; padding: 10px 0; font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid transparent; }
.p-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.p-panel { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; padding: 14px 24px calc(env(safe-area-inset-bottom) + 24px); max-width: 560px; width: 100%; margin: 0 auto; }

/* control center */
.ethr-form { display: grid; gap: 8px; }
.ethr-form .btn, .ethr-form .chip { justify-self: start; }
.ethr-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ethr-field { display: grid; gap: 4px; font: 400 10.5px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.ethr-file { position: relative; overflow: hidden; display: inline-grid; place-items: center; cursor: pointer; justify-self: start; }
.ethr-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ethr-upload { display: grid; gap: 4px; font: 400 11px var(--code); color: var(--dim); }
.ethr-upload i { display: block; height: 2px; background: var(--line); }
.ethr-upload b { display: block; height: 100%; width: 0; background: var(--fg); transition: width .2s linear; }
.ethr-state { text-transform: uppercase; }
.ethr-state.published { color: var(--ok); }
.ethr-trk-edit > summary { list-style: none; cursor: pointer; }
.ethr-trk-edit > summary::-webkit-details-marker { display: none; }
.ethr-trk-edit[open] > .ethr-form { padding: 10px 0 16px; }
.ethr-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 12px; }
.ethr-stats div { display: grid; gap: 2px; }
.ethr-stats b { font: 300 22px var(--code); }
.ethr-stats small { font: 700 9px var(--display); font-stretch: 125%; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .ethr-space, .ethr-player { transition: none; } .p-art.playing { animation: none; } .ethr-view.in > * { animation: none; } }
.ethr-mini .m-toggle { grid-column: 3; grid-row: 1; }
.ethr-mini .m-prog { grid-row: 2; }

/* Maintenance hold */
.hold-screen { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; text-align: center; background: var(--bg); }
.hold-screen[hidden] { display: none; }
.hold-orb { width: 120px; height: 120px; border-radius: 50%; border: 3px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--chrome) border-box; box-shadow: 0 0 40px rgba(var(--ink), .18); animation: breathe 6s ease-in-out infinite; }
.hold-tag { margin: 0; font: 400 10px var(--code); letter-spacing: .1em; color: var(--dim); }
.hold-msg { margin: 0; max-width: 32ch; font: 300 18px/1.5 var(--ui); }

/* Pager v2: the finger drives a transform (axis-locked in app.js); pages scroll vertically only. */
.js-pager { overflow: hidden; }
.js-pager .pager-track { overflow: visible; scroll-snap-type: none; will-change: transform; touch-action: pan-y; }
.js-pager .page { overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; }
.js-pager .page[aria-hidden="true"] { visibility: visible; }
#app, .drawer, .ethr-space { overflow-x: hidden; }

/* Tactile feedback: every control answers the finger the same way. */
.btn, .chip, .icon-btn, .menu-row, .ethr-tile, .ethr-line, .nav-orbit button, .continue-go, .continue-x { transition: transform var(--t-quick) var(--ease-out), opacity var(--t-quick) ease; }
.btn:active, .chip:active, .icon-btn:active, .menu-row:active, .ethr-tile:active, .ethr-line:active, .nav-orbit button:active, .continue-go:active, .continue-x:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .btn:active, .chip:active, .icon-btn:active, .menu-row:active { transform: none; } }

/* ---------- Responsive refinements (desktop/tablet) ---------- */
.mega { white-space: nowrap; }
#boot-mark { font-size: min(140px, 26vw); }
@media (min-width: 1024px) {
  .ethr-view, .ethr-top { max-width: 1100px; }
  .ethr-hero, .ethr-release { grid-template-columns: minmax(320px, 440px) 1fr; gap: 40px; }
  .ethr-title { font-size: clamp(44px, 5vw, 76px); }
  .ethr-tile { width: 180px; }
  .ethr-tracks { max-width: 820px; }
}
@media (min-width: 1440px) { .ethr-view, .ethr-top { max-width: 1240px; } .ethr-hero, .ethr-release { grid-template-columns: 500px 1fr; } }
@media (hover: hover) { .ethr-tile:hover .ethr-cover, .ethr-art:hover { filter: brightness(1.06); } .ethr-track button:hover { background: rgba(var(--ink), .03); } }
.stage .nudge.nudge-on { bottom: auto; } /* placed by JS just above the Next line (and below the status pill) */

/* ETHR control: sequencing */
.ethr-seq { display: grid; }
.ethr-grip { cursor: grab; touch-action: none; padding: 6px 10px 6px 0; color: var(--faint); font: 700 12px var(--code); letter-spacing: -2px; user-select: none; }
.ethr-trk-edit.dragging { position: relative; z-index: 3; background: var(--s2); box-shadow: 0 18px 40px var(--shadow-c); border-radius: 10px; transition: none; }
.ethr-trk-edit.drop-before { box-shadow: inset 0 2px 0 var(--fg); }
.ethr-trk-edit > summary.ethr-line { grid-template-columns: auto auto 1fr auto; }
/* One mini player, everywhere */
.ethr-mini { position: fixed; z-index: 15; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 70px); max-width: 560px; margin: 0 auto; width: calc(100% - 32px); }
.ethr-mini.compact { top: calc(env(safe-area-inset-top) + 12px); bottom: auto; width: min(220px, 46vw); grid-template-columns: 28px 1fr 28px; padding: 6px 8px 5px; border-radius: 999px; }
.ethr-mini.compact .ethr-cover.sm { width: 28px; height: 28px; border-radius: 50%; }
.ethr-mini.compact small { display: none; }
.ethr-mini.compact b { font-size: 12px; }
.ethr-mini.compact .m-prog { margin-top: 3px; }
.nav-layer { z-index: 17; }
#app .bottom { padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
.ethr-mini.compact { left: auto; right: 62px; margin: 0; width: min(200px, 40vw); }
.ethr-space ~ .ethr-mini:not(.compact) { z-index: 15; }

/* Listening together */
.p-together { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 14px auto 0; max-width: 520px; padding: 0 18px; font: 400 10.5px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.p-together[hidden] { display: none; }
.pt-react { display: flex; gap: 4px; }
.pt-r { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--fg); font-size: 13px; }
.p-floats { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.p-float { position: absolute; bottom: 30%; font-style: normal; font-size: 20px; color: var(--fg); opacity: 0; animation: ethr-float 3s ease-out forwards; text-shadow: 0 0 18px rgba(var(--ink), .4); }
@keyframes ethr-float { 0% { opacity: 0; transform: translateY(0) scale(.8); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-160px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .p-float { animation-duration: .01s; } }

.p-vol { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; justify-content: center; margin: 12px auto 0; max-width: 320px; font: 400 10px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.p-vol[hidden] { display: none; }
.p-vol input { flex: 1; accent-color: var(--fg); }
.p-mvoice { position: relative; z-index: 1; display: block; margin: 8px auto 0; }

/* Crew galaxy refinement: no words on the sphere, quieter light, legible labels */
.orbit-core-label b:empty { display: none; }
.orbit-body.o-crowded small { display: none; }
.orbit-body.o-crowded b { transform: translateY(6px); }
.orbit-body b { white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.85); }

/* Cymatics (public/cymatics.js) */
.p-art-wrap { position: relative; }
.p-cym { position: absolute; inset: -18%; width: 136%; height: 136%; z-index: 0; pointer-events: none; opacity: .85; border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 55%, transparent 72%); mask: radial-gradient(circle, #000 55%, transparent 72%); }
.p-art { position: relative; z-index: 1; transition: opacity .6s var(--ease, ease), transform .6s var(--ease, ease); }
.p-cym-btn { position: relative; z-index: 2; display: block; margin: 10px auto 0; }
.ethr-player.immersive .p-art { opacity: 0; transform: scale(.94); }
.ethr-player.immersive .p-cym { opacity: 1; inset: -30%; width: 160%; height: 160%; }
@media (prefers-reduced-motion: reduce) { .p-art { transition: none; } }

/* Dropdowns: the native list follows the theme, so options are never pale text on a white popup */
:root { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
select option, select optgroup { background: var(--bg); color: var(--fg); }

/* Activity island */
#activity { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%); z-index: 90; min-width: 150px; max-width: min(92vw, 420px); padding: 7px 14px; border-radius: 999px; background: rgba(8,8,9,.92); color: #f2f2f2; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: grid; gap: 6px; font: 500 12.5px var(--ui); cursor: pointer; transition: border-radius .3s ease, padding .3s ease; }
#activity[hidden] { display: none; }
#activity.open { border-radius: 22px; padding: 12px 16px; }
#activity .act { display: flex; align-items: center; gap: 9px; min-height: 22px; }
#activity .act span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#activity .act small { font: 400 11px var(--code); color: rgba(255,255,255,.6); }
#activity .act i { width: 7px; height: 7px; border-radius: 50%; background: #d9d9d9; flex: none; }
#activity .act.running i { animation: act-pulse 1.4s ease-in-out infinite; }
#activity .act.failed i { background: #c9a227; }
#activity button { background: none; border: 1px solid rgba(255,255,255,.25); color: inherit; border-radius: 999px; padding: 4px 10px; font: 500 11.5px var(--ui); min-height: 30px; }
@keyframes act-pulse { 50% { opacity: .3; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { #activity .act.running i { animation: none; } }

/* ETHR drafts */
.ethr-draftbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 18px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 16px; }
.ethr-draftbar .ethr-meta { flex: 1 1 100%; margin: 0; }
.ethr-preview { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.ethr-preview-card { width: min(520px, 100%); max-height: 85dvh; overflow: auto; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 22px; padding: 22px; display: grid; gap: 6px; }
.ethr-preview-card .removed { opacity: .5; text-decoration: line-through; }

/* Mini player quick sheet */
.ethr-mini .m-next, .ethr-mini .m-more { display: grid; place-items: center; min-width: 40px; min-height: 40px; font-size: 18px; color: var(--fg); }
.ethr-mini.compact .m-next, .ethr-mini.compact .m-more { display: none; }
.ethr-quick { position: fixed; inset: 0; z-index: 94; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.ethr-quick-card { width: min(480px, 100%); max-height: 70dvh; display: grid; gap: 10px; padding: 18px; border-radius: 22px; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.ethr-quick-card small { color: var(--dim); }
.eq-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.eq-ctl .chip { min-height: 40px; }
.eq-queue { overflow: auto; max-height: 34dvh; display: grid; gap: 2px; }
.eq-queue .ethr-line { text-align: left; min-height: 44px; }
.eq-queue .on { font-weight: 600; }

/* Touch targets and focus: every icon control is at least 44px and shows keyboard focus */
.icon-btn { min-width: 44px; min-height: 44px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
/* Skeleton loading */
.skel { position: relative; overflow: hidden; background: rgba(var(--ink), .06); border-radius: 12px; min-height: 18px; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(var(--ink), .08), transparent); animation: skel 1.3s ease-in-out infinite; }
@keyframes skel { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }

/* Quick actions sheet */
.ctx-sheet { position: fixed; inset: 0; z-index: 96; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.ctx-card { width: min(420px, 100%); display: grid; gap: 4px; padding: 14px; border-radius: 22px; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.ctx-card b { font: 600 13px var(--ui); color: var(--dim); padding: 4px 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-card button { min-height: 46px; text-align: left; padding: 0 12px; border-radius: 12px; border: 0; background: none; color: var(--fg); font: 500 15px var(--ui); }
.ctx-card button:hover, .ctx-card button:focus-visible { background: rgba(var(--ink), .06); }
.ctx-card .ctx-cancel { color: var(--dim); }
.row { -webkit-touch-callout: none; }
.ethr-quick-card input[type="range"], .p-vol input { accent-color: var(--fg); }

.ethr-tap { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); transform: translateX(-50%); z-index: 97; padding: 14px 22px; min-height: 48px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--fg); color: var(--bg); font: 600 14px var(--ui); box-shadow: 0 12px 30px rgba(0,0,0,.4); }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 98; background: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: flex-start; padding: calc(env(safe-area-inset-top, 0px) + 64px) 16px 16px; }
.pal-card { width: min(560px, 100%); max-height: 70dvh; display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.55); overflow: hidden; }
.pal-card input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 20px; font-size: 17px; background: none; }
.pal-card input:focus { outline: none; }
.pal-list { overflow: auto; padding: 6px; display: grid; align-content: start; gap: 2px; }
.pal-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: none; color: var(--fg); text-align: left; font: 500 15px var(--ui); }
.pal-item small { flex: none; width: 92px; font: 400 10.5px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.pal-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item.on, .pal-item:hover { background: rgba(var(--ink), .08); }
.pal-hint { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); font: 400 11px var(--code); color: var(--dim); }
@media (hover: none) { .pal-hint { display: none; } }
/* Active quest and undo */
#mission-panel .row.focus { box-shadow: inset 2px 0 0 var(--fg); background: rgba(var(--ink), .05); border-radius: 10px; }
.undo-chip { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); transform: translateX(-50%); z-index: 97; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: 500 13px var(--ui); box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Artwork placeholder: a quiet chrome disc until the image arrives (or when a release has none) */
.ethr-cover { background-color: #111; background-image: radial-gradient(circle at 30% 25%, #e6e6e6 0%, #7a7a7a 22%, #1c1c1c 55%, #050505 80%); background-size: cover; background-position: center; }
:root[data-theme="light"] .ethr-cover { background-color: #ddd; }

/* Genesis uses the same chrome type and neutral surfaces as System Status. */
.genesis-access { margin: 0.35rem auto; max-width: 100%; }
.genesis-panel { width: min(620px, calc(100% - 24px)); max-height: 86dvh; padding: 0; color: var(--fg); background: var(--s0); }
.genesis-panel::backdrop { background: rgba(0,0,0,.65); }
.genesis-panel .sys-head { position: sticky; top: 0; background: var(--s0); z-index: 1; }
.genesis-content { padding: 1rem; overflow-wrap: anywhere; }
.genesis-content h2, .genesis-content h3 { margin: .75rem 0 .35rem; }
.genesis-content ul { margin: .25rem 0 1rem; padding-inline-start: 1.25rem; }
.genesis-content li { margin-block: .3rem; }
#genesis-teach { display: grid; gap: .5rem; padding-block: .75rem; }
#genesis-teach label { display: grid; gap: .3rem; }
#genesis-teach select, #genesis-teach textarea { width: 100%; font: inherit; color: var(--fg); background: var(--s0); }
#genesis-teach .chip { justify-self: start; }

/* Mini player: full bar, minimized disc, or hidden */
.ethr-mini { grid-template-columns: 40px minmax(0,1fr) 36px 30px 30px 30px; }
.ethr-mini .m-min { display: grid; place-items: center; min-width: 30px; min-height: 40px; font-size: 16px; color: var(--dim); }
.ethr-mini.compact .m-min { display: none; }
.ethr-mini.mini-min { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); width: 52px; height: 52px; margin: 0; padding: 0; border-radius: 50%; display: block; z-index: 40; overflow: hidden; }
.ethr-mini.mini-min > :not(.ethr-cover) { display: none; }
.ethr-mini.mini-min .ethr-cover.sm { width: 100%; height: 100%; border-radius: 50%; }
.ethr-mini.mini-min::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(var(--ink), .35); }

/* Documents, read inside MAX */
.doc-view { position: fixed; inset: 0; z-index: 96; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.dv-card { width: min(760px, 100%); height: 100%; max-height: 92dvh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; }
.dv-card header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dv-card header b { flex: 1; font: 600 15px var(--ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-acts { display: flex; gap: 6px; flex: none; }
.dv-body { overflow: auto; padding: 18px 20px 40px; font: 400 15px/1.6 var(--ui); -webkit-user-select: text; user-select: text; }
.dv-body h2, .dv-body h3, .dv-body h4, .dv-body h5 { font-family: var(--ui); margin: 1.2em 0 .4em; line-height: 1.25; }
.dv-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13.5px; }
.dv-body td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
.dv-body tr:first-child td { font-weight: 600; }
.dv-body iframe { width: 100%; height: 100%; min-height: 70dvh; border: 0; }

/* Conversations: type without leaving the transcript */
.chat-compose { position: sticky; bottom: 0; flex: none; display: flex; gap: 8px; align-items: center; padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 10px); background: var(--bg); border-top: 1px solid var(--line); }
.chat-compose input { flex: 1; min-height: 44px; padding: 10px 14px; border-radius: 22px; }
.chat-compose .chip { min-height: 44px; }
.myname { display: flex; gap: 8px; align-items: flex-end; margin: 0 0 18px; }
.myname .ethr-field { flex: 1; }
/* Navigate: one centred group on an opaque layer (nothing from home shows through), tag top, grip bottom */
.nav-layer { display: flex; flex-direction: column; gap: 28px; padding: calc(env(safe-area-inset-top) + 16px) 22px calc(env(safe-area-inset-bottom) + 12px); background: linear-gradient(180deg, rgba(0,0,0,.96), rgba(0,0,0,.93)); }
:root[data-theme="light"] .nav-layer { background: linear-gradient(180deg, rgba(247,246,243,.97), rgba(247,246,243,.95)); }
.nav-layer > .nav-primary { margin-top: auto; }
.nav-layer > .nav-orbit { margin-bottom: auto; }
.nav-layer[hidden] { display: none; }
.nav-layer > .nav-grip { align-self: center; }
/* Sonic Orb: the cover becomes a disc inside the living ring of the music */
.ethr-player .p-art-wrap { isolation: isolate; }
.ethr-player .p-cym { inset: -22%; width: 144%; height: 144%; border-radius: 0; opacity: 1; -webkit-mask: none; mask: none; }
.ethr-player .p-art { border-radius: 50%; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 30px 80px rgba(0,0,0,.6); transform: scale(.72); }
.ethr-player.immersive .p-art { opacity: 0; transform: scale(.6); }
.ethr-player.immersive .p-cym { inset: -24%; width: 148%; height: 148%; }

/* ---------- Layout containment (FLOW): nothing may make the page wider than the screen ----------
   Drawer bodies are a single grid column sized to the screen (not to their widest child), long words
   wrap, and the document itself never pans sideways. Pagers keep their own horizontal motion. */
html, body { overflow-x: hidden; overscroll-behavior-x: none; }
.drawer { overflow: hidden; }
.drawer-body { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.drawer-body > *, .page > * { min-width: 0; max-width: 100%; }
.drawer-body :is(p, h3, h4, span, b, small, a, .t, .device-name, .device-meta) { overflow-wrap: anywhere; }
.drawer-body img, .drawer-body video, .drawer-body canvas { max-width: 100%; }

/* Mini player: one row of controls, the progress line underneath (never a third row) */
.ethr-mini { grid-template-columns: 40px minmax(0, 1fr) 36px 30px 30px 30px; grid-template-rows: auto 2px; }
.ethr-mini > .ethr-cover { grid-area: 1 / 1; }
.ethr-mini > .m-txt { grid-area: 1 / 2; }
.ethr-mini > .m-toggle { grid-area: 1 / 3; }
.ethr-mini > .m-next { grid-area: 1 / 4; }
.ethr-mini > .m-more { grid-area: 1 / 5; }
.ethr-mini > .m-min { grid-area: 1 / 6; }
.ethr-mini > .m-prog { grid-area: 2 / 1 / 3 / -1; }
.ethr-mini.compact { grid-template-columns: 28px minmax(0, 1fr) 28px; }
.ethr-mini.compact > :is(.m-next, .m-more, .m-min) { display: none; }

/* Finish first */
.finish-first { display: grid; gap: 2px; margin: 0 0 14px; padding: 12px 12px 10px; border: 1px solid var(--line-strong); border-radius: 18px; }
.finish-first:empty { display: none; }
.ff-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; font: 700 11px var(--display); font-stretch: 125%; letter-spacing: .18em; text-transform: uppercase; }
.ff-head small { font: 400 10.5px var(--code); color: var(--dim); letter-spacing: .04em; text-transform: none; }
.ff-more { justify-self: start; margin-top: 6px; }

/* MAX GUIDE */
.ctx-sheet.guide .guide-what { margin: 0 10px 8px; font: 400 15px/1.5 var(--ui); color: var(--fg); }
.ctx-sheet.guide .ctx-card b { color: var(--fg); font: 700 12px var(--display); font-stretch: 125%; letter-spacing: .16em; text-transform: uppercase; }

/* Home fits the phone: the core shrinks on shorter screens, the middle never clips its own content
   (it scrolls quietly if a card is open), and the footer is only as tall as its button. */
.stage { justify-content: safe center; overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain; }
.stage::-webkit-scrollbar { display: none; }
@media (max-height: 760px) { .orb-btn { width: min(62vw, 34dvh, 300px); } .stage { gap: 8px; } }
@media (max-height: 640px) { .orb-btn { width: min(56vw, 30dvh, 260px); } }
.bottom { padding: 2px 18px calc(env(safe-area-inset-bottom) + 6px); }

/* MAX's room: calm by default, layers open on demand */
.max-room .drawer-head h2 { letter-spacing: .02em; }
.max-lede { margin: 0 0 6px; font: 400 15px/1.55 var(--ui); color: var(--fg); }
.max-sec { border-top: 1px solid var(--line); padding: 4px 0; }
.max-sec > summary { list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 2px; cursor: pointer; min-height: 44px; }
.max-sec > summary::-webkit-details-marker { display: none; }
.max-sec > summary b { font: 700 12px var(--display); font-stretch: 125%; letter-spacing: .16em; text-transform: uppercase; }
.max-sec > summary small { font: 400 11px var(--code); color: var(--dim); text-align: right; }
.max-sec[open] > summary { padding-bottom: 6px; }
.max-sec > :not(summary) { margin: 6px 2px 10px; }
.max-sec .chip { margin: 4px 6px 4px 0; }
.max-list { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 6px; font: 400 14px/1.45 var(--ui); }
.max-row { display: flex; align-items: center; gap: 12px; font: 500 14px var(--ui); }
.max-row input { flex: 1; accent-color: var(--fg); }
.max-teach { display: flex; gap: 8px; }
.max-teach input { flex: 1; min-height: 44px; }
.show-more { justify-self: start; margin: 6px 0 10px; }
.ff-warn { margin: 0 4px 6px; font: 400 12.5px/1.4 var(--ui); color: var(--dim); }

.demo-end { position: fixed; left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 99; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--dim); font: 500 11px var(--code); letter-spacing: .04em; opacity: .55; }
.demo-end:hover, .demo-end:focus-visible { opacity: 1; }

/* Calendar */
.cal-view { position: fixed; inset: 0; z-index: 95; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.cal-card { width: min(560px, 100%); max-height: 92dvh; overflow: auto; display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 22px; background: var(--bg); color: var(--fg); border: 1px solid var(--line-strong); }
.cal-head { display: grid; grid-template-columns: 44px 1fr 44px 44px; align-items: center; gap: 4px; }
.cal-head b { text-align: center; font: 700 13px var(--display); font-stretch: 125%; letter-spacing: .12em; text-transform: uppercase; }
.cal-seg { justify-self: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid i { font: 400 10px var(--code); color: var(--dim); font-style: normal; padding-bottom: 4px; }
.cal-cell { position: relative; aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 12px; background: none; color: var(--fg); font: 500 14px var(--ui); display: grid; place-items: center; }
.cal-cell.has { background: rgba(var(--ink), .06); }
.cal-cell.today { box-shadow: inset 0 0 0 1px var(--fg); }
.cal-cell em { position: absolute; bottom: 4px; font-style: normal; font-size: 9px; letter-spacing: 1px; color: var(--dim); }
.cal-list { display: grid; gap: 4px; }
.cal-day { margin: 10px 0 2px; font: 600 11px var(--code); color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.cal-item { display: flex; gap: 12px; align-items: baseline; text-align: left; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 12px; background: rgba(var(--ink), .04); color: var(--fg); font: 400 14px var(--ui); }
.cal-item small { flex: none; width: 70px; font: 400 10.5px var(--code); color: var(--dim); text-transform: uppercase; }

/* The Lighthouse: spatial light, Turrell-quiet; breathes; nothing heavy */
.lighthouse { position: relative; height: 150px; margin: 0 18px 6px; border-radius: 22px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 120%, rgba(var(--ink), .10), transparent 60%), var(--bg); box-shadow: inset 0 0 0 1px var(--line); transition: background 1.2s ease; }
.lh-field { position: absolute; inset: 0; display: grid; place-items: center; }
.lh-field i { width: 46%; aspect-ratio: 1.6; border-radius: 50%; background: radial-gradient(closest-side, rgba(235,238,245,.55), rgba(200,206,218,.12) 60%, transparent 75%); filter: blur(6px); animation: lh-breathe 6s ease-in-out infinite; transition: opacity 1.4s ease, transform 1.4s ease; }
:root[data-theme="light"] .lh-field i { background: radial-gradient(closest-side, rgba(255,255,255,.95), rgba(220,214,204,.35) 60%, transparent 75%); }
.lighthouse.closed .lh-field i { opacity: .12; transform: scale(.7); }
.lh-line { position: relative; margin: 0; font: 400 14px var(--ui); color: var(--fg); letter-spacing: .02em; transition: opacity 1s ease; }
.lh-knock { position: absolute; bottom: 14px; }
@keyframes lh-breathe { 0%, 100% { opacity: .75; transform: scale(.97); } 50% { opacity: 1; transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .lh-field i { animation: none; } }

.pronunciation-form { display: grid; gap: .65rem; }
.pronunciation-form label { display: grid; gap: .25rem; }
.pronunciation-form input:not([type="checkbox"]) { min-width: 0; width: 100%; font: inherit; }
.pronunciation-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
#prometheus-panel details { margin-block: .75rem; }
#prometheus-panel summary { cursor: pointer; padding-block: .5rem; }
#prometheus-preview { max-height: 16rem; overflow: auto; }
#prometheus-preview label { display: grid; grid-template-columns: auto 1fr; gap: .5rem; margin-block: .5rem; }

/* Opt-in presence toggle (Crew): quiet text control, 44px target */
.crew-presence-toggle { appearance: none; border: 0; background: none; color: var(--dim); font: 400 11px var(--ui); letter-spacing: .04em; min-height: 44px; padding: 0 8px; cursor: pointer; }
.crew-presence-toggle[aria-pressed="true"] { color: var(--fg); }
.crew-presence-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }

/* One intelligence (Founders Edition): Round Table is not part of the beta. */
body.unified #table-toggle { display: none; }
/* Shows wait for the person: Next brightens once MAX has finished speaking. */
#show-next.ready { box-shadow: 0 0 0 1px currentColor; }
@media (prefers-reduced-motion: no-preference) { #show-next.ready { animation: next-ready 2.4s ease-in-out infinite; } }
@keyframes next-ready { 50% { opacity: .62; } }

/* Master Settings: quiet sections, one column. */
.master-sec { display: grid; gap: 8px; padding: 6px 0 14px; border-bottom: 1px solid var(--line); }
.master-h { margin: 0; font: 700 10px var(--display); letter-spacing: .26em; text-transform: uppercase; color: var(--dim); }
.master-form { display: grid; gap: 8px; }
.master-field { display: grid; gap: 4px; font-size: 13px; color: var(--dim); }
.master-form input { min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--fg); font: inherit; }

.master-lens { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--fg); }
.master-form textarea { min-height: 72px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--fg); font: inherit; resize: vertical; }
.master-form select { min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--fg); font: inherit; }

/* ---------- SOVEREIGN: Master Settings tabs, Creator Mode HQ, Consumer preview ---------- */
.master-tabs { display: flex; flex: 0 0 auto; min-height: max-content; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 2px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.master-tabs::-webkit-scrollbar { display: none; }
.master-tabs .chip { flex: 0 0 auto; white-space: nowrap; }
.master-tabs .chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.master-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; }
.master-sec[hidden] { display: none; }
.master-sec select { min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fg); padding: 0 10px; font: 500 12px var(--ui); }

/* Creator Mode: a deeper, atmospheric palette for the MAX team's HQ. Consumer Mode keeps the product palette. */
body.creator-mode { --hq-glow: 120, 150, 255; }
body.creator-mode .presence { background: radial-gradient(120% 80% at 50% 0%, rgba(var(--hq-glow), .14), transparent 60%), radial-gradient(90% 60% at 80% 100%, rgba(180, 120, 255, .10), transparent 70%), var(--bg); }
:root[data-theme="light"] body.creator-mode .presence { background: radial-gradient(120% 80% at 50% 0%, rgba(var(--hq-glow), .12), transparent 60%), var(--bg); }
/* Experience Integrity: the HQ is a neighbouring space, never an overlay on the face. */
.creator-hq-intro { position: absolute; z-index: 3; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 168px); display: grid; gap: 2px; justify-items: end; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); color: var(--fg); font: 500 12px var(--ui); opacity: .55; transition: opacity var(--t-slow, .4s) ease, padding .4s ease; }
.creator-hq-intro .hq-kicker { display: none; }
.creator-hq-intro.intro { opacity: 1; padding: 12px 14px; }
.creator-hq-intro.intro .hq-kicker { display: block; }
.creator-hq-intro:hover, .creator-hq-intro:focus-visible { opacity: 1; }
.creator-hq-intro[hidden] { display: none; }
.hq-kicker, .hq-role { margin: 0; font: 700 10px var(--display); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.hq-role { color: rgb(var(--hq-glow, 120, 150, 255)); }
.command-center { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); color: var(--fg); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); animation: cc-in .32s cubic-bezier(.2,.8,.2,1); }
.command-center[hidden] { display: none; }
@keyframes cc-in { from { transform: translate3d(12%,0,0); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .command-center { animation: none; } }
.cc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; max-width: 1100px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.cc-title { margin: 0; font: 900 26px/1 var(--display); font-stretch: 125%; text-transform: uppercase; background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cc-back { font-size: 22px; }
.cc-body { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 16px 24px; display: grid; gap: 14px; align-content: start; max-width: 1100px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.command-center .hq-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.hq-card { display: grid; gap: 6px; padding: 12px 0 0; border-top: 1px solid var(--line); align-content: start; }
.hq-title { margin: 0 0 2px; font: 700 12px var(--display); letter-spacing: .08em; }
.hq-metric { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; font: 400 13px var(--ui); }
.hq-label { color: var(--dim); }
.hq-value { font-weight: 600; text-align: right; }
.hq-src { grid-column: 1 / -1; font: 500 9px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.hq-metric.src-unavailable .hq-value { color: var(--dim); font-weight: 400; }
.hq-metric.src-estimated .hq-src { color: #b8a06a; }
.hq-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.hq-note { margin: 0; color: var(--dim); font-size: 13px; }
.return-creator { position: fixed; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 99; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--glass); color: var(--fg); font: 600 12px var(--ui); }
.return-creator[hidden] { display: none; }
.master-tabs { min-height: 58px; box-sizing: border-box; }
/* Rows with several actions wrap on narrow screens: the name and details keep the full width. */
.master-sec .device { flex-wrap: wrap; row-gap: 8px; }
.master-sec .device .device-info { flex: 1 1 220px; min-width: 0; }

/* ---------- AETHER: continuity status, member search ---------- */
.everyday-status { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 98; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 6px 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--dim); font: 500 12px var(--ui); max-width: calc(100vw - 32px); }
.everyday-status[hidden] { display: none; }
.everyday-status button { min-width: 28px; min-height: 28px; border: 0; background: none; color: var(--dim); font-size: 16px; border-radius: 999px; }
.master-search { min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--fg); padding: 0 12px; font: 400 14px var(--ui); }

/* ---------- AETHER: Hue (ambient light over monochrome surfaces; Night base) ---------- */
:root[data-hue="on"] body::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background-color: rgb(var(--hue-rgb, 92,104,255));
  opacity: calc(0.34 * var(--hue-k, 0.6));
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(120% 70% at 50% -8%, #000 0%, rgba(0,0,0,.45) 45%, transparent 78%), radial-gradient(80% 50% at 50% 115%, rgba(0,0,0,.55), transparent 70%);
  mask-image: radial-gradient(120% 70% at 50% -8%, #000 0%, rgba(0,0,0,.45) 45%, transparent 78%), radial-gradient(80% 50% at 50% 115%, rgba(0,0,0,.55), transparent 70%);
  transition: background-color 40s linear, opacity 1.2s ease;
}
@media (prefers-reduced-motion: reduce) { :root[data-hue="on"] body::after { transition: none; } }
.hue-controls { display: grid; gap: 8px; padding: 6px 16px 10px; }
.hue-controls[hidden] { display: none; }
.hue-controls label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 400 13px var(--ui); color: var(--dim); }
.hue-controls select, .hue-controls input { flex: 0 1 60%; }
.hue-controls select { min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fg); padding: 0 10px; }


/* Short phones (iPhone SE, landscape): the Next line must stay inside the stage. */
@media (max-height: 700px) { .orb-btn { width: min(56vw, 30dvh, 260px); } .caption { min-height: 2.6em; } .stage { gap: 6px; } }
/* B-18 (Experience Integrity): the active home card sits just above the Next line; it used to cover the MAX System
   Status pill when the space between them was shorter than the card. While a card shows, the orb steps down a size so
   there is room, and the card is never placed above the pill's lower edge. Nothing is hidden. */
.stage:has(.nudge-on) .orb-btn { width: min(52vw, 28dvh, 280px); }
.stage:has(.nudge-on) .caption { min-height: 2.2em; }
@media (max-height: 700px) { .stage:has(.nudge-on) .orb-btn { width: min(44vw, 22dvh, 220px); } }
.stage:has(.nudge-on) #genesis-btn { margin-bottom: 86px; }
.stage:has(.nudge-on) #replay-btn { display: none; }

/* Conversations: a composer on the list too; drawers fit above the on-screen keyboard (iOS). */
.chats-home-compose { position: sticky; bottom: 0; margin-top: auto; padding-top: 8px; background: var(--s0); }
#chats-home { display: flex; flex-direction: column; gap: 12px; }
#log-panel { height: min(90dvh, calc(var(--vvh, 100dvh) - 8px)); }

.cupd-react { display: flex; gap: 6px; margin-top: 6px; }
.cupd-r { min-height: 30px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--dim); font: 500 12px var(--ui); }
.cupd-r[aria-pressed="true"] { color: var(--fg); border-color: var(--line-strong); }

.stt-row { display: flex; align-items: center; gap: 12px; }
.stt-row select { margin-left: auto; min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--fg); padding: 0 10px; max-width: 46%; }
