/* VOICE everyday, warm and premium: a few calm minutes people look forward to
   IDEA the Lamplit Street: the hub is one street at dusk, each journal is the inside of one shop
   PICTURE drawn shopfronts and lamp posts on the street; inside a journal, the page of the day and its picture of days done
   COLOUR night, paper, ink, lamp, ember, sea; each world brings its own deep, accent, second, cream and tint
   TYPE Young Serif display + Onest text + Caveat handwriting; each world adds one display face of its own
   LAYOUT laptop: title left, facts right, the street full width under them; phone: title, street, actions stacked */

/* Tokens are written up in DESIGN.md. mech.css (activities) reads the legacy names kept at the end of :root. */

@font-face { font-family: 'Young Serif'; src: url('../fonts/YoungSerif-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Onest'; src: url('../fonts/Onest-400.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../fonts/Caveat-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* ================= 1. Tokens ================= */
:root {
  /* colour roles */
  --night: #0F232B; --night-2: #14282F; --night-3: #1C343C;
  --paper: #F6F1E8; --paper-2: #EDE5D7; --card: #FFFDF9;
  --line: #DDD5C8; --line-2: #C2B7A6;
  --ink: #1E2A2E; --mute: #4F5D61;
  --lamp: #F5D06B; --ember: #F2A65A; --sea: #5FB3A8;
  --ok: #3E6B35; --warn: #8A5A12; --err: #A53A2A; --info: #244A86;
  --ok-bg: #E3EEDD; --warn-bg: #FBF0D9; --err-bg: #FCE3DC; --info-bg: #E2EAF6;
  --care-bg: #FBE7E4; --care-ink: #5A1F17;
  --ring: var(--ink);
  --on-night: #F6F1E8; --on-night-mute: #C3CEC9;

  /* the world in use (the hub default is the Harbor's colours) */
  --wa: #F0763C; --wb: #8FC1B5; --wd: #1F3A5F; --wc: #F3E6CF; --wbg: #E7F0F0; --wink: #14263D;
  --wf: var(--serif); --ww: 400; --wt: none; --wl: -.015em;

  /* type */
  --serif: 'Young Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --t-xs: 13px; --t-s: 15px; --t-m: 17px; --t-l: 20px;
  --t-xl: clamp(24px, 2.3vw, 28px); --t-2xl: clamp(30px, 3.4vw, 40px);
  --t-3xl: clamp(38px, 5vw, 58px); --t-4xl: clamp(46px, 7.2vw, 84px);

  /* space, shape, depth */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --r-xs: 6px; --r-s: 10px; --r-m: 10px; --r: 16px; --r-l: 24px;
  --sh-1: 0 1px 2px rgba(15,35,43,.06), 0 8px 24px -10px rgba(15,35,43,.22);
  --sh-2: 0 24px 64px -16px rgba(9,20,24,.45);
  --gut: max(5vw, 16px, env(safe-area-inset-left, 0px));
  --gutr: max(5vw, 16px, env(safe-area-inset-right, 0px));

  /* motion: one signature curve, three durations */
  --e-sig: cubic-bezier(.2,.7,.1,1);
  --e-out: var(--e-sig); --e-inout: cubic-bezier(.45,0,.2,1); --e-in: cubic-bezier(.5,0,.9,.4); --e-back: cubic-bezier(.3,1.5,.55,1);
  --d1: 160ms; --d2: 360ms; --d3: 560ms;

  /* legacy names read by mech.css and older markup */
  --night2: var(--night-2); --night3: var(--night-3);
  --card2: #FBF8F2; --slab: #E3D9CA;
  --s1: #216560; --s2: #244A86; --s3: #A07424; --s3p: #FBF3E2; --s4: #3E6138; --s5: #80502E; --s6: #387D78; --s7: #99442E; --s8: #6B4E8E; --s8b: #EFD5C9;
  --t-or: var(--ember); --t-orl: #F9DBBD; --t-ye: var(--lamp); --t-yel: #FBEDBF; --t-wh: #FFFDF8; --t-te: var(--sea); --t-tel: #D3ECE7;
  --gold: #E2B33C; --leaf: #6E9F5D; --daysbar: #E3EEDD;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10201F; --paper-2: #142725; --card: #182A2E; --line: #2E4549; --line-2: #46605F;
    --ink: #EFE8DC; --mute: #B9C2BE;
    --ok: #9CCB8E; --warn: #E8BF6F; --err: #F09A87; --info: #9DB8EA;
    --ok-bg: #1E3324; --warn-bg: #33291A; --err-bg: #3A1F1A; --info-bg: #1B2A44;
    --care-bg: #3A1F1A; --care-ink: #F6D3CC;
    --ring: var(--lamp);
    --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -10px rgba(0,0,0,.6);
    --card2: #1D3136; --slab: #0B1719; --s3p: #2B2617; --daysbar: #22352B; --s8b: #2E2433;
    --t-orl: #3A2C1E; --t-yel: #39321A; --t-wh: #1D3136; --t-tel: #193A36;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10201F; --paper-2: #142725; --card: #182A2E; --line: #2E4549; --line-2: #46605F;
  --ink: #EFE8DC; --mute: #B9C2BE;
  --ok: #9CCB8E; --warn: #E8BF6F; --err: #F09A87; --info: #9DB8EA;
  --ok-bg: #1E3324; --warn-bg: #33291A; --err-bg: #3A1F1A; --info-bg: #1B2A44;
  --care-bg: #3A1F1A; --care-ink: #F6D3CC;
  --ring: var(--lamp);
  --sh-1: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -10px rgba(0,0,0,.6);
  --card2: #1D3136; --slab: #0B1719; --s3p: #2B2617; --daysbar: #22352B; --s8b: #2E2433;
  --t-orl: #3A2C1E; --t-yel: #39321A; --t-wh: #1D3136; --t-tel: #193A36;
  color-scheme: dark;
}

/* focus ring colour follows the ground it sits on */
.night, .hero, .top, .foot, .path, .whero, .wbr, .jhead, .whead, .libhead, .keepband, #toast { --ring: var(--lamp); }
.japp, .tgroup, .phero, .board-head, .prompt-card { --ring: var(--wd); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .japp { --ring: var(--lamp); } }
:root[data-theme="dark"] .japp { --ring: var(--lamp); }
.japp .jhead { --ring: var(--lamp); }

/* world-coloured text and marks on paper: the deep colour by day, a lifted accent at night */
:root, [style*="--wd"] { --wtx: var(--wd); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]), :root:not([data-theme="light"]) [style*="--wd"] { --wtx: color-mix(in srgb, var(--wa) 70%, #FFF5E6); } }
:root[data-theme="dark"], :root[data-theme="dark"] [style*="--wd"] { --wtx: color-mix(in srgb, var(--wa) 70%, #FFF5E6); }

/* ================= 2. Base ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: env(safe-area-inset-top, 0px); background: var(--night); z-index: 60; }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, h5 { font-family: var(--serif); font-weight: 400; line-height: 1.1; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--lamp); color: #1E2A2E; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 99; background: var(--lamp); color: #1E2A2E; padding: 10px 16px; border-radius: var(--r-s); font-weight: 600; text-decoration: none; transition: top var(--d1) var(--e-sig); }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 8px); }
main { display: block; min-height: 70vh; }
main:focus { outline: none; }

/* ================= 3. Layout and type helpers ================= */
.wrap { width: 100%; max-width: calc(1240px + var(--gut) + var(--gutr)); margin-inline: auto; padding-left: var(--gut); padding-right: var(--gutr); }
.wrap.narrow { max-width: calc(720px + var(--gut) + var(--gutr)); }
.narrow { max-width: 720px; margin-inline: auto; }
.band { padding-block: clamp(48px, 7vw, 96px); }
.band.tight { padding-block: clamp(20px, 3vw, 32px); }
.night { background: var(--night); color: var(--on-night); }
.night .muted, .night .lede, .hero .lede { color: var(--on-night-mute); }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: var(--sp-4); }
.gap-s { gap: var(--sp-2); }
.between { justify-content: space-between; }
.center { text-align: center; }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: var(--sp-5); }
.acts.center { justify-content: center; }
.muted { color: var(--mute); }
.small { font-size: var(--t-s); }
.tiny { font-size: var(--t-xs); }
.hand { font-family: var(--hand); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); }
.neg { color: var(--err); }
.block { display: flex; width: 100%; }
.eyebrow { font-size: var(--t-s); font-weight: 600; color: var(--mute); }
.lede { font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--mute); max-width: 62ch; text-wrap: pretty; }
.h1 { font-size: var(--t-3xl); line-height: 1.05; letter-spacing: -.02em; }
.h2 { font-size: var(--t-2xl); line-height: 1.1; letter-spacing: -.018em; }
.h3 { font-size: clamp(20px, 1.8vw, 24px); line-height: 1.2; }
.wf, .wf-t { font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); }
.sec-top { display: grid; gap: 10px; margin-bottom: var(--sp-6); max-width: 760px; }
.sec-top.split-top { max-width: none; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.sec-top.split-top > :first-child { min-width: 0; }
.split-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split-even > * { min-width: 0; }
@media (max-width: 860px) { .split-even { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 2.4vw, 28px); }
.panel.soft { background: var(--paper-2); border-color: transparent; }
.panel > * + * { margin-top: var(--sp-3); }
.panel > .acts { margin-top: var(--sp-5); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.stack-form { display: grid; gap: 18px; }

/* tags, notices, small marks */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-xs); background: var(--paper-2); color: var(--mute); font: 600 13px/1.5 var(--sans); white-space: nowrap; }
.tag.demo { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .8; }
.tag.mine-tag { background: var(--wc); color: var(--wd); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-s); border: 1px solid transparent; font-size: var(--t-s); line-height: 1.5; }
.notice.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.hint { font-size: var(--t-s); color: var(--mute); line-height: 1.45; }
.hint.warn, .warn:is(p, span) { color: var(--warn); font-weight: 600; }
.demo-line { color: var(--mute); }
.demo-line::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; border: 1.5px dashed currentColor; vertical-align: 1px; }
.ticks { list-style: none; padding: 0; margin: var(--sp-4) 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 32px; line-height: 1.5; }
.ticks li::before { content: ''; position: absolute; left: 0; top: .15em; width: 22px; height: 22px; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat; }
.ticks.no li::before { background: var(--line-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E") center / 13px no-repeat; }
.support { background: var(--care-bg); color: var(--care-ink); border-radius: var(--r); padding: 16px 20px; line-height: 1.5; }
.support a { font-weight: 600; }
.crisis { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: var(--r); background: var(--care-bg); color: var(--care-ink); }
.crisis > span:not(.ci) { flex: 1 1 260px; min-width: 0; line-height: 1.45; }
.crisis .ci { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--care-ink); color: var(--care-bg); }
.crisis .ci svg { width: 18px; height: 18px; }
.crisis .btn { --bb: var(--care-ink); --bf: var(--care-bg); --bl: transparent; --bh: rgba(255,255,255,.14); }
.link { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: pointer; }
.link:hover { text-decoration-thickness: 2px; }
main p a:not([class]), .support a, .notice a, .hint a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
main p a:not([class]):hover { text-decoration-thickness: 2px; }
.empty-state { display: grid; justify-items: center; gap: 12px; text-align: center; padding: var(--sp-7) var(--sp-4); border: 1.5px dashed var(--line-2); border-radius: var(--r); }
.empty-state.small { padding: var(--sp-5); }
.empty-state .muted { max-width: 46ch; }
.es-pic { margin-bottom: var(--sp-2); }
.faq { display: grid; gap: 10px; margin-top: var(--sp-6); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--d2) var(--e-sig); }
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq details p { padding: 0 18px 18px; color: var(--mute); line-height: 1.6; max-width: 68ch; }
.faq summary:hover { background: color-mix(in srgb, var(--paper-2) 50%, transparent); }

/* ================= 4. Controls ================= */
/* Every control: rest, hover, press, focus-visible, disabled, and busy where it sends. */

/* buttons: accent (primary), world, secondary, ghost, danger, danger-ghost; on night: lamp, ghost-night; on a world band: world-on, ghost-on */
.btn {
  --bb: var(--card); --bf: var(--ink); --bl: var(--line-2); --bh: rgba(30,42,46,.06);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px; border: 0; border-radius: var(--r-s);
  background-color: var(--bb); color: var(--bf); box-shadow: inset 0 0 0 1.5px var(--bl);
  font: 600 16px/1.2 var(--sans); text-align: center; text-decoration: none; text-wrap: balance;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--d1) var(--e-sig), box-shadow var(--d1) var(--e-sig), color var(--d1) var(--e-sig), transform 90ms var(--e-sig);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn .arr { transition: transform var(--d1) var(--e-sig); }
@media (hover: hover) {
  .btn:hover { background-image: linear-gradient(var(--bh), var(--bh)); }
  .btn:hover .arr { transform: translateX(3px); }
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; background-image: none; }
.btn.is-busy { cursor: progress; pointer-events: none; }
.btn.is-busy::before { content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-busy .arr { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.accent { --bb: var(--ink); --bf: var(--paper); --bl: transparent; --bh: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.accent { --bh: rgba(16,32,31,.12); } }
:root[data-theme="dark"] .btn.accent { --bh: rgba(16,32,31,.12); }
:is(.night, .hero, .foot, .keepband, .libhead, .whead) .btn.accent { --bb: var(--lamp); --bf: #1E2A2E; --bh: rgba(255,255,255,.22); }
.btn.lamp { --bb: var(--lamp); --bf: #1E2A2E; --bl: transparent; --bh: rgba(255,255,255,.24); }
.btn.world { --bb: var(--wd); --bf: #fff; --bl: transparent; --bh: rgba(255,255,255,.14); }
.btn.ghost { --bb: transparent; --bf: currentColor; --bl: color-mix(in srgb, currentColor 38%, transparent); --bh: color-mix(in srgb, currentColor 7%, transparent); }
.btn.ghost-night { --bb: transparent; --bf: var(--on-night); --bl: rgba(246,241,232,.45); --bh: rgba(255,255,255,.08); }
.btn.ghost-on { --bb: transparent; --bf: #fff; --bl: rgba(255,255,255,.55); --bh: rgba(255,255,255,.1); }
.btn.world-on { --bb: var(--wc); --bf: var(--wd); --bl: transparent; --bh: rgba(255,255,255,.32); }
.phero .btn.ghost-on, .tgroup .btn.ghost-on { --bf: var(--wink); --bl: color-mix(in srgb, var(--wink) 40%, transparent); --bh: rgba(0,0,0,.05); }
.phero .btn.world-on, .tgroup .btn.world-on { --bb: var(--wd); --bf: #fff; --bh: rgba(255,255,255,.14); }
.btn.danger { --bb: var(--err); --bf: #fff; --bl: transparent; --bh: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { --bf: #1E2A2E; } }
:root[data-theme="dark"] .btn.danger { --bf: #1E2A2E; }
.btn.danger-ghost { --bb: transparent; --bf: var(--err); --bl: color-mix(in srgb, var(--err) 50%, transparent); --bh: var(--err-bg); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: 15px; border-radius: 8px; gap: 6px; }
.btn.sm svg { width: 18px; height: 18px; }
.btn.lg { min-height: 56px; padding: 12px 26px; font-size: 17px; }
.btn.huge { min-height: 56px; padding: 12px 28px; font-size: 17px; }
.btn.block { display: flex; width: 100%; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.btn.file:focus-within { outline: 3px solid var(--ring); outline-offset: 2px; }

/* icon buttons, with a tooltip from data-tip */
.ibtn, .x { position: relative; flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-s); background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px var(--line-2); cursor: pointer; transition: background-color var(--d1) var(--e-sig), transform 90ms var(--e-sig), box-shadow var(--d1); -webkit-tap-highlight-color: transparent; }
.ibtn svg { width: 20px; height: 20px; }
.ibtn.sm { width: 36px; height: 36px; border-radius: 8px; }
.ibtn.sm svg { width: 18px; height: 18px; }
.ibtn.more { box-shadow: none; }
.x { width: 40px; height: 40px; border-radius: 50%; font-size: 24px; line-height: 1; box-shadow: none; background: var(--paper-2); }
:is(.night, .hero, .whero, .wbr) .ibtn { box-shadow: inset 0 0 0 1.5px rgba(246,241,232,.35); }
@media (hover: hover) {
  .ibtn:hover, .x:hover { background-color: color-mix(in srgb, currentColor 9%, transparent); }
}
.ibtn:active, .x:active { transform: scale(.94); }
.ibtn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ibtn[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 30; padding: 6px 10px; border-radius: var(--r-xs); background: var(--night); color: var(--on-night); font: 500 13px/1.2 var(--sans); white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, 4px); transition: opacity 120ms var(--e-sig), transform 120ms var(--e-sig); box-shadow: var(--sh-1); }
.ibtn[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: hover) { .ibtn[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 300ms; } }

/* chips: filters and quick answers (aria-pressed), and radio chips (.chip-r) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip, .chip-r > span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font: 500 15px/1.2 var(--sans); text-align: left; cursor: pointer; transition: background-color var(--d1) var(--e-sig), border-color var(--d1) var(--e-sig), color var(--d1), transform 90ms var(--e-sig); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .chip:hover, .chip-r:hover > span { border-color: var(--wtx); } }
.chip:active, .chip-r:active > span { transform: scale(.97); }
.chip:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.chip.on, .chip[aria-pressed="true"], .chip[aria-checked="true"], .chip-r > input:checked + span { background: var(--wd); border-color: var(--wtx); color: #fff; }
.chip.on::before, .chip[aria-pressed="true"]::before, .chip[aria-checked="true"]::before, .chip-r > input:checked + span::before { content: ''; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.chip.ghost { background: transparent; border-style: dashed; }
.chip.static { cursor: default; }
.chip.static:active { transform: none; }
.chip-r { position: relative; display: inline-flex; }
.chip-r > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip-r > input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }

/* fields: label above, 48px control, hint and error under it */
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > label, .fld > span:first-child { font-size: var(--t-s); font-weight: 600; color: var(--ink); }
.fld.inline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.fld.inline > label { white-space: nowrap; }
.inp, .ta { width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font: 400 16px/1.4 var(--sans); transition: border-color var(--d1) var(--e-sig), box-shadow var(--d1) var(--e-sig); -webkit-appearance: none; appearance: none; }
.inp::placeholder, .ta::placeholder { color: var(--mute); opacity: .8; }
@media (hover: hover) { .inp:hover, .ta:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line-2)); } }
.inp:focus, .ta:focus { border-color: var(--wtx); }
.inp:disabled, .ta:disabled { opacity: .45; cursor: not-allowed; }
.inp.sm { width: auto; min-width: 7em; flex: 1 1 8em; min-height: 40px; padding: 8px 12px; font-size: 15px; }
.inp.line { border: 0; border-bottom: 2px solid var(--line-2); border-radius: 0; background: transparent; padding-inline: 2px; min-height: 40px; }
.inp.wide { flex: 1 1 14em; }
select.inp { padding-right: 40px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F5D61' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; cursor: pointer; }
.ta { resize: vertical; min-height: 110px; line-height: 1.5; }
.ta.hand { font-family: var(--hand); font-weight: 600; font-size: 23px; line-height: 1.35; }
.fld.bad .inp, .fld.bad .ta, .inp[aria-invalid="true"], .ta[aria-invalid="true"] { border-color: var(--err); }
.f-err, .field-err { display: flex; align-items: flex-start; gap: 6px; color: var(--err); font-size: var(--t-s); font-weight: 600; line-height: 1.4; }
.f-err::before, .field-err::before { content: '!'; flex: none; display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--err); color: var(--card); font: 700 12px/1 var(--sans); }
.f-err:empty, .field-err:empty { display: none; }
.err-sum { margin-bottom: var(--sp-5); padding: 16px 20px; border: 2px solid var(--err); border-radius: var(--r); background: var(--err-bg); }
.err-sum:empty { display: none; }
.err-sum h2 { font: 600 17px/1.3 var(--sans); letter-spacing: 0; }
.err-sum ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.err-sum a { color: var(--err); font-weight: 600; text-underline-offset: 3px; }
.mx-note:empty { display: none; }

/* sliders: custom track and thumb in the world's accent */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: transparent; cursor: pointer; accent-color: var(--wa); }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--wa) 30%, var(--line)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--wa) 30%, var(--line)); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--wa); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: var(--wa); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform 90ms var(--e-sig); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--wa); border: 3px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ring); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ring); }
.fld.slider { gap: 2px; }
.fld.slider > span { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; }
.fld.slider output { font-variant-numeric: tabular-nums; font-weight: 700; }

/* dropdown (H.select): a native select shown as a button and a listbox */
.dd { position: relative; display: inline-flex; width: 100%; min-width: 0; }
.dd.sm { width: auto; flex: 1 1 9em; }
.fld.inline .dd { width: auto; flex: 1 1 9em; }
.dd-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px 8px 14px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--card); color: var(--ink); font: 500 16px/1.25 var(--sans); text-align: left; cursor: pointer; transition: border-color var(--d1) var(--e-sig), transform 90ms var(--e-sig); -webkit-tap-highlight-color: transparent; }
.dd.sm .dd-btn { min-height: 40px; padding: 6px 10px 6px 12px; font-size: 15px; }
@media (hover: hover) { .dd-btn:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line-2)); } }
.dd-btn:active { transform: scale(.99); }
.dd-btn:disabled { opacity: .45; cursor: not-allowed; }
.dd.open .dd-btn { border-color: var(--wtx); }
.dd-v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd.empty .dd-v { color: var(--mute); }
.dd-chev { flex: none; width: 16px; height: 16px; color: var(--mute); transition: transform var(--d2) var(--e-sig); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd.up.open .dd-chev { transform: rotate(0deg); }
.dd-list { position: fixed; z-index: 88; margin: 0; padding: 6px; list-style: none; max-height: min(320px, 52vh); overflow: auto; overscroll-behavior: contain; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--sh-1); }
.dd-list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px 8px 10px; border-radius: 8px; font-size: 15px; line-height: 1.3; cursor: pointer; }
.dd-list li.act { background: var(--paper-2); }
.dd-list li[aria-selected="true"] { font-weight: 600; }
.dd-list li[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.dd-tick { flex: none; width: 18px; height: 18px; color: var(--ink); opacity: 0; }
.dd-list li[aria-selected="true"] .dd-tick { opacity: 1; }

/* menu (H.menu): a row's extra actions, danger last */
.menu-pop { position: fixed; z-index: 88; min-width: 210px; max-width: min(320px, calc(100vw - 16px)); padding: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: var(--sh-1); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: inherit; font: 500 15px/1.25 var(--sans); text-align: left; cursor: pointer; }
.mi svg { flex: none; width: 18px; height: 18px; color: var(--mute); }
.mi:hover { background: var(--paper-2); }
.mi:focus-visible { background: var(--paper-2); outline: 3px solid var(--ring); outline-offset: -3px; }
.mi:active { transform: scale(.98); }
.mi.danger, .mi.danger svg { color: var(--err); }
.mi.danger:hover, .mi.danger:focus-visible { background: var(--err-bg); }

/* switch: takes effect at once */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: 500 16px/1.3 var(--sans); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sw-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line-2); transition: background-color var(--d2) var(--e-sig); }
.sw-thumb { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform var(--d2) var(--e-sig), width 90ms var(--e-sig); }
.switch[aria-checked="true"] .sw-track { background: var(--wd); }
.switch[aria-checked="true"] .sw-thumb { transform: translateX(20px); }
.switch:active .sw-thumb { width: 26px; }
.switch[aria-checked="true"]:active .sw-thumb { transform: translateX(16px); }
.switch:focus-visible { outline: none; }
.switch:focus-visible .sw-track { outline: 3px solid var(--ring); outline-offset: 2px; }
.switch:disabled { opacity: .45; cursor: not-allowed; }
.sw-l { font-weight: 500; }

/* custom checkbox row */
.check-row { position: relative; display: flex; align-items: flex-start; gap: 12px; line-height: 1.45; cursor: pointer; }
.check-row > input { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: 0; opacity: 0; cursor: pointer; }
.cbox { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-xs); border: 1.5px solid var(--line-2); background: var(--card); transition: background-color var(--d1) var(--e-sig), border-color var(--d1); }
.cbox::after { content: ''; width: 14px; height: 14px; background: #fff; opacity: 0; transform: scale(.4); transition: opacity var(--d1), transform var(--d2) var(--e-back); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (hover: hover) { .check-row:hover .cbox { border-color: var(--wtx); } }
.check-row > input:checked + .cbox { background: var(--wd); border-color: var(--wtx); }
.check-row > input:checked + .cbox::after { opacity: 1; transform: none; }
.check-row > input:focus-visible + .cbox { outline: 3px solid var(--ring); outline-offset: 2px; }
.check-row > input[aria-invalid="true"] + .cbox { border-color: var(--err); }

/* radio cards (who the account is for) */
.ages { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
.ages legend { padding: 0; margin-bottom: 8px; font-size: var(--t-s); font-weight: 600; }
.age { position: relative; display: block; cursor: pointer; }
.age > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.age > span { position: relative; display: grid; gap: 4px; height: 100%; padding: 14px 16px 14px 48px; border-radius: var(--r-s); border: 1.5px solid var(--line-2); background: var(--card); line-height: 1.35; transition: border-color var(--d1) var(--e-sig), background-color var(--d1) var(--e-sig), transform 90ms var(--e-sig); }
.age > span::before { content: ''; position: absolute; left: 16px; top: 15px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--card); transition: border-color var(--d1), box-shadow var(--d2) var(--e-sig), background-color var(--d1); }
.age small { color: var(--mute); font-size: var(--t-s); }
@media (hover: hover) { .age:hover > span { border-color: var(--wtx); } }
.age:active > span { transform: scale(.99); }
.age > input:checked + span { border-color: var(--wtx); background: color-mix(in srgb, var(--wd) 7%, var(--card)); }
.age > input:checked + span::before { border-color: var(--wtx); background: var(--wd); box-shadow: inset 0 0 0 4px var(--card); }
.age > input:focus-visible + span { outline: 3px solid var(--ring); outline-offset: 2px; }
.ages.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.ages.compact .age > span { padding-block: 10px; }

/* sheet: bottom sheet on phones, centred dialog on wide screens (animated by H.anim) */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; padding-top: calc(env(safe-area-inset-top, 0px) + 24px); background: rgba(9,20,24,.55); }
.sheet { width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--sh-2); padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (min-width: 640px) { .sheet-wrap { align-items: center; padding: 24px; } .sheet { border-radius: var(--r-l); } }
.sheet-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px clamp(18px, 4vw, 28px) 14px; background: var(--paper); border-bottom: 1px solid var(--line); }
.sheet-title { font-size: 23px; line-height: 1.2; min-width: 0; }
.sheet-body { padding: clamp(18px, 4vw, 28px); }
.sheet-body > * + * { margin-top: var(--sp-4); }
.sheet-acts { justify-content: flex-end; margin-top: var(--sp-5); }
.sheet-wrap[data-world] .sheet-top { border-bottom: 3px solid var(--wa); }

/* toast: polite, bottom centre, never takes focus, one action at most */
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: 12px 12px 12px 18px; border-radius: var(--r-s); background: var(--night); color: var(--on-night); border: 1px solid rgba(255,255,255,.08); box-shadow: var(--sh-2); font-size: var(--t-s); line-height: 1.4; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity 240ms var(--e-in), transform 240ms var(--e-in); }
#toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; transition: opacity var(--d2) var(--e-sig), transform var(--d2) var(--e-sig); }
.t-msg { flex: 1 1 auto; min-width: 0; }
.t-act { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--lamp); color: #1E2A2E; font: 600 15px/1 var(--sans); cursor: pointer; transition: transform 90ms var(--e-sig); }
.t-act:active { transform: scale(.96); }
.is-busy { cursor: progress; }

/* ==================================================================
   3. Shell: views, transitions, header, path, next band, footer
   ================================================================== */
.view { min-width: 0; }
.view.rise > * { animation: rise var(--d3) var(--e-sig) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
::view-transition-old(root) { animation: vt-out 200ms var(--e-in) both; }
::view-transition-new(root) { animation: vt-in var(--d2) var(--e-sig) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.wash { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.spark { position: fixed; z-index: 95; pointer-events: none; line-height: 0; }
.spark svg { display: block; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(15,35,43,.94); color: var(--on-night); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 rgba(246,241,232,.08); }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font: 400 21px/1 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.logo svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: 8px; min-width: 0; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--on-night-mute); font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: color var(--d1) var(--e-sig), background-color var(--d1) var(--e-sig); }
.nav a:hover { color: var(--on-night); background: rgba(246,241,232,.07); }
.nav a[aria-current="page"] { color: var(--on-night); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--lamp); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.pill-demo { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px dashed rgba(246,241,232,.4); border-radius: 999px; color: var(--on-night-mute); font: 600 13px/1 var(--sans); text-decoration: none; transition: color var(--d1) var(--e-sig), border-color var(--d1) var(--e-sig); }
.pill-demo:hover { color: var(--on-night); border-color: var(--lamp); }
.acct { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 6px; border-radius: 999px; background: rgba(246,241,232,.09); color: var(--on-night); font: 600 15px/1 var(--sans); text-decoration: none; transition: background-color var(--d1) var(--e-sig), transform 90ms var(--e-sig); }
.acct:hover { background: rgba(246,241,232,.15); }
.acct:active { transform: scale(.97); }
.acct i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--lamp); color: #1E2A2E; font: 600 15px/1 var(--sans); font-style: normal; }
.acct.out { padding: 0 16px; background: var(--lamp); color: #1E2A2E; }
.acct.out:hover { background: #F8DB86; }
@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; row-gap: 0; padding-top: 8px; }
  .nav { order: 3; flex: 1 0 100%; margin: 0 calc(-1 * var(--gut)) 0; padding: 0 var(--gut) 6px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0 10px; }
}
@media (max-width: 520px) { .pill-demo { display: none; } .acct span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* the path: eight lamps, lit as each stop is done */
.path { background: var(--night-2); color: var(--on-night); box-shadow: inset 0 1px 0 rgba(246,241,232,.06); }
.path-in { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.lamps { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.lamps::-webkit-scrollbar { display: none; }
.lamps li { display: flex; align-items: center; flex: none; }
.lamps li + li::before { content: ""; width: 14px; height: 1px; background: rgba(246,241,232,.22); }
.lamps .lamp { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 999px; color: var(--on-night-mute); font: 500 14px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: color var(--d1) var(--e-sig), background-color var(--d1) var(--e-sig); }
.lamps .lamp:hover { color: var(--on-night); background: rgba(246,241,232,.07); }
.lamps .lamp i { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(246,241,232,.5); transition: background-color var(--d2) var(--e-sig), box-shadow var(--d2) var(--e-sig); }
.lamps .lamp.on { color: var(--on-night); }
.lamps .lamp.on i { border-color: var(--lamp); background: var(--lamp); box-shadow: 0 0 0 4px rgba(245,208,107,.16), 0 0 14px rgba(245,208,107,.55); }
.lamps .lamp.next { color: var(--on-night); background: rgba(245,208,107,.1); }
.lamps .lamp.next i { border-color: var(--lamp); animation: lamp-wait 2.4s var(--e-inout) infinite; }
.lamps .lamp.opt i { border-style: dashed; }
@keyframes lamp-wait { 50% { box-shadow: 0 0 0 5px rgba(245,208,107,.22); } }
.path-next { flex: none; }
.path-done { flex: none; color: var(--lamp); font: 600 14px/1.2 var(--sans); }
@media (max-width: 640px) {
  .lamps .lamp:not(.next) span { display: none; }
  .lamps .lamp:not(.next) { padding: 0 8px; }
  .path-next { display: none; }
}

/* next step band, above the footer */
.nextband { background: var(--paper-2); padding-block: clamp(36px, 5vw, 64px); }
.nb-in { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.nb-in > div { min-width: 0; max-width: 60ch; }
.nextband h2 { margin: 0 0 6px; font-size: var(--t-xl); line-height: 1.15; }
.nextband p { margin: 0; color: var(--mute); }
.nextband.all { background: var(--paper); box-shadow: inset 0 1px 0 var(--line); }

/* footer */
.foot { background: var(--night); color: var(--on-night-mute); padding-block: clamp(48px, 7vw, 80px) calc(32px + env(safe-area-inset-bottom, 0px)); }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 40px 32px; }
.foot-brand .logo { color: var(--on-night); }
.priv { margin: 18px 0 10px; max-width: 34ch; color: var(--on-night); font: 400 19px/1.4 var(--serif); }
.tagline { margin: 0; color: var(--lamp); font: 600 12px/1.5 var(--sans); letter-spacing: .12em; }
.foot h2 { margin: 6px 0 14px; color: var(--on-night); font: 600 15px/1.2 var(--sans); }
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin: 0 0 10px; font-size: 15px; }
.foot a { color: var(--on-night-mute); text-decoration: none; }
.foot a:hover { color: var(--on-night); text-decoration: underline; text-underline-offset: 3px; }
.foot .demo { margin: 40px 0 0; padding-top: 24px; border-top: 1px solid rgba(246,241,232,.12); font-size: 13px; line-height: 1.55; max-width: 90ch; }
@media (max-width: 860px) { .foot-in { grid-template-columns: repeat(3, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .foot-in { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 16px; font: 500 14px/1.4 var(--sans); }
.crumbs a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.crumbs a:hover { text-decoration-thickness: 2px; }
.crumbs [aria-current] { opacity: .85; }

/* ==================================================================
   4. Home: the hero street, worlds by mind, the route, the spread
   ================================================================== */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-top: clamp(40px, 6vw, 88px); background: radial-gradient(60% 70% at 88% -10%, rgba(245,208,107,.16), transparent 70%), radial-gradient(45% 60% at -5% 40%, rgba(95,179,168,.12), transparent 70%), var(--night); color: var(--on-night); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.hero-grid.two { align-items: center; }
.hero h1 { margin: 0; max-width: 14ch; color: var(--on-night); font-size: var(--t-4xl); line-height: 1; letter-spacing: -.025em; }
.tryhero, .commhero { padding-block: clamp(40px, 6vw, 80px); }
.tryhero h1, .commhero h1 { max-width: 18ch; font-size: var(--t-3xl); line-height: 1.04; }
.hero .lede { color: var(--on-night-mute); }
.hero-side .lede { margin: 0; font-size: var(--t-l); line-height: 1.5; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.facts li { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(246,241,232,.07); box-shadow: inset 0 0 0 1px rgba(246,241,232,.14); color: var(--on-night); font: 600 14px/1 var(--sans); white-space: nowrap; }
.facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 8px var(--lamp); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; } .hero h1 { max-width: 16ch; } }

/* the street: eleven shopfronts with lamp posts between */
.street-wrap { position: relative; margin-top: clamp(28px, 5vw, 56px); }
.street { --shop: clamp(92px, calc((92vw - 200px) / 11), 150px); display: flex; align-items: flex-end; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); padding: 60px var(--gutr) 0 var(--gut); background: linear-gradient(to top, var(--night-3) 0 50px, transparent 50px); scrollbar-width: none; }
.street::-webkit-scrollbar { display: none; }
.street:focus-visible { outline-offset: -4px; }
.shop { position: relative; flex: none; width: var(--shop); padding-bottom: 50px; color: inherit; text-decoration: none; scroll-snap-align: center; }
.shop .facade { display: block; width: 100%; height: auto; aspect-ratio: 120 / 210; transition: transform var(--d2) var(--e-sig); }
.facade .win { opacity: .5; transition: opacity var(--d2) var(--e-sig); }
.facade .fl { opacity: .45; transition: opacity var(--d2) var(--e-sig); }
.facade .fd { transform-box: fill-box; transform-origin: 0 50%; transition: transform var(--d3) var(--e-sig); }
.facade.lit .win, .facade.lit .fl { opacity: 1; }
.shop:hover .facade, .shop:focus-visible .facade { transform: translateY(-4px); }
.shop:hover .win, .shop:focus-visible .win, .shop:hover .fl, .shop:focus-visible .fl { opacity: 1; }
.shop:hover .fd, .shop:focus-visible .fd { transform: scaleX(.28); }
.shop:focus-visible { outline: none; }
.shop:focus-visible .sign { outline: 3px solid var(--lamp); outline-offset: 2px; }
.sign { position: absolute; top: calc(100% - 42px); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(var(--shop) + 16px); padding: 5px 9px; border-radius: 5px; background: var(--wd); color: var(--wc); box-shadow: 0 0 0 1px rgba(246,241,232,.12), 0 4px 10px rgba(0,0,0,.25); font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); font-size: 13px; line-height: 1.15; text-align: center; transition: transform var(--d2) var(--e-sig); }
.shop:hover .sign { transform: translate(-50%, -2px); }
.street .lpost { flex: none; width: calc(var(--shop) * .22); height: auto; aspect-ratio: 24 / 210; margin-bottom: 50px; }
.lpost .halo { transition: opacity var(--d2) var(--e-sig); }
.lpost.lit .halo { animation: halo 5s var(--e-inout) infinite; }
.street .lpost:nth-of-type(3n) .halo { animation-delay: -1.7s; }
.street .lpost:nth-of-type(3n+1) .halo { animation-delay: -3.4s; }
@keyframes halo { 0%, 100% { opacity: .13; } 50% { opacity: .28; } }
.street-wrap .scroll-btns { position: absolute; top: 4px; right: var(--gutr); z-index: 2; }
.scroll-btns { display: flex; gap: 8px; flex: none; }
.kerb { height: 10px; background: repeating-linear-gradient(90deg, #0B1A20 0 30px, #24424C 30px 32px); }

/* worlds by what is on your mind */
.mind-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.topic { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer; transition: background-color var(--d1) var(--e-sig), box-shadow var(--d1) var(--e-sig), color var(--d1) var(--e-sig), transform 90ms var(--e-sig); }
.topic .motif { width: 20px; height: 20px; color: var(--wtx); transition: color var(--d1) var(--e-sig); }
.topic:hover { box-shadow: inset 0 0 0 1.5px var(--wd); }
.topic:active { transform: scale(.97); }
.topic[aria-pressed="true"] { background: var(--wd); box-shadow: none; color: var(--wc); }
.topic[aria-pressed="true"] .motif { color: var(--wc); }
.mind-card { position: relative; display: grid; grid-template-columns: minmax(96px, .62fr) minmax(0, 1fr); gap: 24px; align-items: end; min-height: 340px; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-l); background: var(--wbg); color: var(--wink); overflow: hidden; }
.mc-art .facade { display: block; width: 100%; height: auto; }
.mc-body { min-width: 0; }
.mc-shelf { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 600 14px/1.3 var(--sans); color: var(--wtx); }
.mc-shelf .motif { width: 20px; height: 20px; flex: none; }
.mc-body h3 { margin: 0 0 10px; font-size: var(--t-xl); line-height: 1.1; }
.mc-body p { margin: 0 0 12px; }
.mc-meta { font-size: 14px; }
.mind-card .btn.world { margin-top: 4px; }
@media (max-width: 860px) { .mind-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .mind-card { grid-template-columns: minmax(0, 1fr); min-height: 0; } .mc-art { width: 112px; } }

/* the route: eight stops, a lamp for each */
.road { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 28px; margin: 36px 0 0; padding: 0; list-style: none; }
.road .stop { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; align-content: start; }
.stop-lamp { grid-row: 1 / span 3; }
.stop-lamp .lpost { display: block; width: 26px; height: 78px; }
.stop-lamp .lpost path:first-child { stroke: var(--ink); }
.stop-lamp .lpost path:nth-child(2) { fill: var(--ink); }
.road .stop:not(.lit) .glass { fill: var(--line-2); }
.road .stop:not(.lit) .halo { opacity: 0; }
.road .stop.opt .stop-lamp { opacity: .75; }
.road .stop h3 { margin: 4px 0 6px; font-size: var(--t-l); line-height: 1.2; }
.road .stop p { margin: 0; color: var(--mute); font-size: 15px; }
.road .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ink); font: 600 15px/1.3 var(--sans); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.road .go:hover { text-decoration-thickness: 2px; }
.road .go .arr { width: 18px; height: 18px; transition: transform var(--d1) var(--e-sig); }
.road .go:hover .arr { transform: translateX(3px); }
@media (max-width: 960px) { .road { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .road { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* every world as a row */
.wl-band { background: var(--paper-2); }
.wlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; margin: 28px 0 0; padding: 0; list-style: none; }
.wlist li { border-top: 1px solid var(--line); }
.wrow { display: grid; grid-template-columns: 40px minmax(0, auto) minmax(0, 1fr) auto 20px; align-items: center; gap: 14px; min-height: 68px; padding: 10px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; transition: background-color var(--d1) var(--e-sig); }
.wrow:hover { background: var(--card); }
.wr-mot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--wd); color: var(--wc); }
.wr-mot .motif { width: 21px; height: 21px; }
.wr-name { font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); font-size: 21px; line-height: 1.1; }
.wr-shelf { min-width: 0; overflow: hidden; color: var(--mute); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.wr-n { color: var(--mute); font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrow .arr { width: 20px; height: 20px; transition: transform var(--d1) var(--e-sig); }
.wrow:hover .arr { transform: translateX(3px); }
@media (max-width: 860px) { .wlist { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .wrow { grid-template-columns: 40px minmax(0, 1fr) auto 20px; } .wr-shelf { display: none; } }

/* an open journal spread */
.spread-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.spread { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-radius: 8px; background: var(--card); box-shadow: 0 1px 0 var(--line), 0 24px 48px -20px rgba(15,35,43,.35), 0 0 0 1px var(--line); transform: rotate(-.8deg); }
.spread::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 48px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(15,35,43,.07) 42%, rgba(15,35,43,.16) 50%, rgba(15,35,43,.07) 58%, transparent); pointer-events: none; }
.spread .leaf { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 360px; padding: clamp(20px, 3vw, 36px); }
.spread .leaf.l { background: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px) 0 64px / 100% calc(100% - 64px) no-repeat; }
.spread .pg-no { margin: 0; color: var(--wtx); font: 600 13px/1 var(--sans); letter-spacing: .06em; }
.spread h3 { margin: 0; font-size: var(--t-xl); line-height: 1.1; }
.spread .leaf p { margin: 0; }
.leaf-foot { margin-top: auto !important; padding-top: 10px; border-top: 1px solid var(--line); color: var(--mute); font-size: 13px; }
.day4 { display: grid; gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: d; }
.day4 li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; counter-increment: d; }
.day4 li::before { content: counter(d); grid-row: 1 / span 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 15px/1 var(--sans); }
.day4 b { font-size: 17px; line-height: 1.3; }
.day4 span { color: var(--mute); font-size: 15px; }
.day4 small { display: block; margin-top: 6px; color: var(--mute); font-size: 13px; }
.day4.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.day4.wide li { grid-template-columns: minmax(0, 1fr); align-content: start; }
.day4.wide li::before { grid-row: auto; margin-bottom: 12px; }
.dayband .day4 li::before { background: var(--wd); color: var(--wc); }
@media (max-width: 960px) { .spread-grid { grid-template-columns: minmax(0, 1fr); } .day4.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .spread { grid-template-columns: minmax(0, 1fr); transform: none; }
  .spread::after { display: none; }
  .spread .leaf { min-height: 0; }
  .spread .leaf.r { border-top: 1px dashed var(--line-2); }
  .day4.wide { grid-template-columns: minmax(0, 1fr); }
}

/* keep it: backup, download, restore */
.keep-grid3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.keep3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.keep3 li { display: grid; align-content: start; gap: 8px; padding: 22px 20px; border-radius: var(--r); background: rgba(246,241,232,.06); box-shadow: inset 0 0 0 1px rgba(246,241,232,.12); }
.keep3 b { color: var(--on-night); font: 400 21px/1.15 var(--serif); }
.keep3 span { color: var(--on-night-mute); font-size: 15px; }
@media (max-width: 960px) { .keep-grid3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .keep3 { grid-template-columns: minmax(0, 1fr); } }

/* community preview and a world's board sample */
.commprev { background: var(--paper-2); }
.boardsample { background: var(--paper); box-shadow: inset 0 1px 0 var(--line); }
.prompt-mini { margin: 24px 0 0; padding: 20px 24px; border-radius: var(--r); background: var(--night); color: var(--on-night); }
.prompt-mini small { display: block; color: var(--lamp); font: 600 13px/1.3 var(--sans); }
.prompt-mini p { margin: 8px 0 0; font-size: var(--t-l); line-height: 1.3; }
.mini-feed { display: grid; gap: 12px; align-content: start; min-width: 0; }

/* the free journal */
.freeband { background: var(--paper); }
.free-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.free-book { display: grid; place-items: center; min-height: 320px; padding: 40px 24px; border-radius: var(--r-l); background: radial-gradient(60% 60% at 50% 40%, rgba(245,208,107,.22), transparent 70%), var(--night); text-decoration: none; }
.free-book .book { transition: transform var(--d2) var(--e-sig); }
.free-book:hover .book, .free-book:focus-visible .book { transform: translateY(-6px) rotate(-2deg); }
@media (max-width: 760px) { .free-grid { grid-template-columns: minmax(0, 1fr); } .free-book { min-height: 240px; } }

/* ==================================================================
   5. Worlds, a world, a journal's page, checkout
   ================================================================== */
.whead { padding-block: clamp(40px, 6vw, 80px); }
.whead-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; }
.whead h1 { margin: 0 0 12px; color: var(--on-night); }
.whead .lede { margin: 0; }
.whead-ctl .fld label { color: var(--on-night); }
.whead-ctl .dd-btn, .whead-ctl .inp { background: var(--card); color: var(--ink); }
@media (max-width: 860px) { .whead-grid { grid-template-columns: minmax(0, 1fr); } }

.wbr { padding-block: clamp(40px, 6vw, 80px); background: var(--wd); color: var(--wc); scroll-margin-top: 72px; }
.wbr + .wbr { box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.wbr-in { display: grid; grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.wbr.flip .wbr-art { order: 2; }
.wbr-art { display: block; justify-self: center; width: min(240px, 100%); }
.wbr-art .facade { display: block; width: 100%; height: auto; transition: transform var(--d2) var(--e-sig); }
.wbr-art:hover .facade { transform: translateY(-4px); }
.wbr-art:hover .win, .wbr-art:hover .fl { opacity: 1; }
.wbr-art:hover .fd { transform: scaleX(.28); }
.wbr-body { min-width: 0; }
.wbr-shelf { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: inherit; font: 600 14px/1.3 var(--sans); }
.wbr-shelf .motif { width: 20px; height: 20px; flex: none; }
.wbr h2 { margin: 0 0 10px; font-size: var(--t-2xl); line-height: 1.05; }
.wbr h2:focus { outline: none; }
.wbr-look { margin: 0; max-width: 52ch; font-size: var(--t-l); line-height: 1.45; }
.wbr-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 22px 0 0; padding: 0; list-style: none; }
.wbr-tools li { display: flex; align-items: center; gap: 10px; min-width: 0; font: 600 15px/1.3 var(--sans); }
.wbr-tools svg { width: 24px; height: 24px; flex: none; color: var(--wa); }
.wbr-meta { margin: 16px 0 0; font-size: 14px; }
@media (max-width: 760px) {
  .wbr-in { grid-template-columns: minmax(0, 1fr); }
  .wbr-art, .wbr.flip .wbr-art { order: 0; justify-self: start; width: 120px; }
  .wbr-tools { grid-template-columns: minmax(0, 1fr); }
}

.whero { position: relative; overflow: hidden; padding-top: clamp(28px, 4vw, 56px); background: radial-gradient(50% 70% at 85% 100%, rgba(255,255,255,.12), transparent 70%), var(--wd); color: var(--wc); }
.whero-in { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 24px 48px; align-items: end; }
.whero-text { padding-bottom: clamp(32px, 5vw, 72px); min-width: 0; }
.whero h1 { margin: 4px 0 12px; font-size: var(--t-3xl); line-height: 1.02; color: var(--wc); }
.whero .lede { margin: 0; color: var(--wc); max-width: 54ch; }
.whero-art { justify-self: center; width: min(250px, 100%); line-height: 0; }
.whero-art .facade { display: block; width: 100%; height: auto; }
@media (max-width: 760px) { .whero-in { grid-template-columns: minmax(0, 1fr); } .whero-art { justify-self: end; width: 140px; margin-top: -24px; } .whero-text { padding-bottom: 0; } }

.progband { background: var(--wbg); color: var(--wink); }
.prog-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.pd-pic { display: grid; place-items: center; min-height: 260px; padding: 24px; border-radius: var(--r-l); background: rgba(255,255,255,.6); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.pd-pic > * { max-width: 100%; }
.progband h2 { margin: 0 0 10px; color: var(--wink); }
.progband .lede, .progband .muted { color: var(--wink); }
@media (max-width: 760px) { .prog-grid { grid-template-columns: minmax(0, 1fr); } }

.shelf-ctl { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.shelf:is([data-shelf], .static) { display: flex; gap: 24px; margin-top: 20px; padding: 10px 4px 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 4px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.shelf-item, .lib-item { display: grid; align-content: start; gap: 4px; flex: none; width: 168px; color: var(--ink); text-decoration: none; scroll-snap-align: start; }
.shelf-item .book, .lib-item .book { margin-bottom: 10px; transition: transform var(--d2) var(--e-sig); }
.shelf-item:hover .book, .shelf-item:focus-visible .book, .lib-item:hover .book, .lib-item:focus-visible .book { transform: translateY(-6px) rotate(-1.5deg); }
.shelf-item:focus-visible, .lib-item:focus-visible { outline: none; }
.shelf-item:focus-visible .si-t, .lib-item:focus-visible .si-t { outline: 3px solid var(--ring); outline-offset: 3px; border-radius: 4px; }
.si-t { font: 400 18px/1.2 var(--serif); }
.si-s { color: var(--mute); font-size: 14px; line-height: 1.35; }
.si-s b { color: var(--ink); font-weight: 600; }

/* a journal's page */
.phero { padding-block: clamp(32px, 5vw, 72px); background: var(--wbg); color: var(--wink); }
.phero-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.phero-book { display: grid; place-items: center; min-width: 0; }
.phero-text { min-width: 0; }
.phero .wbr-shelf { color: var(--wd); }
.phero h1 { margin: 4px 0 12px; font-size: var(--t-3xl); line-height: 1.02; color: var(--wink); }
.phero .lede { margin: 0; color: var(--wink); }
.phero .who { margin: 12px 0 0; color: var(--wink); font-size: 15px; }
.price { margin-top: 24px; padding: 20px 22px; border-radius: var(--r); background: rgba(255,255,255,.66); box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); color: #1E2A2E; }
.price > p { margin: 8px 0 0; font-size: 15px; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.price-row span { font: 600 14px/1.3 var(--sans); color: #4F5D61; }
.price-row b { font: 400 var(--t-xl)/1.1 var(--serif); }
.price .acts { margin-top: 18px; }
@media (max-width: 760px) { .phero-in { grid-template-columns: minmax(0, 1fr); } .phero-book { justify-self: start; } }

.sig-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.live { border-radius: var(--r-l); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--sh-1); overflow: hidden; }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--wd); color: var(--wc); }
.live-head b { font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); font-size: 18px; }
.live-head span { padding: 3px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; font: 600 12px/1.3 var(--sans); }
.live-body { padding: clamp(18px, 3vw, 28px); min-height: 220px; }
@media (max-width: 860px) { .sig-grid { grid-template-columns: minmax(0, 1fr); } }

.lock { display: grid; justify-items: start; gap: 10px; padding: 8px 0; }
.lock p { margin: 0; color: var(--mute); max-width: 46ch; }
.lock b { font: 400 var(--t-l)/1.25 var(--serif); }
.lkc { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--wbg); color: var(--wd); }
.lkc svg { width: 22px; height: 22px; }

.pages-band { background: var(--paper-2); }
.pages-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.pm-detail { margin: 20px 0 0; padding: 12px 16px; border-radius: var(--r-s); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font: 600 15px/1.4 var(--sans); }
[data-pm] { min-width: 0; }
@media (max-width: 860px) { .pages-grid { grid-template-columns: minmax(0, 1fr); } }

/* checkout and the "it's yours" screen */
.checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.checkout h1 { margin: 0 0 20px; }
.steps-n { display: grid; gap: 14px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps-n li { position: relative; padding-left: 46px; counter-increment: s; }
.steps-n li::before { content: counter(s); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 14px/1 var(--sans); }
.steps-n b { display: block; }
.order { position: sticky; top: 140px; padding: 24px; border-radius: var(--r-l); background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--sh-1); }
.order-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.order-top h2 { margin: 2px 0 4px; font-size: var(--t-l); line-height: 1.15; }
.order-top .wbr-shelf { color: var(--wtx); }
.order-top p { margin: 0; }
.order-rows { margin: 0 0 20px; }
.order-rows div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.order-rows dt { color: var(--mute); }
.order-rows dd { margin: 0; font-weight: 600; }
.order .small { margin: 10px 0 0; text-align: center; }
@media (max-width: 860px) { .checkout { grid-template-columns: minmax(0, 1fr); } .order { position: static; } }
.ok-wrap .h1 { margin: 24px 0 10px; }
.ok-wrap .h1:focus { outline: none; }
.ok-book { display: inline-grid; place-items: center; padding: 28px 40px; border-radius: var(--r-l); background: radial-gradient(60% 60% at 50% 40%, rgba(245,208,107,.24), transparent 70%), var(--night); animation: ok-pop var(--d3) var(--e-back) both; }
@keyframes ok-pop { from { opacity: 0; transform: scale(.92) translateY(10px); } }

/* ==================================================================
   6. Try, free journal, account, library, help
   ================================================================== */
.goal-card { padding: 24px; border-radius: var(--r-l); background: var(--card); color: var(--ink); box-shadow: var(--sh-2); }
.goal-card h2 { margin: 0 0 6px; font-size: var(--t-xl); line-height: 1.15; }
.goal-card > p { margin: 0 0 16px; color: var(--mute); }
.goal5 { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.goal5 li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.goal5 i { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); font-style: normal; transition: background-color var(--d2) var(--e-sig), box-shadow var(--d2) var(--e-sig); }
.goal5 li.on i { background: var(--ok); box-shadow: none; color: #fff; }
.goal5 li.on > span { color: var(--mute); }
.goal5 i svg { width: 16px; height: 16px; }
.meter { height: 8px; margin: 0 0 16px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.meter i { display: block; width: var(--p, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ember), var(--lamp)); transition: width var(--d3) var(--e-sig); }

.tgroups { display: grid; gap: 20px; margin-top: 28px; }
.tgroup { padding: clamp(18px, 3vw, 28px); border-radius: var(--r-l); background: var(--wbg); color: var(--wink); }
.tg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.tg-head > div { flex: 1 1 200px; min-width: 0; }
.tg-head h2 { margin: 0; font-size: var(--t-xl); line-height: 1.1; color: var(--wink); }
.tg-head p { margin: 2px 0 0; font-size: 14px; }
.tg-head .link { color: var(--wink); }
.tg-mot { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--wd); color: var(--wc); flex: none; }
.tg-mot .motif { width: 24px; height: 24px; }
.tools4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.toolc { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; gap: 6px; min-height: 196px; padding: 18px; border: 0; border-radius: var(--r); background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform var(--d2) var(--e-sig), box-shadow var(--d2) var(--e-sig); }
.toolc:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--wtx), var(--sh-1); }
.toolc:active { transform: translateY(-1px) scale(.98); }
.toolc .ic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 12px; background: var(--wbg); color: var(--wd); }
.toolc .ic svg { width: 26px; height: 26px; }
.toolc b { font: 600 17px/1.25 var(--sans); }
.toolc .tl { color: var(--mute); font-size: 14px; line-height: 1.4; }
.toolc .st { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--wtx); font: 600 13px/1.3 var(--sans); }
.toolc .st svg { width: 16px; height: 16px; flex: none; }
.toolc.done .st { color: var(--ok); }
.toolc.locked .st { color: var(--mute); }
.tool-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-s); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.tool-done svg { width: 20px; height: 20px; flex: none; }
.tool-done .link { color: inherit; }
@media (max-width: 1040px) { .tools4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .tools4 { grid-template-columns: minmax(0, 1fr); } .toolc { min-height: 0; } }

.usteps { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.ustep { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-s); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.ustep b { display: block; font-size: 16px; }
.ustep p { margin: 2px 0 0; color: var(--mute); font-size: 14px; }
.ub { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.ub svg { width: 16px; height: 16px; }
.ustep.ok .ub { background: var(--ok); box-shadow: none; color: #fff; }
.ok-t { color: var(--ok); font: 600 14px/1 var(--sans); }
#unlock-h { margin-top: 10px; }
.kids { padding: clamp(20px, 3vw, 32px); border-radius: var(--r-l); background: var(--paper-2); }
.kids .h2 { margin-top: 0; }
.mini-street { display: flex; align-items: flex-end; gap: 4px; margin-top: 24px; padding: 18px 14px 0; border-radius: var(--r); background: linear-gradient(to top, var(--night-3) 0 10px, var(--night) 10px); overflow: hidden; }
.mini-street .facade { flex: 1 1 0; min-width: 0; height: auto; }
.mini-street .facade .win { opacity: .9; }

.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile h1 { margin: 0; }
.profile p { margin: 4px 0 0; }
.av { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--wd, var(--night)); color: var(--wc, var(--on-night)); font: 600 15px/1 var(--sans); }
.av.big { width: 72px; height: 72px; background: var(--night); color: var(--lamp); font: 400 32px/1 var(--serif); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.stats div { padding: 16px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.stats dt { color: var(--mute); font-size: 14px; }
.stats dd { margin: 4px 0 0; font: 400 var(--t-xl)/1.1 var(--serif); }
@media (max-width: 480px) { .stats { grid-template-columns: minmax(0, 1fr); } }
.danger-zone { margin-top: 40px; padding: 20px 22px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--err); }
.danger-zone .h3 { margin: 0 0 6px; color: var(--err); }
.danger-zone p { margin: 0 0 14px; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.welcome p { margin: 0; }
.form { display: grid; gap: 22px; margin-top: 28px; }
.form .acts { margin-top: 4px; }
.kidnote:focus { outline: none; }

.libhead { padding-block: clamp(40px, 6vw, 72px); }
.libhead h1 { margin: 0 0 10px; color: var(--on-night); }
.libhead .lede { margin: 0; }
.libshelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 36px 24px; }
.lib-item { width: auto; }
.keep-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin-top: clamp(40px, 6vw, 72px); }
.kc { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.kc .h3 { margin: 4px 0 0; }
.kc p { margin: 0; }
.kc .fld { align-self: stretch; }
.kc .btn { margin-top: auto; }
.kc .fld + .btn { margin-top: 0; }
.kicon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--night); color: var(--lamp); }
.kicon svg { width: 24px; height: 24px; }

/* ================= 7. Art: covers, scenes, pictures of days ================= */
/* A cover is drawn at its own size: everything inside scales with the cover's width (cqi). */
.book { --bw: 148px; position: relative; display: inline-block; flex: none; width: var(--bw); max-width: 100%; aspect-ratio: 2 / 3; container-type: inline-size; vertical-align: top; filter: drop-shadow(0 2px 2px rgba(9,20,24,.18)) drop-shadow(0 14px 16px rgba(9,20,24,.2)); }
.book.sm { --bw: 96px; }
.book.lg { --bw: 200px; }
.book.xl { --bw: clamp(180px, 24vw, 280px); }
.shelf-item .book, .lib-item .book { --bw: 100%; max-width: 180px; }
.order-top .book { --bw: 84px; }
.b-face { position: absolute; inset: 0; overflow: hidden; border-radius: 3px 9px 9px 3px; background: var(--wd); color: var(--wc); }
.b-pic { position: absolute; inset: 0; display: block; overflow: hidden; }
.b-pic .scene { width: 100%; height: 100%; }
.book:not(.xl) .scene * { animation: none; }
.b-spine { position: absolute; inset: 0 auto 0 0; width: 9%; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,.1) 64%, rgba(255,255,255,.16) 88%, rgba(0,0,0,.08)); pointer-events: none; }
.b-edge { position: absolute; top: 2.5%; bottom: 2.5%; right: -3px; width: 4px; border-radius: 0 3px 3px 0; background: repeating-linear-gradient(180deg, #F4ECDD 0 2px, #D9CDB8 2px 3px); }
.b-label { position: absolute; left: 13%; right: 8%; bottom: 8%; display: grid; gap: 2.6cqi; justify-items: start; text-align: left; }
.b-mot { display: block; width: 12cqi; height: 12cqi; color: var(--wa); }
.b-mot .motif { display: block; width: 100%; height: 100%; }
.b-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); font-size: max(10px, 11.5cqi); line-height: 1.03; overflow-wrap: anywhere; }
.b-w { display: block; font: 600 max(8px, 6.2cqi)/1.2 var(--sans); letter-spacing: .05em; opacity: .86; }
.book.sm .b-w, .book.sm .b-mot { display: none; }

/* band: the picture fills the cover, the title sits on a cream band with an accent rule */
.b-band .b-label { left: 0; right: 0; bottom: 0; padding: 6cqi 8cqi 8cqi 14cqi; border-top: 2.4cqi solid var(--wa); background: var(--wc); color: var(--wd); }
.b-band .b-mot { color: var(--wd); }
/* frame: a plain cloth cover, double rule, the world's emblem in a roundel */
.b-frame .b-face::before { content: ""; position: absolute; inset: 6cqi 6cqi 6cqi 13cqi; border: 1.5px solid color-mix(in srgb, var(--wc) 60%, transparent); border-radius: 2px; box-shadow: inset 0 0 0 3cqi var(--wd), inset 0 0 0 calc(3cqi + 1px) color-mix(in srgb, var(--wc) 35%, transparent); pointer-events: none; }
.b-emb { position: absolute; top: 17%; left: 13%; right: 6%; display: grid; place-items: center; }
.b-emb > svg { width: 34cqi; height: 34cqi; padding: 8cqi; border-radius: 50%; background: var(--wa); color: var(--wd); box-shadow: 0 0 0 1.6cqi var(--wd), 0 0 0 2.2cqi color-mix(in srgb, var(--wc) 60%, transparent); }
.b-frame .b-label { left: 16%; right: 10%; bottom: 13%; justify-items: center; text-align: center; }
.b-frame .b-mot { display: none; }
/* split: picture above, an accent rule, a deep field with the title below */
.b-split .b-pic { bottom: 44%; border-bottom: 2.4cqi solid var(--wa); }
.b-split .b-label { bottom: 7%; }
/* plate: a cream cover with a picture tipped in like a bookplate */
.b-plate .b-face { background: var(--wc); color: var(--wd); }
.b-plate .b-pic { inset: 11cqi 9cqi auto 16cqi; height: 50%; border-radius: 2px; box-shadow: 0 0 0 1.5px var(--wd); }
.b-plate .b-face::after { content: ""; position: absolute; inset: 7.5cqi 5.5cqi auto 12.5cqi; height: calc(50% + 7cqi); border: 1px solid color-mix(in srgb, var(--wd) 40%, transparent); border-radius: 3px; pointer-events: none; }
.b-plate .b-mot { color: var(--wa); }
/* slant: the picture fills the cover and a deep panel cuts across it */
.b-slant .b-label { left: 0; right: 0; bottom: 0; padding: 17cqi 8cqi 8cqi 14cqi; background: linear-gradient(170deg, transparent 0 calc(9cqi - 1px), var(--wa) 9cqi calc(11.4cqi), var(--wd) calc(11.4cqi + 1px)); clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%); }
/* window: a deep cover with an arched window onto the world */
.b-window .b-pic { inset: 10cqi 10cqi auto 17cqi; height: 52%; border-radius: 40cqi 40cqi 3px 3px; outline: 1.6cqi solid var(--wa); outline-offset: 1.4cqi; overflow: hidden; }
.b-window .b-label { bottom: 7%; }

.scene { display: block; width: 100%; height: auto; }

/* the picture of days done */
.prog { display: block; width: 100%; height: auto; border-radius: 14px; }
.prog .slot { transform-box: fill-box; transform-origin: 50% 80%; }
.prog .slot.lit.new { animation: slot-in var(--d3) var(--e-back) both; }
@keyframes slot-in { 0% { opacity: 0; transform: scale(.2) translateY(6px); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.prog .pbadge { animation: badge-in var(--d2) var(--e-sig) both 120ms; }
@keyframes badge-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ================= 8. Inside a journal ================= */
/* The shop's own room: the header is the world's deep colour, the page is paper of the journal's kind. */
.japp { background: var(--paper); }
.jhead { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(20px, 3vw, 36px); background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--wa) 30%, transparent), transparent 62%), radial-gradient(50% 90% at 0% 100%, rgba(0,0,0,.22), transparent 70%), var(--wd); color: var(--wc); }
.jhead-in { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(16px, 2.6vw, 36px); align-items: center; }
.jcover { animation: cover-in var(--d3) var(--e-sig) both; }
@keyframes cover-in { from { opacity: 0; transform: translateY(10px) rotate(-3deg); } to { opacity: 1; transform: rotate(-2deg); } }
.jcover .book { transform: rotate(-2deg); }
.jtitle { min-width: 0; }
.jhead .crumbs { margin-bottom: 10px; color: color-mix(in srgb, var(--wc) 86%, transparent); }
.jhead .wbr-shelf { color: var(--wc); opacity: .9; }
.jhead .wbr-shelf .motif { color: var(--wa); }
.jhead h1 { margin: 0; color: var(--wc); font-size: clamp(28px, 3.4vw, 44px); line-height: 1.04; text-wrap: balance; overflow-wrap: anywhere; }
.jsub { margin: 10px 0 0; color: color-mix(in srgb, var(--wc) 80%, transparent); font-size: var(--t-s); }
.jprog { display: grid; gap: 12px; min-width: 0; }
.jprog .prog { box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 32px -18px rgba(0,0,0,.6); }
.count { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; }
.cn { font-family: var(--wf); font-weight: var(--ww); font-size: 44px; line-height: .9; font-variant-numeric: tabular-nums; color: var(--wc); }
.cl { display: grid; gap: 2px; min-width: 0; color: color-mix(in srgb, var(--wc) 80%, transparent); font-size: 14px; line-height: 1.35; }
.cl b { color: var(--wc); font-size: 15px; }
.wdots { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.wdots span { display: grid; justify-items: center; gap: 4px; min-width: 26px; color: color-mix(in srgb, var(--wc) 72%, transparent); font: 600 12px/1 var(--sans); }
.wdots i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--wc) 50%, transparent); transition: background var(--d2) var(--e-sig), box-shadow var(--d2) var(--e-sig); }
.wdots .on i { background: var(--sea); box-shadow: inset 0 0 0 1.5px var(--sea), 0 0 0 3px rgba(95,179,168,.18); }
.wdots .rest i { background: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold), 0 0 10px 1px rgba(226,179,60,.6); }
.wdots .today { color: var(--wc); }
.wdots .today i { outline: 2px solid var(--wc); outline-offset: 2px; }
.count-off { display: grid; gap: 8px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.count-off p { margin: 0; color: var(--wc); font-size: var(--t-s); line-height: 1.5; }
.count-off .link { justify-self: start; color: var(--wc); }
@media (max-width: 900px) {
  .jhead-in { grid-template-columns: auto minmax(0, 1fr); }
  .jprog { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; }
}
@media (max-width: 600px) {
  .jcover .book { --bw: 64px; }
  .jprog { grid-template-columns: minmax(0, 1fr); }
  .cn { font-size: 38px; }
}

/* tabs: a sliding underline, sticky on wide screens only (the header wraps to two rows below 860px) */
.jtabs { z-index: 20; background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 -1px 0 var(--line); }
@media (min-width: 861px) { .jtabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 64px); } }
.jtabs-in { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.jtabs-in::-webkit-scrollbar { display: none; }
.jtab { position: relative; flex: none; min-height: 52px; padding: 0 16px; border: 0; background: none; color: var(--mute); font: 600 15px/1 var(--sans); cursor: pointer; transition: color var(--d1) var(--e-sig); }
.jtab:hover { color: var(--ink); }
.jtab[aria-selected="true"] { color: var(--wtx); }
.jtab:focus-visible { outline: 3px solid var(--ring); outline-offset: -6px; border-radius: 10px; }
.jtab:active { transform: scale(.97); }
.tab-ind { position: absolute; left: 0; bottom: 0; width: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--wtx); transition: transform var(--d2) var(--e-sig), width var(--d2) var(--e-sig); pointer-events: none; }

.jbody { padding-top: clamp(24px, 4vw, 44px); padding-bottom: clamp(48px, 7vw, 96px); }
.jbody:focus { outline: none; }
@media (min-width: 1000px) {
  .jbody:has(> .leaf.page) { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px clamp(28px, 3.4vw, 48px); align-items: start; }
  .jbody:has(> .leaf.page) > .nudge, .jbody:has(> .leaf.page) > .together { grid-column: 1 / -1; }
  .jbody:has(> .leaf.page) > .daily { margin-top: 0; }
}

.nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 24px; padding: 14px 18px; border-radius: var(--r); background: var(--wbg); color: var(--wink); box-shadow: inset 4px 0 0 var(--wa); }
.nudge p { margin: 0; font-size: var(--t-s); }

/* the page of the day: a leaf of paper with a binding edge */
.leaf.page { position: relative; display: grid; gap: 20px; min-width: 0; padding: clamp(20px, 3.5vw, 40px) clamp(20px, 3.5vw, 40px) clamp(24px, 3.5vw, 40px) clamp(28px, 4.4vw, 52px); border-radius: 6px 18px 18px 6px; background-color: var(--card); box-shadow: inset 10px 0 12px -10px rgba(15,35,43,.28), 0 1px 0 var(--line), 0 26px 50px -28px rgba(15,35,43,.38); }
.paper-lined .leaf.page { background-image: linear-gradient(90deg, transparent 0 calc(clamp(28px, 4.4vw, 52px) - 14px), color-mix(in srgb, var(--wa) 45%, transparent) calc(clamp(28px, 4.4vw, 52px) - 14px) calc(clamp(28px, 4.4vw, 52px) - 13px), transparent 0), repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--line) 80%, transparent) 31px 32px); background-position: 0 0, 0 18px; }
.paper-dots .leaf.page { background-image: radial-gradient(circle, color-mix(in srgb, var(--line-2) 70%, transparent) 1.1px, transparent 1.6px); background-size: 22px 22px; background-position: 11px 11px; }
.paper-grid .leaf.page { background-image: linear-gradient(color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px); background-size: 24px 24px; }
.paper-plain .leaf.page { background-image: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--wbg) 70%, transparent), transparent 60%); }
.pg-head { display: grid; gap: 8px; max-width: 64ch; }
.pg-no { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; color: var(--mute); font: 600 13px/1.3 var(--sans); }
.pg-no b { color: var(--wtx); font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); letter-spacing: var(--wl); font-size: 17px; }
.pg-head h2 { margin: 0; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.08; text-wrap: balance; }
.pg-q { margin: 0; color: var(--mute); font-size: var(--t-m); line-height: 1.55; }
.pg-host { min-width: 0; }
.pg-done { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding: 16px 18px; border-radius: var(--r); background: var(--wbg); color: var(--wink); }
.pg-done .stamp { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--wd); color: var(--wc); box-shadow: 0 0 0 3px var(--wbg), 0 0 0 5px var(--wd); font-family: var(--wf); font-weight: var(--ww); font-size: 24px; transform: rotate(-6deg); }
.pd-text p { margin: 0; }
.pd-text .muted { color: color-mix(in srgb, var(--wink) 72%, transparent); }
.pg-done .btn.ghost { --bf: var(--wink); }
.leaf.page.is-done::after { content: ""; position: absolute; top: -4px; right: clamp(20px, 4vw, 44px); width: 22px; height: 64px; background: var(--wa); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); box-shadow: 0 2px 0 rgba(0,0,0,.08); animation: ribbon-in var(--d3) var(--e-sig) both; }
@keyframes ribbon-in { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 560px) { .pg-done { grid-template-columns: auto minmax(0, 1fr); } .pg-done .btn { grid-column: 1 / -1; justify-self: start; } .pg-done .stamp { width: 52px; height: 52px; font-size: 20px; } }

/* twelve ways a page arrives; the same four daily steps follow in a matching rhythm */
.leaf.page.anim-fold { transform-origin: 50% 0; animation: pg-fold var(--d3) var(--e-sig) both; }
@keyframes pg-fold { from { opacity: 0; transform: perspective(1200px) rotateX(-14deg); } to { opacity: 1; transform: none; } }
.leaf.page.anim-drift { animation: pg-drift var(--d3) var(--e-sig) both; }
@keyframes pg-drift { from { opacity: 0; transform: translateX(24px) rotate(.8deg); } to { opacity: 1; transform: none; } }
.leaf.page.anim-bloom { animation: pg-bloom 640ms var(--e-sig) both; }
@keyframes pg-bloom { from { clip-path: circle(12% at 50% 40%); opacity: .4; } to { clip-path: circle(150% at 50% 40%); opacity: 1; } }
.leaf.page.anim-ink { animation: pg-ink var(--d3) var(--e-sig) both; }
@keyframes pg-ink { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
.leaf.page.anim-tilt { transform-origin: 0 100%; animation: pg-tilt var(--d3) var(--e-sig) both; }
@keyframes pg-tilt { from { opacity: 0; transform: translateY(14px) rotate(-2.2deg); } to { opacity: 1; transform: none; } }
.leaf.page.anim-sweep { animation: pg-sweep 600ms var(--e-inout) both; }
@keyframes pg-sweep { from { clip-path: inset(0 100% 0 0 round 6px 18px 18px 6px); } to { clip-path: inset(0 0 0 0 round 6px 18px 18px 6px); } }
.leaf.page.anim-cascade .pg-head > *, .leaf.page.anim-cascade .pg-host { animation: pg-rise var(--d2) var(--e-sig) both; }
.leaf.page.anim-cascade .pg-head > :nth-child(2) { animation-delay: 70ms; }
.leaf.page.anim-cascade .pg-head > :nth-child(3) { animation-delay: 140ms; }
.leaf.page.anim-cascade .pg-host { animation-delay: 210ms; }
@keyframes pg-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.leaf.page.anim-stamp { animation: pg-stamp 480ms var(--e-sig) both; }
@keyframes pg-stamp { 0% { opacity: 0; transform: scale(1.06); } 60% { opacity: 1; transform: scale(.985); } 100% { transform: none; } }
.leaf.page.anim-ripple { animation: pg-ripple 640ms var(--e-sig) both; }
@keyframes pg-ripple { from { clip-path: circle(0 at 0 0); } to { clip-path: circle(160% at 0 0); } }
.leaf.page.anim-unroll { animation: pg-unroll 600ms var(--e-sig) both; }
@keyframes pg-unroll { from { clip-path: inset(0 0 100% 0 round 6px 18px 18px 6px); } to { clip-path: inset(0 0 0 0 round 6px 18px 18px 6px); } }
.leaf.page.anim-flip { transform-origin: 0 50%; animation: pg-flip var(--d3) var(--e-sig) both; }
@keyframes pg-flip { from { opacity: 0; transform: perspective(1400px) rotateY(-18deg); } to { opacity: 1; transform: none; } }
.leaf.page.anim-glide { animation: pg-glide 640ms var(--e-sig) both; }
@keyframes pg-glide { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.daily { min-width: 0; margin-top: 32px; }
.daily .sec-top { margin-bottom: 16px; }
.daily .sec-top p { margin: 0; }
.dsteps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dsteps > li { display: grid; gap: 10px; min-width: 0; padding: 18px 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation-duration: var(--d2); animation-timing-function: var(--e-sig); animation-fill-mode: both; animation-delay: calc(120ms + var(--i, 0) * 80ms); }
.daily.anim-fold .dsteps > li, .daily.anim-tilt .dsteps > li, .daily.anim-glide .dsteps > li { animation-name: ds-rise; }
.daily.anim-drift .dsteps > li, .daily.anim-sweep .dsteps > li, .daily.anim-flip .dsteps > li { animation-name: ds-slide; }
.daily.anim-bloom .dsteps > li, .daily.anim-stamp .dsteps > li, .daily.anim-ripple .dsteps > li { animation-name: ds-pop; }
.daily.anim-ink .dsteps > li, .daily.anim-cascade .dsteps > li, .daily.anim-unroll .dsteps > li { animation-name: ds-soft; }
@keyframes ds-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ds-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes ds-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ds-soft { from { opacity: 0; } to { opacity: 1; } }
.ds-h { display: flex; align-items: center; gap: 10px; }
.ds-h i { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--wd); color: var(--wc); font: 600 13px/1 var(--sans); font-style: normal; }
.ds-h b, .ds-h label { font: 600 16px/1.3 var(--sans); }
.ds-q { margin: 0; color: var(--ink); font-size: var(--t-m); line-height: 1.45; }
.dsteps .hint { margin: 0; }
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 4px; }
.saved-pill { display: inline-flex; align-items: center; gap: 6px; justify-self: start; margin: 0; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font: 600 13px/1.4 var(--sans); animation: pill-in var(--d2) var(--e-back) both; }
.saved-pill svg { width: 16px; height: 16px; flex: none; }
.saved-pill.gold { background: color-mix(in srgb, var(--gold) 22%, var(--card)); color: var(--ink); box-shadow: 0 0 14px -2px rgba(226,179,60,.55); }
@keyframes pill-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.back-card { position: relative; display: grid; gap: 6px; padding: 16px 18px 16px 22px; border-radius: 4px 14px 14px 4px; background: var(--wbg); color: var(--wink); box-shadow: inset 4px 0 0 var(--wa); }
.back-card small { color: color-mix(in srgb, var(--wink) 75%, transparent); font: 600 13px/1.3 var(--sans); }
.back-card .hand { margin: 0; font-size: 22px; line-height: 1.3; }
.grow-strip { margin-top: 12px; }
.grow-strip + .small { margin: 8px 0 0; color: var(--mute); }
.together { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 32px; padding: 22px 24px; border-radius: var(--r-l); background: var(--night); color: var(--on-night); --ring: var(--lamp); }
.together h2, .together p { margin: 0; }
.together p { margin-top: 4px; color: var(--on-night-mute); max-width: 60ch; }
.together .btn.ghost { --bf: var(--on-night); --bl: rgba(246,241,232,.35); --bh: rgba(246,241,232,.08); }

/* pages tab */
.pdetail { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 22px 24px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.pdetail:empty { display: none; }
.pdetail h3 { margin: 0; font-size: var(--t-xl); line-height: 1.15; }
.pdetail p { margin: 0; }
.pdetail .acts { margin-top: 8px; }
.pages-grid { margin-bottom: clamp(32px, 5vw, 56px); }
.pages { display: grid; gap: 12px; }
.ent { display: grid; gap: 8px; min-width: 0; padding: 18px 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.ent-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ent-h b { font: 600 16px/1.3 var(--sans); }
.sigline { margin: 0; color: var(--mute); font-size: var(--t-s); }
.sigline b { color: var(--wtx); }
.lines { margin: 0; font-size: 22px; line-height: 1.35; white-space: pre-line; overflow-wrap: anywhere; }
.ent.rest { background: color-mix(in srgb, var(--gold) 9%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 45%, var(--line)); }
.tag.gold { background: var(--gold); color: #2B2206; }
.lookback { padding: 12px 14px; border-radius: 10px; background: var(--wbg); color: var(--wink); }
.lookback small { font: 600 12px/1.3 var(--sans); opacity: .8; }
.lookback .hand { margin: 4px 0 0; font-size: 20px; line-height: 1.3; }

/* tools and about tabs */
.toolpane { min-width: 0; margin-top: 20px; padding: clamp(18px, 3vw, 28px); border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.toolpane > h3 { margin: 0 0 6px; }
.toolpane > p:first-child { margin: 0; }
.about { align-items: start; }
.about .panel { align-self: start; }

/* ================= 9. Community ================= */
.hero.slim { padding-block: clamp(36px, 5vw, 64px); }
.hero.slim h1 { max-width: 18ch; font-size: var(--t-3xl); line-height: 1.04; }
.hero.slim .lede { margin: 14px 0 0; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.hero-in .lede { margin: 14px 0 0; }
.comm-facts { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.comm-facts li { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(246,241,232,.06); box-shadow: inset 0 0 0 1px rgba(246,241,232,.12); }
.comm-facts svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: rgba(245,208,107,.14); color: var(--lamp); }
.comm-facts span { display: grid; gap: 2px; color: var(--on-night-mute); font-size: 14px; line-height: 1.4; }
.comm-facts b { color: var(--on-night); font-size: 15px; }
@media (max-width: 860px) { .hero-in { grid-template-columns: minmax(0, 1fr); align-items: start; } }

.comm-band { padding-top: clamp(24px, 3vw, 40px); }
.comm { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(24px, 3.4vw, 48px); align-items: start; }
.boards-side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); display: grid; gap: 12px; min-width: 0; }
.boards-side > .h3 { margin: 0; font-size: 17px; }
.chans { display: grid; gap: 2px; }
.chans button { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 15px/1.25 var(--sans); text-align: left; cursor: pointer; transition: background var(--d1) var(--e-sig), color var(--d1) var(--e-sig); }
.chans button:hover { background: var(--paper-2); }
.chans button:active { transform: scale(.98); }
.chans button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 600; }
.chans i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.chans small { color: inherit; opacity: .7; font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; }
.side-note { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.comm-main { display: grid; gap: 20px; min-width: 0; }
.board-sel { display: none; }
@media (max-width: 899px) {
  .comm { grid-template-columns: minmax(0, 1fr); }
  .boards-side { position: static; }
  .boards-side > .h3, .chans { display: none; }
  .side-note { margin: 0; padding: 0; border: 0; }
  .board-sel { display: grid; }
}

.board-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px 18px; padding: 18px 20px; border-radius: var(--r-l); background: var(--wbg); color: var(--wink); }
.board-head h2 { margin: 0; color: var(--wink); }
.board-head p { margin: 2px 0 0; color: color-mix(in srgb, var(--wink) 78%, transparent); }
.board-head .btn.ghost { --bf: var(--wink); --bl: color-mix(in srgb, var(--wink) 35%, transparent); --bh: rgba(0,0,0,.05); }
.bh-m { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--wd); color: var(--wa); }
.bh-m .motif { width: 28px; height: 28px; }
@media (max-width: 560px) { .board-head { grid-template-columns: auto minmax(0, 1fr); } .board-head .btn { grid-column: 1 / -1; justify-self: start; } }

.join { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 28px; }
.join h2 { margin: 0 0 6px; }
.join p { margin: 0; }
.join .ticks { margin: 10px 0 8px; }
.join-r { display: grid; gap: 10px; justify-items: start; max-width: 320px; }
@media (max-width: 720px) { .join { grid-template-columns: minmax(0, 1fr); } .join-r { max-width: none; } }

.prompt-card { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 22px 24px; border-radius: var(--r-l); background: radial-gradient(60% 120% at 100% 0%, rgba(245,208,107,.2), transparent 65%), var(--night); color: var(--on-night); --ring: var(--lamp); }
.prompt-card[style*="--wd"] { background: radial-gradient(60% 120% at 100% 0%, color-mix(in srgb, var(--wa) 34%, transparent), transparent 65%), var(--wd); color: var(--wc); }
.prompt-card > div { min-width: 0; flex: 1 1 320px; }
.prompt-card small { display: block; color: var(--lamp); font: 600 13px/1.3 var(--sans); }
.prompt-card[style*="--wd"] small { color: var(--wa); }
.prompt-card p { margin: 6px 0 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.2; text-wrap: balance; }
.prompt-card .btn:not(.world) { --bb: var(--lamp); --bf: #1E2A2E; --bl: transparent; --bh: rgba(0,0,0,.06); }
.prompt-card .btn.world { --bb: var(--wc); --bf: var(--wd); --bh: rgba(0,0,0,.06); }

.composer { display: grid; gap: 12px; padding: 18px 20px; border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.composer:focus-within { box-shadow: inset 0 0 0 1px var(--line-2), var(--sh-1); }
.comp-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.comp-h b { font: 600 16px/1.3 var(--sans); }
.answering { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--paper-2); font-size: var(--t-s); }
.answering > span { min-width: 0; }
.answering .pgcard { flex: 1; }
.comp-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.kind-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.comp-f { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }

.moments { display: grid; gap: 12px; min-width: 0; }
.moments .h3 { margin: 0; font-size: 18px; }
.mo-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.mo { display: grid; gap: 6px; align-content: start; min-width: 0; scroll-snap-align: start; }
.moment { display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--wbg); color: var(--wink); }
.moment small { display: block; color: color-mix(in srgb, var(--wink) 75%, transparent); font: 600 12px/1.3 var(--sans); }
.moment b { display: block; font-family: var(--wf); font-weight: var(--ww); text-transform: var(--wt); font-size: 20px; line-height: 1.1; }
.moment span { display: block; font-size: 14px; }
.mo-pic .prog { border-radius: 10px; }
.pgcard { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 12px; background: var(--wbg); color: var(--wink); text-decoration: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wd) 18%, transparent); transition: transform var(--d1) var(--e-sig), box-shadow var(--d1) var(--e-sig); }
.pgcard:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--wd), var(--sh-1); }
.pgcard:active { transform: scale(.98); }
.pgc-n { display: grid; place-items: center; width: 44px; height: 54px; border-radius: 3px 8px 8px 3px; background: var(--wd); color: var(--wc); font-family: var(--wf); font-weight: var(--ww); font-size: 19px; box-shadow: inset 4px 0 0 rgba(0,0,0,.2); }
.pgcard small { display: block; color: color-mix(in srgb, var(--wink) 75%, transparent); font: 600 12px/1.3 var(--sans); }
.pgcard b { display: block; font: 600 15px/1.3 var(--sans); }

.feed-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding-top: 8px; border-top: 1px solid var(--line); }
.feed-bar .chips { flex: 1 1 auto; }
.feed { display: grid; gap: 14px; }
.post { position: relative; display: grid; gap: 10px; min-width: 0; padding: 18px 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation: post-in var(--d2) var(--e-sig) both; }
.feed > .post:nth-child(2) { animation-delay: 60ms; }
.feed > .post:nth-child(3) { animation-delay: 120ms; }
.feed > .post:nth-child(n+4) { animation-delay: 180ms; }
@keyframes post-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.post.mine { box-shadow: inset 0 0 0 1px var(--line), inset 4px 0 0 var(--wa); }
.post.mini { padding: 14px 16px; gap: 8px; animation: none; }
.post.mini .post-t { font-size: var(--t-s); }
.post.mini > .small { margin: 0; }
.post-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; color: var(--mute); font-size: 14px; }
.post-h > b { color: var(--ink); font: 600 15px/1.3 var(--sans); }
.post-h .more { margin-left: auto; }
button.who { display: inline-flex; align-items: center; gap: 10px; padding: 2px 6px 2px 2px; border: 0; border-radius: 999px; background: none; color: var(--ink); font: 600 15px/1.3 var(--sans); cursor: pointer; transition: background var(--d1) var(--e-sig); }
button.who:hover { background: var(--paper-2); }
button.who:hover b { text-decoration: underline; text-underline-offset: 3px; }
button.who.sm { padding: 0 2px; font-size: 14px; }
.ans-q { margin: 0; padding-left: 10px; border-left: 3px solid var(--wa); color: var(--mute); font-size: 14px; line-height: 1.4; }
.post-t { margin: 0; font-size: var(--t-m); line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.post-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.react { --rc: var(--wtx); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--paper-2); color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; transition: background var(--d1) var(--e-sig), color var(--d1) var(--e-sig), box-shadow var(--d1) var(--e-sig), transform 90ms var(--e-sig); }
.react svg { width: 16px; height: 16px; flex: none; }
.react b { font-variant-numeric: tabular-nums; opacity: .75; }
.react:hover { box-shadow: inset 0 0 0 1px var(--rc); }
.react:active { transform: scale(.95); }
.react.r-helpful { --rc: var(--ok); }
.react.r-care { --rc: var(--ember); }
.react[aria-pressed="true"] { background: color-mix(in srgb, var(--rc) 16%, var(--card)); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rc); }
.react[aria-pressed="true"] svg { color: var(--rc); animation: react-pop var(--d2) var(--e-back); }
.react[aria-pressed="true"] b { opacity: 1; }
@keyframes react-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: none; } }
.replies { display: grid; gap: 6px; margin-left: 12px; padding-left: 14px; border-left: 2px solid var(--line); }
.replies p { margin: 0; font-size: var(--t-s); line-height: 1.5; }
.reply-box { display: grid; gap: 8px; }
.reply-box .acts { margin: 0; }
.leave { margin: 8px 0 0; }

/* rules */
.rules-list { display: grid; gap: 14px; max-width: 760px; margin: 0; padding: 0; list-style: none; }
.rules-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 20px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation: post-in var(--d2) var(--e-sig) both; animation-delay: calc(var(--i, 0) * 60ms); }
.rules-list b { display: block; margin-bottom: 2px; font: 600 17px/1.35 var(--sans); }
.rules-list span { line-height: 1.55; }
.rn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--night); color: var(--lamp); font: 400 20px/1 var(--serif); }

/* ================= 10. Print ================= */
@media print {
  .top, .foot, .path, .jtabs, .nudge, .together, .save-row, #toast, .skip { display: none !important; }
  body, .japp { background: #fff !important; color: #000; }
  .jhead { background: none !important; color: #000; }
  .jhead h1, .cn, .cl b, .jsub { color: #000; }
  .leaf.page, .dsteps > li, .ent, .kc, .post { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; animation: none !important; }
}

/* ================= 11. Reduced motion ================= */
/* Everything still arrives, at once and in place. Ambient life stops. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  [class*="amb-"], .rip, .wave, .flame, .steam, svg .leaf, .spot.on circle, .fly, .lamps .lamp.next i, .lpost .halo,
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .btn:active, .react:active, .jtab:active, .chans button:active, .pgcard:active { transform: none; }
}
