/* Habient — "Buz". Frosted daylight for working, polar night for focus and the closed day.
   html[data-scene] is the state machine: theme, depth and chrome all derive from it. */

/* ---------- tokens ---------- */
:root, .daylight {
  color-scheme: light;
  --bg: #a7acb8; --ice: #f1f5fa; --glow: #dcebff; --night: #090c11;
  --ink: #0b0e13; --dim: #3b4250; --faint: #555c6b; --on-ink: var(--ice);
  --line: rgba(11, 14, 19, 0.14); --line-2: rgba(11, 14, 19, 0.26); --rim: rgba(255, 255, 255, 0.85);
  --sheet: rgba(244, 247, 251, 0.62); --panel: rgba(255, 255, 255, 0.62); --field: rgba(255, 255, 255, 0.72); --bar: rgba(236, 240, 246, 0.74);
  --scrim: rgba(120, 126, 138, 0.62); --shade: rgba(30, 38, 56, 0.7);
  --veil: rgb(200, 205, 214); --shine: rgb(240, 248, 255); /* the wash over the arrival and night images; the light inside the arrival ice */
  /* Monochrome, like ice: emphasis is brightness and weight, never hue. The one colour is --danger,
     kept for errors and for deleting. --acc/--ok/--warn stay as names for emphasis, all ink. */
  --acc: var(--ink); --acc-ink: var(--on-ink); --ok: var(--ink); --warn: var(--ink); --danger: #a12c12;
  color: var(--ink);
}
:root {
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --display: var(--font);
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sheet: 16px; --r-panel: 10px; --r-ctl: 6px; --r-tag: 3px;
  /* the closed type scale: 10 11 12 13 15 16 17 20 24 28 px, plus these five display sizes */
  --fs-title: clamp(21px, 2.2vw, 28px); --fs-hero: clamp(28px, 3.6vw, 46px); --fs-display: clamp(34px, 6vw, 76px);
  --fs-number: clamp(60px, 11vw, 124px); --fs-timer: clamp(44px, min(8vw, 9vh), 80px);
  /* layers */
  --z-plate: -3; --z-ground: -2; --z-fog: -1; --z-stage: 10; --z-bar: 20; --z-nav: 21; --z-capture: 22; --z-arrive: 30; --z-ask: 35;
  --z-overlay: 40; --z-panel: 41; --z-quick: 46; --z-fx: 55; --z-top: 60;
  --t-fast: 0.14s; --t-ui: 0.28s; --t-scene: 0.95s;
  --ez: cubic-bezier(0.65, 0, 0.2, 1); --ez-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --top: 64px; --tab: 0px; --cap: 76px;
  /* elevation: three depths, all from --shade, all with a large negative spread (depth, not a drop shadow) */
  --e-1: 0 18px 34px -26px var(--shade);
  --e-2: 0 24px 48px -20px var(--shade), 0 2px 8px -4px var(--shade);
  --e-3: 0 44px 70px -44px var(--shade), 0 2px 6px color-mix(in srgb, var(--shade) 14%, transparent);
}
/* dark theme (Ayarlar → Görünüm, kept per device): the whole app in polar night, panels included.
   The two night scenes below keep their own deeper palette either way. */
html[data-theme='dark'], html[data-theme='dark'] .daylight {
  color-scheme: dark;
  --bg: #0e131a; --ice: #171d27; --glow: #1f2b3d;
  --ink: #e9eef6; --dim: #a9b3c3; --faint: #8d97a8; --on-ink: #0b0e13;
  --line: rgba(233, 238, 246, 0.12); --line-2: rgba(233, 238, 246, 0.24); --rim: rgba(233, 238, 246, 0.13);
  --sheet: rgba(20, 26, 35, 0.74); --panel: rgba(233, 238, 246, 0.05); --field: rgba(233, 238, 246, 0.07); --bar: rgba(13, 18, 25, 0.8);
  --scrim: rgba(3, 5, 8, 0.66); --shade: rgba(0, 0, 0, 0.78); --veil: rgb(9, 12, 17);
  --acc: var(--ink); --acc-ink: var(--on-ink); --ok: var(--ink); --warn: var(--ink); --danger: #ffb59f;
  color: var(--ink);
}
html[data-theme='dark'] .fog { opacity: 0.12; mix-blend-mode: screen; }
html[data-theme='dark'] .arrival-hero::after { background: linear-gradient(180deg, color-mix(in srgb, var(--veil) 82%, transparent) 0%, color-mix(in srgb, var(--veil) 62%, transparent) 50%, color-mix(in srgb, var(--veil) 50%, transparent) 100%); }
html[data-theme='dark'] .scene[data-scene='arrive'] .btn:not(.btn-primary) { background: color-mix(in srgb, var(--ice) 72%, transparent); }

/* polar night: the two bare scenes */
html:is([data-scene='focus'], [data-scene='close']) {
  color-scheme: dark;
  --bg: var(--night); --ink: #eef3fa; --dim: #aeb7c6; --faint: #909aaa; --on-ink: var(--night);
  --line: rgba(238, 243, 250, 0.16); --line-2: rgba(238, 243, 250, 0.3); --rim: rgba(238, 243, 250, 0.18);
  --sheet: rgba(14, 18, 25, 0.74); --panel: rgba(238, 243, 250, 0.06); --field: rgba(238, 243, 250, 0.07); --bar: rgba(9, 12, 17, 0.55);
  --scrim: rgba(4, 6, 9, 0.66); --shade: rgba(0, 0, 0, 0.8); --veil: rgb(5, 7, 11);
  --acc: var(--ink); --acc-ink: var(--on-ink); --ok: var(--ink); --warn: var(--ink); --danger: #ffb59f;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--bg); transition: background-color 1s var(--ez); }
body { font: 15px/1.55 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
/* the first paint lands in its final state: nothing travels while booting */
html.boot *, html.boot *::before, html.boot *::after { transition: none !important; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--r-ctl); }
/* scenes that own the whole screen: no rail, no bar */
html:is([data-scene='boot'], [data-scene='arrive'], [data-scene='onboard'], [data-scene='notice'], [data-scene='doc']) { --top: 0px; --tab: 0px; --cap: 0px; }
::selection { background: color-mix(in srgb, var(--acc) 26%, transparent); }
kbd { font: 500 10px/1 var(--mono); opacity: 0.6; border: 1px solid currentColor; border-radius: var(--r-tag); padding: 2px 5px; }
code { font-family: var(--mono); }

/* ---------- ground ---------- */
/* The shader canvas stays transparent until it has drawn; the page colour is the ground until then. */
.ground { position: fixed; inset: 0; width: 100%; height: 100%; z-index: var(--z-ground); pointer-events: none; opacity: 0; transition: opacity 0.6s; }
.ground.is-drawn { opacity: 1; }
.no-ground .ground { display: none; }
/* without WebGL or with reduced motion: an opaque frost plate instead */
.no-ground body::before { content: ''; position: fixed; inset: 0; z-index: var(--z-plate); pointer-events: none; background: url('/assets/plate-mid.webp') center / cover no-repeat; }
html.no-ground:is([data-scene='focus'], [data-scene='close']) body::before { display: none; }
/* The fog: two plates of drifting wisps over the ground. Their motion is a compositor transform (no JS, no repaint),
   slow and alternating; the pointer and the area change only lean them a little (translate), so they move against the content. */
.fog { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; transition: opacity 1s var(--ez); --sy: 0px; }
.fog i { position: absolute; inset: -9%; background: url('/assets/fog-wisp.webp') center / cover no-repeat; will-change: transform; translate: var(--px, 0px) calc(var(--py, 0px) + var(--sy)); transition: translate 1.8s var(--ez); }
.fog i:first-child { opacity: 1; animation: fog-a 78s ease-in-out infinite alternate; }
.fog i:last-child { opacity: 0.65; transform: scaleX(-1) rotate(180deg); background-position: 30% 70%; translate: calc(var(--px, 0px) * -1.7) calc(var(--py, 0px) * -1.7 + var(--sy) * 1.8); animation: fog-b 112s ease-in-out infinite alternate; }
@keyframes fog-a { from { transform: translate3d(-3.5%, -1.5%, 0) scale(1); } to { transform: translate3d(3.5%, 2.5%, 0) scale(1.1); } }
@keyframes fog-b { from { transform: scaleX(-1) rotate(180deg) translate3d(3%, 2%, 0) scale(1.08); } to { transform: scaleX(-1) rotate(180deg) translate3d(-4%, -2%, 0) scale(1); } }
html[data-scene='now'] .fog { --sy: 0px; } html[data-scene='track'] .fog { --sy: -16px; } html[data-scene='day'] .fog { --sy: -32px; }
html[data-scene='inbox'] .fog { --sy: -48px; } html[data-scene='projects'] .fog { --sy: -64px; } html[data-scene='money'] .fog { --sy: -80px; }
html[data-scene='review'] .fog { --sy: -96px; } html[data-scene='spaces'] .fog { --sy: -112px; }
html:is([data-scene='focus'], [data-scene='close'], [data-scene='arrive'], [data-scene='doc']) .fog { opacity: 0; }
/* where the fog is hidden it does not drift either: nothing runs under arrival, setup, documents or night */
html:is([data-scene='boot'], [data-scene='arrive'], [data-scene='onboard'], [data-scene='notice'], [data-scene='doc'], [data-scene='focus'], [data-scene='close']) .fog i { animation-play-state: paused; }
/* generated stills for the two night scenes; they fade in and drift very slowly, on the compositor */
body::after { content: ''; position: fixed; inset: -4%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 1.4s var(--ez); will-change: transform; }
html[data-scene='focus'] body::after { background: url('/assets/focus-night.webp') center / cover no-repeat; opacity: 0.82; mix-blend-mode: screen; animation: night-drift 64s ease-in-out infinite alternate; }
html[data-scene='close'] body::after { background: url('/assets/close-night.webp') 78% 60% / cover no-repeat; opacity: 0.95; mix-blend-mode: screen; animation: night-drift 80s ease-in-out infinite alternate; }
@keyframes night-drift { from { transform: translate3d(-1.5%, 1%, 0) scale(1); } to { transform: translate3d(1.5%, -1%, 0) scale(1.06); } }
html.no-ground:is([data-scene='focus'], [data-scene='close']) body::after { mix-blend-mode: normal; opacity: 1; }

/* ---------- app shell: rail, top bar, content ---------- */
.rail { position: fixed; inset: 0 auto 0 0; z-index: var(--z-nav); width: auto; display: flex; flex-direction: column; gap: 14px; padding: calc(14px + env(safe-area-inset-top, 0px)) 10px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bar); border-right: 1px solid var(--rim); box-shadow: none; transition: transform 0.7s var(--ez), opacity 0.5s, background-color 0.6s; overflow: hidden; }
.rail-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding-left: 8px; }
.brand { display: flex; align-items: center; border: 0; background: none; padding: 8px 2px; color: var(--ink); }
.brand-mark { display: block; height: 15px; width: 96px; }
.dock { display: flex; flex-direction: column; gap: 2px; }
.dock-btn { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; border: 0; background: none; padding: 0 12px; border-radius: var(--r-ctl); color: var(--ink); font: 500 12px/1 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; text-align: left; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast); }
.dock-btn > span:not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 1.6; }
.dock-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.dock-btn.is-on { color: var(--on-ink); background: var(--ink); }
.dock-btn .ic { width: 17px; height: 17px; }
/* the count keeps its place when empty, so the bar never shifts */
.badge { min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-tag); background: var(--acc); color: var(--acc-ink); font: 700 11px/16px var(--mono); text-align: center; letter-spacing: 0; }
.badge:empty { visibility: hidden; }
.more-btn, .more-scrim { display: none; }
.rail-more { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-label { padding: 10px 12px 6px; font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); border-top: 1px solid var(--line); margin-top: 2px; }
.rail-tree { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; display: grid; align-content: start; gap: 1px; padding: 4px 0 8px; }
.tree-space, .tree-doc { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; border-radius: var(--r-ctl); color: var(--ink); text-align: left; font-size: 13px; line-height: 1.3; padding: 6px 12px; }
.tree-space { font-weight: 500; color: var(--dim); }
.tree-doc { padding-left: calc(12px + var(--lvl, 1) * 14px); color: var(--dim); }
.tree-space span, .tree-doc span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-space:hover, .tree-doc:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.tree-space.is-on { font-weight: 600; color: var(--ink); }
.tree-doc i { flex: none; width: 14px; font: 500 10px var(--mono); font-style: normal; color: var(--faint); text-transform: uppercase; }
.tree-empty { padding: 4px 12px; font-size: 12px; color: var(--faint); }
.rail-foot { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.avatar { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 0 -2.5px; border-radius: var(--r-tag); background: var(--ink); color: var(--on-ink); font: 600 11px/1 var(--mono); font-style: normal; }
.dock-btn.is-on .avatar { background: var(--on-ink); color: var(--ink); }
#who { text-transform: none; letter-spacing: 0.01em; font: 500 13px/1 var(--font); }

.topbar { position: fixed; inset: 0 0 auto 0; z-index: var(--z-bar); height: calc(var(--top) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) clamp(16px, 3vw, 40px) 0; display: flex; align-items: center; gap: 16px; background: var(--bar); border-bottom: 1px solid var(--rim); box-shadow: var(--e-1); transition: opacity 0.5s, background-color 0.6s; }
html:is([data-scene='focus'], [data-scene='close']) :is(.topbar, .rail) { background: none; border-color: transparent; box-shadow: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.clock { display: flex; align-items: baseline; justify-content: flex-end; gap: 8px; white-space: nowrap; font-family: var(--mono); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.clock b { font-weight: 500; font-size: 13px; letter-spacing: 0.04em; }
.clock span { font-size: 11px; letter-spacing: 0.05em; color: var(--dim); }
.help-btn { width: 36px; height: 36px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 600 13px var(--mono); }
.help-btn:hover { border-color: var(--ink); }
/* which chrome each scene shows */
html:is([data-scene='boot'], [data-scene='arrive'], [data-scene='onboard'], [data-scene='notice'], [data-scene='doc']) :is(.rail, .topbar, .capture) { visibility: hidden; opacity: 0; pointer-events: none; }
html:is([data-scene='boot'], [data-scene='arrive'], [data-scene='onboard'], [data-scene='notice'], [data-scene='doc']) .rail { transform: translateX(-24px); }
html[data-scene='focus'] .top-right { opacity: 0.6; transition: opacity 0.5s; }
html[data-scene='focus'] .topbar:is(:hover, :focus-within) .top-right { opacity: 1; }
/* focus owns the whole screen: the rail slides out and only a hairline at the edge stays to hover; the ring then sits in the middle */
@media (min-width: 761px) {
  html[data-scene='focus'] .rail { transform: translateX(calc(-100% + 10px)); opacity: 0; }
  html[data-scene='focus'] .rail:is(:hover, :focus-within) { transform: none; opacity: 1; background: color-mix(in srgb, var(--night) 86%, transparent); border-color: var(--rim); box-shadow: var(--e-3); }
}
/* entering from arrival: the shell assembles once, then area switches stay quick */
html[data-from='arrive'] .rail { animation: rail-in 0.8s var(--ez) both; }
html[data-from='arrive'] .topbar { animation: fade 0.8s 0.15s both; }
/* the working sheet comes forward out of depth, as in the prototype; the perspective exists only for this one move */
html[data-from='arrive'] #stage { perspective: 1400px; perspective-origin: 50% 30%; }
html[data-from='arrive'] .sheet.on { transform-origin: 50% 0; animation: sheet-in 1s var(--ez) 0.08s both; }
@keyframes rail-in { from { transform: translate3d(-100%, 0, 0); opacity: 0; } }
@keyframes sheet-in { from { transform: translate3d(0, 44px, -280px); opacity: 0; } }

/* ---------- stage: persistent scenes; the active one fills the content area ---------- */
#stage { position: fixed; inset: calc(var(--top) + env(safe-area-inset-top, 0px)) 0 calc(var(--tab) + 0px) 0; z-index: var(--z-stage); outline: none; }
.scene { position: absolute; inset: 0; margin: auto; display: flex; flex-direction: column; gap: 18px; width: min(720px, 100% - 32px); height: fit-content; max-height: 100%; visibility: hidden; opacity: 0; pointer-events: none; }
.scene.on { visibility: visible; opacity: 1; pointer-events: auto; }
.scene > .body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* working sheets: one full-bleed, translucent frost pane: the fog shows through. A scene change is a quick exit, then the content lifts in. */
.sheet { margin: 0; width: auto; height: auto; max-height: none; justify-content: flex-start; gap: 22px; padding: clamp(20px, 3vw, 36px) clamp(16px, 3.4vw, 48px) calc(64px + var(--cap)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background: var(--sheet); box-shadow: inset 0 1px 0 var(--rim); transition: opacity 0.14s, visibility 0s 0.14s; }
/* leaving is quick (140 ms); the new area fades in just behind it while its own content lifts in (enterScene in fx.mjs) */
.sheet.on { transition: opacity 0.24s 0.06s, visibility 0s; }
.sheet > * { width: 100%; max-width: 1240px; margin-inline: auto; flex: none; }
.sheet[data-scene='review'] > * { max-width: 920px; }
/* every area opens with a quiet mono label ("// TAKİP  12 takip"); the content's own headline does the talking */
.sheet .display { font-size: var(--fs-title); letter-spacing: -0.02em; line-height: 1.15; }
/* night: the sheets are simply gone */
html:is([data-scene='focus'], [data-scene='close']) .sheet { opacity: 0; visibility: hidden; }

/* bare scenes (arrival, setup, focus, close, notice): no slab, they come forward from a little depth */
.scene:not(.sheet) { align-items: center; text-align: center; transform: scale(0.82); transition: transform var(--t-scene) var(--ez), opacity 0.6s, visibility 0s 1s; }
.scene:not(.sheet).on { transform: none; transition: transform var(--t-scene) var(--ez) 0.12s, opacity 0.7s 0.2s, visibility 0s; }
.scene:not(.sheet) > .body { align-items: center; width: 100%; }
.scene:not(.sheet) :is(.eyebrow, .acts) { justify-content: center; }

/* arrival: opaque from the first frame, covering the stage edge to edge; nothing moves under it */
.scene[data-scene='arrive'] { position: fixed; inset: 0; width: auto; height: auto; max-height: none; z-index: var(--z-arrive); justify-content: center; padding: 96px 20px 30vh; background: var(--bg); transform: none; transition: opacity 0.55s var(--ez), visibility 0s 0.55s; }
.scene[data-scene='arrive'].on { transition: opacity 0.3s, visibility 0s; }
.arrival-hero { position: absolute; inset: 0; background: url('/assets/arrival-hero.webp') center 72% / cover no-repeat; }
.arrival-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--veil) 55%, transparent) 0%, color-mix(in srgb, var(--veil) 25%, transparent) 46%, transparent 64%); }
.scene[data-scene='arrive'] > .body { position: relative; gap: 14px; max-width: 760px; }

/* Arrival is alive, on the compositor only (opacity and transforms; nothing repaints, nothing under it runs):
   the light inside the ice breathes, a thin fog crosses in front of it, the camera drifts in very slowly,
   the words arrive one after another, and "Ortama gir" moves the camera into the ice as the scene fades. */
.arrival-hero { transform-origin: 50% 72%; transition: transform 1.1s var(--ez); }
.hero-glow, .hero-fog { position: absolute; pointer-events: none; }
.hero-glow { inset: 0; background: radial-gradient(ellipse 26% 16% at 50% 72%, color-mix(in srgb, var(--shine) 70%, transparent), color-mix(in srgb, var(--shine) 22%, transparent) 55%, transparent 75%); opacity: 0.25; }
.hero-fog { inset: -6% -20% -10% -20%; background: url('/assets/fog-wisp.webp') center 70% / cover no-repeat; opacity: 0.2; }
.scene[data-scene='arrive']:not(.on) .arrival-hero { transform: scale(1.16); }
@media (prefers-reduced-motion: no-preference) {
  .scene[data-scene='arrive'].on .arrival-hero { animation: hero-drift 48s ease-in-out infinite alternate; }
  .scene[data-scene='arrive'].on .hero-glow { animation: hero-breathe 7s ease-in-out infinite alternate; }
  .scene[data-scene='arrive'].on .hero-fog { animation: hero-fog 70s linear infinite alternate; }
  .scene[data-scene='arrive'].on > .body > * { animation: hero-rise 1.1s var(--ez-out) both; }
  .scene[data-scene='arrive'].on > .body > :nth-child(2) { animation-delay: 0.12s; }
  .scene[data-scene='arrive'].on > .body > :nth-child(3) { animation-delay: 0.26s; }
  .scene[data-scene='arrive'].on > .body > :nth-child(4) { animation-delay: 0.5s; }
  .scene[data-scene='arrive'].on > .body > :nth-child(n+5) { animation-delay: 0.72s; }
}
@keyframes hero-drift { from { scale: 1; } to { scale: 1.05; } }
@keyframes hero-breathe { from { opacity: 0.12; } to { opacity: 0.62; } }
@keyframes hero-fog { from { transform: translate3d(-6%, 0, 0); } to { transform: translate3d(6%, -3%, 0); } }
@keyframes hero-rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
.arrival-mark { height: 15px; width: 96px; margin-bottom: 14px; }
.hello { font: 500 var(--fs-display)/1.05 var(--display); letter-spacing: -0.032em; text-wrap: balance; }
.hello em { display: block; font-style: normal; font-weight: 400; font-size: 0.42em; letter-spacing: -0.015em; line-height: 1.3; margin-top: 0.5em; }
.remind { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font: 500 12px/1.5 var(--mono); letter-spacing: 0.03em; }
.remind li { display: flex; align-items: center; gap: 9px; }
.remind li::before { content: ''; width: 5px; height: 5px; border-radius: 0; background: currentColor; flex: none; }
.scene[data-scene='arrive'] .btn:not(.btn-primary) { background: color-mix(in srgb, var(--ice) 60%, transparent); }

/* setup and notice: one sheet-like card, centred */
.onb-card { width: min(640px, 100%); display: grid; gap: 16px; padding: clamp(20px, 3.4vw, 42px); text-align: left; background: var(--sheet); border: 1px solid var(--rim); border-radius: var(--r-sheet); box-shadow: var(--e-3); }
.onb-card textarea { font-size: 16px; }
.onb-card.signin { width: min(420px, 100%); margin: auto; }
.onb-card.signin .field input { letter-spacing: 0.3em; }
.signin-err { margin: 0; color: var(--danger); font-size: 13px; }
/* sign-in by email (login.mjs): the arrival scene, with the form where the greeting stands */
.scene[data-scene='arrive'] .hello em { overflow-wrap: anywhere; }
.login-form { width: min(440px, 100%); display: grid; gap: 12px; margin-top: 12px; text-align: left; }
.login-label { font: 500 11px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.login-row { display: flex; gap: 8px; }
.login-row input { flex: 1; min-width: 0; }
.login-code { font: 400 24px/1 var(--mono); letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.login-keep { justify-self: start; }
.login-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
html .scene[data-scene='arrive'] .login-links .btn.btn-ghost { background: transparent; }
.login-form .btn:disabled { opacity: 0.4; cursor: default; }
.login-hint { margin: 0; font-size: 13px; color: var(--dim); }
.login-legal { max-width: 440px; margin: 20px 0 0; font-size: 12px; color: var(--dim); }
.account-delete { margin-top: 12px; gap: 10px; }
.account-email { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .login-row { flex-direction: column; }
}
.passcode-form { margin-top: 10px; gap: 10px; }
.passcode-form .field input { width: 9em; }
.onb-card .field input { font-size: 20px; padding: 14px 18px; }
.steps { display: flex; gap: 6px; }
.steps i { width: 24px; height: 3px; border-radius: 0; background: var(--line-2); }
.steps i.on { background: var(--ink); }
.pack-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* focus: the light gathers around the timer */
.scene[data-scene='focus'] > .body { gap: 12px; }
.ring-wrap { position: relative; width: min(300px, 34vh, 74vw); aspect-ratio: 1; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: color-mix(in srgb, var(--ink) 14%, transparent); stroke-width: 2; }
/* the ring empties by one CSS animation set for the whole remaining time, in 5-second steps: no per-second updates, no per-frame work */
.ring-bar { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; animation: ring-run var(--ring-left, 0s) steps(var(--ring-steps, 1), end) forwards; }
@keyframes ring-run { to { stroke-dashoffset: 879.65; } }
.ring.is-over .ring-bar { stroke: var(--warn); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; }
.timer { font: 400 var(--fs-timer)/1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.timer-sub { color: var(--dim); font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.focus-title { max-width: 24ch; font: 500 var(--fs-hero)/1.12 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.focus-step { color: var(--dim); font-size: 17px; }
.pause-form { display: grid; gap: 12px; width: min(520px, 100%); }
.pause-form label { font-weight: 600; }
.pause-form input { font-size: 17px; text-align: center; }
.scene[data-scene='focus'] .eyebrow, .scene[data-scene='focus'] .eyebrow span { color: var(--ink); }
html:is([data-scene='focus'], [data-scene='close']) .scene .btn-ghost:not(.is-on) { background: var(--sheet); }

/* a very soft shade behind the credits keeps the lettering readable over the brightest wisps of the night picture */
.scene[data-scene='close']::before { content: ''; position: absolute; z-index: -1; inset: -20vh -24vw; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--veil) 70%, transparent) 0%, color-mix(in srgb, var(--veil) 50%, transparent) 36%, transparent 68%); }
/* close of day: the credits */
.credits { position: relative; width: 100%; }
.credits-roll { text-align: center; }
.credits.is-rolling { height: min(62vh, 560px); overflow: hidden; -webkit-mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.credits.is-rolling .credits-roll { animation: roll 24s linear 0.4s both; }
@keyframes roll { from { transform: translateY(min(62vh, 560px)); } to { transform: translateY(-100%); } }
.credits-kicker { font: 500 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 12px; }
.credits-title { font: 500 var(--fs-display)/1 var(--display); letter-spacing: -0.03em; margin-bottom: 36px; }
.credits-role { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin: 26px 0 8px; }
.credits-name { font: 500 20px/1.5 var(--display); }
.credits-quote { font: 500 20px/1.4 var(--display); color: var(--dim); max-width: 30ch; margin: 36px auto 0; }
.credits-end { font: 500 28px var(--display); margin: 44px 0 20px; }

/* ---------- the shell contract: eyebrow > one hero > acts > aside ---------- */
.eyebrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font: 500 11px/1.4 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.eyebrow b { color: var(--ink); font-weight: 600; }
.eyebrow b::before { content: '// '; opacity: 0.6; }
.eyebrow span { text-transform: none; letter-spacing: 0.01em; font: 400 13px/1.4 var(--font); }
.display, .hero-title { font: 500 var(--fs-hero)/1.06 var(--display); letter-spacing: -0.032em; text-wrap: balance; overflow-wrap: anywhere; }
.hero-title { cursor: pointer; }
.hero-title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.hero { display: grid; gap: 12px; min-width: 0; }
.hero .tags { align-items: center; }
.lede { font-size: 17px; color: var(--dim); max-width: 60ch; text-wrap: pretty; }
.lede b { color: var(--ink); font-weight: 600; }
.lede-sm { color: var(--dim); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.props { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.props ul { display: grid; gap: 8px; }
.prop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: var(--r-panel); border: 1px solid var(--line-2); background: var(--panel); }
.prop.is-destructive { border-color: var(--danger); }
.prop-main { flex: 1 1 260px; display: grid; gap: 3px; min-width: 0; }
.prop-main b { font-weight: 600; overflow-wrap: anywhere; }
.prop-main small { color: var(--dim); font-size: 13px; }
.prop-acts { display: flex; gap: 6px; }
.ai-ask { display: flex; gap: 8px; align-items: center; }
.ai-ask input { flex: 1; }
.ai-note { font-size: 12px; }
.ai-pre { white-space: pre-wrap; font: 12px/1.5 var(--mono); color: var(--dim); max-height: 60vh; overflow: auto; }
.muted { color: var(--faint); }
.muted-sm { display: block; font-size: 15px; color: var(--dim); }
.hint { color: var(--faint); font-size: 13px; }
.hint .ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.warn-text { color: var(--warn); font-style: normal; font-weight: 600; }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row.gap > input { flex: 1; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-head .row-more { margin-top: 0.4em; }
.scene-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.scene-head .energy { margin-left: auto; }
@media (max-width: 760px) { .scene-head .energy { margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } .scene-head .energy-opt { justify-content: center; padding-inline: 6px; } }

/* ---------- surfaces inside a sheet ---------- */
.card { display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--rim); border-radius: var(--r-panel); padding: 18px; min-width: 0; }
.card > .btn, .onb-card .btn { justify-self: start; }
.card-soft { background: none; border-color: var(--line); }
/* inside the sheet a card is a section, not a box: whitespace, then a hairline above it */
.sheet .card { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 16px 0 0; }
/* the one raised surface allowed in a sheet: a form the user is filling in */
.raised, .sheet .card.raised { background: var(--panel); border: 1px solid var(--rim); border-radius: var(--r-panel); padding: 16px; }
.card-label, .hero-label { font: 500 11px/1.4 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.group { margin-top: 6px; font-size: 12px; color: var(--faint); }
.tblock { display: grid; gap: 10px; }

/* ---------- controls: squared, mono labels, corner brackets on hover and focus ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--panel); color: var(--ink); font: 600 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: transform var(--t-fast), background-color var(--t-ui), color var(--t-ui), border-color var(--t-ui); }
.btn:active { transform: scale(0.97); }
.btn:hover { border-color: var(--ink); }
/* the brackets are always laid out; only their opacity and scale change */
.btn::after { content: ''; position: absolute; inset: -5px; pointer-events: none; opacity: 0; transform: scale(1.06); color: var(--ink); transition: opacity var(--t-ui), transform var(--t-ui) var(--ez-out);
  background: linear-gradient(currentColor 0 0) 0 0 / 9px 1.5px, linear-gradient(currentColor 0 0) 0 0 / 1.5px 9px, linear-gradient(currentColor 0 0) 100% 0 / 9px 1.5px, linear-gradient(currentColor 0 0) 100% 0 / 1.5px 9px, linear-gradient(currentColor 0 0) 0 100% / 9px 1.5px, linear-gradient(currentColor 0 0) 0 100% / 1.5px 9px, linear-gradient(currentColor 0 0) 100% 100% / 9px 1.5px, linear-gradient(currentColor 0 0) 100% 100% / 1.5px 9px;
  background-repeat: no-repeat; }
.btn:hover::after { opacity: 1; transform: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost.is-on { background: var(--ink); color: var(--on-ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-go .ic { width: 13px; height: 13px; }
.btn-lg { min-height: 52px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }
.link { border: 0; background: none; color: var(--ink); font-size: 13px; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-ctl); border: 0; background: transparent; color: var(--dim); transition: color var(--t-ui), background-color var(--t-ui); flex: none; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.icon-btn.subtle { opacity: 0.55; }
li:hover .icon-btn.subtle, .icon-btn.subtle:focus-visible { opacity: 1; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--r-ctl); padding: 9px 13px; font: 500 12px/1.2 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink); cursor: pointer; transition: background-color var(--t-ui), color var(--t-ui), border-color var(--t-ui); }
.chip:hover { border-color: var(--ink); }
.chip.is-on, label.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
label.chip:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip.subtle { opacity: 0.75; }
.chip .ic { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* energy: the same square mono chips */
.energy { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.energy-opt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font: 500 12px/1.2 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; transition: background-color var(--t-ui), color var(--t-ui), border-color var(--t-ui); }
.energy-opt:hover { border-color: var(--ink); }
.energy-opt.is-on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.energy-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.energy-bars i { width: 3px; border-radius: 0; background: currentColor; opacity: 0.35; }
.energy-bars i:nth-child(1) { height: 4px; } .energy-bars i:nth-child(2) { height: 8px; } .energy-bars i:nth-child(3) { height: 12px; }
.e-low i:nth-child(1), .e-mid i:nth-child(-n + 2), .e-high i { opacity: 1; }

/* fields: :where() keeps this at zero specificity, so a component can restyle its own field plainly */
:where(input:not([type='checkbox'], [type='radio']), textarea, select) { width: 100%; background-color: var(--field); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 10px 12px; line-height: 1.55; }
/* one focus ring for a field: the border turns ink and a 1px ink ring thickens it; never an outline as well */
:where(input:not([type='checkbox'], [type='radio'], [type='range']), textarea, select):focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
/* native controls wear the same skin as a text field in every engine: same font, padding and height */
:where(select, input[type='date'], input[type='time'], input[type='number']) { appearance: none; -webkit-appearance: none; font-variant-numeric: tabular-nums; min-width: 0; }
:where(select) { padding-right: 34px; text-overflow: ellipsis; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
:where(input[type='date'], input[type='time'])::-webkit-date-and-time-value { text-align: left; margin: 0; }
:where(input[type='date'], input[type='time'])::-webkit-datetime-edit { padding: 0; }
:where(input[type='date'], input[type='time'])::-webkit-datetime-edit-fields-wrapper { padding: 0; line-height: 1; }
:where(input[type='date'], input[type='time'])::-webkit-calendar-picker-indicator { opacity: 0.55; margin: 0; padding: 0; }
:where(input[type='number'])::-webkit-inner-spin-button, :where(input[type='number'])::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
textarea { resize: vertical; line-height: 1.5; }
::placeholder { color: var(--faint); opacity: 1; }
input[type='checkbox'] { accent-color: var(--ink); width: 18px; height: 18px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form :is(input, select) { flex: 1 1 120px; width: auto; }
.inline-form label { flex-basis: 100%; color: var(--dim); }
.field { display: grid; gap: 6px; flex: 1; }
.field > span { font-size: 12px; color: var(--dim); }
.field.check, .check { display: flex; align-items: center; gap: 10px; }
.field.check { align-self: end; padding-bottom: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; font: 500 11px/1.3 var(--mono); letter-spacing: 0.02em; color: var(--dim); padding: 0; border: 0; background: none; white-space: nowrap; }
.tag .ic { width: 12px; height: 12px; }
.tag-amber { color: var(--ink); font-weight: 600; }
.tag-violet, .tag-idea, .tag-project { color: var(--acc); }
.tag-violet { font-weight: 600; }
.tag-violet .ic { fill: currentColor; stroke: none; }
.tag-task { color: var(--ink); }
.tag-expense, .tag-routine { color: var(--ok); }
.tag-area { color: var(--faint); margin-left: 8px; font-weight: 500; }

/* ---------- scene components ---------- */
/* ---------- NOW ---------- */
.first-step { display: flex; align-items: center; gap: 12px; }
.first-step label { flex: none; font: 500 11px/1.4 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.first-step input { font-size: 16px; }
.start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.stuck-title {  color: var(--dim); }
.stuck-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px; border-radius: var(--r-panel); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--ink) 6%, transparent); transition: border-color 0.2s, background-color 0.2s, transform 0.2s var(--ez-out); }
.choice:hover { border-color: var(--ink); }
.choice small { color: var(--faint); font-size: 13px; }
.choice kbd { justify-self: start; }
.choice.subtle { opacity: 0.75; }
.choice textarea { font-size: 13px; }
.choice .btn { justify-self: start; }
/* bars are 2px lines: a --line track, an ink fill scaled from the left (transform only, never width) */
.progress { height: 2px; background: var(--line); overflow: hidden; margin: 6px 0 12px; }
.progress i, .cat-bar i, .mirror-bar i { display: block; width: 100%; height: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left; }
.progress i { transition: transform 1s var(--ez-out); }
.progress.is-over i { background: var(--warn); }

/* ---------- DAY ---------- */
.tasks, .trows, .pay-list, .wishes, .expenses, .ideas, .wins, .carry { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.is-important .task-title::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); margin-right: 8px; vertical-align: middle; }
.task-main { flex: 1; min-width: 0; display: grid; gap: 4px; border: 0; background: none; text-align: left; padding: 2px 0; }
.task-title { overflow-wrap: anywhere; }
.task-main:hover .task-title { color: var(--ink); }
.task-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.tick { cursor: pointer; flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-ctl); border: 1.5px solid var(--dim); background: transparent; color: transparent; transition: border-color var(--t-ui), background-color var(--t-ui), color var(--t-ui); }
.tick .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick:disabled { opacity: 0.3; cursor: default; }
.is-done > .tick { cursor: pointer; background: var(--ok); border-color: var(--ok); color: var(--on-ink); }

/* ---------- MONEY ---------- */
.wishes li, .expenses li, .ideas li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wishes li:last-child, .expenses li:last-child, .ideas li:last-child { border-bottom: 0; }
.wishes li > span:first-child, .expenses li > span:first-child { flex: 1; display: grid; gap: 2px; min-width: 0; }
.wishes small, .expenses small { color: var(--faint); font-size: 12px; }
.num { font: 400 13px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.saved { margin: 14px 0 0; color: var(--ok); }
.cat { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.cat-bar { height: 2px; background: var(--line); overflow: hidden; }
.expenses { margin-top: 14px; }

/* ---------- REVIEW ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 18px; }
.stats div { padding: 12px 0; display: grid; gap: 2px; border-top: 1px solid var(--line); }
.stats div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.stats b { font: 500 var(--fs-hero)/1 var(--display); }
.stats span { color: var(--faint); font-size: 13px; }
.wins li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.wins .ic { color: var(--ok); }
.carry li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 2px; }
.seg button { border: 0; background: none; border-radius: var(--r-ctl); font-size: 12px; }
.seg button.is-on { background: var(--ink); color: var(--on-ink); border-radius: var(--r-tag); }
.tabs { display: flex; flex-wrap: nowrap; gap: 0 22px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; margin-bottom: -1px; padding: 9px 0 10px; border: 0; background: none; color: var(--dim); font: 500 12px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: color var(--t-ui); }
.tabs button:hover { color: var(--ink); }
.tabs .is-on { color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }
form.card textarea { margin-bottom: 14px; }
.carry + .card-label { margin-top: 22px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 150px; margin-bottom: 14px; }
.week-day { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 4px; height: 100%; }
.week-bar { width: 100%; max-width: 12px; display: flex; align-items: flex-end; height: 100%; border-radius: var(--r-tag); background: color-mix(in srgb, var(--ink) 6%, transparent); overflow: hidden; }
.week-bar i { display: block; width: 100%; background: var(--ink); border-radius: 0; min-height: 2px; }
.week-day b { font: 500 12px var(--mono); color: var(--ok); min-height: 1em; }
.week-day small { font-size: 11px; color: var(--faint); }
.week-day.is-today small { color: var(--ink); }
.insight { margin: 0; color: var(--dim); font-size: 13px; }
.settings summary { cursor: pointer; margin: 0; list-style: none; }
.settings[open] summary { margin-bottom: 14px; }
.settings-form { display: grid; gap: 12px; }
.settings-form label { display: grid; gap: 6px; font-size: 13px; color: var(--dim); }
.settings-form label.check { display: flex; }
.settings-form .btn { justify-self: start; }

/* "why this" — the suggestion explains itself */
.nudges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.nudge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--dim); font-size: 13px; text-align: left; transition: border-color var(--t-ui); }
.nudge:hover { color: var(--ink); border-color: var(--line-2); }
.nudge b { color: var(--ink); }
.nudge.warn, .nudge.warn b { color: var(--warn); border-color: var(--warn); }
.nudge .ic { width: 14px; height: 14px; }

/* ---------- film strip: the day ---------- */
.strip-scroll { overflow-x: auto; scrollbar-width: thin; }
.strip-track { position: relative; height: 128px; margin: 0 14px; }
.hour { position: absolute; top: 18px; bottom: 18px; width: 1px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-style: normal; }
.hour b { position: absolute; top: -2px; left: 5px; font: 400 10px var(--mono); color: var(--faint); }
.after-end { position: absolute; top: 0; bottom: 0; right: -14px; border-left: 1px solid var(--line-2); }
.after-end span { position: absolute; bottom: 20px; left: 6px; font: 500 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--warn); white-space: nowrap; }
.frame { position: absolute; top: 34px; bottom: 30px; display: grid; align-content: center; gap: 2px; padding: 0 10px; min-width: 6px; overflow: hidden; text-align: left; border-radius: var(--r-ctl); border: 1px solid color-mix(in srgb, var(--ink) 40%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 20%, transparent), color-mix(in srgb, var(--ink) 7%, transparent)); color: var(--ink); transition: transform 0.2s var(--ez-out); }
.frame span { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame small { font: 400 10px var(--mono); color: var(--faint); }
.frame:hover { z-index: 3; border-color: var(--ink); }
.frame.is-important { border-color: color-mix(in srgb, var(--acc) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 28%, transparent), color-mix(in srgb, var(--acc) 8%, transparent)); }
.frame-focus { border-color: var(--ink); }
.frame-routine { top: 22px; bottom: 22px; border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 14%, transparent); padding: 0 6px; }
.frame-routine span { font-size: 11px; color: var(--ok); }
.frame-routine.is-missed { border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.frame-routine.is-missed span { color: var(--warn); }
.frame.is-overflow { border-color: var(--line-2); background: color-mix(in srgb, var(--ink) 10%, transparent); }
.now-line { position: absolute; top: 10px; bottom: 10px; width: 2px; margin-left: -1px; background: var(--acc); z-index: 4; pointer-events: none; }
.now-line span { position: absolute; top: -2px; left: 6px; font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--acc); }
.strip-caption { color: var(--dim); font-size: 13px; }
.strip-caption.is-over b, .strip-caption.is-over { color: var(--warn); }

/* progressive disclosure */
.reveal-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); padding: 2px 0; }
.reveal-more > summary::-webkit-details-marker { display: none; }
.reveal-more > summary::before { content: '+'; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: var(--r-tag); border: 1px solid var(--line-2); font-size: 12px; transition: transform 0.3s var(--ez-out); }
.reveal-more[open] > summary::before { transform: rotate(45deg); }
.reveal-more[open] > summary { margin-bottom: 12px; color: var(--dim); }
.reveal-more > summary .ic { width: 14px; height: 14px; }
.card > .reveal-more { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- clarify ---------- */
.choice.is-on { border-color: var(--ink); border-width: 2px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.clarify-form { display: grid; gap: 10px; margin: 18px 0 4px; padding: 18px; border-radius: var(--r-panel); background: var(--field); border: 1px solid var(--line); }
.clarify-form label { color: var(--dim); }
.clarify-form input { font-size: 16px; }
.clarify-form select, .clarify-form input[type='time'] { width: auto; flex: 0 1 160px; }
.quick-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.quick-grid .choice { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-ctl); }

/* ---------- projects ---------- */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.poster.is-paused { opacity: 0.55; }
.poster-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.poster-head .card-label { margin: 0; }
.poster-actions { display: flex; gap: 12px; }
.poster-title { margin: 0; font: 500 24px/1.12 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.next-step { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.next-step .row-more { margin-left: auto; }
.next-step small { font: 500 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); }
.next-step .task-title { font-size: 16px; }
.poster .inline-form { margin: 0; }
.poster .link { justify-self: start; }
.poster-foot { margin: auto 0 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.poster-foot .ic { width: 12px; height: 12px; color: var(--ok); }

/* ---------- money ---------- */
.money-hero { margin: 4px 0 30px; }

/* ---------- track: one glance ---------- */
.trows { display: grid; }
.trow.is-done { opacity: 0.55; }
.tcheck { width: 30px; height: 30px; border-radius: var(--r-ctl); display: grid; place-items: center; border: 1.5px solid var(--dim); background: transparent; color: transparent; transition: border-color var(--t-ui), background-color var(--t-ui), color var(--t-ui); }
.tcheck .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.tcheck:hover { border-color: var(--ok); color: var(--ok); }
.trow.is-done .tcheck { background: var(--ok); border-color: var(--ok); color: var(--on-ink); }
.tmain { display: grid; gap: 3px; min-width: 0; }
.tmain b { font-weight: 500; overflow-wrap: anywhere; }
.tmain small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.tmain small .ic { width: 11px; height: 11px; fill: var(--warn); stroke: none; }
.tstate { font: 500 12px var(--mono); color: var(--dim); white-space: nowrap; }
.trow.is-late .tstate { color: var(--warn); }
.trow.is-today .tstate { color: var(--ink); }
.tacts { display: flex; align-items: center; gap: 6px; }
.btn-go { border-color: color-mix(in srgb, var(--ink) 45%, transparent); color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); text-decoration: none; }
.btn-go:hover { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.hero .btn-go {  }
.track-edit { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.track-edit input, .track-edit select { flex: 1 1 160px; width: auto; }
.new-track { display: grid; gap: 10px; margin: 8px 0 18px; padding: 18px; border-radius: var(--r-panel); border: 1px solid var(--line); }
.new-track .card-label { margin: 0; }

.area-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.packs { display: grid; gap: 8px; margin-top: 4px; }
.pack { border: 1px solid var(--line); border-radius: var(--r-panel); padding: 10px 14px; background: var(--field); }
.pack > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.pack > summary::-webkit-details-marker { display: none; }
.pack > summary small { color: var(--faint); font-weight: 400; }
.pack ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.pack li label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); cursor: pointer; }

.poster-due { margin: -4px 0 0; display: inline-flex; align-items: center; gap: 6px; font: 500 12px var(--mono); color: var(--dim); }
.poster-due .ic { width: 13px; height: 13px; }
.poster-due.is-near { color: var(--warn); }

/* ---------- money: payment order ---------- */
.payplan {  }
.cash-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 16px; }
.cash-form label { color: var(--dim); font-size: 13px; }
.cash-form input { flex: 1 1 140px; width: auto; font: 400 17px var(--mono); }
.pay-list { display: grid; }
.pay-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pay-list li:last-child { border-bottom: 0; }
/* in a narrow column the row folds into two lines: rank, title and ⋯ on the first; amount and actions on the second (⋯ never wraps alone) */
.pay-list { container-type: inline-size; }
@container (max-width: 640px) {
  .pay-list li > .rank { order: 0; }
  .pay-list li > .pmain { order: 1; flex: 1 1 0; }
  .pay-list li > .row-more { order: 2; }
  .pay-list li > :not(.rank, .pmain, .row-more) { order: 3; }
  .pay-list li > .num { margin-left: 36px; }
  .pay-list li::after { content: ''; order: 2; flex-basis: 100%; height: 0; }
}
.pay-list .rank { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--r-tag); background: color-mix(in srgb, var(--ink) 9%, transparent); font: 500 12px var(--mono); color: var(--dim); }
.pay-list .pmain { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.pay-list small { font-size: 12px; color: var(--faint); }
.pay-list .cover { display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--mono); color: var(--ok); }
.pay-list .cover .ic { width: 12px; height: 12px; }
.pay-list li.is-short .cover { color: var(--warn); }
.pay-list li.is-late small { color: var(--warn); }
.pay-note { margin: 14px 0 0; color: var(--warn); font-size: 13px; }

/* ---------- projects: the 20% ---------- */
.mirror p { margin: 0; color: var(--dim); }
.mirror p b { color: var(--ink); }
.mirror .ic { width: 15px; height: 15px; color: var(--acc); vertical-align: -3px; margin-right: 6px; }
.mirror-bar { height: 2px; background: var(--line); overflow: hidden; margin-bottom: 10px; }
.mirror.is-low { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.lev-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: transparent; color: var(--faint); font: 500 11px var(--mono); letter-spacing: 0.08em; }
.lev-toggle .ic { width: 12px; height: 12px; }
.lev-toggle:hover { color: var(--acc); border-color: var(--acc); }
.lev-toggle.is-on { color: var(--acc-ink); background: var(--acc); border-color: var(--acc); }
.lev-toggle.is-on .ic { fill: currentColor; }



/* batch decisions & AI transparency */
.batch { margin: 8px 0 30px; }
.batch-list { list-style: none;  padding: 0; }
.batch-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.batch-list .bmain { flex: 1 1 240px; display: grid; gap: 4px; min-width: 0; }
.batch-list .bmain b { font: 400 17px/1.3 var(--display); }
.batch-list select { width: auto; flex: 0 0 auto; min-width: 120px; }
.batch-list li:not(:has(select[name^="as-"] option[value="routine"]:checked)) .every-pick { visibility: hidden; }
.choice b { font: 600 17px var(--display); }

.batch-list li:not(:has(select[name^="as-"] option[value="waiting"]:checked)) .who-pick { display: none; }
.batch-list .who-pick { width: auto; flex: 0 1 140px; }
.tmain[role="button"]:hover b { text-decoration: underline; }


.trow { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow.is-late .tstate { font-weight: 700; letter-spacing: 0.04em; }
.mirror {  padding: 14px 16px; border-radius: var(--r-panel); border: 1px solid var(--line); background: var(--panel); }
.poster { position: relative; display: grid; align-content: start; gap: 12px; padding: 16px 0 0; min-height: 200px; border-top: 1px solid var(--line); }
.money-number { font: 500 var(--fs-number)/0.95 var(--display); letter-spacing: -0.05em; }
.strip { position: relative; margin: 22px 0 8px; border-block: 1px solid var(--line); overflow: hidden; }

/* ---------- pieces rewritten for the sheet layout ---------- */
.stuck { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.clarify-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.progress.big { max-width: 520px; }
.new-track .row input { flex: 1 1 180px; width: auto; }
.cool { width: 20px; height: 20px; border-radius: var(--r-tag); border: 2px solid color-mix(in srgb, var(--acc) 35%, transparent); border-top-color: var(--acc); }
.frame-event { background: color-mix(in srgb, var(--ink) 10%, transparent); border-color: var(--ink); }
.tmain[role="button"] { cursor: pointer; }
.reveal-more > :not(summary) { margin-top: 12px; }
.new-project { display: flex; }

/* ---------- capture line: docked at the bottom, where the thumb is; always there ---------- */
.capture { position: fixed; z-index: var(--z-capture); left: 0; right: 0; bottom: calc(var(--tab) + 14px); margin: 0 auto; width: min(640px, 100% - 32px); transition: opacity 0.5s, visibility 0s; }
.capture-bar { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 7px 0 16px; border-radius: var(--r-panel); background: var(--ice); border: 1px solid var(--line-2); box-shadow: var(--e-2); }
html[data-scene='focus'] .capture:not(:focus-within) { opacity: 0.55; }
html.more-open .capture { visibility: hidden; opacity: 0; }
/* on the night scenes the bar is night too, whatever the theme */
html:is([data-scene='focus'], [data-scene='close']) .capture-bar { background: var(--sheet); border-color: var(--rim); box-shadow: none; }
.capture:has(input:focus) .capture-bar { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.capture-glyph { font: 400 20px/1 var(--mono); color: var(--dim); }
:is(.capture-bar, .quick-capture) input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; padding: 0; font-size: 16px; }
:is(.capture-bar, .quick-capture) input:is(:focus, :focus-visible) { outline: none; box-shadow: none; }
.capture-mic { width: 32px; height: 32px; border-radius: var(--r-ctl); border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }
.capture-mic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.capture-mic.is-on { background: var(--ink); color: var(--on-ink); }
.capture-preview { position: absolute; z-index: 3; bottom: calc(100% + 8px); left: 0; width: max-content; max-width: min(640px, 100vw - 32px); display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: var(--r-panel); background: var(--ice); border: 1px solid var(--line-2); box-shadow: var(--e-2); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity var(--t-ui), transform var(--t-ui) var(--ez-out), visibility 0s var(--t-ui); pointer-events: none; }
.capture-preview.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity var(--t-ui), transform var(--t-ui) var(--ez-out), visibility 0s; }
.capture-preview:empty { display: none; }
.capture-preview.is-examples { pointer-events: auto; }
.capture-preview .tag, .where { background: var(--ice); color: var(--ink); border-color: var(--line-2); }
.capture-preview .tag, .tag-example { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: var(--r-tag); }
.tag-example { cursor: pointer; }
.tag-example:hover { border-color: var(--ink); }
.where { font: 500 11px var(--mono); padding: 3px 8px; border-radius: var(--r-tag); align-self: center; margin-left: 4px; }

/* ---------- toasts and the done mark ---------- */
.toasts { position: fixed; z-index: var(--z-top); top: calc(var(--top) + env(safe-area-inset-top, 0px) + 12px); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast { display: inline-flex; align-items: center; gap: 12px; pointer-events: auto; max-width: 100%; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--ink); color: var(--on-ink); font: 600 12px/1.35 var(--mono); letter-spacing: 0.03em; box-shadow: var(--e-2); animation: toast-in 0.3s var(--ez-out) both; transition: opacity 0.4s, transform 0.4s; }
.toast.warn { outline: 2px solid var(--danger); outline-offset: 2px; }
.toast.warn::before { content: '!'; font-weight: 700; }
.toast.is-out { opacity: 0; transform: translateY(-6px); }
.toast button { border: 1px solid currentColor; background: none; color: inherit; border-radius: var(--r-tag); padding: 4px 9px; font: inherit; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
/* the done moment: brackets lock onto the spot, once (transform and opacity only) */
.done-lock { position: fixed; z-index: var(--z-fx); width: 0; height: 0; pointer-events: none; }
.done-lock::after { content: ''; position: absolute; inset: -20px; color: var(--ink); animation: done-lock 0.9s var(--ez-out) both;
  background: linear-gradient(currentColor 0 0) 0 0 / 11px 2px, linear-gradient(currentColor 0 0) 0 0 / 2px 11px, linear-gradient(currentColor 0 0) 100% 0 / 11px 2px, linear-gradient(currentColor 0 0) 100% 0 / 2px 11px, linear-gradient(currentColor 0 0) 0 100% / 11px 2px, linear-gradient(currentColor 0 0) 0 100% / 2px 11px, linear-gradient(currentColor 0 0) 100% 100% / 11px 2px, linear-gradient(currentColor 0 0) 100% 100% / 2px 11px;
  background-repeat: no-repeat; }
@keyframes done-lock { from { transform: scale(2.3); opacity: 0; } 45% { transform: none; opacity: 1; } to { transform: none; opacity: 0; } }
/* ...and a ring of light opens around it (the generated done-glow, used as a mask so it is ink on daylight and ice at night) */
.done-lock::before { content: ''; position: absolute; left: -150px; top: -147px; width: 300px; height: 294px; background: var(--acc); -webkit-mask: url('/assets/done-glow.webp') center / 100% 100% no-repeat; mask: url('/assets/done-glow.webp') center / 100% 100% no-repeat; animation: done-glow 1.1s var(--ez-out) both; }
@keyframes done-glow { from { transform: scale(0.35); opacity: 0; } 35% { opacity: 0.85; } to { transform: scale(1.15); opacity: 0; } }
/* the day's wins settle in line by line (enterScene), the count on a badge bumps, the capture bar answers a sent note */
.badge { transform-origin: 50% 60%; }
/* a switch: the knob springs across (transform only) */
.settings-form label.check input[type='checkbox'] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: var(--r-panel); border: 1px solid var(--line-2); background: var(--field); cursor: pointer; transition: background-color var(--t-ui), border-color var(--t-ui); }
.settings-form label.check input[type='checkbox']::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--dim); transition: transform 0.42s cubic-bezier(0.3, 1.5, 0.5, 1), background-color var(--t-ui); }
.settings-form label.check input[type='checkbox']:checked { background: var(--ink); border-color: var(--ink); }
.settings-form label.check input[type='checkbox']:checked::after { transform: translateX(16px); background: var(--on-ink); }

/* ---------- overlays: always daylight ice (.daylight), scrims without blur ---------- */
/* An overlay fades in once, when its permanent container opens; rewriting what is inside never replays it. */
.quick:not([hidden]), #overlay:not(:empty) { animation: fade 0.18s both; }
/* the container is its own layer above the stage, so the fade cannot drop it behind a sheet */
#overlay { position: relative; z-index: var(--z-overlay); }
@keyframes fade { from { opacity: 0; } }
.scrim { position: fixed; inset: 0; z-index: var(--z-overlay); background: var(--scrim); }
.drawer { position: fixed; z-index: var(--z-panel); top: 0; right: 0; bottom: 0; width: min(460px, 100%); display: grid; align-content: start; gap: 14px; padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; background: var(--ice); border-left: 1px solid var(--rim); box-shadow: var(--e-3); }
.drawer-title { font: 500 24px/1.2 var(--display); letter-spacing: -0.02em; border: 0; background: none; padding: 0; resize: none; }
.help { position: fixed; z-index: var(--z-panel); inset: 0; margin: auto; width: min(640px, 100% - 32px); height: fit-content; max-height: calc(100dvh - 48px); overflow-y: auto; display: grid; gap: 16px; padding: 26px; border-radius: var(--r-sheet); border: 1px solid var(--rim); background: var(--ice); box-shadow: var(--e-3); }
.help-title { font: 500 var(--fs-title)/1.2 var(--display); letter-spacing: -0.02em; }
.help-steps { display: grid; gap: 14px; }
.help-steps li { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.help-steps p { margin-top: 4px; color: var(--dim); font-size: 13px; }
.hstep { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r-tag); background: var(--ink); color: var(--on-ink); font: 600 13px var(--mono); }
/* the bottom question ("hallettin mi?", "tekrarlansın mı?", next project step) */
.ask { position: fixed; z-index: var(--z-ask); left: 0; right: 0; bottom: calc(var(--tab) + 20px); margin: 0 auto; width: min(640px, 100% - 32px); display: grid; gap: 8px; padding: 14px 18px; border-radius: var(--r-panel); border: 1px solid var(--ink); background: var(--ice); box-shadow: var(--e-2); }
.ask p { color: var(--dim); }
.ask p b { color: var(--ink); }
.ask .row input { flex: 1; }
/* the quick menu: the one modal */
.quick { position: fixed; inset: 0; z-index: var(--z-quick); display: grid; place-items: start center; padding: max(64px, 10vh) 12px 12px; overflow-y: auto; }
.quick-box { position: relative; z-index: var(--z-panel); width: min(580px, 100%); display: grid; gap: 12px; padding: 20px; border-radius: var(--r-sheet); background: var(--ice); border: 1px solid var(--rim); box-shadow: var(--e-3); }
.quick-capture { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--field); }
.quick-capture:has(input:focus) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.quick-rows li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.qmain { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.qmain small { font: 500 11px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.qmain b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.qacts { display: flex; gap: 6px; flex: none; }
.quick-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; }
.quick-foot kbd { margin-right: 6px; }

/* ---------- small screens: bottom tab bar + a "more" sheet ---------- */
@media (max-width: 760px) {
  :root { --top: 56px; --tab: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .rail { inset: auto 0 0 0; width: auto; height: var(--tab); flex-direction: row; gap: 0; padding: 0 6px env(safe-area-inset-bottom, 0px); border-right: 0; border-top: 1px solid var(--rim); overflow: visible; background: var(--ice); }
  html:is([data-scene='focus'], [data-scene='close']) .rail { background: var(--night); }
  .rail-head { display: none; }
  .dock { flex: 1; flex-direction: row; gap: 0; }
  .dock-btn { flex: 1; flex-direction: column; justify-content: center; gap: 5px; min-height: 0; height: 58px; padding: 0 2px; font-size: 10px; letter-spacing: 0.04em; text-align: center; }
  .dock .dock-btn > span:not(.badge) { flex: none; max-width: 100%; }
  .dock .dock-btn .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  .dock .dock-btn.is-on { background: none; color: var(--ink); border-radius: 0; box-shadow: inset 0 2px 0 var(--ink); }
  .more-btn { display: flex; }
  /* the rest of the rail (two more areas, spaces, journal, settings, overview) waits in a sheet */
  .dock .is-extra { position: fixed; z-index: 2; left: 12px; right: 12px; width: auto; flex-direction: row; justify-content: flex-start; gap: 11px; height: 44px; padding: 0 14px; font-size: 12px; text-align: left; display: none; }
  .dock .is-extra[data-scene='projects'] { bottom: calc(var(--tab) + var(--more-h, 320px) - 58px); }
  .dock .is-extra[data-scene='money'] { bottom: calc(var(--tab) + var(--more-h, 320px) - 104px); }
  .rail-more { position: fixed; left: 0; right: 0; bottom: var(--tab); max-height: calc(100dvh - var(--tab) - 24px); padding: 112px 12px 12px; background: var(--ice); border-top: 1px solid var(--rim); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--e-3); display: none; overflow: hidden; }
  .rail-more .dock-btn { flex: none; flex-direction: row; justify-content: flex-start; gap: 11px; height: 44px; padding: 0 14px; font-size: 12px; text-align: left; }
  .rail-more .dock-btn > span:not(.badge) { flex: 1; }
  .rail-more .dock-btn.is-on { background: var(--ink); color: var(--on-ink); }
  .rail-label { border-top: 0; }
  .rail-more > * { flex: none; }
  .rail-tree { max-height: 22vh; }
  html.more-open .rail-more { display: flex; }
  html.more-open .dock .is-extra { display: flex; }
  html.more-open .more-scrim { display: block; position: fixed; inset: 0; z-index: var(--z-bar); background: var(--scrim); }
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .scene-head .tabs { width: 100%; }
  /* ghost top bar (C15): no band, the eyebrow is the header */
  .topbar { background: none; border-bottom: 0; box-shadow: none; }
  .topbar .quick-btn, .topbar .help-btn { border-color: transparent; background: none; }
  .top-right { gap: 6px; }
  .clock, .quick-btn kbd, .scene[data-scene='arrive'] kbd { display: none; }
  .capture { bottom: calc(var(--tab) + 10px); width: calc(100% - 20px); }
  :root { --cap: 68px; }
  .scene { width: calc(100% - 24px); }
  .sheet { width: auto; padding: 18px 14px calc(40px + var(--cap)); }
  /* the last 80px of the sheet fade out under the capture bar (C15). Mobile only: on desktop a mask on .sheet breaks the dolly (M17) */
  .sheet { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 80px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 80px), transparent); }
  .scene[data-scene='arrive'] { width: auto; padding-bottom: 34vh; }
  .arrival-hero { background-image: url('/assets/arrival-hero-portrait.webp'); background-position: center 100%; }
  .remind { flex-direction: column; align-items: center; gap: 4px; }
  html[data-scene='close'] body::after { background-size: auto 58%; background-position: 86% 100%; opacity: 0.7; }
  .btn { min-height: 46px; padding: 0 18px; }
  .btn-sm { min-height: 36px; padding: 0 12px; }
  .split, .posters { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .cat { grid-template-columns: 70px 1fr auto; }
  .trow { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .tacts { grid-column: 2 / -1; grid-row: 2; }
  .tacts:not(:has(*)) { display: none; }
  .clarify-grid { grid-template-columns: 1fr 1fr; }
  .stuck-grid { grid-template-columns: 1fr; }
  .ask { width: calc(100% - 24px); }
}

/* ---------- reduced motion: nothing travels, nothing drifts ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .credits.is-rolling { height: auto; -webkit-mask: none; mask: none; }
  .credits.is-rolling .credits-roll { animation: none; }
  /* no drift, no ring animation (the ring is moved by hand every 5 s instead), no springs */
  .fog i, body::after, .ring-bar { animation: none !important; }
  .fog i { transition: none; translate: 0 0; }
  .settings-form label.check input[type='checkbox']::after { transition: none; }
}

/* ================= v6: home overview, track views, spaces, panels, editors ================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h2.card-label { margin: 0; }

/* ---------- Bugün: the day at a glance ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px 48px; align-items: start; }
.home-side { display: grid; gap: 32px; min-width: 0; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 32px 32px; align-items: start; }
.hsec { display: grid; gap: 12px; align-content: start; min-width: 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.hsec-now { gap: 16px; padding: 0; border: 0; }
.hsec-now .start-row { margin-bottom: 4px; }
.hsec-now .nudges { margin-top: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.hsec .props { padding: 0; border: 0; }
.hsec .task { padding: 6px 0; }
/* Rows in Bugün's narrow cards: the state goes under the title, ⋯ stays at the end of the first line. */
.hsec .trow { grid-template-columns: auto minmax(0, 1fr) auto; }
.hsec .trow > .row-more { grid-column: 3; grid-row: 1; }
.hsec .trow .tstate { grid-column: 2; grid-row: 2; margin-top: -6px; }
.hsec .trow .tacts { grid-column: 2 / -1; grid-row: 3; }
.hsec .trow .tacts:not(:has(*)) { display: none; }
.timed, .recent { display: grid; }
.timed li, .recent li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.timed li:last-child, .recent li:last-child { border-bottom: 0; }
.timed span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.timed small { font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em; }
.home-money { display: grid; gap: 2px; }
.home-money b { font: 500 var(--fs-hero)/1 var(--display); letter-spacing: -0.03em; }
.home-money span { color: var(--dim); font-size: 13px; }
.home-bill { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.home-bill > span { flex: 1 1 140px; display: grid; gap: 2px; min-width: 0; }
.home-bill small { color: var(--faint); font-size: 12px; }

/* ---------- Takip: list with a side column, board, habit grid ---------- */
.seg button { font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 12px; color: var(--dim); }
.tcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.tmaincol, .tsidecol { display: grid; gap: 18px; min-width: 0; }
.tsidecol .new-track { margin: 0; }
.tboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; align-items: start; }
.tcol { display: grid; gap: 0; align-content: start; padding: 16px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.tcol .trow { grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 0; }
.tcol .trow.is-today .tstate { font-weight: 600; }
.tcol .tstate, .tcol .tacts { grid-column: 2; }
.tcol .tacts:not(:has(*)) { display: none; }
.tcol .trow > .row-more { grid-column: 3; grid-row: 1; }
.habits { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.habit { display: grid; gap: 12px; padding: 16px 0 0; border-top: 1px solid var(--line); min-width: 0; }
.habit-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.habit-head b { font-weight: 600; flex: 1 1 120px; overflow-wrap: anywhere; }
.habit-head small { color: var(--faint); font: 500 11px var(--mono); }
.habit-head .chip .ic { fill: none; stroke: currentColor; stroke-width: 2.4; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 3px; overflow-x: auto; padding: 2px; }
.hc { border-radius: var(--r-tag); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.hc.is-on { background: var(--ok); }
.hc.is-today { outline: 1.5px solid var(--ink); outline-offset: 1px; }
.hc.is-pad { visibility: hidden; }

/* ---------- Alanlar ---------- */
.space-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.space-add { flex: 0 1 380px; flex-wrap: nowrap; }
.space-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.space-head .inline-form { flex: 0 1 460px; flex-wrap: nowrap; }
.arch-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.arch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); }
.arch-row span { display: grid; gap: 2px; min-width: 0; }
.arch-row .arch-acts { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.arch-row b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-row small { color: var(--dim); font-size: 12px; }
/* Geçmiş: hairline rows — mono time · what happened, who under it · Geri al. */
.log-list { list-style: none; margin: 0 0 24px; padding: 0; }
.log-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; grid-template-areas: 'time main acts'; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-time { grid-area: time; font-family: var(--mono); font-size: 13px; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--faint); white-space: nowrap; }
.log-main { grid-area: main; display: grid; gap: 2px; min-width: 0; }
.log-main b { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.log-main small { color: var(--faint); font-size: 12px; }
.log-acts { grid-area: acts; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.log-row.is-undone .log-main b { color: var(--faint); font-weight: 400; }
@media (max-width: 760px) {
  .log-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'time acts' 'main main'; }
}

/* ---------- panels: settings and overview ---------- */
.panel { gap: 20px; }
.panel-sm { width: min(460px, 100% - 32px); }
.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { font: 500 11px/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.facts dd { margin: 0; font-size: 13px; color: var(--dim); }
.export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.export b { font: 500 13px var(--mono); color: var(--ink); }
.nums { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin: 0; }
.nums > div { padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.nums dt { font: 500 11px/1.4 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--dim); }
.nums dd { margin: 2px 0 0; display: grid; }
.nums b { font: 500 20px/1.2 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nums b i { font-style: normal; color: var(--faint); font-weight: 400; }
.nums small { color: var(--faint); font-size: 12px; }

/* ---------- document layer: full screen, its own bar ---------- */
.scene.doc { inset: 0; margin: 0; width: auto; height: auto; max-height: none; gap: 0; background: var(--ice); transform: none; transition: opacity 0.18s, visibility 0s 0.18s; }
.scene.doc.on { transition: opacity 0.18s, visibility 0s; }
.scene.doc > .body { flex: 1; min-height: 0; gap: 0; align-items: stretch; text-align: left; }
.doc-loading { margin: auto; color: var(--dim); font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.docbar { flex: none; display: flex; align-items: center; gap: 12px; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) clamp(10px, 2vw, 24px) 0; border-bottom: 1px solid var(--line); background: var(--ice); }
.docbar .btn { flex: none; }
.doc-kind { flex: none; font: 500 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); padding: 5px 8px; border: 1px solid var(--line-2); border-radius: var(--r-tag); }
.doc-title { flex: 1 1 120px; min-width: 0; margin: 0; border: 0; background: none; padding: 6px 4px; font: 600 16px/1.3 var(--font); letter-spacing: -0.01em; text-overflow: ellipsis; }
.doc-title.is-fixed { white-space: nowrap; overflow: hidden; }
.doc-title .doc-date { position: relative; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; cursor: pointer; border-bottom: 1px solid transparent; }
.doc-title .doc-date:hover, .doc-title .doc-date:focus-within { border-bottom-color: var(--line-2); }
.doc-title .doc-date span { overflow: hidden; text-overflow: ellipsis; }
.doc-wd { font-style: normal; font-weight: 400; color: var(--dim); }
.doc-title .doc-date .ic { flex: none; width: 16px; height: 16px; stroke: var(--dim); fill: none; stroke-width: 1.6; }
.doc-date-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.doc-date-input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.doc-days { display: flex; flex: none; }
.doc-days .icon-btn { font-size: 20px; color: var(--ink); }
.doc-days .icon-btn:disabled { opacity: 0.3; cursor: default; }
.doc-save { flex: none; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; color: var(--dim); min-width: 92px; text-align: right; }
.doc-save.is-ok::before { content: '✓ '; color: var(--ok); }
.doc-save.is-warn { color: var(--danger); }
.doc-host { flex: 1; min-height: 0; position: relative; overflow: auto; }

/* ---------- page: blocks on a quiet sheet ---------- */
.pg { position: relative; display: flex; flex-direction: column; width: min(760px, 100%); min-height: 100%; margin: 0 auto; padding: clamp(24px, 6vh, 64px) clamp(14px, 4vw, 44px) 0; }
.pg-tail { flex: 1; min-height: 30vh; border: 0; background: none; cursor: text; }
.blk { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 3px 0 3px 30px; border-radius: var(--r-tag); }
.blk-handle { position: absolute; left: 0; top: 4px; width: 24px; height: 26px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-tag); color: var(--faint); font: 700 12px/1 var(--mono); letter-spacing: -2px; cursor: grab; opacity: 0; touch-action: none; transition: opacity var(--t-fast); }
.blk:hover .blk-handle, .blk:focus-within .blk-handle, .blk-handle:focus-visible { opacity: 1; }
.blk-handle:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.blk.is-dragging { opacity: 0.4; }
.blk-text { flex: 1; min-width: 0; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.6; min-height: 1.6em; }
.blk-text:empty::before { content: attr(data-ph); color: var(--faint); pointer-events: none; }
.blk:not(:first-child) .blk-text:empty:not(:focus)::before { content: ''; }
.blk-h1 { padding-top: 18px; } .blk-h1 .blk-handle { top: 26px; }
.blk-h1 .blk-text { font: 600 var(--fs-title)/1.2 var(--display); letter-spacing: -0.025em; min-height: 1.2em; }
.blk-h2 { padding-top: 12px; } .blk-h2 .blk-handle { top: 14px; }
.blk-h2 .blk-text { font: 600 20px/1.3 var(--display); letter-spacing: -0.015em; min-height: 1.3em; }
.blk-quote .blk-text { border-left: 3px solid var(--ink); padding-left: 14px; color: var(--dim); }
.blk-check { flex: none; margin: 5px 2px 0 0; width: 18px; height: 18px; }
.blk-todo.is-checked .blk-text { color: var(--faint); text-decoration: line-through; }
.blk-dot { flex: none; width: 6px; height: 6px; margin: 11px 8px 0 6px; border-radius: 50%; background: var(--ink); }
.blk-divider { align-items: center; min-height: 28px; }
.blk-divider hr { flex: 1; border: 0; border-top: 1px solid var(--line-2); margin: 0; }
.blk-image img { max-width: 100%; max-height: 70vh; border-radius: var(--r-ctl); border: 1px solid var(--line); display: block; }
.blk-missing { color: var(--faint); font-size: 13px; }
.blk:is(.blk-divider, .blk-image):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pg-menu { position: absolute; z-index: 5; width: 240px; max-height: 320px; overflow-y: auto; display: grid; padding: 6px; border-radius: var(--r-panel); border: 1px solid var(--line-2); background: var(--ice); box-shadow: var(--e-2); }
.pg-opt { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-tag); text-align: left; }
.pg-opt b { font-weight: 500; font-size: 15px; }
.pg-opt small { font: 500 11px var(--mono); color: var(--dim); }
.pg-opt:hover, .pg-opt.is-on { background: var(--ink); color: var(--on-ink); }
.pg-opt:hover small, .pg-opt.is-on small { color: inherit; opacity: 0.8; }
.pg-del { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-tag) var(--r-tag); color: var(--danger); }
.pg-drop { position: absolute; left: 44px; right: 44px; height: 2px; background: var(--acc); pointer-events: none; }
/* the journal page: a faint dotted ground, like a notebook */
.doc-journal { background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.3px); background-size: 22px 22px; background-attachment: local; }

/* ---------- list ---------- */
.lst { display: grid; gap: 16px; align-content: start; width: min(880px, 100%); margin: 0 auto; padding: clamp(20px, 5vh, 48px) clamp(14px, 4vw, 44px) 80px; }
.lst-add { display: flex; gap: 8px; }
.lst-add input { font-size: 16px; }
.lst-rows { display: grid; gap: 6px; }
.lst-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 28px auto; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: var(--r-panel); border: 1px solid var(--rim); background: var(--panel); }
.lst-row.is-done .lst-title { color: var(--faint); text-decoration: line-through; }
.st { min-width: 84px; padding: 7px 8px; border-radius: var(--r-tag); border: 1px solid var(--line-2); background: none; font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.st-doing { border-color: var(--acc); color: var(--acc); }
.st-doing::before { content: '▸ '; }
.st-done { border-color: var(--ok); background: var(--ok); color: var(--on-ink); }
.st-done::before { content: '✓ '; }
.lst-title { border: 0; background: none; padding: 6px 4px; font-size: 16px; }
.stars { display: inline-flex; }
.star { width: 22px; height: 28px; padding: 0; border: 0; background: none; font-size: 15px; line-height: 1; color: var(--faint); }
.star.is-on { color: var(--ink); }
.star:hover { color: var(--acc); }
.lst-go { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-ctl); color: var(--ink); text-decoration: none; font-size: 15px; }
a.lst-go:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.lst-row .icon-btn { font: 700 12px var(--mono); }
.lst-more { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); justify-items: start; }
.lst-empty { padding: 20px 4px; color: var(--faint); }

/* ---------- board: see board.css ---------- */

@media (max-width: 760px) {
  .home-top, .tcols { grid-template-columns: 1fr; }
  .docbar { gap: 6px; }
  .docbar .btn kbd, .doc-kind { display: none; }
  .doc-save { min-width: 0; font-size: 10px; }
  .doc-wd { display: none; }
  .docbar:has(.doc-date) .doc-save.is-ok { font-size: 0; min-width: 0; } /* the journal's title needs the room: only the tick stays */
  .docbar:has(.doc-date) .doc-save.is-ok::before { font-size: 11px; }
  .lst-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lst-row .stars { grid-column: 1 / 3; grid-row: 2; }
  .lst-row .lst-go { display: none; }
  .blk { padding-left: 26px; }
  .blk-handle { opacity: 0.5; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .space-add, .space-head .inline-form { flex-basis: 100%; }
}

/* ---------- Alanlar: the map of alans, and one alan's rhythms, work and documents ---------- */
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sp-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.sp-row:last-child { border-bottom: 0; }
.sp-check { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-ctl); border: 1.5px solid var(--line-2); background: var(--field); color: var(--ok); cursor: pointer; }
.sp-check:hover:not(:disabled) { border-color: var(--ink); }
.sp-check.is-done { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.sp-check:disabled { opacity: 0.4; cursor: default; }
.sp-check .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.sp-time { font: 400 11px var(--mono); color: var(--faint); }
.sp-main { display: grid; gap: 2px; min-width: 0; flex: 1; text-align: left; }
.sp-main b { font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-main small { color: var(--dim); font-size: 12px; }
button.sp-main { border: 0; background: none; padding: 0; color: inherit; cursor: pointer; }
button.sp-main:hover b { text-decoration: underline; }
.sp-kind { flex: none; width: 52px; font: 400 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
/* Alanlar is one outline: alanlar, their documents, documents at the root, children under documents. Rows are
   hairlines indented by level (--lvl); a row with children folds. No cards, no boxes: the create form is the one
   raised surface, opened in place under the row it adds to. */
.space-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; flex: 1 1 520px; }
.outline .ol-row { padding-inline-start: calc(var(--lvl, 0) * 24px); }
.ol-fold { flex: none; width: 24px; height: 24px; display: grid; place-items: center; margin-inline-end: -4px; }
.ol-fold .ic { width: 15px; height: 15px; transition: transform var(--t-ui) var(--ez); }
.ol-fold.is-folded .ic { transform: rotate(-90deg); }
.ol-space .sp-main b { font-weight: 600; }
.ol-row .sp-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-form { padding: 12px 0 12px calc(var(--lvl, 0) * 24px + 20px); border-bottom: 1px solid var(--line); }
.ol-new { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ol-new #new-title { flex: 1 1 200px; min-width: 0; }
.ol-new select { width: auto; max-width: 100%; min-width: 0; }
.ol-new #new-kind { flex: 0 0 auto; }
.ol-new #new-place { flex: 0 1 260px; min-width: 0; }
.ol-new-acts { display: flex; gap: 8px; }
.ol-picks { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 520px); overflow-y: auto; }
.ol-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 4px 8px calc(var(--lvl, 0) * 20px + 4px); border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font-size: 15px; cursor: pointer; transition: background-color var(--t-fast); }
.ol-picks li:last-child .ol-pick { border-bottom: 0; }
.ol-pick:hover:not(:disabled), .ol-pick:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.ol-pick:disabled { cursor: default; color: var(--dim); }
.ol-pick b { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-pick small { flex: none; font: 500 11px var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.doc-path { flex: 0 1 auto; max-width: 32%; min-width: 0; font: 500 11px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-path:empty { display: none; }
@media (max-width: 760px) {
  .outline .ol-row { padding-inline-start: calc(var(--lvl, 0) * 14px); }
  .ol-form { padding-inline-start: calc(var(--lvl, 0) * 14px); }
  .ol-new > *, .ol-new #new-kind, .ol-new #new-place { flex: 1 1 100%; width: 100%; max-width: 100%; }
  .doc-path { display: none; }
}
@media (hover: none) { .ol-fold { width: 32px; height: 44px; } }
/* Drag and drop (outline-drag.mjs). Nothing moves until the drop: the held row and its branch fade, a 1px ink line
   with a small square at its start marks "before" / "after" at the level it lands on, a faint fill marks "inside".
   The marks live in pseudo elements, so the row itself stays a bare hairline row. */
.outline [data-node] { --ol-step: 24px; position: relative; isolation: isolate; -webkit-touch-callout: none; }
.outline .is-dragging { opacity: 0.4; }
.outline .is-drop-in::before { content: ''; position: absolute; inset: 2px 0; z-index: -1; border-radius: var(--r-ctl); background: color-mix(in srgb, var(--ink) 7%, transparent); pointer-events: none; }
.outline :is(.is-drop-before, .is-drop-after)::after { content: ''; position: absolute; inset-inline: calc(var(--drop-lvl, 0) * var(--ol-step)) 0; height: 1px; background: var(--ink); pointer-events: none; }
.outline .is-drop-before::after { top: -1px; }
.outline .is-drop-after::after { bottom: -1px; }
.outline :is(.is-drop-before, .is-drop-after)::before { content: ''; position: absolute; inset-inline-start: calc(var(--drop-lvl, 0) * var(--ol-step)); width: 5px; height: 5px; background: var(--ink); pointer-events: none; }
.outline .is-drop-before::before { top: -3px; }
.outline .is-drop-after::before { bottom: -3px; }
html.ol-dragging, html.ol-dragging * { cursor: grabbing; user-select: none; -webkit-user-select: none; }
html.ol-dragging button.sp-main:hover b { text-decoration: none; }
.ol-ghost { position: fixed; top: 0; left: 0; z-index: var(--z-top); display: flex; align-items: center; gap: 8px; max-width: min(320px, calc(100vw - 32px)); padding: 8px 12px; border-radius: var(--r-ctl); background: var(--ice); border: 1px solid var(--rim); box-shadow: var(--e-2); color: var(--ink); pointer-events: none; }
.ol-ghost .sp-kind { width: auto; }
.ol-ghost b { min-width: 0; font-weight: 500; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .outline [data-node] { --ol-step: 14px; } }
@media (prefers-reduced-motion: no-preference) {
  .outline [data-node] { transition: opacity var(--t-fast); }
  .ol-ghost { animation: menu-in 0.16s var(--ez-out); }
}
.sp-dots { display: flex; gap: 3px; flex: none; }
.sp-dots i { width: 7px; height: 7px; border-radius: 0; background: var(--field); border: 1px solid var(--line); }
.sp-dots i.is-done { background: var(--ok); border-color: var(--ok); }
.sp-dots i.is-skip { background: transparent; border-color: var(--line); }
.sp-dots i.is-miss { border-color: var(--line-2); }
@media (max-width: 560px) { .sp-dots { display: none; } }

/* ================= desktop: the D Buz shell =================
   One bar on top: the brand, the areas centred, the clock and tools on the right. The working sheet is a frost
   slab floating in the fog, ending above the capture line, so nothing ever sits under it. A scene change is a
   dolly: the old slab recedes into the fog, the new one comes forward. Only transform and opacity move. */
@media (min-width: 761px) {
  .rail { inset: 0 0 auto 0; width: auto; height: calc(var(--top) + env(safe-area-inset-top, 0px)); flex-direction: row; align-items: center; gap: 2px; padding: env(safe-area-inset-top, 0px) clamp(16px, 3vw, 40px) 0; background: none; border: 0; box-shadow: none; overflow: visible; pointer-events: none; }
  .rail::after { content: ''; flex: 1 1 0; }
  .rail-head { flex: 1 1 0; padding-left: 0; pointer-events: auto; justify-content: flex-start; }
  .rail-label, .rail-tree, .rail-foot { display: none; }
  .dock { flex-direction: row; gap: 2px; pointer-events: auto; }
  .rail-more { display: contents; }
  .rail-more > .dock-btn { pointer-events: auto; }
  .rail .dock-btn { width: auto; min-height: 36px; padding: 0 12px; gap: 7px; }
  .rail .dock-btn .ic { display: none; }
  .rail .dock-btn > span:not(.badge) { flex: none; }
  html:is([data-scene='boot'], [data-scene='arrive'], [data-scene='onboard'], [data-scene='notice'], [data-scene='doc']) .rail { transform: translateY(-12px); }
  html[data-from='arrive'] .rail { animation: fade 0.8s 0.1s both; }
  html[data-scene='focus'] .rail { transform: none; opacity: 0.55; }
  html[data-scene='focus'] .rail:is(:hover, :focus-within) { opacity: 1; background: none; border-color: transparent; box-shadow: none; }
  .top-tools { display: flex; gap: 6px; }

  #stage { top: calc(var(--top) + env(safe-area-inset-top, 0px)); bottom: 0; }
  .sheet { inset: 18px 0 calc(var(--cap) + 24px) 0; margin: 0 auto; width: min(1120px, 100% - 64px); height: auto; padding: clamp(24px, 3vw, 40px) clamp(24px, 3.4vw, 52px) 40px;
    background: color-mix(in srgb, var(--ice) 88%, transparent); border: 1px solid var(--rim); border-radius: var(--r-sheet);
    box-shadow: inset 0 1px 0 var(--rim), inset 0 -26px 34px -30px var(--glow), var(--e-3);
    transform: scale(0.965); transform-origin: 50% 24%; transition: transform 0.5s var(--ez), opacity 0.22s, visibility 0s 0.5s; }
  .sheet.on { transform: none; transition: transform 0.75s var(--ez) 0.05s, opacity 0.4s 0.05s, visibility 0s; }
  html:is([data-scene='focus'], [data-scene='close']) .sheet { transform: translate(0, 6%) scale(0.6); }
}
  .rail .dock-btn .badge:empty { display: none; }
@media (min-width: 761px) and (max-width: 1599px) { .clock span { display: none; } }
/* tablets: the areas follow the brand instead of centring, and the clock steps aside */
@media (min-width: 761px) and (max-width: 1100px) {
  .rail::after, .clock, .quick-btn kbd { display: none; }
  .rail-head { flex: none; margin-right: 12px; }
  .top-right { gap: 6px; }
}
/* narrower desktops: the areas keep their icons only, so the bar never wraps or touches the clock */
@media (min-width: 761px) and (max-width: 1360px) {
  .rail .dock-btn .ic { display: block; }
  .rail .dock-btn > span:not(.badge) { display: none; }
  .rail .dock-btn { padding: 0 10px; }
  .rail .dock-btn .badge { position: absolute; top: 2px; right: 2px; }
  .clock span { display: none; }
}
@media (max-width: 760px) { .top-tools { display: none; } }

/* the ⋯ menu: one small frost card beside its button */
.row-more { flex: none; }
.row-menu { position: fixed; z-index: var(--z-top); min-width: 168px; display: grid; gap: 2px; padding: 6px; border-radius: var(--r-panel); background: var(--ice); border: 1px solid var(--rim); box-shadow: var(--e-2); }
.row-menu:not([hidden]) { animation: menu-in 0.16s var(--ez) both; }
@keyframes menu-in { from { opacity: 0; transform: translate3d(0, -4px, 0) scale(0.98); } }
.row-menu button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); text-align: left; font-size: 15px; }
.row-menu button:hover, .row-menu button:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.row-menu .is-danger { color: var(--danger); }
.row-menu .ic { width: 16px; height: 16px; }

/* an alan card: the card opens it; its ⋯ sits in the corner */
.space-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Günlük: the page, with every written day beside it (on a phone the date control in the bar takes its place) */
.journal-wrap { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.jnav { overflow-y: auto; scrollbar-width: thin; display: grid; align-content: start; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line); }
.jnav .card-label { padding: 0 10px 8px; }
.jnav-day { display: grid; gap: 2px; padding: 9px 10px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); text-align: left; }
.jnav-day b { font-weight: 500; font-size: 13px; }
.jnav-day span { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jnav-day:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.jnav-day.is-on { background: var(--ink); color: var(--on-ink); }
.jnav-day.is-on span { color: inherit; opacity: 0.7; }
.journal-wrap > .doc-host { min-height: 0; overflow-y: auto; }
@media (max-width: 760px) {
  .journal-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .journal-wrap { grid-template-rows: minmax(0, 1fr); }
  .jnav { display: none; } /* the days list folds into the date control in the bar: ‹ › and the picker */
}
.home-top:not(:has(.home-side)) { grid-template-columns: 1fr; }
.card-head .link { flex: none; white-space: nowrap; }
/* the drawer's number / date / time row: the date needs the room, the minutes need little */
.drawer .row.gap > .field { min-width: 0; }
.drawer .row.gap > .field:has(input[type='date']) { flex: 1.6; }
.drawer-title { field-sizing: content; min-height: 2.4em; padding: 4px 6px; margin: -4px -6px; width: calc(100% + 12px); }
.batch-list .bmain b { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .arch-row { flex-wrap: wrap; }
  .arch-row > span:first-child { flex: 1 1 100%; }
  .arch-row b { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------- lighter controls on a pointer screen (DESIGN.md C7): igloo's controls barely there ---------- */
@media (min-width: 761px) {
  .btn { min-height: 40px; padding: 0 18px; }
  .btn-lg { min-height: 48px; }
  .btn-sm { min-height: 32px; padding: 0 14px; }
  .chip, .energy-opt { padding: 7px 12px; }
  .tick, .sp-check { width: 22px; height: 22px; border: 1px solid var(--dim); border-radius: var(--r-tag); }
  .tick .ic, .sp-check .ic { width: 13px; height: 13px; }
  .topbar .quick-btn, .topbar .help-btn { border-color: transparent; background: none; }
  .topbar .quick-btn:hover, .topbar .help-btn:hover { border-color: transparent; color: var(--dim); }
}

/* ---------- touch: the hit area, not the drawing, is 44px (DESIGN.md C8) ----------
   The visual box stays small and precise; an invisible ::before widens what a finger can hit. Neighbours that sit
   closer than the extra reach (the Gün row's four icon buttons, 4px apart) widen vertically only. */
@media (hover: none) {
  .tick, .tcheck, .sp-check, .icon-btn, .help-btn, .capture-mic, .chip, .energy-opt, .lev-toggle, .btn-sm, .seg button, .link, .nudge, .hero-title { position: relative; }
  .tick::before, .tcheck::before, .sp-check::before, .icon-btn::before, .help-btn::before, .capture-mic::before, .chip::before, .seg button::before, .link::before, .nudge::before, .hero-title::before, .energy-opt::before, .lev-toggle::before, .btn-sm::before { content: ''; position: absolute; inset: -9px; }
  .tick::before, .sp-check::before { inset: -11px; } /* the 1.5px border is outside the ::before's box */
  .icon-btn::before { inset: -6px 0; } /* icon buttons sit edge to edge (the Gün row, the drawer's bar): taller only, so no hit area reaches a neighbour's */
  .chip::before, .energy-opt::before { inset: -5px -2px; }
  .lev-toggle::before { inset: -11px -2px; }
  .btn-sm::before { inset: -3px 0; }
  .seg button::before { inset: -9px -2px; }
  .tabs button { min-height: 44px; }
  .chips, .energy { row-gap: 10px; }
  .card-head + .pm-month { margin-top: 10px; }
  .quick-grid .choice, .choice.subtle { min-height: 44px; }
  .link::before { inset: -13px -4px; }
  /* a native 18px checkbox cannot carry a ::before: on touch the drawer's own checkbox is drawn, 22px, with the 44px reach */
  .field.check input[type='checkbox'] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--dim); border-radius: var(--r-tag); background: var(--field); }
  .field.check input[type='checkbox']:checked { background: var(--ink); border-color: var(--ink); }
  .field.check input[type='checkbox']:checked::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 11px; border: solid var(--on-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  .field.check input[type='checkbox']::before { content: ''; position: absolute; inset: -13px -6px; } /* the 1.5px border is outside the pseudo's box */
  .poster > .link { margin-top: 6px; }
  .settings-form label.check input[type='checkbox']::before { content: ''; position: absolute; inset: -11px -4px; }
  .nudge::before { inset: -6px 0; }
  .nudges { row-gap: 12px; }
  .btn-sm, .row-menu button, input:not([type='checkbox'], [type='radio'], [type='range'], [type='hidden']), select { min-height: 44px; }
  .tree-space, .tree-doc, .task-main, .reveal-more > summary, .pack > summary { min-height: 44px; }
}

/* ---------- plans (public/js/plan.mjs): one quiet line at the foot of a scene, and the Pro sheet ---------- */
.plan-foot { display: grid; margin-top: 32px; border-top: 1px solid var(--line); }
.plan-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0; padding: 12px 0; color: var(--dim); font-size: 13px; }
.plan-line + .plan-line { border-top: 1px solid var(--line); }
.plan-line p { margin: 0; flex: 1 1 280px; }
.plan-invite p { color: var(--ink); }
.plan-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pro-title { font: 500 24px/1.2 var(--display); letter-spacing: -0.02em; }
.pro-list { display: grid; margin: 0; padding: 0; list-style: none; }
.pro-list li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.pro-list b { font: 500 15px/1.4 var(--font); color: var(--ink); }
.pro-list small { font-size: 12px; color: var(--faint); }
.pro-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pro-done { font: 600 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.pro-foot { margin: 0; font-size: 12px; color: var(--faint); }
