/* daily-forge: one stylesheet, light and dark, desktop first but responsive.
   v0.11 design system: tokens below (spacing, radius, elevation, module colours), an icon sprite (templates/_icons.html),
   a sidebar on the desktop and a command palette. Component rules further down keep their class names. */
:root {
  --bg: #f5f4f0; --surface: #ffffff; --surface-2: #faf9f6; --text: #1c1b19; --muted: #6d6b66; --line: #e6e3dc;
  --line-strong: #d6d2c8; --accent: #c2410c; --accent-hover: #a8380a; --accent-text: #ffffff; --accent-soft: #fdeee6;
  --done: #16a34a; --partial: #f59e0b; --missed: #e7e5e0; --slip: #dc2626; --danger: #b91c1c;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(28, 27, 25, .04), 0 2px 12px rgba(28, 27, 25, .045);
  --shadow-lift: 0 2px 6px rgba(28, 27, 25, .06), 0 12px 32px rgba(28, 27, 25, .10);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.5rem; --sp-6: 2rem;
  --font: "Inter var", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 236px; --sidebar-mini: 68px;
  /* one colour per module: icons, active states, tile chips */
  --m-today: #ea580c; --m-plan: #0d9488; --m-tasks: #2563eb; --m-habits: #16a34a; --m-goals: #d97706;
  --m-journal: #4f46e5; --m-coach: #db2777; --m-mood: #9333ea; --m-focus: #dc2626; --m-stats: #0891b2; --m-notes: #65a30d;
  --c: #16a34a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121211; --surface: #1c1c1a; --surface-2: #22221f; --text: #edebe6; --muted: #9d9a93; --line: #2f2e2a;
    --line-strong: #3d3b36; --accent: #fb7a35; --accent-hover: #ff8c4d; --accent-text: #1a0d05; --accent-soft: #3a1f12;
    --missed: #2b2a27; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lift: 0 10px 30px rgba(0, 0, 0, .5);
    --m-tasks: #60a5fa; --m-journal: #818cf8; --m-mood: #c084fc; --m-plan: #2dd4bf; --m-habits: #4ade80;
    --m-goals: #fbbf24; --m-coach: #f472b6; --m-focus: #f87171; --m-stats: #22d3ee; --m-notes: #a3e635; }
}
.c-green { --c: #16a34a; } .c-blue { --c: #2563eb; } .c-purple { --c: #9333ea; }
.c-orange { --c: #ea580c; } .c-red { --c: #dc2626; } .c-teal { --c: #0d9488; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  stroke-linejoin: round; vertical-align: -.18em; }
/* No underlined links anywhere (Radek, 2026-11-06): actions are buttons or pills, links show on hover by colour. */
a { color: inherit; text-decoration: none; }
a:where(:not(.button, .chip)):hover { color: var(--accent); }
.allauth a:not(.button), .links a, .logout { color: var(--accent); }
h1 { font-size: 1.75rem; font-weight: 700; margin: .2rem 0 .6rem; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.02rem; font-weight: 650; margin: 0 0 .7rem; letter-spacing: -.005em; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 750; text-decoration: none; font-size: 1.1rem; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; padding: .35rem .5rem; border-radius: 8px; color: var(--muted); }
.topbar nav a:hover { background: var(--bg); color: var(--text); }
.topbar nav a.active { background: var(--bg); color: var(--text); font-weight: 600; }
.tools { margin-left: auto; display: flex; gap: .8rem; align-items: center; }
.lang { display: flex; gap: 0; }
.lang button { border-radius: 0; padding: .2rem .5rem; font-size: .72rem; font-weight: 600; }
.lang button:first-of-type { border-radius: 7px 0 0 7px; } .lang button:last-of-type { border-radius: 0 7px 7px 0; }
.lang button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.logout { color: var(--muted); font-size: .9rem; }

main { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.5rem; }
main.narrow { max-width: 460px; }
footer { text-align: center; color: var(--muted); font-size: .75rem; padding: 2rem 0; opacity: .7; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card.narrow { max-width: 460px; margin: 1rem auto; }
.card.empty { text-align: center; padding: 2.5rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 1.2rem; }
.row { display: flex; gap: .8rem; align-items: center; margin-top: .6rem; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

button, .button { font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); padding: .48rem .95rem; border-radius: var(--radius-sm); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; line-height: 1.2;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease); }
button:hover, .button:hover { border-color: var(--muted); background: var(--surface-2); }
button:active, .button:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button.primary, .button.primary, .allauth button[type=submit] { background: var(--accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .15); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.small, .button.small { padding: .28rem .6rem; font-size: .8rem; border-radius: var(--radius-xs); }
button.ghost { border-color: transparent; background: none; }
button.ghost:hover { background: var(--surface-2); border-color: transparent; }
button.danger, .button.danger { color: var(--danger); }
.danger-link { color: var(--danger); font-size: .85rem; }

input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
  font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--ring); }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .25rem; }
.field { margin-bottom: 1rem; border: 0; padding: 0; }
.field legend { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field ul, .field > div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.field ul li label, .field > div > div label { font-weight: 400; display: inline-flex; align-items: center; gap: .35rem; }
.colors label { text-transform: capitalize; }
.help { color: var(--muted); font-size: .8rem; display: block; margin-top: .2rem; }
.errorlist { color: var(--danger); list-style: none; padding: 0; margin: .3rem 0; font-size: .85rem; }
[hidden] { display: none !important; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { background: var(--surface); border-left: 4px solid var(--done); padding: .6rem .9rem; border-radius: 6px; }
.messages li.error { border-color: var(--danger); }

/* Today */
.dayhead { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.dayhead h1 { margin: 0; text-transform: capitalize; }
.dayhead p { margin: 0; }
.navbtn { font-size: 1.5rem; text-decoration: none; width: 2.2rem; height: 2.2rem; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); line-height: 1; }
.navbtn.disabled { opacity: .3; }
.habits { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .5rem; }
.habit { display: grid; grid-template-columns: 7.5rem 1fr auto auto; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius);
  padding: .6rem .9rem; box-shadow: var(--shadow); }
.habit .control form { display: flex; align-items: center; gap: .3rem; margin: 0; }
.tick { width: 2.4rem; height: 2.4rem; border-radius: 50%; font-size: 1.2rem; color: transparent; border: 2px solid var(--line); padding: 0; }
.tick:hover { border-color: var(--c); color: var(--c); }
.tick.on { background: var(--c); border-color: var(--c); color: #fff; }
.counter input { width: 3.6rem; text-align: center; padding: .3rem; }
.slip { font-size: .85rem; }
.state-slip .slip { background: var(--slip); color: #fff; border-color: var(--slip); }
.habit .name { font-weight: 600; text-decoration: none; }
.habit .meta { display: block; color: var(--muted); font-size: .85rem; }
.habit.state-done .name::after { content: " ✓"; color: var(--c); }
.streak { text-align: right; white-space: nowrap; }
.streak small { display: block; color: var(--muted); font-size: .75rem; }
.hnote summary { cursor: pointer; list-style: none; color: var(--muted); padding: .2rem .4rem; }
.hnote summary::-webkit-details-marker { display: none; }
.hnote[open] { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; }
.hnote[open] form { flex: 1; }
.resting { margin-bottom: 1.2rem; } .resting summary { cursor: pointer; color: var(--muted); margin-bottom: .5rem; }
.resting .habit { opacity: .75; }
.daynote textarea { resize: vertical; }
.saved { color: var(--done); font-size: .85rem; }

/* Lists */
.list { list-style: none; padding: .3rem 1.2rem; }
.list li { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list .name { font-weight: 600; }
.list .actions { margin-left: auto; display: flex; gap: .3rem; }
.list .actions form { margin: 0; }
.archived { opacity: .8; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); display: inline-block; margin-right: .4rem; }
.badge { font-size: .7rem; padding: .1rem .4rem; border-radius: 4px; background: var(--line); vertical-align: middle; }

/* Detail */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; margin: 1rem 0 1.2rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); }
.tile .label { display: block; color: var(--muted); font-size: .78rem; }
.tile strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tile .unit { color: var(--muted); font-size: .8rem; margin-left: .2rem; }
.cardhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cardhead h2 { margin: 0; }
.cardhead > a, .linkpill { font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); white-space: nowrap; }
.cardhead > a:hover, a.linkpill:hover { border-color: var(--muted); color: var(--text); }
.cardhead h2.month-name { text-transform: capitalize; }
.month { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.month th { font-size: .75rem; color: var(--muted); font-weight: 500; }
.month td { height: 2.4rem; text-align: center; border-radius: 6px; font-size: .85rem; }
.month td a { text-decoration: none; display: block; line-height: 2.4rem; }
.s-done { background: var(--c); color: #fff; } span.s-done { background: none; color: var(--c); }
.s-partial { background: color-mix(in srgb, var(--c) 35%, transparent); } span.s-partial { background: none; color: color-mix(in srgb, var(--c) 45%, var(--bg)); }
.s-missed { background: var(--missed); } span.s-missed { background: none; color: var(--missed); }
.s-slip { background: var(--slip); color: #fff; } span.s-slip { background: none; color: var(--slip); }
.s-open { outline: 2px dashed var(--c); outline-offset: -3px; }
.s-rest, .s-before { color: var(--muted); }
.s-future { color: var(--line); }
.legend { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }
.notes { list-style: none; padding: 0; margin: 0; } .notes li { padding: .3rem 0; } .notes a { color: var(--muted); margin-right: .5rem; }

/* Charts (inline SVG built from habits.views._bars) */
.bars { width: 100%; height: 110px; display: block; }
.bars .bar { fill: var(--c); } .bars .bar:hover { opacity: .75; }
.bars .axis { stroke: var(--line); stroke-width: .5; }
.bar-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 1rem; }
.stats { width: 100%; border-collapse: collapse; }
.stats th, .stats td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.stats th { font-size: .8rem; color: var(--muted); font-weight: 500; }
.exports { list-style: none; padding: 0; } .exports li { margin: .7rem 0; } .exports .button { min-width: 4.5rem; text-align: center; margin-right: .6rem; }
.links { padding-left: 1.1rem; } .links li { margin: .4rem 0; }

/* allauth pages */
.allauth h1 { text-align: center; }
.allauth form p { margin: 0 0 .9rem; }
.allauth button { width: 100%; margin-top: .3rem; }
.allauth hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.allauth section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.allauth section ul { list-style: none; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.allauth section ul button, .allauth section ul a { width: auto; }
.allauth input[type=checkbox] { width: auto; }
.allauth p label[for] { display: inline; }
.allauth code, .allauth pre { background: var(--bg); padding: .3rem .5rem; border-radius: 6px; display: inline-block; }
.allauth img { background: #fff; padding: .5rem; border-radius: 8px; }

/* Today: one column, the module sections stacked in the order of config/modules.py */
/* Today: the tile grid (accounts/tiles.py, v0.8.0). 6 columns × 64 px rows; 2 columns on the phone. */
main.today { max-width: 1240px; }
.tiles-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 64px; gap: 16px; grid-auto-flow: row dense; margin-bottom: 1.5rem; }
.tile-cell { grid-column: span var(--w); grid-row: span var(--h); position: relative; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; container-type: inline-size; }
.tile-cell.hide-d { display: none; }
.tile-body { padding: 1rem 1.1rem; }  /* natural height: tiles.js grows the tile to fit (v0.10.1); no inner scrolling */
.tile-body > .card, .tile-body > section.card { border: 0; box-shadow: none; background: none; padding: 0; margin: 0; }
.tile-body .shutdown-cta.evening, .tile-body .goals-card .shutdown-cta.evening { margin: .9rem -1.1rem -1rem; }
.tile-tools { display: none; }
.arrange-btn { margin-left: auto; }
.arrange-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .6rem .8rem; margin: -.4rem 0 1rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius); }
.arrange-bar .hidden-tiles { display: flex; gap: .3rem; flex-wrap: wrap; margin-left: auto; }
.arranging .tile-body { pointer-events: none; opacity: .45; filter: saturate(.6); }
.arranging .tile-cell { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
.arranging .tile-cell:focus-visible { outline: 3px solid var(--accent); }
.arranging .tile-cell.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.arranging .tile-tools { display: block; position: absolute; inset: 0; pointer-events: none; }
.tile-name { position: absolute; top: 0; left: 0; right: 0; font-weight: 700; background: var(--surface); padding: .45rem 2.8rem .45rem .8rem; border-bottom: 1px solid var(--line); }
.tile-size { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.4rem; font-weight: 700; color: var(--accent);
  background: var(--surface); padding: .2rem .7rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.tile-hide { position: absolute; top: .25rem; right: .3rem; pointer-events: auto; padding: .15rem .4rem; }
.tile-resize { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; pointer-events: auto; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%); border-bottom-right-radius: var(--radius); }
@media (pointer: coarse) {
  .arranging .tile-cell { touch-action: auto; }
  .arranging .tile-name { pointer-events: auto; touch-action: none; cursor: grab; }
  .arranging .tile-name::after { content: " ⠿"; color: var(--muted); }
}
@container (max-width: 300px) {
  .cardhead { flex-wrap: wrap; gap: .3rem; }
  .goal-mini li { grid-template-columns: minmax(0, 1fr) 2.8rem; }
  .goal-mini li .goal-bar { grid-column: 1 / -1; grid-row: 2; }
}
@container (max-width: 520px) {
  .habit { grid-template-columns: auto minmax(0, 1fr) auto auto !important; gap: .6rem; padding: .55rem .7rem; }
  .counter button[value=dec] { display: none; }
  .done-sum { columns: 1; }
}
.col-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .6rem; }
.col-sub { font-size: .9rem; color: var(--muted); margin: 1rem 0 .5rem; }
.tile-cell .habit { grid-template-columns: 9rem 1fr auto auto; }
.backlog summary { cursor: pointer; color: var(--muted); margin: .4rem 0 .5rem; }

/* Today: mood dial and focus timer */
.cardhead h2 { margin: 0; }
.mood-card .dial-form { display: flex; flex-direction: column; align-items: center; }
svg.dial { overflow: visible; width: 100%; max-width: 300px; touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; outline: none; }
svg.dial:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.dial-seg { fill: none; stroke-width: 18; stroke-linecap: butt; }
.dial-end { font-size: 10px; fill: var(--muted); }
.dial-thumb { fill: var(--surface); stroke: var(--text); stroke-width: 3; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); transition: r .15s; }
svg.dial.dragging .dial-thumb { r: 15; }
svg.dial[data-empty] .dial-thumb { stroke: var(--muted); stroke-dasharray: 4 3; }
.face-bg { transition: fill .15s; }
.face-ink { fill: #1d1d1b; }
.face-brow, .face-mouth { fill: none; stroke: #1d1d1b; stroke-width: 2.6; stroke-linecap: round; }
.dial-read { display: flex; gap: .5rem; align-items: baseline; margin-top: -.2rem; }
.dial-word { font-size: 1.15rem; }
.dial-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.mood-logged { text-align: center; margin: .3rem 0 .4rem; }
.mood-note { display: flex; gap: .4rem; }
.mood-saved-note { color: var(--text); font-style: italic; }
.mood-note input { flex: 1; }
.shift.up { color: var(--done); font-weight: 600; }
.shift.down { color: var(--danger); font-weight: 600; }
.mood-spark { width: 100%; height: 48px; margin-top: .6rem; }
.mood-spark .zero, .mood-chart .zero { stroke: var(--line); stroke-dasharray: 3 3; }
.spark-line { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.mood-list { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .9rem; }
.mood-list li { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.mood-list .t { color: var(--muted); font-variant-numeric: tabular-nums; width: 2.8rem; }
.mood-list .v { color: #fff; border-radius: 6px; padding: 0 .35rem; font-size: .8rem; font-variant-numeric: tabular-nums; min-width: 2rem; text-align: center; }
.mood-list .n { flex: 1; }
.mood-list .dayrow { color: var(--muted); font-size: .8rem; text-transform: capitalize; margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .4rem; }
.mood-list .del { margin: 0; }
.mood-chart { width: 100%; height: 180px; }
.mood-chart .band-up { fill: color-mix(in srgb, var(--done) 5%, transparent); }
.mood-chart .avg-line { fill: none; stroke: var(--text); stroke-width: 2; opacity: .55; }
.rhythm { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; text-align: center; margin-bottom: .8rem; }
.rhythm.week { grid-template-columns: repeat(7, 1fr); }
.rhythm div { background: var(--bg); border-radius: 8px; padding: .4rem .2rem; display: flex; flex-direction: column; }
.rhythm span { font-size: .75rem; color: var(--muted); }
.rhythm .ico { font-size: 1.1rem; }
.chips a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pagehead .chips { margin: 0; }

.focus-card .timer { position: relative; width: 190px; height: 190px; margin: .2rem auto .6rem; }
.focus-card .ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring .progress { fill: none; stroke: #dc2626; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .5s linear; }
.timer.kind-short .progress { stroke: #0d9488; }
.timer.kind-long .progress { stroke: #16a34a; }
.timer.paused .progress { stroke: var(--muted); }
.timer-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-read .clock { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer-read .what { color: var(--muted); font-size: .85rem; }
.timer.paused .clock { opacity: .5; }
.focus-on { text-align: center; margin: 0 0 .5rem; }
.row.center { justify-content: center; }
.row form { margin: 0; }
.focus-start { display: flex; flex-direction: column; gap: .6rem; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.kinds label { margin: 0; }
.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.kinds span { display: block; text-align: center; padding: .55rem .3rem; border: 1px solid var(--line); border-radius: 8px; font-weight: 500; font-size: .85rem; cursor: pointer; }
.kinds input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.kinds input:focus-visible + span { outline: 2px solid var(--accent); }
button.big { padding: .75rem 1rem; font-size: 1.05rem; }
.focus-done { background: color-mix(in srgb, var(--done) 12%, transparent); border-radius: 8px; padding: .5rem .7rem; margin: 0 0 .6rem; }
.tomatoes { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; margin-top: .8rem; }
.tomatoes span { filter: grayscale(1); opacity: .3; font-size: 1.1rem; }
.tomatoes span.on { filter: none; opacity: 1; }
.tomatoes small { margin-left: auto; color: var(--muted); }

/* Stats: one section per module */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.2rem 0 1rem; }
.chips a { text-decoration: none; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.stats-module { margin-bottom: 1.6rem; scroll-margin-top: 4.5rem; }
a.tile { text-decoration: none; color: inherit; }
.tile.warn strong { color: var(--danger); }

/* Tasks */
.quickadd { display: flex; gap: .5rem; }
.quickadd input { flex: 1; }
.quickadd { margin-bottom: .8rem; }
.icon-btn { width: 2.3rem; padding-left: 0; padding-right: 0; color: var(--muted); font-weight: 600; flex: none; }
.keys-head { margin-top: 1.2rem; }
code { font: .85em ui-monospace, monospace; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.tasks { list-style: none; padding: .2rem .4rem; margin: 0 0 1rem; }
.task { display: flex; align-items: center; gap: .7rem; padding: .5rem .5rem; border-bottom: 1px solid var(--line); border-radius: 6px; outline: none; }
.task:last-child { border-bottom: 0; }
.task.selected { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.task form { margin: 0; }
.task .tinfo { flex: 1; min-width: 0; }
.task .ttitle { text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
.task.done .ttitle { text-decoration: line-through; color: var(--muted); }
.task.prio-1 .ttitle { font-weight: 600; }
.tmeta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.tmeta:empty { display: none; }
.pill { font-size: .72rem; padding: .05rem .4rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.pill.high { color: #fff; background: var(--danger); border-color: var(--danger); }
.pill.low { opacity: .7; }
.pill.due.late { color: var(--danger); border-color: var(--danger); }
.pill.carried { color: var(--partial); border-color: var(--partial); }
.check { width: 1.6rem; height: 1.6rem; border-radius: 6px; padding: 0; color: transparent; border: 2px solid var(--line); font-size: .9rem; }
.check:hover { border-color: var(--done); color: var(--done); }
.check.on { background: var(--done); border-color: var(--done); color: #fff; }
.prio-1 .check { border-color: var(--danger); }
.task button.on { border-color: var(--accent); color: var(--accent); }
.empty-row { padding: .8rem .5rem; }
.done-list .task { opacity: .75; }
.tasks-layout { display: grid; grid-template-columns: 14rem 1fr; gap: 1.2rem; align-items: start; }
.listnav { display: flex; flex-direction: column; gap: .15rem; padding: .7rem; }
.listnav a { text-decoration: none; padding: .35rem .6rem; border-radius: 6px; color: var(--muted); display: flex; justify-content: space-between; }
.listnav a:hover, .listnav a.active { background: var(--bg); color: var(--text); }
.listnav hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; width: 100%; }
.search input { width: 16rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 .6rem; }
.checklist li form { display: flex; align-items: center; gap: .5rem; padding: .25rem 0; }
.checklist li span { flex: 1; }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }
button.ghost { color: var(--muted); }
.inline-check { display: flex; align-items: center; gap: .5rem; }
.inline-check label { margin: 0; }
.inline-check input { width: auto; }
.row.grow { flex: 1; margin: 0; }
.row.grow input { max-width: 18rem; }
dialog.card { max-width: 30rem; border: 1px solid var(--line); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.keys td { padding: .3rem .6rem .3rem 0; }
kbd { font: .8rem ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: .05rem .35rem; background: var(--bg); }

@media (max-width: 900px) {
  .tasks-layout { grid-template-columns: 1fr; }

  .listnav { flex-direction: row; flex-wrap: wrap; }
  .listnav hr { display: none; }
  .search input { width: 100%; }
}

@media (max-width: 760px) {
  main { padding: 1rem; }
  .topbar { padding: .6rem 1rem; gap: .6rem; }
  .grid2, .field-row { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .habit { grid-template-columns: auto 1fr auto; gap: .6rem; }
  .habit .hnote:not([open]) { grid-column: auto; }
  .habit .control { grid-row: span 1; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Touch and iPhone (home-screen app). Phones get an iPhone-style layout: an orange top bar under the status bar,
   a bottom tab bar, safe-area padding for the notch and the home indicator, 16px inputs (no zoom on focus) and
   44px tap targets. Hover effects only where a real pointer can hover.
   --------------------------------------------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input[type=search] { font: inherit; width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text); -webkit-appearance: none; appearance: none; }
.backbtn { display: inline-flex; align-items: center; gap: .1rem; text-decoration: none; color: var(--muted); font-size: .9rem; }
.backbtn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tabbar { display: none; }
@media (hover: none) {
  .tick:hover { border-color: var(--line); color: transparent; }
  .tick.on:hover { border-color: var(--c); color: #fff; }
  .check:hover { border-color: var(--line); color: transparent; }
  .check.on:hover { border-color: var(--done); color: #fff; }
  .prio-1 .check:hover { border-color: var(--danger); }
  button:hover, .button:hover { border-color: var(--line); }
  .topbar nav a:hover, .listnav a:hover { background: none; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=search],
  select, textarea { font-size: 16px; }

  /* Top bar under the status bar */
  .topbar { background: var(--accent); color: #fff; border-bottom: 0; gap: .4rem; flex-wrap: nowrap; min-height: 3rem;
    padding: calc(env(safe-area-inset-top) + .55rem) max(1rem, env(safe-area-inset-right)) .6rem max(1rem, env(safe-area-inset-left)); }
  .topbar .brand { color: #fff; font-size: 1.05rem; }
  .topbar .brand span { color: #ffd8bf; }
  .backbtn { color: #fff; font-size: 1rem; min-height: 44px; margin-left: -.4rem; padding-right: .4rem; }
  .backbtn + .brand { display: none; }
  .signed-in .mainnav, .signed-in .tools .lang, .signed-in .tools .logout { display: none; }
  .signed-in .tools .cmdk-mini { color: #fff; }
  .signed-in .tools .cmdk-mini .icon { width: 1.35rem; height: 1.35rem; }
  .tools .lang button { border-color: rgba(255,255,255,.5); background: transparent; color: #fff; }
  .tools .lang button.on { background: #fff; color: var(--accent); }

  /* Bottom tab bar above the home indicator */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: color-mix(in srgb, var(--surface) 96%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: .3rem max(.3rem, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + .3rem) max(.3rem, env(safe-area-inset-left)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; text-decoration: none; color: var(--muted);
    font-size: .68rem; min-height: 44px; justify-content: center; }
  .tabbar svg { width: 1.55rem; height: 1.55rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active svg { stroke-width: 2.2; }
  .signed-in main { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
  .signed-in footer { display: none; }
  main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }

  /* Headings and page heads */
  h1 { font-size: 1.45rem; }
  .pagehead { flex-wrap: wrap; }
  .pagehead .search, .pagehead .search input { width: 100%; }
  .pagehead .search { margin-bottom: .8rem; }
  .dayhead { gap: .7rem; }
  .dayhead .button.small { display: none; }
  .navbtn { width: 2.75rem; height: 2.75rem; flex: none; }

  /* Habits on Today: control | name | streak | note, with a compact counter */
  .habit, .tile-cell .habit { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .6rem; padding: .55rem .7rem; }
  .tick { width: 2.75rem; height: 2.75rem; }
  .counter button[value=dec] { display: none; }
  .counter input { width: 3rem; padding: .45rem .2rem; }
  .counter button { min-width: 2.75rem; min-height: 2.75rem; font-size: 1.1rem; }
  .slip { min-height: 2.75rem; }
  .streak strong { font-size: 1rem; }
  .streak small { font-size: .7rem; }
  .hnote summary { min-width: 2rem; min-height: 2.75rem; display: grid; place-items: center; }

  /* Tasks: 44px checkboxes, list chips scroll sideways */
  .task { gap: .55rem; padding: .45rem .3rem; }
  .check { width: 1.9rem; height: 1.9rem; margin: .45rem; }
  .task .js-today button { min-height: 2.5rem; }
  .listnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: .5rem; }
  .listnav::-webkit-scrollbar { display: none; }
  .listnav a { white-space: nowrap; flex: none; }
  .quickadd button { min-height: 44px; }
  .quickadd input { min-height: 44px; }

  /* Habit page: two tiles per row */
  .tiles { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .tile strong { font-size: 1.35rem; }
  .month td { height: 2.6rem; }

  /* Forms and buttons */
  button, .button { min-height: 44px; }
  button.small, .button.small, .lang button { min-height: 36px; }
  .field ul label, .field > div > div label { min-height: 36px; }
  input[type=radio], input[type=checkbox] { width: 1.25rem; height: 1.25rem; }
  dialog.card { width: calc(100% - 2rem); }
}

/* Journal: the one thing, last night's top 3, the shutdown (v0.5.0) */
main.medium { max-width: 760px; }
.ritual-card .one-thing { display: flex; align-items: center; gap: .8rem; margin: .2rem 0 .4rem; font-size: 1.15rem; font-weight: 600; }
.ritual-card .one-thing .check { width: 2rem; height: 2rem; padding: 0; border-radius: 50%; border: 2px solid var(--accent); background: none;
  color: var(--accent-text); font-weight: 700; flex: none; display: inline-grid; place-items: center; }
.ritual-card .one-thing.done .check { background: var(--done); border-color: var(--done); color: #fff; }
.ritual-card .one-thing.done .text { color: var(--muted); text-decoration: line-through; }
.one-thing-change { margin: -.2rem 0 .3rem 2.8rem; }
.one-thing-set input { flex: 1; max-width: none !important; }
.pick-chips { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .6rem; }
.chip-btn { font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; background: var(--bg); }
.chip-btn.high { border-color: var(--danger); }
.top3 ol { margin: .2rem 0 .4rem; padding-left: 1.4rem; }
.top3 li.done a { text-decoration: line-through; color: var(--muted); }
.top3 .col-sub { margin-top: .8rem; }
.shutdown-cta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.shutdown-cta.evening { background: color-mix(in srgb, var(--accent) 8%, transparent); margin: .9rem -1.2rem -1.1rem; padding: .8rem 1.2rem; border-radius: 0 0 var(--radius) var(--radius); }
.reflection p { margin: .3rem 0; }
.center { text-align: center; }
.mood-win { display: flex; gap: .5rem; align-items: baseline; background: color-mix(in srgb, var(--partial) 14%, transparent); border-radius: 8px; padding: .5rem .7rem; margin: .5rem 0; font-size: .9rem; }
.shutdown-form { display: flex; flex-direction: column; gap: .5rem; }
.shutdown-form input[type=text] { width: 100%; }
.shutdown-form label.inline { display: flex; align-items: center; gap: .4rem; color: var(--muted); margin-bottom: .6rem; }
.shutdown-form label.inline input { width: auto; }
.top-pick { border: 0; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .3rem; }
.top-pick legend { margin-bottom: .4rem; }
.top-pick .pick { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.top-pick .pick:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.top-pick .pick.off { opacity: .45; cursor: default; }
.top-pick .pick input { width: auto; }
.top-pick .pick span:first-of-type { flex: 1; }
.badge.high { background: var(--danger); color: #fff; } .badge.overdue { color: var(--danger); }
.one-thing-sum { margin: .2rem 0 .6rem; }
.done-sum { list-style: none; padding: 0; margin: .6rem 0 0; color: var(--muted); columns: 2; font-size: .9rem; }
.win-list { list-style: none; padding: 0; margin: .3rem 0; }
.win-list li { display: flex; gap: .7rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.win-list li:last-child { border-bottom: 0; }
.win-list .d { width: 3.5rem; flex: none; font-variant-numeric: tabular-nums; }
.win-list .t { flex: 1; }
.add-win input { flex: 1; max-width: none !important; }
.add-win { margin-bottom: .4rem; }
.on-this-day { border-style: dashed; }
@media (max-width: 760px) { .done-sum { columns: 1; } }
.medium .tiles { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .medium .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .ritual-card .one-thing .check { width: 2.75rem; height: 2.75rem; min-width: 2.75rem; } .one-thing-change { margin-left: 3.5rem; } }

/* Goals and the weekly review (v0.6.0) */
.qnav { display: flex; align-items: center; gap: .6rem; }
.qnav h1 { margin: 0; }
.goal-bar { flex: 1; height: .5rem; border-radius: 999px; background: var(--line); overflow: hidden; min-width: 4rem; }
.goal-bar span { display: block; height: 100%; background: var(--c); border-radius: 999px; }
.goal-mini { list-style: none; padding: 0; margin: .2rem 0; display: flex; flex-direction: column; gap: .5rem; }
.goal-mini li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 2.8rem; gap: .6rem; align-items: center; }
.goal-mini li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-mini li .small { text-align: right; }
.week-focus { margin: .1rem 0 .7rem; padding: .5rem .7rem; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 8px 8px 0; }
.goal { border-left: 4px solid var(--c); }
.goal-overall { display: flex; align-items: center; gap: .8rem; margin: .6rem 0; }
.goal-overall .goal-bar { height: .7rem; }
.goal-parts { list-style: none; padding: 0; margin: .4rem 0; display: flex; flex-direction: column; gap: .2rem; }
.goalform .pick-list > div { max-height: 16rem; overflow: auto; flex-direction: column; flex-wrap: nowrap; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; margin: .6rem 0 .3rem; }
.wday { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.wday .bar { height: 4rem; width: 1.4rem; background: var(--bg); border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.wday .bar span { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 0 0; }
.mood-dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--line); }
.warn { color: var(--danger); font-weight: 600; }
.goal-score { border: 0; padding: 0; margin: 0 0 .6rem; }
.goal-score legend { margin-bottom: .3rem; }
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: .25rem; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: grid; place-items: center; height: 2.2rem; border: 1px solid var(--line); border-radius: 6px; font-variant-numeric: tabular-nums; }
.scale input:checked + span { background: var(--c); border-color: var(--c); color: #fff; font-weight: 700; }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 760px) { .scale span { height: 2.75rem; font-size: .85rem; } .scale { gap: .15rem; } }

/* Planner: time-boxing (v0.7.0) */
.plan-add input[type=text] { flex: 1; max-width: none !important; }
.plan-add input[type=time] { width: 7rem; flex: none; }
.plan-add select { width: auto; flex: none; }
.plan-hint { margin: 0 0 1rem; }
.dayhead h1.plain { text-transform: none; }
.plan-add { margin-bottom: .5rem; }
.dlg-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .8rem; }
@media (pointer: coarse) { .block, .plan-task { touch-action: auto; } .block .bact { display: none !important; } }
.planner-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.planner-grid .card { margin-bottom: 0; }
.planner-area { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.plan-side .col-sub { margin-top: 0; }
.plan-tasks { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.plan-task { display: flex; align-items: center; gap: .4rem; padding: .35rem .3rem .35rem .5rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; font-size: .9rem; }
.plan-task.high { border-left: 3px solid var(--danger); }
.plan-task .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-task .grip { color: var(--muted); font-size: .7rem; letter-spacing: -.1em; }
.drag-ghost { position: fixed; z-index: 50; pointer-events: none; opacity: .9; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.plan-sum { display: flex; flex-direction: column; gap: .2rem; padding: .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.plan-sum div { display: flex; justify-content: space-between; gap: .5rem; }
.timeline { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-left: 3rem; }
.timeline.drop { outline: 2px dashed var(--accent); outline-offset: 2px; }
.hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.hour span { position: absolute; left: -3rem; top: -.6rem; width: 2.6rem; text-align: right; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hour:first-child { border-top: 0; }
.now-line { position: absolute; left: -6px; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -2px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.lanes { position: absolute; inset: 0 6px 0 6px; }
.block { position: absolute; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-left: 4px solid var(--accent); padding: .2rem .45rem; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; z-index: 2; }
.block.has-task { background: color-mix(in srgb, #2563eb 10%, var(--surface)); border-color: color-mix(in srgb, #2563eb 40%, transparent); border-left-color: #2563eb; }
.block.now { box-shadow: 0 0 0 2px var(--danger); }
.block.past:not(.done) { opacity: .75; }
.block.done { opacity: .55; }
.block.done .btitle { text-decoration: line-through; }
.block.dragging { z-index: 10; box-shadow: 0 8px 20px rgba(0,0,0,.2); cursor: grabbing; }
.block:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.block .fill { position: absolute; left: 0; bottom: 0; width: 4px; margin-left: -4px; background: var(--done); }
.block .bhead { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.block .btime { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.block .bmeta { color: var(--muted); position: relative; }
.block .bact { position: absolute; top: .1rem; right: .1rem; display: none; gap: 0; background: var(--surface); border-radius: 6px; }
.block:hover .bact, .block:focus-within .bact { display: flex; }
.block .bact button { padding: .1rem .35rem; min-height: 0; min-width: 0; }
.block .resize { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.block .resize::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 24px; margin-left: -12px; height: 3px; border-radius: 2px; background: var(--line); }
.plan-now, .plan-next { margin: .2rem 0; }
.plan-now { padding: .4rem .6rem; border-left: 3px solid var(--danger); background: var(--bg); border-radius: 0 8px 8px 0; }
@media (max-width: 1100px) { .planner-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .planner-area { grid-template-columns: 1fr; }
  .plan-add { flex-wrap: wrap; }
  .plan-add input[type=text] { flex-basis: 100%; }
  .block .bact { display: flex; }
  .block .bact button { min-height: 2rem; min-width: 2rem; }
}

@media (max-width: 760px) {
  .tiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-cell { grid-column: span var(--pw); grid-row: span var(--ph); order: var(--po); }
  .tile-cell.hide-d { display: block; }
  .tile-cell.hide-p { display: none; }
  .tile-body { padding: .8rem .9rem; }
  .tile-resize { width: 34px; height: 34px; }
}

/* Coach (v0.9.0) */
.path-bar { height: .45rem; background: var(--line); border-radius: 999px; overflow: hidden; margin: .1rem 0 .7rem; }
.path-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, var(--accent)); border-radius: 999px; }
.path-bar.big { height: .7rem; }
.nudge { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .2rem .6rem; align-items: start; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.nudge:last-child { border-bottom: 0; }
.nudge-icon { font-size: 1.3rem; line-height: 1.4; }
.nudge-text { margin: .1rem 0; }
.nudge-acts { grid-column: 2; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.path { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-direction: column; gap: .2rem; }
.path li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .5rem .4rem; border-radius: 8px; }
.path li.next { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.path li.done { color: var(--muted); }
.path .mark { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); font-weight: 700; font-size: .85rem; }
.path li.done .mark { background: var(--done); border-color: var(--done); color: #fff; }
.path li.next .mark { border-color: var(--accent); color: var(--accent); }
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.insight { display: flex; gap: .6rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.insight p { margin: .2rem 0 0; font-size: .9rem; }
.insight.good { border-color: color-mix(in srgb, var(--done) 50%, transparent); }
.insight.look { border-color: color-mix(in srgb, var(--partial) 60%, transparent); }
@container (min-width: 700px) { .coach-card .nudge { grid-template-columns: 2rem minmax(0, 1fr) auto; } .coach-card .nudge-acts { grid-column: 3; } }

/* Coach with Claude (v0.10.0) */
pre.sent { white-space: pre-wrap; word-break: break-word; max-height: 24rem; overflow: auto; font-size: .78rem; background: var(--bg); padding: .7rem; border-radius: 8px; margin: .5rem 0 0; }
.coach-answer { font-size: 1.02rem; line-height: 1.6; }
.shutdown-form textarea { width: 100%; }

/* ---- v0.11: sidebar, command palette, module colours, page headers ---------------------------------------------- */
.sidebar { display: none; }
@media (min-width: 761px) {
  body.has-sidebar .topbar { display: none; }
  body.has-sidebar .shell { margin-left: var(--sidebar); transition: margin-left .2s var(--ease); }
  .sidebar { display: flex; flex-direction: column; gap: .35rem; position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20;
    padding: .9rem .7rem; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none;
    transition: width .2s var(--ease); }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 .3rem .5rem; }
  .sidebar .brand { display: flex; align-items: center; gap: .55rem; font-size: 1.08rem; }
  .logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #fb923c, var(--accent) 60%, #9a3412); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
    letter-spacing: -.04em; flex: none; }
  .side-toggle { padding: .3rem; color: var(--muted); }
  .cmdk-btn { justify-content: flex-start; width: 100%; margin: .1rem 0 .6rem; color: var(--muted); background: var(--surface-2);
    border-color: var(--line); font-weight: 450; }
  .cmdk-btn kbd { margin-left: auto; font-size: .68rem; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a, .side-foot a { display: flex; align-items: center; gap: .7rem; padding: .48rem .6rem; border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 520; transition: background-color .12s, color .12s; white-space: nowrap; }
  .side-nav a .icon, .side-foot a .icon { width: 1.25rem; height: 1.25rem; }
  .side-nav a:hover, .side-foot a:hover { background: var(--surface-2); color: var(--text); }
  .side-nav a.active { background: color-mix(in srgb, var(--mc, var(--accent)) 11%, transparent); color: var(--text); font-weight: 650; }
  .side-nav a.active .icon { color: var(--mc, var(--accent)); stroke-width: 2.1; }
  .side-group { margin: .9rem .6rem .25rem; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); opacity: .8; }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: .7rem; border-top: 1px solid var(--line); }
  .side-row { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .35rem .3rem 0; }
  .side-logout { padding: .4rem .5rem !important; }
  .side-logout .label { font-size: .85rem; }
  /* collapsed (and automatically on narrow desktops) */
  html.side-collapsed .sidebar { width: var(--sidebar-mini); }
  html.side-collapsed body.has-sidebar .shell { margin-left: var(--sidebar-mini); }
  html.side-collapsed .sidebar .label, html.side-collapsed .sidebar .brand-text, html.side-collapsed .side-group,
  html.side-collapsed .cmdk-btn kbd, html.side-collapsed .sidebar .lang { display: none; }
  html.side-collapsed .side-head { flex-direction: column; gap: .5rem; padding: 0 0 .4rem; }
  html.side-collapsed .side-nav a, html.side-collapsed .side-foot a, html.side-collapsed .cmdk-btn { justify-content: center; padding-left: 0; padding-right: 0; }
  html.side-collapsed .side-row { justify-content: center; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .sidebar { width: var(--sidebar-mini); }
  body.has-sidebar .shell { margin-left: var(--sidebar-mini); }
  .sidebar .label, .sidebar .brand-text, .side-group, .cmdk-btn kbd, .sidebar .lang, .side-toggle { display: none !important; }
  .side-nav a, .side-foot a, .cmdk-btn { justify-content: center; padding-left: 0 !important; padding-right: 0 !important; }
  .side-row { justify-content: center; }
}
.cmdk-mini { padding: .35rem .45rem; background: transparent; border-color: transparent; color: inherit; }
kbd { font: 600 .72rem var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem;
  background: var(--surface); color: var(--muted); }

/* module colours: nav icons and tile/page title chips */
.m-today { --mc: var(--m-today); } .m-plan { --mc: var(--m-plan); } .m-tasks { --mc: var(--m-tasks); } .m-habits { --mc: var(--m-habits); }
.m-goals { --mc: var(--m-goals); } .m-journal { --mc: var(--m-journal); } .m-coach { --mc: var(--m-coach); } .m-mood { --mc: var(--m-mood); }
.m-focus { --mc: var(--m-focus); } .m-stats { --mc: var(--m-stats); } .m-notes { --mc: var(--m-notes); }
.icon.chip { width: 1.75rem; height: 1.75rem; padding: .32rem; border-radius: 9px; color: var(--mc, var(--accent));
  background: color-mix(in srgb, var(--mc, var(--accent)) 13%, transparent); vertical-align: middle; margin-right: .45rem; stroke-width: 2; }
h1 .icon.chip { width: 2.2rem; height: 2.2rem; padding: .42rem; border-radius: 11px; margin-right: .6rem; vertical-align: -.35em; }
.cardhead h2, h2.with-chip { display: flex; align-items: center; }

/* command palette */
dialog.cmdk { padding: 0; border: 0; background: transparent; width: min(640px, calc(100vw - 2rem)); max-height: 70vh; margin: 12vh auto auto; overflow: visible; }
dialog.cmdk::backdrop { background: rgba(20, 18, 15, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.cmdk[open] .cmdk-box { animation: cmdk-in .16s var(--ease); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.cmdk-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmdk-input { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.cmdk-input .icon { color: var(--muted); width: 1.3rem; height: 1.3rem; }
.cmdk-input input { border: 0; background: none; padding: 0; font-size: 1.05rem; box-shadow: none !important; }
.cmdk-list { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; }
.cmdk-group { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .55rem .6rem .25rem; }
.cmdk-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 10px; cursor: pointer; }
.cmdk-item .icon { color: var(--muted); width: 1.2rem; height: 1.2rem; }
.cmdk-item.on { background: var(--accent-soft); }
.cmdk-item.on .icon { color: var(--accent); }
.cmdk-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-empty { padding: 1rem; color: var(--muted); }
.cmdk-foot { margin: 0; padding: .5rem 1rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); background: var(--surface-2); }

/* tiles and cards: a touch of depth on hover; tile titles align with chips */
.tile-cell { transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.tile-cell:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.arranging .tile-cell:hover { box-shadow: none; }
.col-title { display: flex; align-items: center; font-size: 1.02rem; font-weight: 650; text-transform: none; letter-spacing: -.005em; color: var(--text); }
.cardhead > a, .linkpill { transition: border-color .12s, color .12s, background-color .12s; }

/* checkboxes and the one-thing tick animate */
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.task.done .check, .one-thing.done .check, .habit .done { animation: pop .25s var(--ease); }

/* ---- v0.12: toasts, Now strip, quick capture, plan drop zones -------------------------------------------------- */
.toasts { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .8rem; padding: .6rem .7rem .6rem 1rem; border-radius: 12px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lift); font-size: .9rem; max-width: min(92vw, 520px); animation: toast-in .2s var(--ease); transition: opacity .35s, transform .35s; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { color: var(--accent); border-color: transparent; font-weight: 700; }
.toast button:hover { background: rgba(255, 255, 255, .08); }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .toasts { bottom: calc(5.4rem + env(safe-area-inset-bottom)); } }
.confetti { position: fixed; left: 50%; top: 40%; width: 0; height: 0; z-index: 70; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: confetti 1.2s var(--ease) forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 260px)) rotate(var(--r)); } }
.now-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.2rem; align-items: center; margin: 0 0 1.2rem; padding: 1rem 1.25rem;
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--m-today) 14%, var(--surface)) 0%, var(--surface) 55%); }
.now-strip.phase-evening { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--m-journal) 18%, var(--surface)) 0%, var(--surface) 55%); }
.now-clock { display: flex; flex-direction: column; min-width: 8.5rem; }
.now-time { font-size: 2.3rem; font-weight: 750; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.now-phase { color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.now-day { height: .3rem; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.now-day span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, var(--accent), var(--m-journal)); border-radius: 999px; transition: width .6s var(--ease); }
.now-items { display: flex; gap: 1.4rem; flex-wrap: wrap; min-width: 0; }
.now-item { display: flex; align-items: center; min-width: 0; max-width: 22rem; color: inherit; }
.now-item > div { display: flex; flex-direction: column; min-width: 0; }
.now-k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.now-v { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.now-v.done { text-decoration: line-through; color: var(--muted); }
.now-cta .button, .now-cta button { white-space: nowrap; }
.now-closed { color: var(--muted); font-weight: 600; display: inline-flex; gap: .4rem; align-items: center; }
@media (max-width: 900px) { .now-strip { grid-template-columns: 1fr; gap: .8rem; } .now-items { gap: .8rem 1.2rem; } }
@media (max-width: 760px) { .now-time { font-size: 1.9rem; } .now-clock { flex-direction: row; align-items: baseline; gap: .6rem; flex-wrap: wrap; } .now-day { flex-basis: 100%; } }
.drop-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .35rem; margin-top: .7rem; }
.slot { display: flex; flex-direction: column; padding: .35rem .5rem; border: 1px dashed var(--line-strong); border-radius: 9px; font-size: .78rem;
  transition: background-color .12s, border-color .12s, transform .12s; min-width: 0; }
.slot .st { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot .sl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.taken { border-style: solid; background: color-mix(in srgb, var(--m-plan) 10%, transparent); border-color: color-mix(in srgb, var(--m-plan) 35%, transparent); }
.slot.taken .sl { color: var(--text); }
body.dragging-task .slot:not(.taken) { border-color: var(--m-plan); }
.slot.over { background: color-mix(in srgb, var(--m-plan) 18%, transparent); transform: scale(1.04); border-style: solid; }
.drop-hint { margin: .4rem 0 0; }
@media (hover: none) { .drop-hint { display: none; } }
#tiles-grid li.task[draggable="true"] { cursor: grab; }
.fab, .sheet { display: none; }
@media (max-width: 760px) {
  .signed-in .fab { display: grid; place-items: center; position: fixed; right: 1rem; bottom: calc(4.9rem + env(safe-area-inset-bottom)); z-index: 15;
    width: 3.4rem; height: 3.4rem; border-radius: 50%; padding: 0; border: 0; color: #fff;
    background: linear-gradient(135deg, #fb923c, var(--accent)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent); }
  .fab .icon { width: 1.6rem; height: 1.6rem; stroke-width: 2.4; }
  dialog.sheet[open] { display: flex; flex-direction: column; gap: 1rem; position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none;
    border: 0; border-radius: 20px 20px 0 0; padding: .6rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); background: var(--surface);
    color: var(--text); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); animation: sheet-in .22s var(--ease); }
  dialog.sheet::backdrop { background: rgba(20, 18, 15, .4); }
  .sheet-grip { width: 2.6rem; height: .3rem; border-radius: 999px; background: var(--line-strong); margin: 0 auto .2rem; }
  .sheet-row label:first-child { display: flex; align-items: center; gap: .4rem; }
  .sheet .row.grow input { flex: 1; max-width: none !important; }
  .mood-quick { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
  .mq { padding: .6rem 0; font-weight: 700; font-variant-numeric: tabular-nums; color: #1c1b19; border: 0;
    background: hsl(calc(60 + var(--v) * 12) 70% 55%); }
  .sheet-close { align-self: center; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

/* ---- v0.13: Insights ------------------------------------------------------------------------------------------- */
main.wide { max-width: 1240px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a { padding: .32rem .8rem; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .9rem; margin: 1rem 0 1.4rem; }
.kpi { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.kpi:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); color: inherit; }
.kpi-head { display: flex; align-items: center; }
.kpi-head .icon.chip { width: 1.55rem; height: 1.55rem; padding: .28rem; }
.kpi-label { font-size: .8rem; font-weight: 650; color: var(--muted); }
.kpi-value { font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: .78rem; font-weight: 700; color: var(--muted); }
.kpi-delta.up { color: var(--done); } .kpi-delta.down { color: var(--danger); }
.kpi[class*="m-tasks"] .kpi-delta.up, .kpi .kpi-delta { font-variant-numeric: tabular-nums; }
.spark-mini { width: 100%; height: 32px; margin-top: .2rem; }
.spark-mini rect { fill: color-mix(in srgb, var(--mc, var(--accent)) 55%, transparent); }
.spark-mini path { fill: none; stroke: var(--mc, var(--accent)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-mini .zero { stroke: var(--line-strong); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.chart-grid > .card { margin: 0; }
.chart { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 160px; overflow: visible; }
.chart .b { fill: color-mix(in srgb, var(--mc, var(--accent)) 70%, transparent); transition: fill .15s; }
.chart .l { fill: none; stroke: var(--mc, var(--accent)); stroke-width: 2.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .d { fill: var(--surface); stroke: var(--mc, var(--accent)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .zero { stroke: var(--line-strong); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart .guide { stroke: var(--muted); stroke-width: 1; opacity: 0; vector-effect: non-scaling-stroke; }
.chart .guide.on { opacity: .5; }
.chart-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .3rem; }
.chart-tip { position: absolute; top: -.4rem; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); border-radius: 8px;
  padding: .3rem .55rem; font-size: .78rem; display: flex; flex-direction: column; align-items: center; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lift); }
.chart-tip strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.chart.is-empty svg { opacity: .35; }
.section-title { margin: 2rem 0 .6rem; font-size: 1.2rem; }
@media (max-width: 760px) { .chart-grid { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } .kpi-value { font-size: 1.45rem; } }
.tile-spark { margin: .6rem 0 .2rem; }
.tile-spark .spark-mini { height: 28px; }
.title-spark { margin-left: auto; width: 110px; display: inline-flex; }
.title-spark .spark-mini { height: 22px; margin: 0; }

/* ---- Notes (v0.14) ------------------------------------------------------------------------------------------------ */
main.notes-page { max-width: 1440px; }
.notes-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.notes-layout.with-aside { grid-template-columns: 232px minmax(0, 1fr) 220px; }
.notes-side { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .35rem; max-height: calc(100vh - 2rem); overflow-y: auto; padding-right: .25rem; scrollbar-width: thin; }
.notes-search { position: relative; margin-bottom: .4rem; }
.notes-search .icon { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.notes-search input { padding-left: 2rem; }
.shelf-nav { display: flex; flex-direction: column; gap: 1px; }
.shelf-nav a, .shelf-tree a { display: flex; align-items: center; gap: .55rem; padding: .32rem .55rem; border-radius: var(--radius-xs); color: var(--text); text-decoration: none; font-size: .9rem; min-width: 0; }
.shelf-nav a span:not(.em), .shelf-tree a span:not(.em) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-nav a:hover, .shelf-tree a:hover { background: var(--surface); }
.shelf-nav a.on, .shelf-tree a.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--m-notes); font-weight: 600; }
.shelf-nav .icon { width: 17px; height: 17px; color: var(--muted); flex: none; }
.shelf-nav .em, .shelf-tree .em { width: 17px; text-align: center; flex: none; font-size: .95rem; }
.count { margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--line); border-radius: 999px; padding: 0 .45rem; }
.side-label { margin: .9rem .55rem .2rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.shelf-tree { list-style: none; margin: 0; padding: 0; }
.shelf-tree li { padding-left: calc((var(--d) - 1) * .95rem); }
.shelf-tree .linked { color: var(--m-goals); font-size: .75rem; }
.shelf-add summary { cursor: pointer; color: var(--muted); font-size: .85rem; padding: .3rem .55rem; list-style: none; display: flex; align-items: center; gap: .4rem; }
.shelf-add summary .icon { width: 15px; height: 15px; }
.shelf-add form { display: grid; gap: .4rem; padding: .3rem .2rem .6rem; }
.shelf-add .row { gap: .4rem; flex-wrap: nowrap; }
.emoji-in { width: 3.2rem !important; text-align: center; flex: none; }
.shelf-nav.foot { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem .3rem; }
a.tag, .tag { font-size: .78rem; color: var(--m-notes); text-decoration: none; background: color-mix(in srgb, var(--m-notes) 12%, transparent); border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
a.tag:hover, a.tag.on { background: color-mix(in srgb, var(--m-notes) 24%, transparent); color: var(--text); }
.tag small { margin-left: .3rem; color: var(--muted); }
.notes-main { min-width: 0; }
.notes-main h1 .crumbs { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); }
.notes-main h1 .crumbs a { color: var(--muted); text-decoration: none; }
.seed-form { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--m-notes) 55%, var(--line)); border-radius: var(--radius); padding: .4rem .5rem .4rem .8rem; margin: .9rem 0 1rem; }
.seed-form input { border: 0; background: none; box-shadow: none !important; padding-left: .2rem; }
.seed-form.compact { margin: .3rem 0 .6rem; padding: .15rem .2rem .15rem .5rem; }
.ripeness-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.ripeness-bar a { display: flex; align-items: baseline; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.ripeness-bar strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ripeness-bar span:last-child { color: var(--muted); font-size: .85rem; }
.ripeness-bar .em { font-size: 1.2rem; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.week-strip a { display: flex; flex-direction: column; align-items: center; padding: .45rem 0 .35rem; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .75rem; }
.week-strip a strong { font-size: 1.1rem; color: var(--text); }
.week-strip a i { width: 6px; height: 6px; border-radius: 50%; margin-top: .2rem; background: var(--line); }
.week-strip a.written i { background: var(--m-notes); }
.week-strip a.today { border-color: var(--m-notes); box-shadow: inset 0 0 0 1px var(--m-notes); }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list li + li { border-top: 1px solid var(--line); }
.note-list li.empty { padding: 1rem 0; text-align: center; }
.note-list a { display: flex; gap: .75rem; padding: .7rem .3rem; text-decoration: none; color: var(--text); border-radius: var(--radius-xs); }
.note-list a:hover { background: var(--surface-2); }
.note-list .ripe { font-size: 1.1rem; line-height: 1.4; }
.nl-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.nl-prev { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nl-prev mark { background: color-mix(in srgb, var(--m-notes) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 .1rem; }
.nl-meta { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .75rem; color: var(--muted); align-items: center; }
.shelf-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.shelf-card { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; text-decoration: none; color: var(--text); }
.shelf-card small { margin-left: auto; color: var(--muted); }
.shelf-links { display: flex; gap: .5rem; flex-wrap: wrap; margin: .2rem 0 0; }

/* the editor */
.note-editor { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.5rem 1.25rem; box-shadow: var(--shadow); min-height: 70vh; }
.note-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.note-bar .crumbs { margin: 0; font-size: .82rem; color: var(--muted); }
.note-bar .crumbs a { color: var(--muted); text-decoration: none; }
.note-bar .crumbs a:hover { color: var(--text); }
.note-tools { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.note-tools form { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: .28rem .6rem; font-size: .8rem; background: var(--surface); color: var(--muted); display: inline-flex; gap: .3rem; align-items: center; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: color-mix(in srgb, var(--m-notes) 16%, var(--surface)); color: var(--text); font-weight: 650; }
.seg.ripeness button span { display: none; }
.seg.ripeness button.on span { display: inline; }
.shelf-pick select { padding: .28rem .5rem; font-size: .8rem; width: auto; max-width: 180px; }
button.ghost.on { background: color-mix(in srgb, var(--m-notes) 16%, transparent); }
input.note-title { font-size: 1.85rem; line-height: 1.25; font-weight: 750; letter-spacing: -.02em; border: 0 !important; background: none !important; box-shadow: none !important; padding: .2rem 0 .3rem; }
.note-title::placeholder { color: var(--line-strong); }
.day-head { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .4rem; }
.day-head h1 { margin: 0; font-size: 1.6rem; flex: 1; }
.day-sum { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; }
.ds { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.ds .icon { width: 14px; height: 14px; color: var(--muted); }
.ds.ok { border-color: var(--done); } .ds.win { border-color: color-mix(in srgb, var(--m-goals) 60%, var(--line)); }
.md-toolbar { display: flex; gap: .15rem; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .25rem 0; margin-bottom: .75rem; position: sticky; top: 0; background: var(--surface); z-index: 3; }
.md-toolbar button { border: 0; background: none; padding: .25rem .5rem; font-size: .85rem; color: var(--muted); border-radius: var(--radius-xs); min-width: 2rem; }
.md-toolbar button:hover { background: var(--surface-2); color: var(--text); }
.md-toolbar .grow { flex: 1; }
.note-editor:not(.writing) .md-toolbar { display: none; }
.md-help { position: relative; }
.md-help summary { list-style: none; cursor: pointer; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.md-help-box { position: absolute; right: 0; top: 2.1rem; width: min(380px, 80vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: .6rem .9rem; font-size: .85rem; z-index: 6; }
.md-help-box p { margin: .35rem 0; }
.note-panes { display: grid; gap: 1.5rem; }
.note-panes[data-mode="split"] { grid-template-columns: 1fr 1fr; }
.note-panes[data-mode="write"] .pane-read, .note-panes[data-mode="read"] .pane-write { display: none; }
.pane-write textarea { width: 100%; min-height: 320px; resize: none; overflow: hidden; border: 0; background: none; box-shadow: none !important; padding: 0;
  font: 15px/1.7 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; tab-size: 4; }
.note-panes[data-mode="split"] .pane-write { border-right: 1px solid var(--line); padding-right: 1.5rem; }
.note-panes[data-mode="split"] .pane-read { max-height: none; }
.note-status { margin: 1rem 0 0; font-size: .75rem; color: var(--muted); text-align: right; }
.banner { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border-radius: var(--radius-sm); padding: .5rem .8rem; margin-bottom: .6rem; font-size: .9rem; }
.banner form { margin: 0; }

/* rendered markdown */
.md { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3 { line-height: 1.25; margin: 1.4em 0 .5em; letter-spacing: -.01em; scroll-margin-top: 4rem; }
.md h1 { font-size: 1.5rem; } .md h2 { font-size: 1.25rem; } .md h3 { font-size: 1.08rem; }
.md p { margin: .6em 0; }
.md ul, .md ol { padding-left: 1.4rem; margin: .5em 0; }
.md li { margin: .15em 0; }
.md li.task-item { list-style: none; margin-left: -1.3rem; }
.md li.task-item > p { margin: 0; }
.md input.box { width: 1.05rem; height: 1.05rem; margin: 0 .45rem 0 0; vertical-align: -.15rem; accent-color: var(--m-notes); cursor: pointer; }
.md li.task-item:has(> input.box:checked), .md li.task-item:has(> p > input.box:checked) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.md blockquote { margin: .8em 0; padding: .1em 1em; border-left: 3px solid var(--m-notes); color: var(--muted); background: var(--surface-2); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.md code { font: .88em ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: .05em .3em; }
.md pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem 1rem; overflow-x: auto; }
.md pre code { border: 0; background: none; padding: 0; }
.md table { border-collapse: collapse; margin: .8em 0; font-size: .92rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: .35rem .6rem; }
.md th { background: var(--surface-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.md a { color: var(--accent); }
.md a.tag { color: var(--m-notes); text-decoration: none; font-size: .85em; }
.md a.wl { color: var(--m-notes); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--m-notes) 45%, transparent); font-weight: 550; }
.md a.wl:hover { border-bottom-color: var(--m-notes); }
.md a.wl.new { color: var(--muted); border-bottom-style: dashed; font-weight: 450; }
.md a.wl.day::before { content: "📅 "; font-size: .85em; }
.ref { display: inline-flex; align-items: center; gap: .35rem; padding: .02rem .55rem .02rem .3rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2);
  font-size: .88em; line-height: 1.6; text-decoration: none !important; color: var(--text) !important; vertical-align: baseline; white-space: nowrap; max-width: 100%; }
.ref a { color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.ref small { color: var(--muted); font-size: .85em; }
.ref-task { border-color: color-mix(in srgb, var(--m-tasks) 50%, var(--line)); }
.ref-task.done a { text-decoration: line-through; color: var(--muted); }
.ref-check { width: 1.05rem; height: 1.05rem; padding: 0; border-radius: 50%; border: 1.5px solid var(--m-tasks); background: var(--surface); font-size: .7rem; line-height: 1; color: #fff; display: grid; place-items: center; }
.ref-task.done .ref-check { background: var(--m-tasks); }
.ref-habit { border-color: color-mix(in srgb, var(--m-habits) 50%, var(--line)); padding-left: .55rem; }
.ref-dot { width: .55rem; height: .55rem; border-radius: 50%; border: 1.5px solid var(--m-habits); }
.ref-habit.on .ref-dot { background: var(--m-habits); }
.ref-goal { border-color: color-mix(in srgb, var(--m-goals) 55%, var(--line)); padding-left: .55rem; }
.ref-goal progress { width: 3.2rem; height: .4rem; accent-color: var(--m-goals); }
.ref.missing { text-decoration: line-through !important; color: var(--muted) !important; border-style: dashed; padding-left: .55rem; }
button.promote { padding: 0 .45rem; font-size: .72rem; border-radius: 999px; color: var(--muted); border-color: var(--line); opacity: 0; transition: opacity .15s; vertical-align: 1px; }
.md li.task-item:hover button.promote, button.promote:focus-visible { opacity: 1; }
@media (hover: none) { button.promote { opacity: .8; } }
.empty-hint { font-style: italic; }
.ac-pop { position: absolute; z-index: 20; min-width: 220px; max-width: 360px; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: .25rem; }
.ac-item { padding: .35rem .6rem; border-radius: var(--radius-xs); font-size: .88rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item.on { background: color-mix(in srgb, var(--m-notes) 18%, transparent); }

/* side panel of a note */
.note-aside { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1.2rem; font-size: .88rem; }
.note-aside h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .4rem; }
.outline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.outline li a { display: block; padding: .15rem .6rem; color: var(--muted); text-decoration: none; }
.outline li a:hover { color: var(--text); }
.outline li.lv2 a { padding-left: 1.1rem; } .outline li.lv3 a { padding-left: 1.6rem; font-size: .82rem; }
.backlink { display: flex; gap: .4rem; padding: .3rem .4rem; border-radius: var(--radius-xs); color: var(--text); text-decoration: none; }
.backlink:hover { background: var(--surface); }
.note-facts form { margin-top: .4rem; }

/* tile, mentions */
.notes-mini { list-style: none; margin: .2rem 0 .6rem; padding: 0; }
.notes-mini li a { display: flex; gap: .45rem; padding: .22rem 0; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-mini li a:hover { color: var(--m-notes); }
.cmdk-sub { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }

@media (max-width: 1180px) {
  .notes-layout.with-aside { grid-template-columns: 210px minmax(0, 1fr); }
  .note-aside { grid-column: 2; position: static; flex-direction: row; flex-wrap: wrap; gap: 1.5rem; }
}
@media (max-width: 900px) {
  .notes-layout, .notes-layout.with-aside { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
  .note-aside { grid-column: 1; }
  .notes-side { position: static; max-height: none; overflow: visible; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .3rem; padding-bottom: .3rem; scrollbar-width: none; }
  .notes-search { flex: 0 0 9.5rem; margin: 0; }
  .shelf-nav, .shelf-tree { flex-direction: row; display: flex; flex: none; gap: .3rem; }
  .shelf-nav a, .shelf-tree a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
  .shelf-tree li { padding: 0; }
  .notes-side .side-label, .notes-side .tag-cloud, .shelf-add, .shelf-nav.foot { display: none; }
  .note-editor { padding: .8rem 1rem 1rem; border-radius: var(--radius-sm); }
  .note-title { font-size: 1.45rem; }
  .ripeness-bar a { padding: .55rem .7rem; flex-wrap: wrap; }
  .modes button[data-mode="split"] { display: none; }
}
@media (max-width: 640px) {
  .seg button { min-height: 38px; }
  button.promote, button.ref-check, .md-toolbar button, .md-help summary { min-height: 0; }
  .note-tools { gap: .3rem; }
  .shelf-pick select { max-width: 140px; }
}

/* ---- Guide (v0.15) ------------------------------------------------------------------------------------------------ */
main.guide-page { max-width: 1320px; }
.guide-hero { text-align: center; padding: 1.5rem 0 1.25rem; }
.guide-hero h1 { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 .3rem; font-size: 2rem; }
.guide-hero > p { margin: 0 auto 1rem; max-width: 52ch; }
.guide-search { position: relative; max-width: 520px; margin: 0 auto; }
.guide-search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.guide-search input { padding-left: 2.4rem; border-radius: 999px; }
.guide-search.small { margin: .2rem 0 .6rem; }
.guide-search.small input { padding: .4rem .6rem .4rem 2.1rem; font-size: .88rem; }
.guide-search.small .icon { width: 15px; height: 15px; left: .65rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; margin-top: 1rem; }
.guide-card { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s; border-top: 3px solid var(--mc, var(--line-strong)); }
.guide-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--mc, var(--muted)); }
.guide-card.first { grid-column: 1 / -1; background: linear-gradient(120deg, var(--accent-soft), var(--surface) 60%); }
.guide-card strong { font-size: 1.05rem; }
.gicon { width: 2.1rem; height: 2.1rem; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--mc, var(--muted)) 14%, transparent); color: var(--mc, var(--muted)); flex: none; }
.gicon .icon { width: 1.15rem; height: 1.15rem; }
.guide-hits { list-style: none; margin: 0; padding: 0; }
.guide-hits li + li { border-top: 1px solid var(--line); }
.guide-hits a { display: flex; gap: .8rem; padding: .7rem .2rem; text-decoration: none; color: var(--text); }
.guide-hits a > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.guide-hits mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; }
.guide-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 200px; gap: 1.5rem; align-items: start; }
.guide-toc { position: sticky; top: 1rem; }
.guide-home { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; padding: .3rem .5rem; }
.guide-home .icon { width: 18px; height: 18px; color: var(--accent); }
.guide-toc ol { list-style: none; margin: 0; padding: 0; }
.guide-toc ol a { display: flex; align-items: center; gap: .55rem; padding: .32rem .55rem; border-radius: var(--radius-xs); color: var(--text); text-decoration: none; font-size: .9rem; }
.guide-toc ol a .icon { width: 16px; height: 16px; color: var(--mc, var(--muted)); flex: none; }
.guide-toc ol a:hover { background: var(--surface); }
.guide-toc ol a.on { background: var(--surface); font-weight: 650; box-shadow: inset 3px 0 0 var(--mc, var(--accent)); }
.guide-article { padding: 1.5rem 2rem 1.25rem; max-width: 760px; }
.guide-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.guide-head h1 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: 1.75rem; }
.guide-body { font-size: 1rem; }
.guide-body h2 { padding-top: .2rem; }
.guide-body h2::before { content: ""; display: inline-block; width: .45rem; height: .45rem; border-radius: 2px; background: var(--mc, var(--accent)); margin-right: .55rem; vertical-align: .2em; }
.guide-body table { display: table; width: 100%; }
.guide-body code { white-space: nowrap; }
.guide-pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.guide-pager a { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); padding: .5rem .7rem; border-radius: var(--radius-sm); border: 1px solid var(--line); max-width: 48%; }
.guide-pager a:hover { border-color: var(--muted); }
.guide-pager a span { display: flex; flex-direction: column; }
.guide-pager .next { text-align: right; margin-left: auto; }
.guide-pager small { color: var(--muted); font-size: .72rem; }
.guide-pager .icon { width: 18px; height: 18px; flex: none; }
.guide-outline { position: sticky; top: 1rem; font-size: .88rem; }
.guide-outline h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .4rem 0 .5rem; }
@media (max-width: 1180px) { .guide-layout { grid-template-columns: 210px minmax(0, 1fr); } .guide-outline { display: none; } }
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-toc { position: static; }
  .guide-toc ol { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
  .guide-toc ol a { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
  .guide-article { padding: 1.1rem 1rem; }
  .guide-head h1 { font-size: 1.4rem; }
  .guide-body code { white-space: normal; }
  .guide-card.first { grid-column: auto; }
}
