/* =========================================================================
   Stillroom — visual system
   Dark neutral base · warm off-white type · one contextual accent (--tint)
   Breaks swap --tint to a calm sage; environments set --accent.
   ========================================================================= */

:root {
  --bg: #0b0c0e;
  --ink: #ece6dc;
  --ink-2: rgba(236, 230, 220, .68);
  --ink-3: rgba(236, 230, 220, .46);
  --ink-4: rgba(236, 230, 220, .24);
  --line: rgba(236, 230, 220, .085);
  --line-2: rgba(236, 230, 220, .15);

  --surface: rgba(13, 14, 17, .5);
  --surface-2: rgba(19, 20, 24, .9);

  --accent: #d9b98a;
  --accent-rgb: 217, 185, 138;
  --break: #9fc3ae;
  --break-rgb: 159, 195, 174;
  --tint: var(--accent);
  --tint-rgb: var(--accent-rgb);
  --warn: #e39c84;

  --radius: 10px;
  --radius-s: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 180ms;
  --progress: 0;
  --shade: .3;
  color-scheme: dark;
}
body.mode-short, body.mode-long { --tint: var(--break); --tint-rgb: var(--break-rgb); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid rgba(var(--tint-rgb), .85); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(var(--tint-rgb), .35); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-fill { fill: currentColor; stroke: none; }
kbd { font: 11px/1 var(--font-mono); padding: 2px 5px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.skip-link { position: absolute; left: -999px; top: 10px; z-index: 100; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); }
.skip-link:focus { left: 12px; }

/* ---------- Scene ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene > * { position: absolute; inset: 0; }
.scene-bg, .scene-gl, .scene-video, .scene-decor, .scene-wall, .scene-fx { transition: opacity .45s var(--ease), filter .6s var(--ease); }
.scene.is-switching .scene-bg,
.scene.is-switching .scene-decor,
.scene.is-switching .scene-wall,
.scene.is-switching .scene-fx { opacity: 0; }
.scene-wall { background-size: cover; background-position: center; transform: scale(1.06); opacity: 0; }
.scene-wall.on { opacity: 1; }
.scene-fx { width: 100%; height: 100%; }
.scene-shade {
  background:
    linear-gradient(180deg, rgba(0,0,0,.32), transparent 16%, transparent 78%, rgba(0,0,0,.38)),
    radial-gradient(ellipse 75% 70% at 50% 45%, rgba(0,0,0,calc(var(--shade) * .55)), rgba(0,0,0,var(--shade)));
  transition: background .4s;
}
.scene-glow {
  background: radial-gradient(circle at 50% 44%, rgba(var(--tint-rgb), calc(.035 + var(--progress) * .055)), transparent 38%);
  transition: background 1s linear;
}
body.mode-short .scene-bg, body.mode-long .scene-bg,
body.mode-short .scene-wall, body.mode-long .scene-wall { filter: saturate(.75) brightness(1.08); }
body.mode-short .scene-shade, body.mode-long .scene-shade { opacity: .85; }

/* Decor — quiet architectural hints, never illustrations */
.scene-decor > * { position: absolute; }

.win {
  right: 7vw; top: 12vh; width: min(32vw, 500px); height: min(62vh, 600px);
  display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 9px; padding: 9px;
  border-radius: 2px; background: rgba(8, 10, 13, .6);
  box-shadow: 0 0 0 1px rgba(255,255,255,.035), 0 50px 140px rgba(0,0,0,.55);
}
.win i { display: block; background: radial-gradient(120% 90% at 70% 0%, rgba(110,130,180,.16), transparent 60%), linear-gradient(180deg, #111828, #0a0e17); box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.win i.moonpane { background: radial-gradient(circle at 62% 32%, rgba(238,228,204,.62) 0 9px, rgba(238,228,204,.08) 11px, transparent 70px), radial-gradient(120% 90% at 70% 0%, rgba(110,130,180,.18), transparent 60%), linear-gradient(180deg, #111828, #0a0e17); }
.win-rain i { background: radial-gradient(90% 60% at 50% 100%, rgba(150,175,200,.07), transparent 70%), linear-gradient(180deg, #10161e, #0a0e14); }
.scene-decor .win, .scene-decor .win-sill { opacity: .8; }
.win-sill { right: calc(7vw - 16px); top: calc(12vh + min(62vh, 600px)); width: calc(min(32vw, 500px) + 32px); height: 9px; border-radius: 2px; background: rgba(22, 24, 28, .85); }

.lamp-glow { left: -12vw; bottom: -24vh; width: 72vw; height: 86vh; background: radial-gradient(closest-side, rgba(230,150,72,.24), transparent); animation: flicker 7s ease-in-out infinite; }
.shelf { right: 0; top: 0; bottom: 0; width: 20vw;
  background:
    repeating-linear-gradient(180deg, transparent 0 22vh, rgba(0,0,0,.45) 22vh calc(22vh + 7px)),
    repeating-linear-gradient(90deg, rgba(92,56,34,.22) 0 13px, rgba(58,34,22,.22) 13px 21px, rgba(110,72,42,.16) 21px 30px, rgba(70,40,26,.2) 30px 37px);
  -webkit-mask: linear-gradient(90deg, transparent, #000 60%); mask: linear-gradient(90deg, transparent, #000 60%); opacity: .7; }
@keyframes flicker { 0%, 100% { opacity: .9; } 40% { opacity: 1; } 47% { opacity: .82; } 55% { opacity: .97; } 80% { opacity: .9; } }

.desk-light { left: 50%; top: -34vh; width: 90vw; height: 90vh; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(220,228,240,.075), transparent); }
.desk-top { left: 0; right: 0; bottom: 0; height: 19vh; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.28)); box-shadow: 0 -1px 0 rgba(255,255,255,.045); }

.nebula { inset: -10%; background: radial-gradient(40% 30% at 70% 30%, rgba(110,120,200,.09), transparent 70%), radial-gradient(30% 25% at 30% 70%, rgba(150,90,140,.07), transparent 70%); animation: slow-turn 240s linear infinite; }
@keyframes slow-turn { to { transform: rotate(360deg); } }

.trees { left: 0; right: 0; bottom: 0; }
.trees.t1 { height: 48vh; background: #0b1611; opacity: .9; }
.trees.t2 { height: 32vh; background: #050906; }
.fog { left: -20%; right: -20%; height: 30vh; background: radial-gradient(ellipse at center, rgba(205,212,218,.075), transparent 70%); animation: drift 90s ease-in-out infinite alternate; }
.fog.f1 { bottom: 14vh; }
.fog.f2 { bottom: 0; height: 24vh; animation-duration: 120s; }
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }

.mtn { left: 0; right: 0; bottom: 0; }
.mtn.m1 { height: 64vh; background: linear-gradient(180deg, #47535d, #39444d); }
.mtn.m2 { height: 46vh; background: linear-gradient(180deg, #2c363e, #232b32); }
.mtn.m3 { height: 25vh; background: #151a1f; }

.moon { right: 18vw; top: 13vh; width: 44px; height: 44px; border-radius: 50%; background: #efe4cc; box-shadow: 0 0 70px 14px rgba(239,228,204,.13); opacity: .85; }
.dune { left: -10%; right: -10%; bottom: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.dune.d1 { height: 30vh; background: linear-gradient(180deg, #3a2b29, #221a1b); transform: translateX(-14%); }
.dune.d2 { height: 19vh; background: linear-gradient(180deg, #281e1e, #140e0f); transform: translateX(20%); }

.sun { left: 50%; bottom: 6vh; width: 70vw; height: 44vh; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(255,190,150,.26), transparent); }
.hills { left: 0; right: 0; bottom: 0; height: 18vh; background: #1b1418; }

.decor-bokeh span { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(232,172,112,.5), rgba(232,172,112,0) 70%); filter: blur(6px); animation: float 34s ease-in-out infinite alternate; }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(18px, -14px); } }

body.no-anim .scene-decor *, body.reduce-motion .scene-decor * { animation: none !important; }

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 14px 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--ink-2); justify-self: start; }
.brand-mark { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--tint); transition: border-color .4s; }
.clock { display: flex; align-items: baseline; gap: 10px; justify-self: center; font-variant-numeric: tabular-nums; }
.clock-time { font-size: 14px; font-weight: 500; }
.clock-date { font-size: 13px; color: var(--ink-3); }
body.clock-minimal .clock-date { display: none; }

.toolbar { display: flex; align-items: center; gap: 4px; justify-self: end; }
.toolbar-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); transition: color var(--t), background var(--t); }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--ink); background: rgba(255,255,255,.06); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .i { width: 15px; height: 15px; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--tint); opacity: 0; transform: scale(.4); transition: opacity var(--t), transform var(--t); }
.icon-btn.is-on .dot { opacity: 1; transform: none; }

.level-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--ink-2); transition: background var(--t), color var(--t); }
.level-chip:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.level-text { display: flex; white-space: nowrap; gap: 6px; font-variant-numeric: tabular-nums; }
.level-text > :first-child { color: var(--ink); font-weight: 600; }
.xp-track { width: 52px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.xp-fill { display: block; height: 100%; width: 0; background: var(--tint); transition: width .7s var(--ease), background .4s; }
.coins { display: inline-flex; align-items: center; gap: 4px; color: var(--tint); font-variant-numeric: tabular-nums; }
.coins .i { width: 14px; height: 14px; }

.focus-toggle { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; margin-left: 6px; padding: 7px 12px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: color var(--t), background var(--t); }
.focus-toggle:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.focus-toggle .i { width: 15px; height: 15px; }

/* ---------- Stage ---------- */
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr) minmax(260px, 320px);
  grid-template-areas: "today timer tasks";
  gap: clamp(16px, 3vw, 48px);
  padding: 6px clamp(16px, 3vw, 40px) 96px;
  align-items: start;
}
.stage > .today { grid-area: today; }
.stage > .timer { grid-area: timer; }
.stage > .tasks { grid-area: tasks; }

.pane {
  margin-top: 8vh;
  padding: 16px 18px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pane-head { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; }
.pane-head h2 { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.pane-meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pane-toggle .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--t); }
.pane-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }

/* ---------- Timer ---------- */
.timer { display: flex; flex-direction: column; align-items: center; padding-top: 1vh; outline: none; }
.timer-switches { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: 12.5px; color: var(--ink-3); transition: color var(--t), background var(--t); }
.seg button:hover { color: var(--ink-2); }
.seg button[aria-selected="true"] { color: var(--ink); background: rgba(255,255,255,.08); }
.seg-quiet { background: none; box-shadow: none; }
.seg-quiet button[aria-selected="true"] { background: none; color: var(--tint); }
body.kind-flow #modeSwitch { visibility: hidden; }

.dial { position: relative; width: min(380px, 78vw); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: rgba(236,230,220,.075); stroke-width: 1.5; }
.ring-progress { fill: none; stroke: var(--tint); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 628.32; stroke-dashoffset: 628.32; transition: stroke-dashoffset .3s linear, stroke .45s, stroke-width .3s; }
.ring-head { fill: var(--tint); opacity: 0; transition: opacity .3s, fill .45s; }
body.ring-bold .ring-track { stroke-width: 3.5; }
body.ring-bold .ring-progress { stroke-width: 4.5; }
body.ring-glow .ring-progress { filter: drop-shadow(0 0 4px rgba(var(--tint-rgb), .75)); }
body.face-segments .ring-track { stroke-width: 7; stroke-dasharray: 1.2 9.272; stroke: rgba(236,230,220,.12); }
body.face-segments .ring-progress { stroke-width: 1.5; }
body.face-minimal .ring { display: none; }

.dial-face { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; max-width: 76%; }
.dial-mode { font-size: 11.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--tint); transition: color .45s; padding-left: .26em; }
.dial-time {
  font-family: var(--font-display); font-weight: 200;
  font-size: clamp(64px, 9.6vw, 116px); line-height: 1.02; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 12px;
  transition: background var(--t), color .4s;
}
.dial-time:hover { background: rgba(255,255,255,.035); }
body.kind-flow .dial-time { cursor: default; }
body.kind-flow .dial-time:hover { background: none; }
body.is-paused .dial-time { color: var(--ink-2); }
body.face-serif .dial-time { font-family: var(--font-serif); font-weight: 400; letter-spacing: 0; }
body.face-mono .dial-time { font-family: var(--font-mono); font-weight: 300; letter-spacing: -.05em; }
.dial-time-input {
  width: 3.4em; font: 200 clamp(48px, 7.5vw, 88px)/1.1 var(--font-display); text-align: center;
  background: transparent; border: 0; border-bottom: 1px solid var(--tint); color: var(--ink); outline: none;
  -moz-appearance: textfield; appearance: textfield;
}
.dial-time-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.dial-objective { max-width: 100%; padding: 2px 8px; border-radius: 6px; font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--t), background var(--t); }
.dial-objective:hover { color: var(--ink); background: rgba(255,255,255,.035); }
.dial-objective.empty { color: var(--ink-3); }
body:not(.focus-mode) .dial-objective.has-input { display: none; }
.dial-objective-input { width: 100%; max-width: 280px; text-align: center; font-size: 15px; background: transparent; border: 0; border-bottom: 1px solid var(--tint); padding: 2px 4px; outline: none; }
.dial-cycle { margin-top: 4px; font-size: 12px; letter-spacing: .04em; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dial-bar { display: none; width: 160px; height: 2px; margin: 10px 0 2px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.dial-bar i { display: block; height: 100%; width: 0; background: var(--tint); transition: width .3s linear; }
body.face-minimal .dial-bar { display: block; }

.intention { margin-top: 20px; width: min(360px, 82vw); }
.intention input { width: 100%; padding: 8px 4px; text-align: center; font-size: 15px; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; transition: border-color var(--t); }
.intention input:focus { outline: none; border-color: var(--tint); }
.intention input::placeholder { color: var(--ink-3); }

.controls { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.ctl { display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background var(--t), color var(--t), box-shadow var(--t), transform .12s; }
.ctl:active { transform: scale(.97); }
.ctl-small { width: 44px; height: 44px; border-radius: 50%; gap: 1px; font-size: 12px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); font-variant-numeric: tabular-nums; }
.ctl-small .i { width: 11px; height: 11px; stroke-width: 2; }
.ctl-small:hover { color: var(--ink); background: rgba(255,255,255,.05); }
.ctl-primary { min-width: 148px; height: 52px; padding: 0 26px; border-radius: 26px; background: var(--ink); color: #121212; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.ctl-primary .i { width: 16px; height: 16px; }
.ctl-primary:hover { background: #fff; }
body.is-running .ctl-primary { background: rgba(255,255,255,.07); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
body.is-running .ctl-primary:hover { background: rgba(255,255,255,.11); }
.ctl-primary.swap span, .ctl-primary.swap .i { animation: swap .22s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.controls-sub { display: flex; gap: 14px; margin-top: 14px; }
.text-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-3); transition: color var(--t), background var(--t); }
.text-btn:hover:not(:disabled) { color: var(--ink); }
.text-btn:disabled { opacity: .4; }
.text-btn .i { width: 15px; height: 15px; }
.text-btn.small { font-size: 12px; padding: 3px 6px; }

.break-tip { margin-top: 22px; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); animation: rise .3s var(--ease); }

/* ---------- Today pane ---------- */
.pane-body { margin-top: 14px; }
.today-hero { display: flex; flex-direction: column; gap: 2px; }
.today-hero .k, .kv dt, .goal-row { font-size: 12px; color: var(--ink-3); }
.today-hero .v { font: 300 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.goal { margin-top: 16px; }
.goal-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-variant-numeric: tabular-nums; }
.goal-row span:last-child { color: var(--ink-2); }
.bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--tint); border-radius: 2px; transition: width .6s var(--ease), background .4s; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 0; }
.kv div { min-width: 0; }
.kv dd { margin: 2px 0 0; font-size: 16px; font-variant-numeric: tabular-nums; }
.exam { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.exam-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.exam-subject { font-weight: 600; letter-spacing: .02em; }
.exam-when { font-size: 12px; color: var(--tint); }
.today .link { margin-top: 16px; }

/* ---------- Tasks ---------- */
.task-form { margin: 10px 0 4px; }
.task-name-input { width: 100%; padding: 8px 2px; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; transition: border-color var(--t); }
.task-name-input:focus { outline: none; border-color: var(--tint); }
.task-name-input::placeholder { color: var(--ink-3); }
.task-form-more { display: none; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.task-form.open .task-form-more { display: flex; animation: rise .18s var(--ease); }
.task-form-more #taskSubject { flex: 1 1 110px; min-width: 0; }

.input, select.input { padding: 6px 8px; border: 0; border-radius: 6px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); transition: box-shadow var(--t); }
.input:focus { outline: none; box-shadow: inset 0 0 0 1px rgba(var(--tint-rgb), .7); }
.input::placeholder { color: var(--ink-3); }
select.input option { background: #1a1b1f; color: var(--ink); }
.input.num { width: 64px; }
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.mini-field .input.num { width: 52px; }

.task-list { list-style: none; margin: 6px 0 0; padding: 0 0 0 2px; max-height: 54vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.task { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 2px; border-top: 1px solid var(--line); transition: opacity .25s, background var(--t); outline: none; }
.task:first-child { border-top: 0; }
.task.is-current::before { content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--tint); }
.task.is-current .task-name { color: var(--tint); }
.task-check { width: 18px; height: 18px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); color: #121212; transition: background var(--t), box-shadow var(--t); }
.task-check:hover { box-shadow: inset 0 0 0 1.5px var(--tint); }
.task-check .i { width: 12px; height: 12px; stroke-width: 2.4; opacity: 0; transition: opacity var(--t); }
.task.is-done .task-check { background: var(--tint); box-shadow: none; }
.task.is-done .task-check .i { opacity: 1; }
.task.is-done .task-name { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.task.is-done .task-meta { opacity: .6; }
.task.just-done .task-check { animation: pop .38s var(--ease); }
.task.just-done .task-name { animation: settle .4s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes settle { from { opacity: .4; transform: translateX(4px); } to { opacity: 1; transform: none; } }
.task-name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.task.prio-high .task-name::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 7px; border-radius: 50%; background: var(--warn); vertical-align: 2px; }
.task.prio-low .task-name { color: var(--ink-2); }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; margin-top: 3px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.task-subject { color: var(--ink-2); }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--ink-4); }
.dots i.on { background: var(--tint); box-shadow: none; }
.task-now { color: var(--tint); }
.task-actions { display: flex; gap: 1px; opacity: 0; transition: opacity var(--t); }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
@media (hover: none) { .task-actions { opacity: 1; } }
.task-actions button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-3); transition: color var(--t), background var(--t); }
.task-actions button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.task-actions .i { width: 15px; height: 15px; }
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: .35; }
.task.drop-before { box-shadow: inset 0 2px 0 var(--tint); }
.task.drop-after { box-shadow: inset 0 -2px 0 var(--tint); }
.task-edit { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.task-edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-edit-row.end { justify-content: flex-end; }
.task-edit .input[name="name"] { width: 100%; }
.task-edit .input[name="subject"] { flex: 1 1 100px; min-width: 0; }
.empty { padding: 18px 0 6px; font-size: 14px; }
.empty .muted { margin-top: 2px; font-size: 13px; }
#clearDoneBtn { margin-top: 8px; }

/* ---------- Notes ---------- */
.notes { position: fixed; left: 20px; bottom: 18px; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.notes-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-3); transition: color var(--t), background var(--t); }
.notes-toggle:hover, .notes-toggle[aria-expanded="true"] { color: var(--ink); background: rgba(255,255,255,.05); }
.notes-toggle .i { width: 16px; height: 16px; }
.notes-panel { width: min(340px, calc(100vw - 40px)); padding: 12px 12px 8px; border-radius: var(--radius); background: var(--surface-2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.4); animation: rise .2s var(--ease); }
.notes-panel textarea { display: block; width: 100%; height: 150px; resize: vertical; padding: 2px; background: transparent; border: 0; line-height: 1.55; font-size: 13.5px; }
.notes-panel textarea:focus { outline: none; }
.notes-panel textarea::placeholder { color: var(--ink-3); }
.notes-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- Focus mode ---------- */
.focus-dock { display: none; position: fixed; left: 50%; bottom: 22px; z-index: 5; transform: translateX(-50%); align-items: center; gap: 6px; opacity: .5; transition: opacity .3s; }
.focus-dock:hover, .focus-dock:focus-within { opacity: 1; }
body.focus-mode .topbar,
body.focus-mode .pane,
body.focus-mode .notes,
body.focus-mode .timer-switches,
body.focus-mode .controls-sub,
body.focus-mode .intention,
body.focus-mode .ctl-small,
body.focus-mode .break-tip { display: none !important; }
body.focus-mode .stage { grid-template-columns: 1fr; grid-template-areas: "timer"; min-height: 100vh; align-items: center; padding-bottom: 60px; }
body.focus-mode .timer { padding-top: 0; animation: fade .4s var(--ease); }
body.focus-mode .focus-dock { display: flex; }
body.focus-mode .dial { width: min(440px, 80vw); }

/* ---------- Side sheet ---------- */
.sheet {
  position: fixed; top: 62px; right: 12px; bottom: 12px; z-index: 20;
  width: min(420px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  border-radius: 14px; background: rgba(15, 16, 19, .94);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.5);
  animation: slide-in .24s var(--ease);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 6px 20px; }
.sheet-head h2 { font-size: 15px; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 20px 28px; scrollbar-width: thin; }
.section { padding: 18px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 8px; }
.section h3 { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.section h3 .count { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.hint { margin-top: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; min-height: 36px; }
.row > label { color: var(--ink-2); }
.row > label small { display: block; font-size: 11.5px; color: var(--ink-3); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.num-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t), filter var(--t), color var(--t); white-space: nowrap; }
.btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.btn:disabled { opacity: .4; }
.btn .i { width: 15px; height: 15px; }
.btn-accent { background: var(--tint); color: #131313; font-weight: 600; box-shadow: none; }
.btn-accent:hover:not(:disabled) { background: var(--tint); filter: brightness(1.08); }
.btn-danger { color: var(--warn); }
.btn-danger-solid { background: var(--warn) !important; color: #131313; }

.switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 10px; background: rgba(255,255,255,.14); cursor: pointer; transition: background var(--t); }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform var(--t), background var(--t); }
.switch:checked { background: var(--tint); }
.switch:checked::before { transform: translateX(14px); background: #151515; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--tint) var(--fill), rgba(255,255,255,.13) var(--fill)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5.5px; border-radius: 50%; background: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.45); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255,255,255,.13); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--tint); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--ink); }
input[type="range"]:disabled { opacity: .35; cursor: not-allowed; }
.range-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 12px; padding: 6px 0; }
.range-row label { color: var(--ink-2); font-size: 13px; }
.range-row output { font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* Environment picker */
.env-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.env-tile { position: relative; display: flex; align-items: flex-end; aspect-ratio: 16 / 10; padding: 8px 10px; overflow: hidden; border-radius: 8px; font-size: 12.5px; text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t), transform .15s; }
.env-tile:hover { transform: translateY(-1px); }
.env-tile .swatch { position: absolute; inset: 0; background-size: cover; background-position: center; transition: filter var(--t); }
.env-tile .name { position: relative; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.env-tile[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--tint); }
.env-tile.locked .swatch { filter: saturate(.4) brightness(.6); }
.env-tile .lock { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 5px; border-radius: 10px; font-size: 11.5px; color: var(--ink-2); background: rgba(0,0,0,.5); font-variant-numeric: tabular-nums; }
.env-tile .lock .i { width: 12px; height: 12px; }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--ink-2); background: rgba(var(--tint-rgb), .08); }
.suggest b { color: var(--ink); font-weight: 600; }

/* Sound */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 11px; border-radius: 16px; font-size: 12.5px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: color var(--t), background var(--t), box-shadow var(--t); }
.chip:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.chip[aria-pressed="true"] { color: var(--ink); background: rgba(var(--tint-rgb), .14); box-shadow: inset 0 0 0 1px rgba(var(--tint-rgb), .5); }
.chip small { color: var(--ink-3); margin-left: 4px; }
.chip-wrap { display: inline-flex; align-items: center; }
.chip-wrap .chip { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip-x { height: 100%; padding: 6px 9px 6px 7px; border-radius: 0 16px 16px 0; font-size: 12.5px; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); margin-left: -1px; }
.chip-x:hover { color: var(--warn); }
.group-label { margin: 14px 0 7px; font-size: 12px; color: var(--ink-3); }
.group-label:first-of-type { margin-top: 0; }
.layer { display: grid; grid-template-columns: 28px minmax(70px, 110px) 1fr 38px 28px; align-items: center; gap: 8px; padding: 5px 0; }
.layer-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .pct { font-size: 12px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.layer.paused .layer-name { color: var(--ink-3); }
.empty-inline { font-size: 13px; color: var(--ink-3); }
.preset-save { display: flex; gap: 8px; margin-top: 12px; }
.preset-save .input { flex: 1; min-width: 0; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin: 18px 0 4px; }
.stat .v { font: 300 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .k { font-size: 12px; color: var(--ink-3); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 11px; height: 11px; border-radius: 2px; background: rgba(255,255,255,.055); }
.heat i.future { background: transparent; }
.heat i[data-l="1"] { background: rgba(var(--accent-rgb), .25); }
.heat i[data-l="2"] { background: rgba(var(--accent-rgb), .45); }
.heat i[data-l="3"] { background: rgba(var(--accent-rgb), .7); }
.heat i[data-l="4"] { background: rgba(var(--accent-rgb), 1); }
.heat i.is-today { box-shadow: 0 0 0 1px var(--ink-2); }
.heat-legend { display: flex; align-items: center; gap: 3px; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.heat-legend i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.055); }
.heat-legend i[data-l="1"] { background: rgba(var(--accent-rgb), .25); }
.heat-legend i[data-l="2"] { background: rgba(var(--accent-rgb), .45); }
.heat-legend i[data-l="3"] { background: rgba(var(--accent-rgb), .7); }
.heat-legend i[data-l="4"] { background: rgba(var(--accent-rgb), 1); }
.heat-legend span { margin: 0 4px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.history li:first-child { border-top: 0; }
.h-obj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-dur { font-variant-numeric: tabular-nums; }
.h-meta, .h-rew { font-size: 11.5px; color: var(--ink-3); }
.h-rew { text-align: right; }
.h-skip { color: var(--warn); }

/* Rewards */
.level-hero { padding: 6px 0 4px; }
.lv-num { font-size: 12px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.lv-name { margin: 2px 0 12px; font: 300 28px/1.15 var(--font-display); }
.lv-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.shop-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.shop-item:first-of-type { border-top: 0; }
.shop-item .name { font-size: 13.5px; display: flex; align-items: center; }
.shop-item .desc { font-size: 12px; color: var(--ink-3); }
.shop-item .state { font-size: 12px; color: var(--tint); white-space: nowrap; }
.swatch-dot { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; flex: none; }
.btn .i-coin { width: 14px; height: 14px; }

/* Shortcut list */
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; color: var(--ink-2); }
.keys kbd { justify-self: start; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 8, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
.modal-card { width: min(380px, 100%); padding: 26px 26px 22px; border-radius: 14px; background: rgba(20, 21, 25, .97); box-shadow: inset 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.6); animation: rise .28s var(--ease); }
.confirm-text { font-size: 14.5px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.modal-actions.end { justify-content: flex-end; }
.done { text-align: center; }
.eyebrow { margin-bottom: 18px; font-size: 11.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.done-rewards { display: flex; justify-content: center; gap: 20px; font: 300 24px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.done-rewards span { display: inline-flex; align-items: center; gap: 5px; animation: rise .5s var(--ease) both; }
.done-rewards span:nth-child(2) { animation-delay: .08s; color: var(--accent); }
.done-rewards .i { width: 18px; height: 18px; }
.done-objective { margin-top: 18px; font-size: 15px; }
.done-meta { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.done-level { margin-top: 12px; font-size: 13px; color: var(--accent); }
.done .btn { min-width: 120px; }
body:has(#doneModal:not([hidden])) .modal-card .btn-accent { background: var(--accent); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Palette */
.palette-wrap { place-items: start center; padding-top: 14vh; }
.palette { width: min(560px, 100%); overflow: hidden; border-radius: 12px; background: rgba(20, 21, 25, .98); box-shadow: inset 0 0 0 1px var(--line), 0 30px 90px rgba(0,0,0,.6); animation: rise .18s var(--ease); }
.palette input { width: 100%; padding: 16px 18px; font-size: 15px; background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: none; }
.palette input::placeholder { color: var(--ink-3); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.palette li[aria-selected="true"] { color: var(--ink); background: rgba(255,255,255,.07); }
.palette li .hint-k { font-size: 12px; color: var(--ink-3); }
.palette .none { padding: 14px 12px; color: var(--ink-3); cursor: default; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 20px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
body.focus-mode .toasts { bottom: 72px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 10px; font-size: 13px; background: rgba(22, 23, 27, .97); box-shadow: inset 0 0 0 1px var(--line), 0 14px 34px rgba(0,0,0,.45); animation: rise .2s var(--ease); transition: opacity .2s, transform .2s; }
.toast.out { opacity: 0; transform: translateY(4px); }
.toast button { color: var(--tint); font-weight: 600; }

/* ---------- Motion preferences ---------- */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1400px) { .level-name { display: none; } }
@media (max-width: 1180px) {
  .stage { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); grid-template-areas: "timer tasks" "timer today"; }
  .pane { margin-top: 0; }
  .tasks { margin-top: 4vh; }
}
@media (max-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "timer" "tasks" "today"; padding-bottom: 110px; }
  .tasks { margin-top: 26px; }
  .topbar { grid-template-columns: auto 1fr auto; padding: 10px 12px; gap: 8px; }
  .brand-name, .level-name, .focus-toggle span, .clock-date, .toolbar-sep { display: none; }
  .win { opacity: .3; }
  .task-list { max-height: none; }
}
@media (max-width: 560px) {
  .clock, .xp-track, .hide-touch { display: none; }
  .icon-btn { width: 32px; height: 32px; }
  .level-chip { padding: 6px 6px; gap: 6px; }
  .dial { width: min(320px, 86vw); }
  .controls { gap: 12px; }
  .ctl-primary { min-width: 126px; }
  .notes { left: 12px; bottom: 12px; }
  .sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 86vh; }
  .range-row { grid-template-columns: 90px 1fr 40px; }
  .layer { grid-template-columns: 28px minmax(60px, 90px) 1fr 34px 28px; gap: 6px; }
}
@media (hover: none) { .hide-touch { display: none; } }

/* ---------- Quote of the day ---------- */
.quote { margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.quote blockquote { margin: 0; font: italic 400 15px/1.5 var(--font-serif); color: var(--ink); }
.quote figcaption { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.quote figcaption span { color: var(--ink-4); }
.quote-actions { display: flex; gap: 4px; margin: 6px 0 0 -6px; opacity: 0; transition: opacity var(--t); }
.quote:hover .quote-actions, .quote:focus-within .quote-actions { opacity: 1; }
@media (hover: none) { .quote-actions { opacity: 1; } }

/* ---------- Goals and progression ---------- */
.ghost { margin-top: 8px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.block { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sub-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--ink-3); }
.sub-h .ok { color: var(--tint); }
.objs { list-style: none; margin: 0 0 4px; padding: 0; }
.obj { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; }
.obj-mark { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.obj.done .obj-mark { background: var(--tint); box-shadow: none; }
.obj.done .obj-label { color: var(--ink-3); }
.obj.gone .obj-label { color: var(--ink-4); font-style: italic; }
.obj-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.obj-prog { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.obj-edit { display: inline-flex; gap: 2px; opacity: 0; transition: opacity var(--t); }
.obj:hover .obj-edit, .obj:focus-within .obj-edit { opacity: 1; }
@media (hover: none) { .obj-edit { opacity: 1; } }
.obj-edit button { width: 20px; height: 20px; border-radius: 4px; color: var(--ink-3); font-size: 13px; line-height: 1; }
.obj-edit button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.mission { margin-top: 8px; }
.mission .goal-row { margin-bottom: 5px; }
.mission.done .goal-row span:first-child { color: var(--ink-3); }
.next-reward { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 18px; padding: 10px; border-radius: 8px; text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t); }
.next-reward:hover { background: rgba(255,255,255,.04); }
.nr-k { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.nr-v { display: block; font-size: 13.5px; }
.nr-m { display: block; font-size: 11.5px; color: var(--ink-3); }
.reward-thumb { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13px; color: var(--ink-2); }
.reward-thumb.plain { background: rgba(255,255,255,.04); }
.reward-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.reward-card { padding: 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.reward-card .reward-thumb { width: 100%; height: 48px; margin-bottom: 8px; }
.rc-name { font-size: 13px; }
.rc-meta { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.ach .h-obj { color: var(--ink-3); }
.ach.got .h-obj { color: var(--ink); }
.ach.got .h-dur { color: var(--tint); }
.done-bonus { list-style: none; margin: 14px auto 0; padding: 0; max-width: 280px; font-size: 13px; color: var(--ink-2); }
.done-bonus li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.done-bonus li span { color: var(--accent); white-space: nowrap; }
.done-rate { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); }
.done-rate div { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.done-rate button { width: 32px; height: 32px; border-radius: 50%; font-size: 13px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--t), color var(--t); }
.done-rate button:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.done-rate button[aria-pressed="true"] { background: var(--accent); color: #131313; box-shadow: none; }
.obj-label { white-space: normal; overflow: visible; line-height: 1.35; }
.notes-toggle { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.today { margin-bottom: 40px; }

/* ---------- Study toolkit ---------- */
.stat-grid.three { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
.rec { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rec:first-of-type { border-top: 0; }
.rec-t { font-size: 13.5px; }
.rec-w { margin-top: 2px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.card-form { display: flex; flex-direction: column; gap: 8px; }
.card-form textarea { resize: vertical; line-height: 1.5; font: inherit; }
.new-topic { display: flex; gap: 8px; }
.new-topic .input { flex: 1; min-width: 0; }
.card-list { margin-top: 10px; max-height: 340px; overflow-y: auto; }
.err-fix { grid-column: 1 / -1; color: var(--ink-2); }
.expl-text { grid-column: 1 / -1; white-space: pre-wrap; }
.steps-hint { margin: 0 0 12px; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.review { min-height: 360px; }
.rv-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.rv-front { margin: 22px 0 18px; font: 400 20px/1.45 var(--font-serif); color: var(--ink); }
.rv-back { margin-bottom: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--ink); }
.rv-steps { margin: 0 0 18px; padding: 14px 0 0 20px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.7; }
.rv-steps li { animation: rise .2s var(--ease); }
.rv-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rv-rate .btn { flex-direction: column; gap: 2px; padding: 8px 4px; }
.rv-rate small { font-size: 11px; opacity: .7; font-weight: 400; }

/* ---------- Friends: standings set like print ---------- */
.standings-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.standings-title { font: 400 22px/1.2 var(--font-serif); }
.standings { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.standings th { padding: 6px 4px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.standings td { padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.standings tr.me td { color: var(--ink); }
.standings .rk { width: 22px; color: var(--ink-3); }
.standings .nm { min-width: 0; }
.standings .sc { text-align: right; font-weight: 600; color: var(--ink); }
.standings .ac { text-align: right; white-space: nowrap; }
.standings .av { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.standings .live { margin-left: 8px; font-size: 11px; color: var(--tint); }
.standings .capped { margin-left: 6px; font-size: 10.5px; font-weight: 400; color: var(--warn); }
.standings .dots i { width: 5px; height: 5px; }
.small { font-size: 11.5px; }
.invite-code { padding: 6px 10px; border-radius: 6px; font: 600 14px var(--font-mono); letter-spacing: .08em; background: rgba(255,255,255,.05); }
.duel { grid-template-columns: minmax(0, 1fr) auto; }
.duel-bar { grid-column: 1 / -1; display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(255,255,255,.1); overflow: hidden; }
.duel-bar i { display: block; height: 100%; background: var(--tint); }
.form-error { margin-top: 10px; font-size: 12.5px; color: var(--warn); }
.color-chip { padding: 6px 8px; }
@media (max-width: 560px) {
  #fullscreenBtn { display: none; }
  .toolbar { gap: 0; }
  .icon-btn { width: 30px; }
  .topbar { padding: 10px 8px; gap: 4px; }
}

/* ---------- Planner ---------- */
.plan { list-style: none; margin: 0; padding: 0; }
.pb { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pb:first-child { border-top: 0; }
.pb-time { grid-row: span 2; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pb-title { color: var(--ink); }
.pb-meta { grid-column: 2; font-size: 11.5px; color: var(--ink-3); }
.pb-act { grid-column: 3; grid-row: 1 / span 2; align-self: center; white-space: nowrap; font-size: 12px; color: var(--tint); }
.pb.done .pb-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.pb.ev .pb-title, .pb.pr .pb-title { color: var(--ink-3); }
.pb.pr .pb-time { color: var(--tint); }
.next-block { display: grid; gap: 1px; margin-top: 14px; }
input[type="time"].input { width: 124px; }

/* =========================================================================
   Design refresh (M8): a reading room at night.
   Side columns are set as typographic margins — small-caps labels and hairline
   rules — instead of glass cards. The dial stays the only circle on screen.
   ========================================================================= */
.pane { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; border-radius: 0; }
.pane-head { padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.pane-head h2 { font: 600 11px/1 var(--font); letter-spacing: .2em; color: var(--ink-2); }
.today .pane-body, .tasks .task-form { margin-top: 14px; }
.today, .tasks { text-shadow: 0 1px 12px rgba(0,0,0,.35); }
@media (min-width: 1181px) { .stage { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(260px, 320px); } }
.task-list { padding-left: 0; }
.task.is-current::before { left: -12px; }

/* More menu */
.more { position: relative; }
.menu { position: absolute; right: 0; top: 42px; z-index: 30; min-width: 230px; padding: 6px; border-radius: 12px;
  background: rgba(20, 21, 25, .98); box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgba(0,0,0,.5); animation: rise .16s var(--ease); }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); text-align: left; }
.menu button:hover, .menu button:focus-visible { color: var(--ink); background: rgba(255,255,255,.06); }
.menu kbd { margin-left: auto; }
.menu .i { width: 16px; height: 16px; }

/* Phone navigation */
.bottom-nav { display: none; }
@media (max-width: 860px) {
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(11, 12, 14, .94);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 -1px 0 var(--line); }
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--ink-3); border-radius: 8px; }
  .bottom-nav button[aria-expanded="true"] { color: var(--tint); }
  .bottom-nav .i { width: 20px; height: 20px; }
  .toolbar > [data-sheet="plan"], .toolbar > [data-sheet="study"], .toolbar > [data-sheet="friends"], #moreBtn { display: none; }
  .menu { position: fixed; top: auto; right: 8px; bottom: 70px; }
  .notes { bottom: 74px; }
  .notes-toggle { display: none; }
  .toasts { bottom: 80px; }
  .sheet { bottom: 66px; }
  .stage { padding-bottom: 140px; }
  body.focus-mode .bottom-nav { display: none; }
}
@media (max-width: 560px) { .sheet { top: auto; max-height: calc(100vh - 140px); } }

/* Decor stays behind, never competes with text */
.scene-decor .win, .scene-decor .win-sill { opacity: .45; }
@media (max-width: 1180px) { .scene-decor .win, .scene-decor .win-sill { opacity: .25; } }
@media (max-width: 860px) { .scene-decor .win, .scene-decor .win-sill { display: none; } .seg-quiet button { padding: 5px 8px; } }
.quote-actions { display: none; }
.quote:hover .quote-actions, .quote:focus-within .quote-actions { display: flex; }
@media (hover: none) { .quote-actions { display: flex; } }

/* Mock exam: the Pomodoro cycle counter means nothing during a paper. */
.is-exam #dialCycle { visibility: hidden; }

/* Settings: setup check */
.setup-v { text-align: right; color: var(--ink); font-size: 13px; }
.setup-v code, #setupSection .hint code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--ink-2); }

/* AI study assistant */
.ai-draft li { padding: 8px 0; }
.ai-pick { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ai-pick input { margin-top: 3px; accent-color: var(--tint); }
.ai-pick > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.feedback { grid-column: 1 / -1; margin-top: 8px; padding: 10px 12px; border-left: 2px solid var(--tint); background: rgba(255,255,255,.03); font-size: 13px; color: var(--ink-2); }
.feedback p { margin: 4px 0; }
.feedback ul { margin: 2px 0 6px; padding-left: 18px; }
.fb-head { display: flex; justify-content: space-between; color: var(--ink); font-weight: 500; }
.fb-k { margin-top: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* Animated scenes (WebGL) and video wallpapers */
.scene-gl, .scene-video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.scene-gl.on, .scene-video.on { opacity: 1; }
.scene-video { object-fit: cover; transform: scale(1.04); }
.scene.is-switching .scene-gl, .scene.is-switching .scene-video { opacity: 0; }
.anim-tag { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
video.swatch { object-fit: cover; }
