/* Nebula — one calm screen: today's tasks. Everything else slides in on demand. */
:root {
  --bg: #0b0812;
  --surface: #15101f;
  --surface-2: #1d1629;
  --line: rgba(205, 180, 255, 0.12);
  --text: #f2edfa;
  --muted: #a397b8;
  --faint: #6f6584;
  --accent: #b98aff;
  --accent-ink: #160a2a;
  --good: #6fd8a2;
  --warn: #f0c46b;
  --bad: #ff8f86;
  --ui: "Outfit", "Segoe UI", system-ui, sans-serif;
  --read: "Newsreader", Georgia, serif;
  --r: 18px;
  --gutter-l: max(18px, env(safe-area-inset-left, 0px));
  --gutter-r: max(18px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(120% 60% at 50% -10%, #241338 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
img { max-width: 100%; display: block; }

.screen {
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 40px) var(--gutter-l);
  max-width: 640px;
  margin: 0 auto;
  animation: in .28s cubic-bezier(.2,.8,.2,1);
}
.screen.back { animation-name: in-back; }
@keyframes in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }

/* ---------- Today ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; color: var(--muted); font-size: 14px; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.icon-btn:active { background: var(--surface); }

.hello { margin: 26px 0 6px; }
.hello .date { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 6px; }
.hello h1 { margin: 2px 0 0; font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.daynav { display: inline-flex; gap: 2px; margin-left: auto; }
.daynav button { width: 32px; height: 32px; border-radius: 50%; color: var(--faint); display: grid; place-items: center; }
.daynav button:active { background: var(--surface); }

.progress { display: flex; align-items: center; gap: 12px; margin: 18px 0 22px; color: var(--muted); font-size: 14px; }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }

.tasks { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.task {
  width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  transition: transform .12s ease, background .2s;
}
.task:active { transform: scale(.985); background: var(--surface-2); }
.task .kind { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.task .name { font-weight: 600; font-size: 17px; line-height: 1.25; }
.task .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.task .state { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.task.done { background: transparent; }
.task.done .name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.task.done .kind { background: rgba(111, 216, 162, .12); color: var(--good); }

.allclear { text-align: center; padding: 40px 10px 10px; color: var(--muted); }
.allclear b { display: block; color: var(--text); font-size: 20px; margin-bottom: 4px; }
.catchup { margin-top: 22px; width: 100%; color: var(--warn); font-size: 14px; text-align: left; padding: 12px 4px; }

/* ---------- Task screens ---------- */
.bar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 15px; padding: 8px 8px 8px 0; }
.bar-top .count { margin-left: auto; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 4px; margin: 0 0 16px; }
.dots i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-2); }
.dots i.on { background: var(--accent); }
.dots i.good { background: var(--good); }
.dots i.again { background: var(--bad); }

h2.title { font-size: 26px; line-height: 1.15; margin: 0 0 6px; font-weight: 600; text-wrap: balance; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.slide { width: 100%; aspect-ratio: 1100 / 620; border-radius: 12px; background-color: #fff; background-repeat: no-repeat; margin-bottom: 8px; }
.slides { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin: 6px 0 10px; }
.v-ok { background: rgba(111,216,162,.14); color: var(--good); }
.v-add { background: rgba(240,196,107,.14); color: var(--warn); }
.v-fix { background: rgba(255,143,134,.14); color: var(--bad); }
.v-blank { background: rgba(185,138,255,.16); color: var(--accent); }

.read { font-family: var(--read); font-size: 17px; line-height: 1.6; max-width: 66ch; }
.read p { margin: .6em 0; }
.read ul { margin: .3em 0 .7em; padding-left: 1.2em; }
.read li { margin: .2em 0; }
.read strong { font-weight: 600; color: #fff; }
.label { font-family: var(--ui); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 18px 0 6px; }

.actions { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 0 calc(env(safe-area-inset-bottom, 0px) + 8px); background: linear-gradient(transparent, var(--bg) 30%); margin-top: 18px; }
.btn { flex: 1; height: 52px; border-radius: 14px; font-weight: 600; font-size: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.good { color: var(--good); }
.btn.again { color: var(--bad); }
.btn:active { transform: scale(.98); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin: 6px 0 16px; }
.seg button { height: 40px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.toc { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.toc button { text-align: left; padding: 7px 0; color: var(--accent); font-size: 15px; }
.lsec { scroll-margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 18px; }
.lsec h3 { font-size: 20px; line-height: 1.25; margin: 10px 0 4px; font-weight: 600; text-wrap: balance; }
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; scroll-margin-top: 20px; }
.point.flash { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(185,138,255,.18); }
.point .read { font-size: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags span { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; color: var(--muted); }
.empty b { color: var(--text); }
.file { font-family: var(--ui); font-size: 14px; color: var(--accent); word-break: break-word; }

.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 16px; }
.opt .k { color: var(--faint); font-weight: 600; }
.opt.right { border-color: var(--good); background: rgba(111,216,162,.10); }
.opt.wrong { border-color: var(--bad); background: rgba(255,143,134,.10); }
.opt[disabled] { cursor: default; }
.linkish { color: var(--accent); font-weight: 600; font-size: 15px; padding: 10px 0; }

.station { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 10px; }
.station .n { font-weight: 600; }
.station .s { color: var(--muted); font-size: 14px; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--faint); display: grid; place-items: center; color: transparent; }
.tick.on { border-color: var(--good); background: var(--good); color: var(--accent-ink); }

/* ---------- Sheet (hidden menu) ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(5,3,10,.6); display: flex; align-items: flex-end; z-index: 10; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 640px; margin: 0 auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px var(--gutter-r) calc(env(safe-area-inset-bottom, 0px) + 18px) var(--gutter-l); max-height: 82vh; overflow: auto; animation: up .26s cubic-bezier(.2,.8,.2,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--faint); margin: 4px auto 14px; }
.sheet h3 { margin: 6px 0 10px; font-size: 18px; }
.row { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.row .r { color: var(--faint); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row.today .l { color: var(--accent); }
