/* ============================================================
   Lumen — soft-light styling
   The page "mood" follows the time of day: dawn → day → dusk → night.
   ============================================================ */

:root {
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-display: "Sitka Display", "Sitka Banner", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
}

body[data-mood="dawn"] {
  --bg: #f6eee9; --ink: #3a312d; --ink-2: #7a6c66; --ink-3: #ab9d96;
  --card: rgba(255, 250, 247, .55); --card-inner: rgba(255, 255, 255, .55); --card-strong: rgba(255, 252, 250, .8);
  --card-border: rgba(255, 255, 255, .75); --line: rgba(90, 60, 50, .08); --line-strong: rgba(90, 60, 50, .15);
  --well: rgba(90, 60, 50, .06); --hover: rgba(255, 255, 255, .5); --chip: rgba(255, 255, 255, .65);
  --accent: #dc8c70; --accent-ink: #fff; --accent-soft: rgba(220, 140, 112, .18);
  --orb1: rgba(255, 184, 150, .75); --orb2: rgba(247, 196, 222, .6); --orb3: rgba(255, 224, 170, .7);
  --shadow: 0 1px 1px rgba(80, 50, 40, .03), 0 14px 44px -18px rgba(120, 70, 50, .25);
  --drawer: rgba(253, 248, 245, .9); --scrim: rgba(60, 35, 25, .10);
  --good: #6f9f84; --warn: #c98a4b;
  --h-sage: #7fae97; --h-peach: #e59a7e; --h-sky: #7ea8d4; --h-lilac: #a993d6; --h-rose: #dc8fa6; --h-sand: #cfa96a;
}

body[data-mood="day"] {
  --bg: #eef0ed; --ink: #2e3433; --ink-2: #69716f; --ink-3: #9aa29f;
  --card: rgba(255, 255, 255, .5); --card-inner: rgba(255, 255, 255, .6); --card-strong: rgba(255, 255, 255, .82);
  --card-border: rgba(255, 255, 255, .8); --line: rgba(40, 60, 60, .08); --line-strong: rgba(40, 60, 60, .14);
  --well: rgba(40, 60, 60, .055); --hover: rgba(255, 255, 255, .55); --chip: rgba(255, 255, 255, .7);
  --accent: #6b9c89; --accent-ink: #fff; --accent-soft: rgba(107, 156, 137, .18);
  --orb1: rgba(186, 216, 234, .85); --orb2: rgba(212, 232, 198, .75); --orb3: rgba(255, 232, 196, .8);
  --shadow: 0 1px 1px rgba(40, 60, 60, .03), 0 14px 44px -18px rgba(50, 80, 80, .22);
  --drawer: rgba(250, 251, 250, .9); --scrim: rgba(30, 45, 45, .10);
  --good: #5f9a80; --warn: #c48a48;
  --h-sage: #79a993; --h-peach: #e39a7f; --h-sky: #79a3d0; --h-lilac: #a490d3; --h-rose: #d88ca3; --h-sand: #c9a465;
}

body[data-mood="dusk"] {
  --bg: #f2eae6; --ink: #37302f; --ink-2: #786b69; --ink-3: #a89b98;
  --card: rgba(255, 249, 246, .52); --card-inner: rgba(255, 255, 255, .55); --card-strong: rgba(255, 250, 248, .8);
  --card-border: rgba(255, 255, 255, .72); --line: rgba(80, 50, 50, .08); --line-strong: rgba(80, 50, 50, .15);
  --well: rgba(80, 50, 50, .06); --hover: rgba(255, 255, 255, .5); --chip: rgba(255, 255, 255, .62);
  --accent: #cc8760; --accent-ink: #fff; --accent-soft: rgba(204, 135, 96, .18);
  --orb1: rgba(250, 188, 148, .78); --orb2: rgba(214, 196, 240, .72); --orb3: rgba(246, 176, 188, .6);
  --shadow: 0 1px 1px rgba(80, 50, 50, .03), 0 14px 44px -18px rgba(110, 60, 60, .25);
  --drawer: rgba(252, 247, 245, .9); --scrim: rgba(55, 30, 30, .10);
  --good: #6c9c83; --warn: #c7843f;
  --h-sage: #7cab95; --h-peach: #e3967a; --h-sky: #7ea5d2; --h-lilac: #a690d6; --h-rose: #d98aa2; --h-sand: #cca566;
}

body[data-mood="night"] {
  --bg: #121320; --ink: #e9e6f2; --ink-2: #a29eb6; --ink-3: #6e6b84;
  --card: rgba(30, 31, 50, .5); --card-inner: rgba(255, 255, 255, .035); --card-strong: rgba(38, 39, 60, .78);
  --card-border: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .13);
  --well: rgba(255, 255, 255, .06); --hover: rgba(255, 255, 255, .04); --chip: rgba(255, 255, 255, .07);
  --accent: #a89ff0; --accent-ink: #16152a; --accent-soft: rgba(168, 159, 240, .18);
  --orb1: rgba(76, 68, 170, .55); --orb2: rgba(30, 96, 108, .45); --orb3: rgba(120, 62, 128, .38);
  --shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 18px 50px -22px rgba(0, 0, 0, .7);
  --drawer: rgba(24, 25, 42, .93); --scrim: rgba(4, 4, 14, .4);
  --good: #8cc7a8; --warn: #e2b071;
  --h-sage: #8cc6aa; --h-peach: #f0ac91; --h-sky: #93bae6; --h-lilac: #bba7f0; --h-rose: #eba2b8; --h-sand: #e2bf80;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background-color 2.5s ease, color 1s ease;
  overflow: hidden;
}
body.booting *, body.booting *::before, body.booting *::after { transition: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- ambient light ----------
   Three soft glows painted on a tiny canvas (see Ambient in app.js) and stretched
   to fill the window: it looks the same as big blurred layers at a fraction of the cost. */
.ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; display: block; }
:root {
  --grain-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.04'/></svg>");
  --grain-dark: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.025'/></svg>");
}

/* ---------- title bar ---------- */
.titlebar {
  position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 0 22px; -webkit-app-region: drag; user-select: none;
}
body.desktop .titlebar { padding-right: 8px; }
.titlebar button, .titlebar .clock { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: .14em; color: var(--ink-3); font-weight: 500; }
.brand-glow { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 3px var(--accent-soft), 0 0 2px var(--accent); }
.titlebar-tools { display: flex; align-items: center; gap: 10px; }
.clock { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.icon-btn { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s; font-size: 17px; }
.icon-btn:hover { background: var(--well); color: var(--ink); }
.win-controls { display: flex; gap: 2px; margin-left: 6px; -webkit-app-region: no-drag; }
.win-controls button {
  width: 34px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  color: var(--ink-3); font-size: 15px; transition: background .2s, color .2s;
}
.win-controls button:hover { background: var(--well); color: var(--ink); }
.win-controls button.close:hover { background: rgba(220, 110, 110, .16); color: #c45d5d; }

/* ---------- layout ---------- */
.scroller {
  position: fixed; top: 40px; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 30px 40px 56px; }
body.idle .tl-now, body.idle .empty .glow { animation-play-state: paused; }
.scroller { background-image: var(--grain-light); }
body[data-mood="night"] .scroller { background-image: var(--grain-dark); }
.hero { padding: 0 6px; animation: rise .8s var(--ease) both; }
.hero h1 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 3.6vw, 46px);
  line-height: 1.1; letter-spacing: -.01em; margin: 0 0 8px;
}
.summary { margin: 0; color: var(--ink-2); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 0; }
.summary .sep { margin: 0 10px; color: var(--ink-3); }
.summary { cursor: pointer; width: fit-content; border-radius: 8px; transition: color .2s; }
.summary:hover { color: var(--ink); }
.summary .next { color: var(--ink); }
.summary .next.soon { color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- capture ---------- */
.capture { margin-top: 26px; animation: rise .8s .08s var(--ease) both; }
.capture-bar {
  display: flex; align-items: center; gap: 6px; height: 58px; padding: 6px;
  background: var(--card-strong); border: 1px solid var(--card-border); border-radius: 999px;
  box-shadow: var(--shadow);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.capture-bar:focus-within { box-shadow: var(--shadow), 0 0 0 6px var(--accent-soft); }
.capture-bar.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.mode-toggle { position: relative; display: flex; background: var(--well); border-radius: 999px; padding: 3px; flex: none; }
.mode-toggle button { position: relative; z-index: 1; padding: 0 15px; height: 38px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); transition: color .25s; }
.mode-toggle button.active { color: var(--ink); }
.mode-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 999px;
  background: var(--card-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  transition: transform .35s var(--ease), width .35s var(--ease);
}
body[data-mood="night"] .mode-pill { background: rgba(255, 255, 255, .1); }
#captureInput { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; padding: 0 12px; }
#captureInput::placeholder { color: var(--ink-3); transition: opacity .3s; }
#captureInput.fading::placeholder { opacity: 0; }
.capture-kbd {
  font: 500 11.5px var(--font-ui); color: var(--ink-3); border: 1px solid var(--line-strong);
  border-radius: 7px; padding: 2px 7px; margin-right: 4px; transition: opacity .2s;
}
.capture-bar:focus-within .capture-kbd { opacity: 0; }
.capture-go {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--well); color: var(--ink-3); font-size: 19px; transition: background .3s, color .3s, transform .2s;
}
.capture-go.ready { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -6px var(--accent); }
.capture-go:active { transform: scale(.94); }
.capture-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; padding: 8px 18px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2);
  background: var(--chip); border: 1px solid var(--card-border); border-radius: 999px; padding: 3px 10px 3px 8px;
  animation: chipIn .3s var(--ease) both;
}
.chip svg { font-size: 13px; color: var(--ink-3); }
.chip.accent { color: var(--ink); }
.chip.accent svg { color: var(--accent); }
.chip.muted { opacity: .65; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hue, var(--accent)); }
.hint { font-size: 12.5px; color: var(--ink-3); padding: 3px 2px; }
.hint b { font-weight: 500; color: var(--ink-2); }
@keyframes chipIn { from { opacity: 0; transform: translateY(-4px) scale(.96); } }

.goal-form {
  margin-top: 6px; padding: 14px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow);
  animation: rise .4s var(--ease) both;
}
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  text-align: left; padding: 11px 14px; border-radius: 14px; border: 1px solid transparent;
  background: var(--well); transition: background .2s, border-color .2s;
}
.seg button strong { display: block; font-weight: 500; font-size: 14px; }
.seg button span { font-size: 12px; color: var(--ink-3); }
.seg button.active { background: var(--card-strong); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.goal-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 14px; }
.goal-fields .grow { flex: 1; }

/* ---------- form bits ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.input, .select {
  height: 38px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--well);
  padding: 0 12px; outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { width: 90px; }
.input.xs { width: 64px; }
input[type="date"].input, input[type="time"].input, .select { color-scheme: light; }
.select option { background-color: #fbfaf8; color: #2e3433; }
body[data-mood="night"] .select { color-scheme: dark; }
body[data-mood="night"] .select option { background-color: #232438; color: #e9e6f2; }
body[data-mood="night"] input[type="date"].input, body[data-mood="night"] input[type="time"].input { color-scheme: dark; }
.btn {
  height: 38px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-weight: 500; font-size: 13.5px; transition: transform .15s, box-shadow .2s, opacity .2s; white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px -8px var(--accent); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--well); color: var(--ink-2); }
.btn.ghost:hover { box-shadow: none; color: var(--ink); }
.btn.danger { background: transparent; color: #c46a6a; padding: 0 6px; }
.link { color: var(--ink-3); font-size: 13px; transition: color .2s; }
.link:hover { color: var(--ink); }

/* ---------- panels ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 6px; align-items: stretch; }
/* Today runs across the top; Goals and School sit side by side below it. */
.today-panel { grid-column: 1 / -1; }
.today-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
.today-col > .section-label:first-child { margin-top: 8px; }
@media (min-width: 900px) {
  .today-panel > .task-list.split { columns: 2; column-gap: 28px; }
  .task-list.split .task { break-inside: avoid; }
}
.goals-panel { display: flex; flex-direction: column; }
.goals-panel .goal-grid { flex: 1; align-content: start; }
.goals-panel .goal-grid:has(.goal-empty) { align-content: center; }
.panel {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  padding: 22px 22px 18px; box-shadow: var(--shadow);
  animation: rise .8s var(--ease) both;
}
.goals-panel { animation-delay: .16s; }
.today-panel { animation-delay: .12s; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.panel-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 23px; margin: 0; letter-spacing: -.005em; }
.panel-head h2 small { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin-left: 8px; letter-spacing: 0; }

/* week strip */
.week { display: flex; gap: 2px; }
.week button {
  width: 38px; padding: 5px 0 6px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: background .2s;
}
.week button:hover { background: var(--well); }
.week .wd { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.week .dn { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.week .dots { height: 5px; display: flex; gap: 2px; }
.week .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); opacity: .55; }
.week button.is-today .dn { color: var(--accent); font-weight: 600; }
.week button.sel { background: var(--card-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
body[data-mood="night"] .week button.sel { background: rgba(255, 255, 255, .08); }
.week button.sel .dn { color: var(--ink); }

/* timeline */
.timeline { position: relative; height: 40px; margin: 14px 6px 2px; }
.tl-line { position: absolute; left: 0; right: 0; top: 13px; height: 2px; border-radius: 2px; background: var(--line-strong); }
.tl-past { position: absolute; left: 0; top: 13px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent)); opacity: .7; }
.tl-now {
  position: absolute; top: 8px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 18px 4px var(--accent-soft);
  animation: breathe 3.6s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 0 7px var(--accent-soft), 0 0 26px 8px var(--accent-soft); } }
.tl-mark {
  position: absolute; top: 9px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--hue, var(--ink-3)); cursor: pointer; transition: transform .2s;
}
.tl-mark.done { background: var(--hue, var(--ink-3)); opacity: .45; }
.tl-mark:hover { transform: scale(1.3); }
.tl-mark::after {
  content: attr(data-label); position: absolute; bottom: 17px; left: 50%; transform: translate(-50%, 4px);
  white-space: nowrap; font-size: 12px; color: var(--ink); background: var(--card-strong); border: 1px solid var(--card-border);
  padding: 4px 9px; border-radius: 9px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.tl-mark:hover::after { opacity: 1; transform: translate(-50%, 0); }
.tl-label { position: absolute; top: 24px; font-size: 10.5px; color: var(--ink-3); transform: translateX(-50%); font-variant-numeric: tabular-nums; }

/* tasks */
.task-list { list-style: none; margin: 4px 0 0; padding: 0; }
.task {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 14px; min-height: 46px; transition: background .2s, opacity .3s, transform .35s var(--ease);
  animation: rise .45s var(--ease) both;
}
.task.leaving { opacity: 0; transform: translateX(14px); }
body.settled .task:not(.fresh), body.settled .goal-card:not(.fresh) { animation: none; }
.task-end { display: flex; align-items: center; justify-content: flex-end; min-height: 26px; }
.task:hover { background: var(--hover); }
.check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid var(--ink-3); position: relative;
  display: grid; place-items: center; color: var(--accent-ink); transition: background .25s, border-color .25s;
}
.check:hover { border-color: var(--accent); background: var(--accent-soft); }
.check svg { font-size: 13px; stroke-width: 2.6; stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .35s .05s var(--ease); }
.task.done .check, .task.completing .check { background: var(--accent); border-color: var(--accent); }
.task.done .check svg, .task.completing .check svg { stroke-dashoffset: 0; }
.task.completing .check { animation: pop .45s var(--ease); }
.task.completing .check::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--accent);
  animation: ring .6s var(--ease) forwards;
}
@keyframes pop { 40% { transform: scale(1.2); } }
@keyframes ring { to { transform: scale(2.2); opacity: 0; } }
.task-body { min-width: 0; cursor: pointer; }
.task-title { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s; }
.task.done .task-title, .task.completing .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); text-decoration-thickness: 1px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.task-meta:empty { display: none; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .gdot { width: 7px; height: 7px; border-radius: 50%; background: var(--hue); }
.task-meta .carried { color: var(--warn); }
.task-time { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.task.soon .task-time { color: var(--accent); font-weight: 500; }
.task.soon .task-time::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; box-shadow: 0 0 8px 2px var(--accent-soft); }
.task.done .task-time { color: var(--ink-3); }
.task-actions { display: none; gap: 2px; animation: fadeIn .2s ease both; }
.task:hover .task-actions { display: flex; }
.task:hover .task-time { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.mini {
  height: 26px; padding: 0 8px; border-radius: 8px; font-size: 12px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 4px; transition: background .2s, color .2s;
}
.mini:hover { background: var(--well); color: var(--ink); }
.mini svg { font-size: 14px; }

.section-label {
  display: flex; align-items: center; justify-content: space-between; margin: 16px 10px 2px;
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3);
}
.section-label button { letter-spacing: .04em; text-transform: none; font-size: 12px; color: var(--ink-3); }
.section-label button:hover { color: var(--ink); }
.done-toggle { margin: 6px 10px 0; font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.done-toggle:hover { color: var(--ink-2); }
.done-toggle svg { transition: transform .25s; }
.done-toggle.open svg { transform: rotate(90deg); }

.empty { text-align: center; padding: 26px 10px 18px; color: var(--ink-2); }
.empty .glow {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, var(--accent-soft) 45%, transparent 70%);
  animation: breathe2 4s ease-in-out infinite;
}
@keyframes breathe2 { 50% { transform: scale(1.15); opacity: .8; } }
.empty p { margin: 0; font-family: var(--font-display); font-size: 18px; }
.empty small { color: var(--ink-3); font-size: 13px; }

/* ---------- goals ---------- */
.goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.goal-card {
  position: relative; overflow: hidden; cursor: pointer; padding: 15px 16px 14px; border-radius: 20px;
  background: var(--card-inner); border: 1px solid var(--line); min-height: 172px;
  display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  animation: rise .6s var(--ease) both;
}
.goal-card::before {
  content: ""; position: absolute; width: 180px; height: 180px; top: -90px; right: -70px; border-radius: 50%;
  background: radial-gradient(circle, var(--hue), transparent 65%); opacity: .28; pointer-events: none; transition: opacity .4s;
}
.goal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--card-border); }
.goal-card.pulse { animation: glowPulse 1.6s var(--ease); }
@keyframes glowPulse {
  25% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hue) 40%, transparent), 0 0 40px -6px var(--hue); }
}
.goal-card:hover::before { opacity: .42; }
.goal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; }
.goal-name { font-size: 13px; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-log {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--well); color: var(--ink-2); font-size: 15px; transition: background .2s, color .2s, transform .2s;
}
.goal-log:hover { background: var(--hue); color: #fff; transform: scale(1.06); }
.goal-log.logged { background: var(--hue); color: #fff; }
.goal-value { font-family: var(--font-display); font-size: 31px; line-height: 1.15; margin-top: 6px; letter-spacing: -.01em; position: relative; }
.goal-value small { font-family: var(--font-ui); font-size: 13px; color: var(--ink-3); margin-left: 5px; letter-spacing: 0; }
.goal-value .of { font-size: 20px; color: var(--ink-3); }
.goal-viz { height: 38px; margin: 6px 0 8px; position: relative; }
.goal-viz svg.spark { width: 100%; height: 38px; overflow: visible; }
.goal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: auto; }
.goal-foot .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pace { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.pace::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pace.ahead, .pace.done { color: var(--good); }
.pace.on { color: var(--ink-2); }
.pace.behind { color: var(--warn); }
.goal-bar { height: 4px; border-radius: 4px; background: var(--well); margin-top: 9px; overflow: hidden; }
.goal-bar span { display: block; height: 100%; border-radius: 4px; background: var(--hue); transition: width .8s var(--ease); }
.weekdots { display: flex; justify-content: space-between; align-items: flex-end; height: 38px; padding: 0 2px; }
.weekdots div { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 9.5px; color: var(--ink-3); }
.weekdots i { width: 13px; height: 13px; border-radius: 50%; background: var(--well); transition: background .3s, transform .3s; }
.weekdots i.on { background: var(--hue); box-shadow: 0 0 10px -1px var(--hue); }
.weekdots i.today { outline: 1.5px solid var(--hue); outline-offset: 2px; }
.weekdots i.future { opacity: .5; }
.quicklog { display: flex; align-items: center; gap: 6px; margin-top: auto; position: relative; }
.quicklog .input { height: 34px; flex: 1; width: 0; }
.quicklog .btn { height: 34px; padding: 0 12px; background: var(--hue); }
.quicklog span { font-size: 12px; color: var(--ink-3); }
.goal-empty { grid-column: 1 / -1; text-align: center; padding: 30px 10px; color: var(--ink-3); }

/* ---------- folds (Subscriptions, Wishlist) ---------- */
.fold { border-top: 1px solid var(--line); margin-top: 6px; }
.fold-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 6px; text-align: left;
  border-radius: 14px; transition: background .2s;
}
.fold-head:hover { background: var(--hover); }
.fold-chev {
  width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--well); color: var(--ink-3); font-size: 14px; transition: transform .4s var(--ease), color .2s;
}
.fold-head:hover .fold-chev { color: var(--ink); }
.fold.open .fold-chev { transform: rotate(90deg); }
.fold-title { font-family: var(--font-display); font-weight: 400; font-size: 18px; margin: 0; }
.fold-sum { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fold-meter { margin-left: auto; width: 140px; height: 4px; border-radius: 4px; background: var(--well); overflow: hidden; flex: none; }
.fold-meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .8s var(--ease); }
.fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.fold.open .fold-body { grid-template-rows: 1fr; }
.fold-inner { overflow: hidden; min-height: 0; }
.fold-pad { padding: 0 6px 14px; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .4s var(--ease); }
.fold.open .fold-pad { opacity: 1; transform: none; transition-delay: .08s; }

/* ---------- wishlist ---------- */

.wish-add {
  display: grid; grid-template-columns: minmax(0, 1.5fr) 118px minmax(0, 1.2fr) auto; gap: 8px;
  padding: 2px 0 14px; border-bottom: 1px solid var(--line);
}
.wish-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wish {
  position: relative; display: grid; align-items: center; gap: 12px;
  grid-template-columns: 18px 30px minmax(0, 1fr) minmax(140px, 210px) 128px;
  padding: 10px 10px 10px 6px; border-radius: 16px; transition: background .2s;
  animation: rise .45s var(--ease) both;
}
.wish:hover { background: var(--hover); }
body.settled .wish:not(.fresh) { animation: none; }
.wish-grip {
  width: 18px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 16px;
  color: var(--ink-3); opacity: .3; cursor: grab; touch-action: none; transition: opacity .2s;
}
.wish:hover .wish-grip, .wish-grip:focus-visible { opacity: 1; }
.wish-link {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; text-decoration: none;
  color: var(--hue); background: color-mix(in srgb, var(--hue) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 32%, transparent); transition: transform .2s var(--ease), background .2s;
}
.wish-link:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--hue) 26%, transparent); }
.wish-link.empty { background: transparent; border: 1.5px dashed var(--line-strong); color: transparent; }
.wish-link.empty:hover { color: var(--ink-3); border-color: var(--ink-3); transform: none; }
.wish-main { min-width: 0; cursor: pointer; }
.wish-name { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wish-meta { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.wish-meta:empty { display: none; }
.wish-money { min-width: 0; }
.wish-amt { font-size: 13px; color: var(--ink-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wish-amt b { font-weight: 600; color: var(--ink); }
.wish.funded .wish-amt { color: var(--good); }
.wish-bar { height: 5px; border-radius: 5px; background: var(--well); margin-top: 7px; overflow: hidden; }
.wish-bar i { display: block; height: 100%; border-radius: 5px; background: var(--hue); transition: width .8s var(--ease); }
.wish.funded .wish-bar i { box-shadow: 0 0 10px var(--hue); }
.wish-acts { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.mini.strong { background: var(--well); color: var(--ink-2); padding: 0 10px; }
.mini.strong:hover, .mini.strong.on { background: var(--hue); color: #fff; }
.wish-acts .del { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.wish:hover .wish-acts .del, .wish-acts .del:focus-visible { opacity: 1; }

.wish.dragging { z-index: 3; background: var(--card-strong); box-shadow: var(--shadow); }
body[data-mood="night"] .wish.dragging { background: rgba(48, 49, 72, .95); }
.wish.dragging .wish-grip { cursor: grabbing; opacity: 1; }
.wish-list.sorting { user-select: none; }
.wish-list.sorting .wish:not(.dragging) { transition: transform .22s var(--ease); }
.wish.settling { transition: transform .19s var(--ease); }

.wish-alloc {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 0 2px 60px; animation: rise .3s var(--ease) both;
}
.wish-alloc .input { width: 118px; height: 34px; }
.wa-label { font-size: 12.5px; color: var(--ink-3); }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-chips button { font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--well); color: var(--ink-2); transition: background .2s, color .2s; }
.wa-chips button:hover { background: var(--hue); color: #fff; }
.wish-alloc .btn { height: 34px; padding: 0 14px; background: var(--hue); }
.wa-hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }
.wish-empty { padding: 22px 10px 8px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.shake { animation: shake .4s; }

@media (max-width: 720px) {
  .fold-meter { display: none; }
  .wish-add { grid-template-columns: 1fr 1fr; }
  .wish-add > :first-child { grid-column: 1 / -1; }
  .wish { grid-template-columns: 18px 30px minmax(0, 1fr) auto; }
  .wish-money { grid-column: 3 / -1; grid-row: 2; }
  .wish-alloc { padding-left: 0; }
  .wa-hint { display: none; }
}

/* ---------- layout: Today on the left, Goals + School on the right ---------- */

/* ---------- morning briefing ---------- */
.briefing {
  margin-top: 22px; border-radius: 22px; overflow: hidden;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow);
  animation: rise .8s .05s var(--ease) both;
}
.brief-line { display: flex; align-items: center; gap: 14px; padding: 14px 12px 14px 18px; cursor: pointer; border-radius: 22px; transition: background .2s; }
.brief-line:hover { background: var(--hover); }
.brief-line:focus-visible { outline-offset: -3px; }
.brief-sun {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 42% 40%, #fff7e6 0%, var(--accent) 48%, transparent 72%);
  box-shadow: 0 0 22px 6px var(--accent-soft); animation: breathe2 5s ease-in-out infinite;
}
.brief-text { flex: 1; min-width: 0; }
.brief-kicker { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.brief-text p { margin: 0; font-size: 15.5px; line-height: 1.45; color: var(--ink); }
.brief-more { color: var(--ink-3); font-size: 16px; display: grid; place-items: center; transition: transform .4s var(--ease); }
.briefing.open .brief-more { transform: rotate(90deg); }
.brief-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.briefing.open .brief-body { grid-template-rows: 1fr; }
.brief-inner { overflow: hidden; min-height: 0; }
.brief-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 2px 14px 14px; }
.brief-block { background: var(--card-inner); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.brief-block h4 { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.brief-block p { margin: 0 0 4px; }
.brief-block b { color: var(--ink); font-weight: 600; }
.brief-block .soft { color: var(--ink-3); }
.brief-dot { display: inline-block; width: 7px; height: 7px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.brief-block .big { font-family: var(--font-display); font-size: 24px; color: var(--ink); margin-right: 4px; }
body.idle .brief-sun { animation-play-state: paused; }

/* ---------- school ---------- */
.school-panel { display: flex; flex-direction: column; animation-delay: .18s; }
.due-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.due-add .full { grid-column: 1 / -1; }
.due-list { list-style: none; margin: 10px 0 0; padding: 0; }
.due { display: grid; grid-template-columns: 26px minmax(0, 1fr) 28px auto 28px; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 14px; transition: background .2s, opacity .3s; }
.due:hover { background: var(--hover); }
.due.completing { opacity: .4; }
.due.completing .check { background: var(--accent); border-color: var(--accent); }
.due.completing .check svg { stroke-dashoffset: 0; }
.due-main { min-width: 0; cursor: pointer; }
.due-link {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 14px; text-decoration: none;
  color: var(--hue); background: color-mix(in srgb, var(--hue) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 30%, transparent); transition: transform .2s var(--ease), background .2s;
}
.due-link:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--hue) 24%, transparent); }
.due-title { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.due-meta i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.due-count { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--well); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.soon .due-count { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.due.urgent .due-count { background: var(--accent); color: var(--accent-ink); }
.due.late .due-count { background: rgba(214, 110, 110, .16); color: #cf6b6b; }
.due .del, .spend .del, .sub .del { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.due:hover .del, .spend:hover .del, .sub:hover .del, .due .del:focus-visible, .spend .del:focus-visible, .sub .del:focus-visible { opacity: 1; }
.due-more, .spend-more { margin: 6px 8px 0; }
.school-empty { margin: auto 0; padding: 18px 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.school-empty b { color: var(--ink-2); font-weight: 500; }

/* ---------- calendar ---------- */
.cal-panel { display: flex; flex-direction: column; animation-delay: .18s; }
.cal-head { flex-wrap: wrap; row-gap: 6px; }
.cal-tools { display: flex; align-items: center; gap: 2px; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 14px; }
.cal-tools .icon-btn:first-child svg { transform: rotate(180deg); }
.cal-month { min-width: 118px; padding: 4px 8px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); text-align: center; font-variant-numeric: tabular-nums; transition: background .2s, color .2s; cursor: default; }
.cal-month.away { cursor: pointer; color: var(--accent); }
.cal-month.away:hover { background: var(--well); }
.cal-tools .link { margin-left: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 14px; }
.cal-wd { text-align: center; font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); padding-bottom: 4px; }
.cal-day {
  position: relative; min-height: 50px; padding: 5px 6px 6px; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px; transition: background .2s;
}
.cal-day:hover { background: var(--hover); }
.cal-day.out { opacity: .38; }
.cal-day.past:not(.today) .cal-dn { color: var(--ink-3); }
.cal-dn { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; margin: -2px 0 0 -3px; }
.cal-day.today .cal-dn { background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-dots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 10px; }
.cal-ev {
  width: 10px; height: 10px; border-radius: 4px; background: var(--c); flex: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 18%, transparent);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.cal-ev:hover, .cal-ev:focus-visible { transform: scale(1.45); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent), 0 0 12px color-mix(in srgb, var(--c) 60%, transparent); outline: none; }
.cal-ev.done { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); opacity: .6; }
.cal-more { font-size: 10.5px; line-height: 1; color: var(--ink-3); padding: 1px 3px; border-radius: 5px; }
.cal-more:hover { background: var(--well); color: var(--ink); }

.cal-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 0 2px; }
.cal-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--well); color: var(--ink-2); transition: color .2s, background .2s; }
.cal-cat i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.cal-cat:hover { color: var(--ink); background: color-mix(in srgb, var(--c, var(--ink-3)) 16%, transparent); }
.cal-cat.add { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-3); padding: 3px 10px 3px 7px; }
.cal-cat.add svg { font-size: 12px; }
.cal-soon-head { margin: 16px 8px 2px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.cal-panel .due-list { margin-top: 2px; }
.cal-panel .due { grid-template-columns: 26px minmax(0, 1fr) 28px auto 0; }
.cal-panel .due.completing .check { background: var(--hue); border-color: var(--hue); }
.cal-panel .due-link { --hue: inherit; }
.cal-empty { margin: 16px 0 4px; padding: 14px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.cal-empty b { color: var(--ink-2); font-weight: 500; }

/* hover card */
.cal-tip {
  position: fixed; z-index: 70; min-width: 200px; max-width: 280px; padding: 6px; border-radius: 16px;
  background: var(--drawer); border: 1px solid var(--card-border); backdrop-filter: blur(24px);
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(4px) scale(.97); pointer-events: none;
  transition: opacity .18s, transform .22s var(--ease);
}
.cal-tip.below { transform: translateY(-4px) scale(.97); }
.cal-tip.show { opacity: 1; transform: none; pointer-events: auto; }
.tip-ev { display: flex; gap: 10px; width: 100%; padding: 8px 10px 8px 8px; border-radius: 11px; text-align: left; transition: background .2s; }
.tip-ev:hover { background: var(--hover); }
.tip-bar { width: 4px; border-radius: 4px; background: var(--c); flex: none; }
.tip-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tip-body b { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.tip-body span { font-size: 12px; color: var(--ink-2); }
.tip-body .tip-meta { color: var(--ink-3); }
.tip-ev.done b { text-decoration: line-through; color: var(--ink-3); }
.tip-hint { display: block; padding: 2px 10px 4px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }

/* editors */
.cat-pick, .remind-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick button, .remind-chips button {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  background: var(--well); color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s;
}
.cat-pick button i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.cat-pick button:hover, .remind-chips button:hover { color: var(--ink); }
.cat-pick button.on { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); }
.cat-pick button.add { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-3); padding: 5px 12px 5px 9px; }
.cat-pick button.add svg { font-size: 12px; }
.remind-chips button.on { background: var(--accent); color: var(--accent-ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 10px; background: var(--c); transition: transform .2s var(--ease), box-shadow .2s; }
.swatches button:hover { transform: scale(1.08); }
.swatches button.on { box-shadow: 0 0 0 2px var(--drawer), 0 0 0 4px var(--c); }
.field-note { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- money ---------- */
.money-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.money-net { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: default; }
.money-net.up { color: var(--good); }
.money-net.down { color: var(--warn); }
.money-net small { font-size: 11.5px; color: var(--ink-3); margin-left: 6px; }
.money-panel { margin-top: 22px; animation-delay: .2s; padding-bottom: 8px; }
.budget { padding: 14px 4px 4px; }
.budget-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.budget-big .big { font-family: var(--font-display); font-size: 40px; line-height: 1; letter-spacing: -.01em; }
.budget-big .unit { color: var(--ink-3); font-size: 14px; margin-left: 8px; }
.budget-big.over .big { color: var(--warn); }
.budget-side { font-size: 12.5px; color: var(--ink-3); text-align: right; line-height: 1.55; }
.budget-bar { position: relative; height: 10px; margin-top: 14px; }
.budget-bar .segs { display: flex; height: 100%; border-radius: 10px; overflow: hidden; background: var(--well); }
.budget-bar .seg { height: 100%; transition: width .8s var(--ease); }
.budget-bar .seg + .seg { box-shadow: -1.5px 0 0 var(--bg); }
.budget-pace { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink-3); opacity: .55; }
.budget-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.budget-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.budget-setup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.budget-setup .input { width: 140px; }
.spend-add { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 8px; margin-top: 18px; }
.cat-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chips button {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px 5px 9px;
  border-radius: 999px; background: var(--well); color: var(--ink-2); transition: background .2s, color .2s, box-shadow .2s;
}
.cat-chips button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cat-chips button:hover { color: var(--ink); }
.cat-chips button.on { background: var(--card-strong); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); }
body[data-mood="night"] .cat-chips button.on { background: rgba(255, 255, 255, .08); }
.spend-group { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); margin: 16px 8px 2px; }
.spend-list { list-style: none; margin: 0; padding: 0; }
.spend { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 28px; gap: 12px; align-items: center; padding: 8px 8px; border-radius: 12px; transition: background .2s; }
.spend:hover { background: var(--hover); }
.spend.upcoming { opacity: .72; }
.spend .cdot { width: 8px; height: 8px; border-radius: 50%; }
.sp-main { min-width: 0; }
.sp-title { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-meta { display: block; font-size: 12px; color: var(--ink-3); }
.sp-amt { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-amt.refund { color: var(--good); }
.money-note { font-size: 12.5px; color: var(--ink-3); margin: 8px 6px 0; }
.spend-empty { margin: 16px 8px 6px; }
.sub-list { list-style: none; margin: 0 0 6px; padding: 0; }
.sub { display: grid; grid-template-columns: minmax(0, 1fr) auto 120px 28px; gap: 14px; align-items: center; padding: 8px 8px; border-radius: 12px; transition: background .2s; }
.sub:hover { background: var(--hover); }
.sub-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-amt { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-next { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.sub-add { display: grid; grid-template-columns: minmax(0, 1.4fr) 110px 120px 150px auto; gap: 8px; margin-top: 6px; }
.wish-panel .wish-add { margin-top: 2px; }

/* ---------- settings: weather ---------- */
.city-row { display: flex; gap: 6px; }
.city-row .input { flex: 1; }
.city-row .btn { height: 38px; padding: 0 14px; }
.unit-seg { margin-top: 8px; }

@media (max-width: 1020px) {
  .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .brief-grid { grid-template-columns: 1fr; }
  .spend-add { grid-template-columns: 1fr auto; }
  .spend-add > [name="note"] { grid-column: 1 / -1; grid-row: 2; }
  .sub-add { grid-template-columns: 1fr 1fr; }
  .sub-add > :first-child { grid-column: 1 / -1; }
  .sub { grid-template-columns: minmax(0, 1fr) auto 28px; }
  .sub-next { display: none; }
  .budget-side { text-align: left; }
}

/* ---------- To buy + Recipes (side by side under Money) ---------- */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; align-items: start; }

.buy-panel.fold { border-top: 1px solid var(--card-border); margin-top: 0; padding: 14px 16px; animation-delay: .22s; }
.buy-panel .fold-head { padding: 8px 8px; }
.buy-panel .fold-title { font-size: 23px; }
.buy-panel .fold-sum { margin-left: auto; font-variant-numeric: tabular-nums; }
.buy-panel .fold-pad { padding: 0 2px 6px; }
.buy-add { display: grid; grid-template-columns: minmax(0, 1fr) 104px auto; gap: 8px; padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.buy-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.buy {
  position: relative; display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto 28px; gap: 10px; align-items: center;
  padding: 8px 8px 8px 2px; border-radius: 14px; transition: background .2s, opacity .3s; animation: rise .45s var(--ease) both;
}
.buy:hover { background: var(--hover); }
body.settled .buy:not(.fresh) { animation: none; }
.buy:hover .wish-grip { opacity: 1; }
.buy-name { min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.buy-price { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-price em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.buy .del { opacity: 0; transition: opacity .2s, background .2s, color .2s; }
.buy:hover .del, .buy .del:focus-visible { opacity: 1; }
.buy.completing { opacity: .4; }
.buy.completing .check { background: var(--accent); border-color: var(--accent); animation: pop .45s var(--ease); }
.buy.completing .check svg { stroke-dashoffset: 0; }
.buy.completing .buy-name { text-decoration: line-through; }
.buy.dragging { z-index: 3; background: var(--card-strong); box-shadow: var(--shadow); }
body[data-mood="night"] .buy.dragging { background: rgba(48, 49, 72, .95); }
.buy.dragging .wish-grip { cursor: grabbing; opacity: 1; }
.buy-list.sorting { user-select: none; }
.buy-list.sorting .buy:not(.dragging) { transition: transform .22s var(--ease); }
.buy.settling { transition: transform .19s var(--ease); }
.buy-total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 8px 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.buy-total b { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.buy-empty { padding: 18px 10px 8px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

.recipe-panel { animation-delay: .24s; transition: box-shadow .25s, border-color .25s; }
.recipe-panel.drop-over { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.recipe-search { width: 100%; margin-top: 12px; }
.recipe-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.recipe {
  border-radius: 16px; background: var(--card-inner); border: 1px solid var(--line); overflow: hidden;
  transition: border-color .25s, box-shadow .25s; animation: rise .45s var(--ease) both;
}
body.settled .recipe:not(.fresh) { animation: none; }
.recipe:hover { border-color: color-mix(in srgb, var(--hue) 45%, var(--line)); }
.recipe-top { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 10px; }
.recipe-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; border-radius: 12px; }
.recipe-badge {
  width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 19px; color: var(--hue);
  background: color-mix(in srgb, var(--hue) 15%, transparent); border: 1px solid color-mix(in srgb, var(--hue) 30%, transparent);
  transition: transform .25s var(--ease);
}
.recipe-open:hover .recipe-badge { transform: scale(1.06) rotate(-3deg); }
.recipe-main { min-width: 0; }
.recipe-title { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-meta { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.macro-toggle {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px 5px 11px; border-radius: 999px;
  font-size: 12px; color: var(--ink-3); background: var(--well); transition: color .2s, background .2s;
}
.macro-toggle svg { font-size: 12px; transition: transform .35s var(--ease); }
.macro-toggle:hover, .recipe.macros-open .macro-toggle { color: var(--ink); }
.recipe.macros-open .macro-toggle { background: color-mix(in srgb, var(--hue) 18%, transparent); }
.recipe.macros-open .macro-toggle svg { transform: rotate(90deg); }
.recipe-fold { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease); }
.recipe.macros-open .recipe-fold { grid-template-rows: 1fr; }
.recipe-fold > div { overflow: hidden; min-height: 0; }
.recipe-fold .macros, .recipe-fold .macros-empty { margin: 0 10px 10px; }
.macros-empty { display: block; width: calc(100% - 20px); padding: 12px; border-radius: 12px; background: var(--well); font-size: 12.5px; color: var(--ink-3); text-align: left; }
.macros-empty:hover { color: var(--ink); }
.recipe-empty {
  width: 100%; margin-top: 14px; padding: 26px 18px; border-radius: 18px; border: 1.5px dashed var(--line-strong);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink-2); transition: border-color .2s, background .2s;
}
.recipe-empty:hover { border-color: var(--accent); background: var(--accent-soft); }
.recipe-empty .re-icon { font-size: 24px; color: var(--ink-3); margin-bottom: 4px; }
.recipe-empty b { font-weight: 500; }
.recipe-empty small { color: var(--ink-3); font-size: 12.5px; max-width: 300px; line-height: 1.45; }

.macros {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--well);
}
.macros .kcal { grid-row: span 2; text-align: center; padding-right: 16px; border-right: 1px solid var(--line-strong); min-width: 58px; }
.macros .kcal b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 400; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.macros .kcal span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.macro-row { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-3); }
.macro-row i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.macro-row b { margin-right: 4px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.macro-bar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--line); }
.macro-bar span { height: 100%; transition: width .6s var(--ease); }
.macro-bar span + span { box-shadow: -2px 0 0 var(--card-strong); }
.macros-note { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); }

/* recipe dialogs */
.modal-card.wide-form { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 70px); overflow: auto; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 132px; padding: 18px;
  border-radius: 18px; border: 1.5px dashed var(--line-strong); background: var(--card-inner); text-align: center;
  color: var(--ink-2); cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop.over { transform: scale(1.01); }
.drop-icon { font-size: 26px; color: var(--ink-3); margin-bottom: 4px; transition: color .2s; }
.drop-title { font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-sub { color: var(--ink-3); font-size: 12.5px; }
.drop.busy .drop-icon { animation: breathe2 1.4s ease-in-out infinite; }
.drop.loaded { border-style: solid; border-color: color-mix(in srgb, var(--good) 55%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.drop.loaded .drop-icon { color: var(--good); }
.paste-link { align-self: center; margin-top: -4px; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; font: inherit; }
.paste-area { width: 100%; min-height: 150px; resize: vertical; font-size: 13.5px; }
.recipe-found { font-size: 12.5px; color: var(--good); margin-top: -4px; padding: 0 4px; }
.macro-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.macro-inputs label { position: relative; }
.macro-inputs .input { width: 100%; padding-right: 36px; }
.macro-inputs em { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 11.5px; color: var(--ink-3); pointer-events: none; }

.modal-card.reader { position: relative; width: min(800px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow: auto; padding: 30px 32px 22px; }
.reader-x { position: absolute; top: 16px; right: 16px; }
.reader-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 40px 10px 0; }
.reader-kicker span { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--hue) 14%, transparent); color: var(--ink-2); }
.reader-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-right: 40px; }
.pdf-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 9px 14px 9px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink); background: color-mix(in srgb, var(--hue) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 34%, transparent); transition: background .2s, transform .2s var(--ease);
}
.pdf-btn svg { font-size: 16px; color: var(--hue); }
.pdf-btn:hover { background: color-mix(in srgb, var(--hue) 26%, transparent); transform: translateY(-1px); }
.steps li .step-lead { display: block; margin-bottom: 2px; }
.reader-title h2 { margin-right: 0 !important; }
.reader h2 { margin: 0 40px 8px 0; font-family: var(--font-display); font-weight: 400; font-size: 31px; line-height: 1.15; letter-spacing: -.01em; }
.reader .intro { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; max-width: 62ch; }
.reader-macros { margin: 14px 0 4px; max-width: 460px; }
.reader-cols { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 34px; margin-top: 22px; }
.reader h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.reader h5 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.reader h4 + h5 { margin-top: 0; }
.ingr { list-style: none; margin: 0; padding: 0; }
.ingr li { display: flex; gap: 10px; align-items: flex-start; padding: 5px 6px; margin: 0 -6px; border-radius: 9px; font-size: 14px; line-height: 1.45; cursor: pointer; transition: background .2s, color .2s; }
.ingr li:hover { background: var(--hover); }
.ingr li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 5px; border: 1.5px solid var(--line-strong); transition: background .2s, border-color .2s; }
.ingr li.got { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ingr li.got::before { background: var(--hue); border-color: var(--hue); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 14px 40px; font-size: 14.5px; line-height: 1.62; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--hue);
  background: color-mix(in srgb, var(--hue) 15%, transparent);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 31px; bottom: 4px; width: 1px; background: var(--line-strong); }
.steps li b { font-weight: 600; color: var(--ink); }
.reader-notes { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.reader-notes ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.reader-raw { margin-top: 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.reader-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.reader-foot .btn svg { font-size: 15px; margin-right: 6px; vertical-align: -3px; }

@media (max-width: 1020px) {
  .duo { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .reader-title { flex-direction: column; gap: 6px; }
  .reader-cols { grid-template-columns: 1fr; gap: 18px; }
  .macro-inputs { grid-template-columns: 1fr 1fr; }
  .buy-add { grid-template-columns: 1fr 90px; }
  .buy-add .btn { grid-column: 1 / -1; }
}

/* ---------- notes ---------- */
.hero-sub { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0; }
.notes-link { font-size: 15px; color: var(--ink-3); padding: 0 2px; border-radius: 6px; transition: color .2s; }
.notes-link::before { content: "·"; margin: 0 10px; color: var(--ink-3); }
.notes-link:hover, .notes-link.on { color: var(--accent); }
.notes-box {
  position: fixed; z-index: 55; width: 360px; height: auto; max-height: calc(100vh - 70px); min-width: 260px; min-height: 140px;
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; resize: both;
  background: var(--drawer); border: 1px solid var(--card-border); backdrop-filter: blur(28px);
  box-shadow: 0 26px 70px -24px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .05);
}
.notes-box[hidden] { display: none; }
.notes-box.pop { animation: modalIn .3s var(--ease) both; }
.notes-box.moving { box-shadow: 0 34px 80px -24px rgba(0, 0, 0, .45); opacity: .97; }
.notes-bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; cursor: grab; user-select: none; border-bottom: 1px solid var(--line); flex: none; }
.notes-box.moving .notes-bar { cursor: grabbing; }
.notes-grip { font-size: 15px; color: var(--ink-3); opacity: .5; display: grid; }
.notes-bar h3 { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 400; font-size: 19px; }
.notes-body { flex: 1; overflow: auto; padding: 8px 8px 12px; }
.notes-empty { padding: 26px 12px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.note-secs, .note-items { list-style: none; margin: 0; padding: 0; }
.note-sec { border-radius: 14px; }
.note-sec + .note-sec { margin-top: 2px; }
.note-sec-head { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0; border-radius: 12px; transition: background .2s; }
.note-sec-head:hover { background: var(--hover); }
.note-sec-head .wish-grip { opacity: 0; }
.note-sec-head:hover .wish-grip, .note-sec-head .wish-grip:focus-visible { opacity: .6; }
.note-chev { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; color: var(--ink-3); flex: none; transition: transform .35s var(--ease), color .2s; }
.note-sec.open .note-chev { transform: rotate(90deg); }
.note-sec-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 3px 2px; }
.note-count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.note-sec-head .mini { opacity: 0; transition: opacity .2s, background .2s, color .2s; width: 26px; height: 26px; }
.note-sec-head .mini svg { font-size: 13px; }
.note-sec-head:hover .mini, .note-sec-head .mini:focus-visible { opacity: 1; }
.note-sec-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.note-sec.open .note-sec-body { grid-template-rows: 1fr; }
.note-sec-inner { overflow: hidden; min-height: 0; padding-left: 22px; }
.note-sec:not(.open) .note-sec-inner { visibility: hidden; transition: visibility 0s .35s; }
.note-item { position: relative; display: grid; grid-template-columns: 16px 10px minmax(0, 1fr) 24px; align-items: start; gap: 6px; padding: 3px 2px; border-radius: 10px; transition: background .2s; }
.note-item:hover { background: var(--hover); }
.note-item .wish-grip { height: 22px; opacity: 0; }
.note-item:hover .wish-grip, .note-item .wish-grip:focus-visible { opacity: .6; }
.note-bullet { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 9px; justify-self: center; }
.note-bullet.ghost { background: transparent; border: 1.2px solid var(--ink-3); opacity: .6; }
.note-text { font-size: 14px; line-height: 1.5; padding: 1px 2px; color: var(--ink); cursor: text; white-space: pre-wrap; word-break: break-word; }
.note-item .mini { width: 24px; height: 24px; opacity: 0; transition: opacity .2s; }
.note-item .mini svg { font-size: 12px; }
.note-item:hover .mini, .note-item .mini:focus-visible { opacity: 1; }
.note-input {
  width: 100%; border: none; outline: none; background: var(--well); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.5;
  padding: 1px 6px; border-radius: 7px; resize: none; overflow: hidden;
}
.note-input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.note-input.title { font-weight: 600; font-size: 14.5px; flex: 1; min-width: 0; }
.note-add { display: grid; grid-template-columns: 16px 10px minmax(0, 1fr); gap: 6px; align-items: center; padding: 3px 2px 8px; }
.note-add .note-bullet { grid-column: 2; margin-top: 0; }
.note-add .note-input { background: transparent; padding: 3px 6px; }
.note-add .note-input:focus { background: var(--well); }
.note-add .note-input::placeholder { color: var(--ink-3); }
.note-item.dragging, .note-sec.dragging { z-index: 3; background: var(--card-strong); box-shadow: var(--shadow); }
.note-items.sorting, .note-secs.sorting { user-select: none; }
.note-items.sorting .note-item:not(.dragging), .note-secs.sorting .note-sec:not(.dragging) { transition: transform .22s var(--ease); }
.note-item.settling, .note-sec.settling { transition: transform .19s var(--ease); }

/* ---------- sync ---------- */
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); opacity: .75; transition: background .3s, opacity .3s; }
.sync-dot[hidden] { display: none; }
.sync-dot.syncing { background: var(--accent); animation: breathe2 1.4s ease-in-out infinite; }
.sync-dot.offline { background: var(--ink-3); opacity: .5; }
.sync-dot.error { background: var(--warn); }
.sync-box { border-top: 1px solid var(--line); padding-top: 12px; }
.sync-box .field { gap: 8px; }
.sync-note { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.sync-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sync-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.sync-status.syncing i { background: var(--accent); }
.sync-status.offline i { background: var(--ink-3); }
.sync-status.error i { background: var(--warn); }
.sync-on { font-size: 13px; color: var(--good); font-weight: 600; }
.sync-off { align-self: flex-start; font-size: 12px; }
.pair-code { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.pair-code b { font-size: 24px; letter-spacing: .14em; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.pair-code small { font-size: 12px; line-height: 1.45; color: var(--ink-2); }

/* phone: connect screen */
.pair-screen {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px;
  background: var(--bg); transition: opacity .45s, transform .45s var(--ease);
}
.pair-screen.done { opacity: 0; transform: scale(1.02); pointer-events: none; }
.pair-card { width: min(380px, 100%); text-align: center; animation: rise .8s var(--ease) both; }
.pair-orb {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff7ee 0%, #f2b08e 45%, #dc8c70 100%);
  box-shadow: 0 0 60px 18px var(--accent-soft); animation: breathe2 5s ease-in-out infinite;
}
.pair-card h1 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 34px; }
.pair-card p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.pair-card ol { margin: 0 auto 18px; padding-left: 22px; text-align: left; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; max-width: 320px; }
.pair-tip { padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px !important; }
.pair-form { display: flex; gap: 8px; }
.pair-input { flex: 1; height: 48px; font-size: 20px; letter-spacing: .14em; text-align: center; text-transform: uppercase; }
.pair-form .btn { height: 48px; padding: 0 18px; }
.pair-msg { min-height: 22px; margin-top: 12px !important; font-size: 13.5px !important; }

/* phone layout */
@supports (padding: env(safe-area-inset-bottom)) {
  .scroller { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 720px) {
  .notes-box { left: 8px !important; right: 8px; top: 52px !important; width: auto !important; height: auto !important; max-height: 72vh; resize: none; }
  .notes-bar { cursor: default; }
  .notes-grip { display: none; }
  .note-item .wish-grip, .note-sec-head .wish-grip, .note-item .mini, .note-sec-head .mini { opacity: .55; }
  .cal-day { min-height: 44px; padding: 4px; }
  .cal-ev { width: 9px; height: 9px; }
  .cal-tools .cal-month { min-width: 0; }
  .popover { max-height: calc(100vh - 70px); overflow: auto; }
  .hero h1 { font-size: 34px; }
}

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .4s; }
.scrim.show { opacity: 1; pointer-events: auto; backdrop-filter: blur(3px); }
.drawer {
  position: fixed; z-index: 50; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px));
  background: var(--drawer); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .35);
  transform: translateX(calc(100% + 30px)); visibility: hidden; transition: transform .5s var(--ease);
  overflow-y: auto; overflow-x: hidden; padding: 46px 28px 28px;
}
.drawer { transition: transform .5s var(--ease), visibility 0s .5s; }
.drawer.open { transform: none; visibility: visible; transition: transform .5s var(--ease); backdrop-filter: blur(30px) saturate(1.2); }
.drawer::before {
  content: ""; position: absolute; top: -120px; right: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, var(--hue, var(--accent)), transparent 65%); opacity: .3; pointer-events: none;
}
.drawer-close { position: absolute; top: 12px; right: 12px; }
.d-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); position: relative; }
.d-title { font-family: var(--font-display); font-weight: 400; font-size: 32px; margin: 4px 0 2px; position: relative; outline: none; border-radius: 6px; }
.d-title:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.d-stat { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 2px; position: relative; flex-wrap: wrap; }
.d-stat .big { font-family: var(--font-display); font-size: 48px; line-height: 1; }
.d-stat .unit { color: var(--ink-3); font-size: 15px; }
.d-sub { color: var(--ink-2); font-size: 13.5px; position: relative; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.d-section { margin-top: 26px; position: relative; }
.d-section h3 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin: 0 0 10px; }
.chart { position: relative; margin-top: 18px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font-ui); font-size: 10.5px; fill: var(--ink-3); stroke: none; }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -120%); white-space: nowrap;
  background: var(--card-strong); border: 1px solid var(--card-border); border-radius: 10px; padding: 4px 9px;
  font-size: 12px; box-shadow: var(--shadow); opacity: 0; transition: opacity .15s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-weight: 600; }
.chart-tip span { color: var(--ink-3); margin-left: 6px; }
.logrow { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.logrow .grow { flex: 1; min-width: 90px; }
.logrow .btn { background: var(--hue, var(--accent)); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.history li:last-child { border-bottom: 0; }
.history .h-date { color: var(--ink-3); font-size: 12.5px; }
.history .h-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history .h-val em { font-style: normal; color: var(--ink-3); margin-left: 6px; font-size: 12px; }
.history .h-val .up { color: var(--good); }
.history .h-val .down { color: var(--warn); }
.history .x { opacity: 0; transition: opacity .2s; }
.history li:hover .x { opacity: 1; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; }
.heat i { width: 100%; aspect-ratio: 1; border-radius: 4px; background: var(--well); }
.heat i.on { background: var(--hue); }
.heat i.today { outline: 1.5px solid var(--hue); outline-offset: 1px; }
.heat i.future { opacity: .35; }
.heat-wrap { display: grid; grid-template-columns: 16px 1fr; gap: 6px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; font-size: 9.5px; color: var(--ink-3); align-items: center; }
.weekbars { display: grid; grid-auto-flow: column; gap: 4px; align-items: end; height: 46px; margin-top: 10px; margin-left: 22px; }
.weekbars span { border-radius: 4px 4px 2px 2px; background: var(--hue); opacity: .35; min-height: 3px; }
.weekbars span.met { opacity: .9; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-grid .full { grid-column: 1 / -1; }
details.edit summary { cursor: pointer; list-style: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit summary svg { transition: transform .25s; }
details.edit[open] summary svg { transform: rotate(90deg); }
details.edit[open] summary { margin-bottom: 12px; }
.row-end { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 8px; }

/* ---------- modal + popover ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; }
.modal-card {
  width: min(440px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-lg);
  background: var(--drawer); border: 1px solid var(--card-border); backdrop-filter: blur(30px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .4); pointer-events: auto;
  animation: modalIn .35s var(--ease) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-card h3 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 400; font-size: 22px; }
.modal-card .title-input { width: 100%; font-size: 17px; height: 44px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.daypick { display: flex; gap: 4px; flex-wrap: wrap; }
.daypick button { width: 36px; height: 32px; border-radius: 10px; background: var(--well); font-size: 12px; color: var(--ink-2); transition: background .2s, color .2s; }
.daypick button.on { background: var(--accent); color: var(--accent-ink); }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-dates button { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--well); color: var(--ink-2); }
.quick-dates button:hover { color: var(--ink); }

.popover {
  position: fixed; z-index: 70; top: 46px; right: 16px; width: 310px; padding: 18px;
  border-radius: 20px; background: var(--drawer); border: 1px solid var(--card-border);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .35); visibility: hidden;
  opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s;
}
.popover.open { transition: opacity .25s, transform .3s var(--ease); }
body.desktop .popover { right: 120px; }
.popover.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; backdrop-filter: blur(30px); }
.popover h4 { margin: 0 0 12px; font-weight: 500; font-size: 14px; }
.pill-seg { display: flex; background: var(--well); border-radius: 999px; padding: 3px; }
.pill-seg button { flex: 1; height: 30px; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); }
.pill-seg button.on { background: var(--card-strong); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
body[data-mood="night"] .pill-seg button.on { background: rgba(255, 255, 255, .1); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; }
.switch { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .25s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.pop-links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
.pop-note { font-size: 11.5px; color: var(--ink-3); word-break: break-all; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 80; left: 50%; bottom: 26px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 12px 10px 18px; border-radius: 999px; font-size: 13.5px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .4);
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--bg); opacity: .75; font-weight: 600; padding: 4px 8px; border-radius: 999px; }
.toast button:hover { opacity: 1; background: rgba(127, 127, 127, .2); }
.toast:not(:has(button)) { padding-right: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid { grid-template-columns: 1fr; }
  .today-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { padding: 22px 16px 40px; }
  .seg { grid-template-columns: 1fr; }
  .week button { width: 32px; }
  .panel-head { flex-wrap: wrap; }
  .capture-kbd { display: none; }
}
@media (max-width: 520px) {
  .goal-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}

.popover { max-height: calc(100vh - 60px); overflow: auto; }
