@import url('/cjk.css');
/* 催催 / Nudge design system — see /design.html for the living reference.
   Warm paper, warm ink, one accent (ember). Serif display type over a sans UI. */

/* ---------------------------------------------------------- tokens */
:root {
  /* colour */
  --bg: #f7f5f1;
  --surface: #ffffff;
  --sunken: #efece6;
  --ink: #15130f;
  --ink-2: #5d5950;
  --ink-3: #99948a;
  --line: rgba(21, 19, 15, 0.09);
  --line-2: rgba(21, 19, 15, 0.17);
  --accent: #e5481b;
  --accent-soft: rgba(229, 72, 27, 0.1);
  --ok: #1f7a4d;
  --ok-soft: rgba(31, 122, 77, 0.1);
  --gold: #b8862b;
  /* elevation */
  --e1: 0 1px 2px rgba(21, 19, 15, 0.05);
  --e2: 0 1px 2px rgba(21, 19, 15, 0.04), 0 8px 24px rgba(21, 19, 15, 0.07);
  --shadow: 0 2px 4px rgba(21, 19, 15, 0.04), 0 18px 48px rgba(21, 19, 15, 0.14);
  /* shape */
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  /* type */
  /* The three 'Nudge CJK…' families cover Chinese only and must stay first: see scripts/build-cjk-css.js. */
  --font: 'Nudge CJK Local', 'Nudge CJK', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', system-ui, sans-serif;
  --display: 'Nudge CJK Serif', 'Nudge CJK Local', 'Nudge CJK', ui-serif, 'New York', 'Iowan Old Style', Georgia, serif;
  --mono: 'Nudge CJK Local', 'Nudge CJK', ui-monospace, 'SF Mono', Menlo, monospace;
  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 0.15s;
  --slow: 0.45s;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e0c;
    --surface: #191815;
    --sunken: #22201c;
    --ink: #f4f1ea;
    --ink-2: #aaa59b;
    --ink-3: #706b62;
    --line: rgba(244, 241, 234, 0.09);
    --line-2: rgba(244, 241, 234, 0.18);
    --accent: #ff6a3d;
    --accent-soft: rgba(255, 106, 61, 0.14);
    --ok: #4ccb86;
    --ok-soft: rgba(76, 203, 134, 0.14);
    --gold: #e0b356;
    --e1: 0 1px 2px rgba(0, 0, 0, 0.3);
    --e2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}
/* A surface that is always night, whatever the system theme: the reminder. */
.night, .nag-wrap {
  --bg: #0f0e0c;
  --surface: #191815;
  --sunken: #22201c;
  --ink: #f4f1ea;
  --ink-2: #aaa59b;
  --ink-3: #706b62;
  --line: rgba(244, 241, 234, 0.1);
  --line-2: rgba(244, 241, 234, 0.2);
  --accent: #ff6a3d;
  --accent-soft: rgba(255, 106, 61, 0.14);
  --ok: #4ccb86;
  color: var(--ink);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------- shell */
.shell { display: flex; min-height: 100%; }
.side {
  width: 228px; flex: none; padding: 30px 14px 22px; border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 26px; }
.logo { width: 28px; height: 28px; flex: none; display: block; }
.logo svg { width: 100%; height: 100%; display: block; }
.wordmark { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.brand small { font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.nav-btn {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; width: 100%;
  color: var(--ink-2); font-weight: 500; text-align: left; transition: background var(--fast), color var(--fast);
}
.nav-btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:hover { background: var(--sunken); color: var(--ink); }
.nav-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.nav-btn .count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.side-foot { margin-top: auto; padding: 0 4px; font-size: 12px; color: var(--ink-3); }
.streak { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.streak b { font-family: var(--display); font-size: 26px; line-height: 1; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.streak span { line-height: 1.35; }
.streak.lit b { color: var(--accent); }

.main { flex: 1; min-width: 0; padding: 56px 36px 96px; overflow-x: clip; }
.view { max-width: 700px; margin: 0 auto; animation: rise var(--slow) var(--ease) both; }
.view.wide { max-width: 900px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 820px) {
  .shell { display: block; }
  .side {
    position: fixed; inset: auto 0 0 0; top: auto; width: auto; height: auto; flex-direction: row; gap: 0; z-index: 20;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  }
  .brand, .side-foot { display: none; }
  .nav-btn { flex: 1; flex-direction: column; gap: 3px; padding: 6px 0 4px; font-size: 10.5px; border-radius: 10px; text-align: center; position: relative; }
  .nav-btn svg { width: 22px; height: 22px; }
  .nav-btn.on, .nav-btn:hover { background: none; box-shadow: none; }
  .nav-btn.on { color: var(--ink); }
  .nav-btn.on svg { stroke-width: 2; }
  .nav-btn .count { display: none; }
  /* Unspent draws and open plans still show on the tab bar, as a small badge. */
  #n-today:not(:empty), #n-tickets:not(:empty) {
    display: block; position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  }
  .main { padding: calc(26px + env(safe-area-inset-top)) 18px calc(104px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------- type */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
h1 { font-family: var(--display); font-size: 38px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.section-title { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 34px 2px 10px; display: flex; justify-content: space-between; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.warn { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { h1 { font-size: 32px; } }

/* ---------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 17px;
  border-radius: 12px; font-weight: 600; font-size: 14px; white-space: nowrap; border: 1px solid var(--line-2);
  background: var(--surface); transition: transform 0.08s, opacity var(--fast), background var(--fast), box-shadow var(--fast);
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: scale(0.975); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); box-shadow: var(--e1); }
.btn.primary:hover { opacity: 0.86; background: var(--ink); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent); opacity: 0.9; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--accent); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--accent-soft); }
.btn.lg { height: 52px; font-size: 16px; border-radius: 15px; padding: 0 24px; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.35; pointer-events: none; }
a.btn { color: var(--ink); text-decoration: none; }
a.btn.primary { color: var(--bg); }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); outline: none; transition: border-color var(--fast), box-shadow var(--fast); -webkit-appearance: none; appearance: none;
}
select.input {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2399948a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 88px; line-height: 1.5; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--line); }
.input::placeholder { color: var(--ink-3); }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; }
.switch input { width: 18px; height: 18px; accent-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500;
  color: var(--ink-2); background: var(--surface); transition: all var(--fast);
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chips.week { display: grid; grid-template-columns: repeat(7, 1fr); }
.chips.week .chip { padding: 0; height: 36px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.seg { display: inline-flex; background: var(--sunken); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 15px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: color var(--fast), background var(--fast); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--e1), 0 0 0 0.5px var(--line); }

/* small status label */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.hot { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------- today */
.hero {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 32px; margin-bottom: 18px;
  border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e2), inset 0 0 0 1px var(--line); overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 120% at 100% 0%, var(--accent-soft), transparent 70%);
}
.hero > * { position: relative; }
.hero-text { min-width: 0; }
.hero h1 { font-size: 40px; }
.hero-sub { color: var(--ink-2); margin-top: 8px; font-size: 15px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.ring { position: relative; width: 116px; height: 116px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--sunken); }
.ring .value { stroke: var(--ink); stroke-linecap: round; transition: stroke-dashoffset 0.9s var(--ease), stroke var(--fast); }
.ring.full .value { stroke: var(--ok); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label b { font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
@media (max-width: 560px) {
  .hero { padding: 22px 20px; gap: 14px; }
  .hero h1 { font-size: 30px; }
  .ring { width: 88px; height: 88px; }
  .ring-label b { font-size: 23px; }
}
/* legacy header progress (still used outside the hero) */
.progress { text-align: right; min-width: 120px; }
.progress b { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress span { color: var(--ink-3); font-size: 13px; }
.bar { height: 4px; background: var(--sunken); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; transition: width 0.5s var(--ease); }

/* the plan that needs attention now */
.nextup {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-bottom: 18px; border-radius: var(--r);
  background: var(--ink); color: var(--bg); box-shadow: var(--e2);
}
.nextup .when { font-family: var(--display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.nextup .what { flex: 1; min-width: 0; }
.nextup .what small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.nextup .what b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nextup.due { background: var(--accent); color: #fff; }
.nextup.hush { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.nextup.hush .what b { white-space: normal; }
.nextup.hush .btn { flex: none; }
.nextup .btn { background: color-mix(in srgb, currentColor 14%, transparent); border-color: transparent; color: inherit; }
.nextup .btn:hover { background: color-mix(in srgb, currentColor 24%, transparent); }
.nextup.hush .btn.primary, .nextup.hush .btn.primary:hover { background: var(--ink); color: var(--bg); } /* the one thing to do about it */

.quick { display: flex; gap: 8px; margin-bottom: 8px; padding: 6px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow var(--fast); }
.quick:focus-within { box-shadow: inset 0 0 0 1px var(--ink), 0 0 0 4px var(--line); }
.quick .input { flex: 1; min-width: 0; height: 40px; border-color: transparent; background-color: transparent; box-shadow: none; }
.quick .input:focus { box-shadow: none; border-color: transparent; }
.quick select.input, .quick input[type='time'] { flex: none; width: auto; background-color: var(--sunken); border-radius: 10px; color: var(--ink-2); font-size: 13.5px; }
.quick select.input { width: 92px; }
.quick input[type='time'] { width: 116px; }
.quick .btn { height: 40px; border-radius: 10px; }
/* plain two-field forms inside panels keep the simple look */
.quick-read { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 2px 10px 12px; font-size: 13px; }
.quick-read b { font-weight: 600; margin-left: 2px; overflow-wrap: anywhere; }
.quick-read .btn { margin-left: auto; }
.panel .quick { padding: 0; box-shadow: none; background: none; }
.panel .quick .input { border-color: var(--line-2); background-color: var(--surface); height: 44px; }
.panel .quick .input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--line); }
.panel .quick .btn { height: 44px; border-radius: 12px; }

.list { border-radius: var(--r); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); overflow: hidden; }
.row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background var(--fast); }
.row:last-child { border-bottom: 0; }
.row:hover { background: color-mix(in srgb, var(--sunken) 45%, transparent); }
.check {
  width: 24px; height: 24px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); position: relative;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
}
.check:hover { border-color: var(--ink); transform: scale(1.06); }
.row.done .check { background: var(--ok); border-color: var(--ok); animation: pop 0.35s var(--ease); }
.row.done .check::after {
  content: ''; position: absolute; left: 7.5px; top: 3.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.12); } }
.row.skipped .check { border-style: dashed; }
.row-main { flex: 1; min-width: 0; text-align: left; display: block; }
.row-title { display: block; font-weight: 550; letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .row-title, .row.skipped .row-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.row-meta { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta em { font-style: normal; color: var(--accent); font-weight: 550; }
.row .pin, .pin { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; position: relative; top: -1px; }
.row-time { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.row.due .row-time { color: var(--accent); }
/* The time and the row's action sit side by side; on a phone they stack, so the title keeps the width. */
.row-side { display: flex; align-items: center; gap: 13px; flex: none; }
.row-actions { display: flex; gap: 4px; flex: none; }
/* A plan's small steps: a tick list under its row on Today and inside the reminder. */
.row.stepped { flex-wrap: wrap; row-gap: 6px; }
.substeps { flex: 0 0 100%; display: grid; gap: 1px; padding-left: 37px; }
.substep { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); text-align: left; }
.substep i { flex: none; width: 16px; height: 16px; margin-top: 1.5px; border-radius: 5px; border: 1.5px solid var(--line-2); transition: border-color var(--fast), background var(--fast); }
.substep:hover i { border-color: var(--ink); }
.substep span { min-width: 0; overflow-wrap: anywhere; }
.substep.next { color: var(--ink); font-weight: 550; }
.substep.next i { border-color: var(--ink-2); }
.substep.on { color: var(--ink-3); }
.substep.on span { text-decoration: line-through; text-decoration-color: var(--line-2); }
.substep.on i { background: var(--ink); border-color: var(--ink); position: relative; }
.substep.on i::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--bg); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.nag .substeps { padding-left: 0; margin-bottom: 18px; max-height: 168px; overflow: auto; }
.nag .substep { font-size: 15px; padding: 6px 0; }
.nag .substep i { margin-top: 2.5px; }
.nag-next { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 6px; }
.list.ahead { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.list.ahead .row-title { color: var(--ink-2); }
/* Yesterday's unanswered plans: outlined like the look-ahead, and the two answers stay side by side on a phone. */
.list.late { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.list.late .row-side { flex-direction: row; }

.empty { padding: 44px 0 52px; text-align: center; color: var(--ink-3); }
.empty svg { width: 132px; height: 96px; display: block; margin: 0 auto 14px; }
.empty b { display: block; color: var(--ink); font-family: var(--display); font-size: 21px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }

/* first-run card */
.welcome { border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--e2), inset 0 0 0 1px var(--line); padding: 26px 28px; margin-bottom: 18px; }
.welcome h2 { font-family: var(--display); font-size: 24px; margin-bottom: 4px; }
.welcome ol { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; }
.welcome li { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.welcome li i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; background: var(--sunken); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.welcome li.done i { background: var(--ok); color: #fff; }
.welcome li div { flex: 1; min-width: 0; }
.welcome li b { display: block; font-weight: 600; }
.welcome li span { display: block; font-size: 13px; color: var(--ink-2); }
.welcome li.done b { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }

/* ---------------------------------------------------------- review */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats div { padding: 16px 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.stats b { display: block; font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--ink-3); }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr 1fr; } }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 140px; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.days .d { display: flex; flex-direction: column; gap: 7px; min-width: 0; text-align: center; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.days .track { flex: 1; border-radius: 6px; background: var(--sunken); display: flex; align-items: flex-end; overflow: hidden; }
.days .track i { display: block; width: 100%; background: var(--ink); border-radius: 6px; }
.days .d.off .track { background: none; border: 1px dashed var(--line-2); }
.days .d.now span { color: var(--accent); font-weight: 700; }
.days .d.now .track i { background: var(--accent); }
.habit { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; }
.habit.few { grid-auto-columns: 44px; justify-content: start; } /* a monthly plan: a handful of squares, not a stretched bar */
.habit i { height: 22px; border-radius: 6px; background: var(--sunken); }
.habit i.done { background: var(--ink); }
.habit i.off { background: none; border: 1px dashed var(--line-2); }
.habit i.todo { background: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
.rank { border-radius: var(--r); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); overflow: hidden; }
.rank div { position: relative; display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rank div:last-child { border-bottom: 0; }
.rank span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.rank b { flex: none; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; position: relative; }
.rank i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); }

/* ---------------------------------------------------------- cards */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { flex: 1; min-width: 160px; height: 38px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } .cards > .empty { grid-column: 1 / -1; } }
.card { border-radius: var(--r); background: var(--surface); padding: 18px 18px 10px; min-width: 0; box-shadow: var(--e1), inset 0 0 0 1px var(--line); transition: box-shadow var(--fast), transform var(--fast); }
.card:hover { box-shadow: var(--e2), inset 0 0 0 1px var(--line); }
.card-foot .btn.sm { padding: 0 8px; }
.card h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; }
.card pre {
  margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.card.prompt pre { font: 13px/1.6 var(--mono); background: var(--sunken); border-radius: var(--r-sm); padding: 12px 13px; color: var(--ink); }
.card-foot { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.card-foot .tags { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { margin-right: 8px; }
.tag[data-tag] { cursor: pointer; }
.tag[data-tag]:hover { color: var(--ink); }
.kind { font-weight: 600; color: var(--ink-2); margin-right: 8px; }

/* ---------------------------------------------------------- rewards */
.tickets { text-align: right; }
.tickets b { font-family: var(--display); font-size: 30px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.stage {
  position: relative; border-radius: var(--r-lg); overflow: hidden; height: min(62vh, 540px); min-height: 320px;
  background: radial-gradient(120% 90% at 50% 0%, var(--surface), var(--sunken)); box-shadow: var(--e2), inset 0 0 0 1px var(--line);
}
.stage > .room { position: absolute; inset: 0; }
.stage-bar { position: absolute; left: 12px; right: 12px; bottom: 14px; display: flex; gap: 8px; justify-content: center; pointer-events: none; }
.stage-bar > * { pointer-events: auto; }
.postcard { display: block; width: 100%; aspect-ratio: 4 / 5; margin-top: 18px; border-radius: var(--r); box-shadow: var(--e2), 0 0 0 1px var(--line); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.pill .label { padding: 0 10px; font-size: 13px; font-weight: 600; }
.hint { position: absolute; top: 16px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--ink-2); pointer-events: none; }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.thing {
  --rar: var(--ink-3);
  border-radius: var(--r); background: var(--surface); padding: 8px 6px 11px; text-align: center; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start; /* a button centres its content; cards in a row line up from the top */
  box-shadow: var(--e1), inset 0 0 0 1px var(--line); transition: box-shadow var(--fast), transform var(--fast);
}
.thing::before { content: ''; position: absolute; inset: 0 0 45% 0; background: radial-gradient(80% 100% at 50% 0%, color-mix(in srgb, var(--rar) 16%, transparent), transparent 75%); pointer-events: none; }
.thing > * { position: relative; }
button.thing:hover { transform: translateY(-2px); box-shadow: var(--e2), inset 0 0 0 1px var(--line-2); }
.thing.on { box-shadow: var(--e2), inset 0 0 0 2px var(--ink); }
.thing img, .thing .ph { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.thing .ph { display: grid; place-items: center; color: var(--ink-3); font-family: var(--display); font-size: 26px; background: var(--sunken); border-radius: 11px; }
.thing .nm { display: block; font-size: 12.5px; font-weight: 600; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.thing .rr { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }
.thing .qty { position: absolute; top: 7px; right: 8px; font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: 6px; padding: 0 5px; }
.thing .spare { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.thing.locked::before { display: none; }
.thing.locked { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.thing.locked .nm, .thing.locked .rr { color: var(--ink-3) !important; }
.thing.wished { box-shadow: inset 0 0 0 1.5px var(--rar); }
.thing.wished .ph { color: var(--rar); background: color-mix(in srgb, var(--rar) 9%, var(--sunken)); }
.thing.wished .spare { color: var(--rar); }
.finishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.finish {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; text-align: left; cursor: pointer;
  border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; box-shadow: var(--e1), inset 0 0 0 1px var(--line); transition: box-shadow var(--fast);
}
.finish:hover { box-shadow: var(--e1), inset 0 0 0 1px var(--line-2); }
.finish.on { box-shadow: var(--e1), inset 0 0 0 2px var(--ink); }
.finish i { flex: none; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.finish b { display: block; font-size: 13px; font-weight: 600; }
.finish small { display: block; font-size: 11px; color: var(--ink-3); letter-spacing: 0.02em; white-space: nowrap; }
.finish.locked i { opacity: 0.35; }
.finish.locked b { color: var(--ink-3); }

.draw { --rar: var(--ink-3); text-align: center; padding: 0; }
.draw-stage { position: relative; border-radius: var(--r-lg); padding: 18px 20px 30px; background: var(--surface); box-shadow: var(--e2), inset 0 0 0 1px var(--line); overflow: hidden; }
.draw-stage::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 70% at 50% 34%, color-mix(in srgb, var(--rar) 20%, transparent), transparent 72%); pointer-events: none; transition: background var(--slow); }
.draw-stage > * { position: relative; }
.draw .preview { height: 280px; position: relative; animation: reveal 0.7s var(--ease) both; }
.draw .preview > div { position: absolute; inset: 0; }
@keyframes reveal { from { opacity: 0; transform: scale(0.86) translateY(14px); } }
.draw .idle { height: 280px; display: grid; place-items: center; }
.orb { width: 128px; height: 128px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2), var(--e2); display: grid; place-items: center; font-family: var(--display); font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }
.orb::before, .orb::after { content: ''; position: absolute; inset: -18px; border-radius: 50%; border: 1px solid var(--line); }
.orb::after { inset: -40px; opacity: 0.55; }
.orb.spin { animation: pulse 0.9s ease-in-out infinite; }
.orb.spin::before { border-color: var(--accent); border-right-color: transparent; border-bottom-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes pulse { 50% { transform: scale(0.94); } }
@keyframes spin { to { transform: rotate(360deg); } }
.draw .rr { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; background: color-mix(in srgb, var(--rar) 14%, transparent); }
.draw .nm { font-family: var(--display); font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 0 2px; }
.rules { margin-top: 28px; border-radius: var(--r); background: var(--surface); box-shadow: var(--e1), inset 0 0 0 1px var(--line); text-align: left; overflow: hidden; }
.rules div { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rules div:last-child { border-bottom: 0; }
.rules div span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 8px; }
.set { border-radius: var(--r); background: var(--surface); padding: 15px 17px; box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.set-head b { display: block; font-size: 14.5px; font-weight: 650; }
.set-head div span { font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; }
.set-head > span { flex: none; font-variant-numeric: tabular-nums; }
.set-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.set-items span { padding: 2px 8px; border-radius: 7px; box-shadow: inset 0 0 0 1px var(--line); }
.set-items .have { color: var(--ink); font-weight: 550; background: var(--sunken); box-shadow: none; }
.set.claimed { box-shadow: inset 0 0 0 1px var(--line); background: transparent; }
.set.claimed .set-head b { color: var(--ink-2); }
.shards { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.shards .bar { flex: 1; max-width: 220px; margin: 0; }
.like { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.like svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.like.on { border-color: var(--accent); color: var(--accent); }
.like.on svg { fill: currentColor; }
.like:disabled { cursor: default; }

/* ---------------------------------------------------------- settings */
.panel { border-radius: var(--r); background: var(--surface); padding: 22px; margin-bottom: 12px; box-shadow: var(--e1), inset 0 0 0 1px var(--line); }
.panel h2 { font-size: 16.5px; margin-bottom: 4px; }
.panel > p { margin-bottom: 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pair { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.pair img { width: 148px; height: 148px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); background: #fff; padding: 8px; }
.pair ol { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; flex: 1; min-width: 220px; }
.pair li { margin-bottom: 6px; }
.mono { font: 12.5px/1.4 var(--mono); word-break: break-all; color: var(--ink); }
kbd { font: 12px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sunken); }

/* ---------------------------------------------------------- sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 14, 12, 0.4); opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet {
  position: relative; width: 100%; max-width: 448px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); color: var(--ink);
  border-radius: var(--r-lg); padding: 28px 26px 22px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); opacity: 0; transform: translateY(12px) scale(0.985);
  transition: opacity 0.2s, transform 0.28s var(--ease);
}
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { opacity: 1; transform: none; }
.sheet-wrap.out .sheet-backdrop, .sheet-wrap.out .sheet { opacity: 0; }
.sheet h2 { font-family: var(--display); font-size: 24px; margin-bottom: 6px; letter-spacing: -0.01em; }
.sheet .lead { color: var(--ink-2); margin-bottom: 20px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 22px; }
.sheet-actions .spacer { flex: 1; }
.sheet-alt { margin: 16px 0 0; text-align: center; }
.sheet-alt button { border: 0; background: none; padding: 4px; font: inherit; font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sheet-alt button:hover { color: var(--ink); }
@media (max-width: 560px) {
  .sheet-wrap { place-items: end center; padding: 0; }
  .sheet { max-width: none; border-radius: 26px 26px 0 0; padding: 30px 22px calc(22px + env(safe-area-inset-bottom)); transform: translateY(28px); max-height: 92vh; }
  .sheet::before { content: ''; position: absolute; top: 9px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: var(--line-2); }
}

.finale { text-align: center; padding-top: 6px; }
.finale .ring { margin: 0 auto 18px; }
.finale .lead { margin-bottom: 0; }
.steps { display: flex; gap: 6px; margin-bottom: 24px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--sunken); transition: background 0.3s; }
.steps i.on { background: var(--ink); }
.hold { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold .fill { position: absolute; inset: 0; background: var(--ok); width: 0; transition: width 0.15s linear; }
.hold.holding .fill { width: 100%; transition: width 1.2s linear; }
.hold span { position: relative; }
.history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.history p { font-size: 13px; color: var(--ink-2); padding: 5px 0; display: flex; gap: 10px; }
.history p time { color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- reminder (in-page overlay + popup window) */
.nag-wrap {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 28px; overflow: auto;
  background: radial-gradient(90% 60% at 50% -10%, rgba(255, 106, 61, 0.28), transparent 70%), #0f0e0c;
  animation: fade 0.3s both;
}
@keyframes fade { from { opacity: 0; } }
.nag-wrap { grid-template-columns: minmax(0, 1fr); }
.nag { width: 100%; max-width: 420px; min-width: 0; justify-self: center; animation: rise 0.5s var(--ease) both; }
.nag-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 44px; }
.nag-top .logo { width: 30px; height: 30px; }
.nag-time { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nag .eyebrow { color: var(--accent); display: flex; align-items: center; gap: 8px; }
.nag .eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.7); opacity: 0.35; } }
.nag h1 { font-size: 38px; line-height: 1.14; margin-bottom: 12px; word-break: break-word; }
.nag .note { color: var(--ink-2); white-space: pre-wrap; margin-bottom: 8px; max-height: 96px; overflow: auto; }
.nag .meta { font-size: 13px; color: var(--ink-3); margin-bottom: 30px; }
.nag .stack { display: grid; gap: 8px; }
.nag .pair-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nag .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nag .btn { background: rgba(244, 241, 234, 0.08); border-color: transparent; color: var(--ink); }
.nag .btn:hover { background: rgba(244, 241, 234, 0.14); }
.nag .btn.primary { background: var(--ink); color: #0f0e0c; }
.nag .btn.primary:hover { background: var(--ink); opacity: 0.9; }
.nag .skip { margin-top: 16px; text-align: center; }
.nag .skip button { font-size: 13px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
.nag .skip button:hover { color: var(--ink-2); }

/* ---------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 80; opacity: 0;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 10px 10px 10px 16px; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); transition: opacity 0.2s, transform 0.3s var(--ease);
  /* left: 50% leaves a fixed box only half the screen to fit in, so a sentence wrapped into three lines on a phone. */
  width: max-content; max-width: calc(100vw - 32px);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
/* Sign in (cloud): one narrow column, the mark on top; the tabs stay out of sight until there is an account. */
.signed-out #nav { visibility: hidden; pointer-events: none; }
.login { max-width: 380px; margin: 0 auto; padding-top: 11vh; display: grid; gap: 14px; }
.login .logo { width: 52px; height: 52px; margin-bottom: 6px; }
.login .eyebrow { margin: 0; }
.login h1 { font-size: 34px; margin: -4px 0 0; }
.login > .muted { margin: 0 0 6px; }
.login form { display: grid; gap: 10px; }
.login .input { height: 50px; font-size: 16px; }
.login .input.code { font: 600 26px/1 var(--mono); letter-spacing: 0.4em; text-align: center; }
.login-alt { display: flex; justify-content: space-between; margin: 0; }
.login-alt button { font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.login-alt button:disabled { color: var(--ink-3); text-decoration: none; }
.login .small { margin-top: 8px; }
/* 设置 → 更新: how far the download is. */
.upbar { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.upbar i { display: block; height: 100%; border-radius: 6px; background: var(--ink); transition: width 0.4s var(--ease); }
/* The Mac cannot be reached: a quiet line at the top of every page, above the reminder, until a request gets through. */
.net-note {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 85;
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; animation: rise 0.3s var(--ease) both;
}
.night .net-note { background: #f4f1ea; color: #0f0e0c; }
.toast button { color: var(--bg); font-weight: 700; padding: 5px 11px; border-radius: 9px; background: color-mix(in srgb, var(--bg) 16%, transparent); white-space: nowrap; }
.toast span { padding-right: 6px; }
@media (min-width: 821px) { .toast { bottom: 32px; } }

@media (max-width: 560px) {
  #quick { flex-wrap: wrap; }
  #quick [name='title'] { flex-basis: 100%; }
  #quick select.input, #quick input[type='time'] { flex: 1; width: auto; }
}

/* ---------------------------------------------------------- colour: tints, glyphs, time of day */
/* Six quiet tints for kinds of things (never for urgency — that is ember's job). */
.tint-1 { --tint-bg: #e2edfa; --tint-fg: #2b5c99; }
.tint-2 { --tint-bg: #e1efe2; --tint-fg: #2f6b3f; }
.tint-3, .kind.prompt { --tint-bg: #eee5f8; --tint-fg: #6a3fa0; }
.tint-4, .kind.idea { --tint-bg: #f6ead0; --tint-fg: #8a6212; }
.tint-5 { --tint-bg: #f9e3e5; --tint-fg: #a5384a; }
.tint-6 { --tint-bg: #dbf0ee; --tint-fg: #1f6b66; }
@media (prefers-color-scheme: dark) {
  .tint-1 { --tint-bg: rgba(88, 148, 222, 0.2); --tint-fg: #9cc3f2; }
  .tint-2 { --tint-bg: rgba(98, 176, 120, 0.2); --tint-fg: #a5d8b3; }
  .tint-3, .kind.prompt { --tint-bg: rgba(160, 118, 220, 0.22); --tint-fg: #cdb3f0; }
  .tint-4, .kind.idea { --tint-bg: rgba(214, 168, 74, 0.2); --tint-fg: #e6c987; }
  .tint-5 { --tint-bg: rgba(226, 108, 128, 0.2); --tint-fg: #f0aab6; }
  .tint-6 { --tint-bg: rgba(84, 184, 176, 0.2); --tint-fg: #9bd9d3; }
}
.glyph {
  flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  background: var(--tint-bg); color: var(--tint-fg); font-size: 15px; font-weight: 700; transition: opacity var(--fast), filter var(--fast);
}
.glyph svg { width: 19px; height: 19px; }
.glyph.mono { font-family: var(--display); font-size: 17px; }
.row.done .glyph, .row.skipped .glyph { opacity: 0.5; filter: saturate(0.35); }
.list.ahead .glyph { opacity: 0.7; }
.h-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--sunken); color: var(--ink-2); margin-right: 10px; vertical-align: -8px; }
.h-icon svg { width: 16px; height: 16px; }
.kind { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; background: var(--tint-bg, var(--sunken)); color: var(--tint-fg, var(--ink-2)); vertical-align: 1px; }

/* The hero takes its light from the time of day. */
.hero .eyebrow { display: flex; align-items: center; gap: 7px; }
.hero .eyebrow svg { width: 16px; height: 16px; color: var(--gold); flex: none; }
.hero[data-part='sunrise']::before { background: radial-gradient(70% 150% at 100% 0%, rgba(255, 150, 100, 0.36), transparent 68%), radial-gradient(55% 130% at 0% 110%, rgba(255, 204, 120, 0.3), transparent 70%); }
.hero[data-part='sun']::before { background: radial-gradient(70% 150% at 100% 0%, rgba(110, 172, 240, 0.32), transparent 68%), radial-gradient(55% 130% at 0% 110%, rgba(250, 206, 104, 0.3), transparent 70%); }
.hero[data-part='sunset']::before { background: radial-gradient(70% 150% at 100% 0%, rgba(240, 104, 74, 0.34), transparent 68%), radial-gradient(55% 130% at 0% 110%, rgba(150, 110, 224, 0.26), transparent 70%); }
.hero[data-part='night']::before { background: radial-gradient(70% 150% at 100% 0%, rgba(112, 110, 228, 0.34), transparent 68%), radial-gradient(55% 130% at 0% 110%, rgba(64, 132, 196, 0.24), transparent 70%); }
.hero[data-part='night'] .eyebrow svg { color: #8f8cf0; }
.hero[data-part='sunset'] .eyebrow svg { color: var(--accent); }

/* Draw tickets look like a ticket; the orb glows when it holds draws. */
.page-head .tickets { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); text-align: left; }
.page-head .tickets::before, .page-head .tickets::after { content: ''; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--bg); }
.page-head .tickets::before { left: -6px; }
.page-head .tickets::after { right: -6px; }
.page-head .tickets br { display: none; }
.page-head .tickets .faint { color: inherit; opacity: 0.85; font-weight: 600; }
.orb { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 8px var(--accent-soft), var(--e2); color: var(--ink); }
.orb::before { border-style: dashed; border-color: var(--line-2); animation: spin 40s linear infinite; }

/* Review numbers carry their meaning in colour. */
.stats div:nth-child(1) b { color: var(--ok); }
.stats div:nth-child(3) b { color: var(--gold); }
.stats div:nth-child(4) b { color: var(--accent); }
@media (min-width: 821px) { .nav-btn.on svg { color: var(--accent); } }

/* The "done" moment. */
.burst { position: fixed; z-index: 90; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; animation: bit 1.1s var(--ease) both; }
@keyframes bit {
  from { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; }
  65% { opacity: 1; }
  to { transform: translate(var(--dx), calc(var(--dy) + 110px)) rotate(var(--rot)) scale(0.5); opacity: 0; }
}

/* ---------------------------------------------------------- phone polish */
@media (max-width: 820px) {
  /* Content scrolls under the status bar in the iPhone app; this strip keeps the clock readable. */
  .shell::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); z-index: 30; }
}
@media (max-width: 560px) {
  /* Room to read a plan: titles may take two lines instead of being cut short. */
  .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row-meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  /* The strip for what is due keeps its title whole: time and title on one line, the buttons under them. */
  .nextup { flex-wrap: wrap; gap: 12px 14px; padding: 15px 16px; }
  .nextup .what { flex: 1 1 calc(100% - 110px); }
  .nextup .what b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .nextup.hush .what b { display: block; } /* a sentence, not a title: never cut short */
  .nextup .btn, .nextup.hush .btn { flex: 1; height: 38px; }
  .row { gap: 11px; padding: 13px 14px; }
  .row-side { flex-direction: column; align-items: flex-end; gap: 1px; }
  .row-actions .btn.sm { padding: 0 6px; margin-right: -6px; }
  /* The 3D room takes touches for itself, so leave space around it to scroll the page. */
  .stage { height: 46vh; min-height: 280px; }
}
/* iOS shows an empty time field as a blank box: a label sits over it until a time is picked.
   (A ::before inside the input itself makes iOS draw the field far too tall.) */
.time-wrap { position: relative; flex: none; display: flex; }
.time-wrap i { display: none; position: absolute; left: 13px; top: 0; line-height: 40px; font-style: normal; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
@media (max-width: 560px) {
  #quick .time-wrap { flex: 1; min-width: 0; }
  #quick .time-wrap input[type='time'] { width: 100%; }
}
@supports (-webkit-touch-callout: none) {
  .time-wrap.no-time i { display: block; }
}

/* 3D that is still loading, or could not be drawn, says so instead of staying blank. */
.stage-note { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 0 28px; text-align: center; color: var(--ink-3); font-size: 13px; }
.stage-note b { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.stage-note .btn { margin-top: 8px; }
.draw .preview .stage-note { position: absolute; }
img[data-thumb]:not([src]) { background: var(--sunken); border-radius: 11px; }
