/* BattleFuel — Kaki Ridge default, plus BattleLog colourways Aizome Kasuri and Riso Washi
 * (from /workspace/bl-colourways and the BJJ design-language spec). Switch with data-theme.
 * Contrast: text on fills uses --on, never --ink, on accent/danger. Small accent text uses --accent-text
 * (tuned to AA on raised). Poster skins have no pure white. Roboto Slab stops at 800. */
:root, [data-theme="kaki"] {
  color-scheme: dark;
  --bg: #1b2520; --surface: #22332a; --surface-2: #2c4234; --shadow-ink: #0e1411;
  --ink: #f2e9d6; --ink-2: #b9b29e; --ink-3: #b9b29e; --on: #1b1712; --line: #7a967f;
  --accent: #f27536; --accent-text: #ff874a; --accent-soft: #3a2a1c;
  --good: #b9c774; --good-soft: #243018; --bad: #ff8c7a;
  --protein: #b9c774; --carbs: #4f80b3; --carbs-text: #7fb3e6; --fat: #9273ba; --fat-text: #c2a5e8; --water: #4f80b3; --water-text: #7fb3e6;
  --radius: 2px; --radius-sm: 2px;
  --shadow: 4px 4px 0 0 var(--shadow-ink); --shadow-accent: 5px 5px 0 0 var(--accent);
  --font-display: 'Roboto Slab', Georgia, serif;
  --font-sans: 'Barlow', system-ui, sans-serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --text-xs: 0.8125rem; --text-sm: 0.9375rem; --text-base: 1rem; --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem); --text-xl: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --asanoha: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='45.03'><path d='M-13.00 0.00L0.00 -22.52M-26.00 0.00L0.00 0.00M-13.00 -22.52L0.00 0.00M-13.00 -7.51L0.00 0.00M13.00 0.00L26.00 -22.52M0.00 -22.52L13.00 0.00M13.00 -15.01L13.00 0.00M0.00 0.00L13.00 -22.52M0.00 0.00L26.00 0.00M13.00 -22.52L26.00 0.00M0.00 0.00L13.00 -7.51M13.00 -7.51L26.00 0.00M26.00 -22.52L39.00 0.00M26.00 0.00L39.00 -22.52M26.00 0.00L52.00 0.00M26.00 0.00L39.00 -7.51M-13.00 22.52L0.00 0.00M-13.00 7.51L0.00 0.00M-26.00 22.52L0.00 22.52M-13.00 0.00L0.00 22.52M-13.00 15.01L0.00 22.52M13.00 22.52L26.00 0.00M0.00 0.00L13.00 22.52M0.00 0.00L13.00 7.51M13.00 7.51L26.00 0.00M13.00 22.52L13.00 7.51M0.00 22.52L13.00 0.00M0.00 22.52L26.00 22.52M13.00 0.00L26.00 22.52M13.00 0.00L13.00 15.01M0.00 22.52L13.00 15.01M13.00 15.01L26.00 22.52M26.00 0.00L39.00 22.52M26.00 0.00L39.00 7.51M26.00 22.52L39.00 0.00M26.00 22.52L52.00 22.52M26.00 22.52L39.00 15.01M-13.00 45.03L0.00 22.52M-13.00 30.02L0.00 22.52M-26.00 45.03L0.00 45.03M-13.00 22.52L0.00 45.03M-13.00 37.53L0.00 45.03M13.00 45.03L26.00 22.52M0.00 22.52L13.00 45.03M0.00 22.52L13.00 30.02M13.00 30.02L26.00 22.52M13.00 30.02L13.00 45.03M0.00 45.03L13.00 22.52M0.00 45.03L26.00 45.03M13.00 22.52L26.00 45.03M13.00 22.52L13.00 37.53M0.00 45.03L13.00 37.53M13.00 37.53L26.00 45.03M26.00 22.52L39.00 45.03M26.00 22.52L39.00 30.02M26.00 45.03L39.00 22.52M26.00 45.03L52.00 45.03M26.00 45.03L39.00 37.53M-13.00 67.55L0.00 45.03M-13.00 52.54L0.00 45.03M-13.00 45.03L0.00 67.55M13.00 67.55L26.00 45.03M0.00 45.03L13.00 67.55M0.00 45.03L13.00 52.54M13.00 52.54L26.00 45.03M0.00 67.55L13.00 45.03M13.00 45.03L26.00 67.55M13.00 45.03L13.00 60.04M26.00 45.03L39.00 67.55M26.00 45.03L39.00 52.54M26.00 67.55L39.00 45.03' fill='none' stroke='%23F2E9D6' stroke-opacity='0.05' stroke-width='0.6'/></svg>");
  --asanoha-strong: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='26' height='45.03'><path d='M-13.00 0.00L0.00 -22.52M-26.00 0.00L0.00 0.00M-13.00 -22.52L0.00 0.00M-13.00 -7.51L0.00 0.00M13.00 0.00L26.00 -22.52M0.00 -22.52L13.00 0.00M13.00 -15.01L13.00 0.00M0.00 0.00L13.00 -22.52M0.00 0.00L26.00 0.00M13.00 -22.52L26.00 0.00M0.00 0.00L13.00 -7.51M13.00 -7.51L26.00 0.00M26.00 -22.52L39.00 0.00M26.00 0.00L39.00 -22.52M26.00 0.00L52.00 0.00M26.00 0.00L39.00 -7.51M-13.00 22.52L0.00 0.00M-13.00 7.51L0.00 0.00M-26.00 22.52L0.00 22.52M-13.00 0.00L0.00 22.52M-13.00 15.01L0.00 22.52M13.00 22.52L26.00 0.00M0.00 0.00L13.00 22.52M0.00 0.00L13.00 7.51M13.00 7.51L26.00 0.00M13.00 22.52L13.00 7.51M0.00 22.52L13.00 0.00M0.00 22.52L26.00 22.52M13.00 0.00L26.00 22.52M13.00 0.00L13.00 15.01M0.00 22.52L13.00 15.01M13.00 15.01L26.00 22.52M26.00 0.00L39.00 22.52M26.00 0.00L39.00 7.51M26.00 22.52L39.00 0.00M26.00 22.52L52.00 22.52M26.00 22.52L39.00 15.01M-13.00 45.03L0.00 22.52M-13.00 30.02L0.00 22.52M-26.00 45.03L0.00 45.03M-13.00 22.52L0.00 45.03M-13.00 37.53L0.00 45.03M13.00 45.03L26.00 22.52M0.00 22.52L13.00 45.03M0.00 22.52L13.00 30.02M13.00 30.02L26.00 22.52M13.00 30.02L13.00 45.03M0.00 45.03L13.00 22.52M0.00 45.03L26.00 45.03M13.00 22.52L26.00 45.03M13.00 22.52L13.00 37.53M0.00 45.03L13.00 37.53M13.00 37.53L26.00 45.03M26.00 22.52L39.00 45.03M26.00 22.52L39.00 30.02M26.00 45.03L39.00 22.52M26.00 45.03L52.00 45.03M26.00 45.03L39.00 37.53M-13.00 67.55L0.00 45.03M-13.00 52.54L0.00 45.03M-13.00 45.03L0.00 67.55M13.00 67.55L26.00 45.03M0.00 45.03L13.00 67.55M0.00 45.03L13.00 52.54M13.00 52.54L26.00 45.03M0.00 67.55L13.00 45.03M13.00 45.03L26.00 67.55M13.00 45.03L13.00 60.04M26.00 45.03L39.00 67.55M26.00 45.03L39.00 52.54M26.00 67.55L39.00 45.03' fill='none' stroke='%23F2E9D6' stroke-opacity='0.22' stroke-width='0.6'/></svg>");
  --terrain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect x='8' y='36' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/><rect x='16' y='7' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/><rect x='48' y='28' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/><rect x='27' y='38' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/><rect x='37' y='6' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/><rect x='53' y='18' width='1.5' height='1' fill='%23F2E9D6' opacity='0.18'/></svg>");
  --tape: #f2e9d6; --tape-ink: #1b1712;
  --page-motif: var(--asanoha); --page-size: 26px 45.03px;
  --band-motif: var(--asanoha-strong); --band-size: 26px 45.03px;
  --theme-color: #1b2520;
}
[data-theme="aizome"] {
  color-scheme: dark;
  --bg: #111a31; --surface: #192548; --surface-2: #22335f; --shadow-ink: #080d1c;
  --ink: #f1ebdd; --ink-2: #afb8d0; --ink-3: #afb8d0; --on: #111a31; --line: #6a80bf;
  --accent: #ff4f5e; --accent-text: #ff6e7a; --accent-soft: #3a1d2c;
  --good: #86d0c6; --good-soft: #1a2c38; --bad: #ffb4d0;
  --protein: #86d0c6; --carbs: #5b8fd6; --carbs-text: #6ba0e8; --fat: #a07ad0; --fat-text: #b38de2; --water: #5b8fd6; --water-text: #6ba0e8;
  --shadow: 4px 4px 0 0 var(--shadow-ink); --shadow-accent: 5px 5px 0 0 var(--accent);
  --tape: #f1ebdd; --tape-ink: #111a31;
  --page-motif: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' opacity='0.12'><rect x='5' y='2' width='2' height='5' fill='%23F1EBDD'/><rect x='5' y='8' width='2' height='3' fill='%23F1EBDD'/><rect x='5' y='12' width='2' height='4' fill='%23F1EBDD'/><rect x='11' y='2' width='2' height='5' fill='%23F1EBDD'/><rect x='11' y='8' width='2' height='3' fill='%23F1EBDD'/><rect x='11' y='12' width='2' height='4' fill='%23F1EBDD'/><rect x='2' y='5' width='4' height='2' fill='%23F1EBDD'/><rect x='7' y='5' width='5' height='2' fill='%23F1EBDD'/><rect x='13' y='5' width='3' height='2' fill='%23F1EBDD'/><rect x='2' y='11' width='4' height='2' fill='%23F1EBDD'/><rect x='7' y='11' width='5' height='2' fill='%23F1EBDD'/><rect x='13' y='11' width='3' height='2' fill='%23F1EBDD'/><rect x='23' y='20' width='2' height='5' fill='%23F1EBDD'/><rect x='23' y='26' width='2' height='3' fill='%23F1EBDD'/><rect x='23' y='30' width='2' height='4' fill='%23F1EBDD'/><rect x='29' y='20' width='2' height='5' fill='%23F1EBDD'/><rect x='29' y='26' width='2' height='3' fill='%23F1EBDD'/><rect x='29' y='30' width='2' height='4' fill='%23F1EBDD'/><rect x='20' y='23' width='4' height='2' fill='%23F1EBDD'/><rect x='25' y='23' width='5' height='2' fill='%23F1EBDD'/><rect x='31' y='23' width='3' height='2' fill='%23F1EBDD'/><rect x='20' y='29' width='4' height='2' fill='%23F1EBDD'/><rect x='25' y='29' width='5' height='2' fill='%23F1EBDD'/><rect x='31' y='29' width='3' height='2' fill='%23F1EBDD'/></svg>"); --page-size: 36px 36px;
  --band-motif: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='16'><circle cx='0' cy='0' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='0' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='0' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='0' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='0' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='0' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='0' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='0' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='8.0' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='8.0' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='8.0' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='8.0' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='16' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='16' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='16' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='0' cy='16' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='16' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='16' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='16' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='32' cy='16' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='24.0' r='16.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='24.0' r='12.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='24.0' r='8.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/><circle cx='16' cy='24.0' r='4.0' fill='none' stroke='%236A80BF' stroke-width='1.1'/></svg>"); --band-size: 32px 16px;
  --terrain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect x='15' y='37' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='8' y='23' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='30' y='40' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='4' y='38' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='58' y='53' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='16' y='35' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='12' y='45' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='34' y='53' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='30' y='25' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='55' y='9' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='40' y='9' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='24' y='47' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='42' y='49' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='10' y='48' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='2' y='19' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='52' y='55' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='30' y='38' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='58' y='56' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='45' y='50' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='25' y='46' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='28' y='59' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='56' y='23' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='2' y='8' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='13' y='16' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='27' y='49' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='54' y='19' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='32' y='53' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='36' y='22' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='37' y='26' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='14' y='57' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='43' y='58' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='54' y='17' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='42' y='44' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='44' y='55' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='34' y='57' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='36' y='6' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='41' y='13' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='53' y='36' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='18' y='7' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='30' y='54' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='30' y='5' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='51' y='4' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='57' y='9' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='18' y='27' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='55' y='7' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='38' y='39' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='24' y='45' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='21' y='35' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='32' y='15' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='19' y='0' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='6' y='38' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='2' y='12' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='18' y='39' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='9' y='44' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='55' y='21' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='23' y='8' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='24' y='29' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='24' y='41' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='43' y='35' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='39' y='51' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='17' y='27' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='46' y='45' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='59' y='19' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='16' y='33' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='35' y='21' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='50' y='26' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='20' y='1' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='39' y='37' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='8' y='3' width='2' height='1' fill='%23F1EBDD' opacity='0.1'/><rect x='40' y='21' width='1' height='1' fill='%23F1EBDD' opacity='0.1'/></svg>");
  --theme-color: #111a31;
}
[data-theme="riso"] {
  color-scheme: light;
  --bg: #ece1c8; --surface: #f5eedc; --surface-2: #fbf6ea; --shadow-ink: #1e1a1d;
  --ink: #1e1a1d; --ink-2: #574e54; --ink-3: #574e54; --on: #fbf6ea; --line: #1e1a1d;
  --accent: #c8174f; --accent-text: #c2154c; --accent-soft: #f3d5d4;
  --good: #3c2b8e; --good-soft: #e4deee; --bad: #a3201a;
  --protein: #3c2b8e; --carbs: #2c5aa8; --carbs-text: #2c5aa8; --fat: #5b3a9e; --fat-text: #5b3a9e; --water: #2c5aa8; --water-text: #2c5aa8;
  --shadow: 4px 4px 0 0 var(--shadow-ink); --shadow-accent: 5px 5px 0 0 #3c2b8e;
  --tape: #1e1a1d; --tape-ink: #fbf6ea;
  --page-motif: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect x='55' y='54' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='5' y='5' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='10' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='51' y='42' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='16' y='38' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='38' y='2' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='43' y='10' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='40' y='25' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='55' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='34' y='59' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='32' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='55' y='1' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='29' y='59' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='24' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='57' y='56' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='10' y='35' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='15' y='14' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='11' y='20' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='8' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='35' y='11' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='50' y='26' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='33' y='58' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='50' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='54' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='10' y='48' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='45' y='47' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='41' y='33' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='31' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='32' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='42' y='56' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='57' y='57' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='22' y='36' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='35' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='29' y='31' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='14' y='20' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='10' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='17' y='49' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='19' y='19' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='33' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='39' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='19' y='46' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='31' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='59' y='43' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='56' y='4' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='46' y='0' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='6' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='36' y='41' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='17' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='43' y='56' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='48' y='33' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='54' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='52' y='13' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='27' y='57' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='48' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='23' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='15' y='43' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='5' y='7' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='1' y='2' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='1' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='16' y='8' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='11' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='44' y='0' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='37' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='9' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='22' y='39' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='47' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='18' y='21' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='1' y='19' width='1' height='1' fill='%231E1A1D' opacity='0.35'/></svg>"); --page-size: 60px 60px;
  --band-motif: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='40'><polygon points='0,-20 6.0,-13 12.0,-20 12.0,0 6.0,7 0,0' fill='%23C8174F'/><polygon points='12.0,-10 18.0,-3 24.0,-10 24.0,10 18.0,17 12.0,10' fill='%233C2B8E'/><polygon points='0,0 6.0,7 12.0,0 12.0,20 6.0,27 0,20' fill='%233C2B8E'/><polygon points='12.0,10 18.0,17 24.0,10 24.0,30 18.0,37 12.0,30' fill='%23C8174F'/><polygon points='0,20 6.0,27 12.0,20 12.0,40 6.0,47 0,40' fill='%23C8174F'/><polygon points='12.0,30 18.0,37 24.0,30 24.0,50 18.0,57 12.0,50' fill='%233C2B8E'/></svg>"); --band-size: 24px 40px;
  --terrain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='60'><rect x='55' y='54' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='5' y='5' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='10' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='51' y='42' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='16' y='38' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='38' y='2' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='43' y='10' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='40' y='25' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='55' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='34' y='59' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='32' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='55' y='1' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='29' y='59' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='24' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='57' y='56' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='10' y='35' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='15' y='14' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='11' y='20' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='8' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='35' y='11' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='50' y='26' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='33' y='58' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='50' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='54' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='10' y='48' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='45' y='47' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='41' y='33' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='31' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='32' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='42' y='56' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='57' y='57' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='22' y='36' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='35' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='29' y='31' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='14' y='20' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='10' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='17' y='49' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='19' y='19' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='53' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='33' y='32' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='39' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='19' y='46' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='31' y='32' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='59' y='43' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='56' y='4' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='46' y='0' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='6' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='36' y='41' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='17' y='37' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='43' y='56' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='48' y='33' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='54' y='17' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='52' y='13' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='27' y='57' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='48' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='23' y='23' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='15' y='43' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='5' y='7' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='1' y='2' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='58' y='1' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='16' y='8' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='11' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='44' y='0' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='37' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='9' y='2' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='22' y='39' width='2' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='47' y='47' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='18' y='21' width='1' height='1' fill='%231E1A1D' opacity='0.35'/><rect x='1' y='19' width='1' height='1' fill='%231E1A1D' opacity='0.35'/></svg>");
  --theme-color: #ece1c8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background-color: var(--bg); background-image: var(--page-motif, var(--asanoha)); background-size: var(--page-size, 26px 45.03px); color: var(--ink);
  font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.5; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
/* 16px minimum keeps iOS Safari from zooming when a field takes focus. */
input, select, textarea, .input { font-size: max(1rem, 16px) !important; }
a { color: var(--accent-text); }
a.plain { color: inherit; text-decoration: none; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px; z-index: 99; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.accent-text { color: var(--accent-text); }
.muted { color: var(--ink-2); } .faint { color: var(--ink-2); } .small { font-size: var(--text-sm); } .xs { font-size: var(--text-xs); }
.row { display: flex; align-items: center; gap: var(--space-3); } .between { justify-content: space-between; } .wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: var(--space-4); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
@media (max-width: 720px) { .grid2:not(.keep) { grid-template-columns: 1fr; } }

/* Type */
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; line-height: 0.95; text-wrap: balance; overflow-wrap: anywhere; margin: 0; }
h1 { font-size: var(--text-xl); text-transform: uppercase; margin: 0 0 var(--space-3); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); }
.kicker { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--text-xs); color: var(--good); margin: 0 0 var(--space-2); }
h2.tape, h3.tape { font-family: var(--font-label); font-weight: 700; font-size: var(--text-sm); letter-spacing: 0.14em; }
.tape { display: inline-block; background: var(--tape, var(--ink)); color: var(--tape-ink, var(--on)); font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; line-height: 1;
  padding: 0.4em 0.7em 0.35em; clip-path: polygon(0% 8%, 3% 0%, 6% 10%, 9% 2%, 100% 0%, 97% 20%, 100% 38%, 97% 56%, 100% 74%, 97% 90%, 100% 100%, 10% 100%, 7% 92%, 4% 100%, 0% 94%, 2% 76%, 0% 58%, 3% 40%, 0% 22%); }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) max(var(--space-6), env(safe-area-inset-right)) var(--space-3) max(var(--space-6), env(safe-area-inset-left)); background: var(--bg); border-bottom: 2px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.35em; text-decoration: none; font-size: 1.125rem; }
.brand .tape { font-size: 1rem; }
.brand-accent { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; color: var(--accent-text); letter-spacing: -0.01em; font-size: 1.25rem; line-height: 1; }
.tabs { display: flex; align-items: center; gap: var(--space-1); }
.tabs a { padding: var(--space-2) var(--space-3); text-decoration: none; color: var(--ink-2); font-family: var(--font-label); font-weight: 700; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .btn svg { width: 18px; height: 18px; }
.topbar .goals-btn { display: none; text-decoration: none; color: var(--ink); }
.goals-btn[aria-current="page"] { background: var(--accent); color: var(--on); border-color: var(--accent); }
.asanoha-band { display: block; width: 100%; height: 26px; border-block: 2px solid var(--line); background-color: var(--surface); background-image: var(--band-motif, var(--asanoha-strong, var(--asanoha))); background-size: var(--band-size, 26px 45.03px); }
main { max-width: 980px; margin: 0 auto; padding: var(--space-6) max(var(--space-6), env(safe-area-inset-right)) 120px max(var(--space-6), env(safe-area-inset-left)); outline: none; }
.dock { display: none; }
@media (max-width: 720px) {
  .tabs { display: none; }
  .topbar .goals-btn { display: inline-grid; }
  .topbar { padding-left: max(var(--space-4), env(safe-area-inset-left)); padding-right: max(var(--space-4), env(safe-area-inset-right)); }
  main { padding: var(--space-5) max(var(--space-4), env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left)); }
  .dock { display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; position: fixed; z-index: 10;
    left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--surface); border: 1px solid var(--line); border-radius: 2px; box-shadow: var(--shadow); padding: 0 4px; }
  .dock a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 0 4px;
    font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--ink-2); text-decoration: none; }
  .dock a[aria-current="page"] { color: var(--ink); }
  .dock a[aria-current="page"]::before { content: ''; position: absolute; top: -1px; left: 18%; right: 18%; height: 3px; background: var(--accent); }
  .dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: square; stroke-linejoin: miter; }
  .dock .fab { align-self: center; justify-self: center; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 2px; border: 1px solid var(--accent); cursor: pointer;
    background: var(--accent); color: var(--on); box-shadow: 3px 3px 0 0 var(--shadow-ink); }
  .dock .fab:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--shadow-ink); }
  .dock .fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}

/* Primitives */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 2px; padding: var(--space-5); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.frame { position: relative; border: 1px solid var(--line); box-shadow: var(--shadow); background-color: var(--surface);
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)),
    linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 14px 3px, 3px 14px, 14px 3px, 3px 14px, 14px 3px, 3px 14px, 14px 3px, 3px 14px;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right; }
.poster-frame { position: relative; border: 2px solid var(--ink); background-color: var(--surface); box-shadow: var(--shadow-accent); border-radius: 2px; padding: var(--space-6); }
.terrain { background-image: var(--terrain); background-size: 60px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head h1 { margin: 0; }
.page-head-r { display: flex; align-items: baseline; gap: var(--space-2); }
.page-rule { border-bottom: 3px solid var(--line); box-shadow: 0 4px 0 0 var(--bg), 0 7px 0 0 var(--line); padding-bottom: 0.75rem; }
.big-num { font-size: var(--text-lg); font-weight: 600; }
.stamp { position: absolute; top: var(--space-4); right: var(--space-4); transform: rotate(-6deg); border: 2px solid var(--accent-text); color: var(--accent-text); background: transparent;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8125rem; line-height: 1; padding: 0.35rem 0.5rem; }
.stamp.good { border-color: var(--good); color: var(--good); }
.stamp.bad { border-color: var(--bad); color: var(--bad); }
.complete-wrap { display: grid; gap: var(--space-3); }
.complete-wrap .stamp { position: static; justify-self: start; font-size: 1rem; }
.pill { display: inline-block; font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; line-height: 1; padding: 0.35rem 0.5rem;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 2px; }
.pill.mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.pill.good { background: var(--good); color: var(--on); border-color: var(--good); }
.pill.bad { background: var(--bad); color: var(--on); border-color: var(--bad); }
.signal { background: var(--shadow-ink); border: 1px solid var(--bad); border-left-width: 4px; padding: var(--space-3) var(--space-4); border-radius: 2px; }
.signal ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }

/* Buttons and controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-5); border-radius: 2px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow);
  font-family: var(--font-label); font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease; -webkit-tap-highlight-color: transparent; }
.btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 var(--shadow-ink); }
.btn.accent { background: var(--accent); color: var(--on); border-color: var(--accent); }
.btn.raised { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad); color: var(--on); border-color: var(--bad); }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad); box-shadow: none; }
.btn.sm { min-height: 40px; padding: 0 var(--space-4); font-size: 0.875rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; }
.iconbtn { width: 44px; height: 44px; border-radius: 2px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); display: inline-grid; place-items: center; cursor: pointer; box-shadow: 2px 2px 0 0 var(--shadow-ink); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }
label.field, div.field { display: block; font-family: var(--font-label); font-weight: 600; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); }
.input, select.input { width: 100%; min-height: 48px; margin-top: var(--space-1); padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: 2px; background: var(--surface-2); color: var(--ink);
  font-family: var(--font-sans); text-transform: none; letter-spacing: normal; font-weight: 400; }
.input.mono { font-family: var(--font-mono); }
textarea.input { padding: 10px var(--space-3); min-height: 72px; }
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input:focus { border-color: var(--accent-text); outline: 2px solid var(--accent-text); outline-offset: 1px; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; }
input::-webkit-date-and-time-value { text-align: left; }
html:not([data-theme='riso']) ::-webkit-calendar-picker-indicator { filter: invert(0.9) sepia(0.2); }
.unit-input { position: relative; } .unit-input span { position: absolute; right: 12px; top: 50%; transform: translateY(-30%); color: var(--ink-2); font-family: var(--font-mono); font-size: var(--text-sm); text-transform: none; letter-spacing: 0; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 2px; padding: 3px; background: var(--bg); margin-top: 6px; gap: 3px; }
.seg button { min-height: 40px; border: 0; background: transparent; border-radius: 2px; padding: 6px 14px; cursor: pointer; color: var(--ink-2);
  font-family: var(--font-label); font-weight: 700; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.1em; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on); }

/* Onboarding */
.ob { max-width: 580px; margin: 0 auto; padding-top: var(--space-4); }
.ob-meta { margin-bottom: var(--space-2); color: var(--ink-2); }
.ob-progress { height: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: var(--space-8); }
.ob-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.ob-welcome { text-align: center; padding: var(--space-8) var(--space-6); }
.wordmark { display: inline-flex; align-items: center; gap: 0.35em; margin: var(--space-2) 0 var(--space-4); }
.wordmark .tape { font-size: 1.75rem; }
.wordmark .brand-accent { font-size: 2.25rem; }
.ob-welcome h1 { margin-top: var(--space-4); }
.choice { position: relative; display: block; width: 100%; text-align: left; padding: var(--space-4); margin-top: var(--space-2); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 2px; cursor: pointer; box-shadow: 3px 3px 0 0 var(--shadow-ink); }
.choice[aria-pressed="true"] { border-color: var(--accent); background-color: var(--accent-soft); box-shadow: 3px 3px 0 0 var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-size: 14px 3px, 3px 14px; background-position: top left, top left; }
.choice strong { display: block; font-weight: 600; } .choice small { color: var(--ink-2); font-size: var(--text-sm); }
.ob-nav { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-8); }
.ring-demo { width: 150px; margin: var(--space-4) auto; }
.ring-demo svg { transform: rotate(-90deg); display: block; } .ring-demo .track { stroke: var(--surface-2); }

/* Today */
.hero-plate { padding: var(--space-6); }
.hero-plate h1 { padding-right: 6.5rem; }
.summary { display: grid; grid-template-columns: 200px 1fr; gap: var(--space-6); align-items: center; margin-top: var(--space-4); }
.summary-r { min-width: 0; }
@media (max-width: 720px) { .summary { grid-template-columns: 1fr; justify-items: center; } .summary-r { width: 100%; } .hero-plate { padding: var(--space-5) var(--space-4); } }
.ring { position: relative; width: 200px; height: 200px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); } .ring .bar { transition: stroke-dashoffset .5s; stroke-linecap: butt; }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-size: 2.25rem; font-weight: 700; line-height: 1; }
.ring-l { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--text-xs); color: var(--ink-2); margin-top: 4px; }
.equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: var(--space-1); }
.eq-cell { background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; padding: var(--space-2) var(--space-1); text-align: center; min-width: 0; }
.eq-cell .v { font-weight: 600; font-size: 1rem; line-height: 1.15; overflow-wrap: anywhere; }
.eq-cell .l { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; color: var(--ink-2); }
.equation .op { font-family: var(--font-mono); color: var(--ink-2); font-size: 1rem; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
@media (max-width: 720px) { .macros { grid-template-columns: 1fr; gap: var(--space-3); } }
.macro .bar { height: 8px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin-top: 6px; }
.macro .bar i { display: block; height: 100%; }
.macro .name { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--text-xs); }
.m-protein .name, .m-protein .mlabel { color: var(--protein); } .m-protein .bar i { background: var(--protein); }
.m-carbs .name, .m-carbs .mlabel { color: var(--carbs-text); } .m-carbs .bar i { background: var(--carbs); }
.m-fat .name, .m-fat .mlabel { color: var(--fat-text); } .m-fat .bar i { background: var(--fat); }
.actionbar { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--space-3); margin-top: var(--space-5); }
@media (max-width: 420px) { .actionbar { grid-template-columns: 1fr 1fr; } .actionbar > :first-child { grid-column: 1 / -1; } }
.actionbar .btn { padding: 0 var(--space-3); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-top: var(--space-5); }
.tile { position: relative; padding: var(--space-4) var(--space-3) var(--space-3); border: 1px solid var(--line); border-radius: 2px; background: var(--surface); box-shadow: var(--shadow); text-decoration: none; color: inherit; min-width: 0; }
.tile::before { content: ''; position: absolute; top: -1px; left: -1px; width: 32px; height: 4px; background: var(--accent); }
.tile.t-water::before { background: var(--water); } .tile.t-weight::before { background: var(--good); }
.tile .v { font-weight: 600; font-size: 1.125rem; overflow-wrap: anywhere; } .tile .l { font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--ink-2); }

/* Diary */
.datebar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.datebar .d { text-align: center; min-width: 0; flex: 1; display: grid; justify-items: center; gap: 4px; }
.datelabel { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.date-pick { min-height: 40px; width: auto; max-width: 200px; margin: 0; font-family: var(--font-mono); text-align: center; }
.meal { padding: 0; overflow: hidden; }
.meal-head { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.meal-head .kcal { font-weight: 600; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2); padding: var(--space-3) var(--space-5); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; background: none; color: inherit; text-align: left; width: 100%; }
.entry:hover { background: var(--surface-2); }
.entry .n { font-weight: 500; } .entry .s { font-size: var(--text-xs); color: var(--ink-2); }
.entry .k { font-weight: 600; text-align: right; } .entry .m { font-size: var(--text-xs); color: var(--ink-2); text-align: right; white-space: nowrap; }
.meal-foot { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-5) var(--space-4); gap: var(--space-3); flex-wrap: wrap; }
.totals { width: 100%; border-collapse: collapse; font-size: var(--text-sm); table-layout: fixed; }
.totals th, .totals td { padding: var(--space-2) var(--space-1); text-align: right; border-bottom: 1px solid var(--line); }
.totals th:first-child, .totals td:first-child { text-align: left; width: 32%; }
.totals thead th { font-family: var(--font-label); font-size: 0.75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.meter { height: 12px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--water); }
.water-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.water-tiles button { min-height: 64px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface-2); color: var(--water-text); cursor: pointer; font-weight: 600; box-shadow: 3px 3px 0 0 var(--shadow-ink); }
.water-tiles button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--shadow-ink); }
.water-tiles button small { display: block; font-weight: 600; color: var(--ink-2); font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
.callout { padding: var(--space-4); border-radius: 2px; background: var(--accent-soft); border: 1px solid var(--line); }

/* Add food */
.scanbar { display: grid; grid-template-columns: 7fr 3fr; gap: var(--space-3); }
.scan-main { justify-content: flex-start; min-height: 64px; text-align: left; }
.scan-main svg { width: 30px; height: 30px; }
.scan-main b { display: block; font-size: 1rem; } .scan-main small { display: block; font-family: var(--font-sans); text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--text-xs); }
.scan-photos { min-height: 64px; flex-direction: column; gap: 2px; padding: 0 var(--space-2); white-space: normal; text-align: center; line-height: 1.1; }
.searchbar { display: flex; gap: var(--space-2); }
.searchbar .input { margin: 0; }
.results { margin-top: var(--space-4); }
.result { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.result-main { background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; min-width: 0; font-weight: 400; }
.result .n { font-weight: 500; } .result .b { font-size: var(--text-xs); color: var(--ink-2); }
.result .k { font-weight: 600; white-space: nowrap; font-size: var(--text-sm); }
.iconbtn.sq { background: var(--accent); color: var(--on); border-color: var(--accent); }
.badge { display: inline-block; font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.6875rem; padding: 2px 6px; border-radius: 2px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); margin-left: 6px; vertical-align: 2px; }
.badge.warn { background: var(--bad); color: var(--on); border-color: var(--bad); }
.grouphead { font-family: var(--font-label); font-size: var(--text-xs); color: var(--good); text-transform: uppercase; letter-spacing: 0.14em; margin: var(--space-5) 0 0; font-weight: 700; }
.empty { text-align: center; padding: var(--space-8) var(--space-4); color: var(--ink-2); }
.skeleton { height: 54px; border-radius: 2px; margin-top: 8px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* Dialogs */
dialog { border: 2px solid var(--ink); border-radius: 2px; padding: 0; width: min(540px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-accent); max-height: calc(100dvh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(14, 20, 17, 0.78); }
dialog .dh { padding: var(--space-5) var(--space-5) 0; } dialog .db { padding: var(--space-5); } dialog .df { padding: 0 var(--space-5) var(--space-5); display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
dialog h2 { line-height: 1.1; }
.nut-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); text-align: center; }
.nut-grid div { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px; padding: var(--space-3) var(--space-1) var(--space-2); }
.nut-grid div::before { content: ''; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px; background: var(--accent); }
.nut-grid .n-p::before { background: var(--protein); } .nut-grid .n-c::before { background: var(--carbs); } .nut-grid .n-f::before { background: var(--fat); }
.nut-grid .n-p b { color: var(--protein); } .nut-grid .n-c b { color: var(--carbs-text); } .nut-grid .n-f b { color: var(--fat-text); }
.nut-grid b { display: block; font-size: 1rem; }
.nut-grid span { font-family: var(--font-label); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; color: var(--ink-2); font-weight: 700; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.steps { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); background: var(--ink); color: var(--on); padding: 10px 16px; border-radius: 2px; box-shadow: var(--shadow);
  font-weight: 600; font-size: var(--text-sm); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warn { background: var(--accent); }
.pct-total { font-weight: 700; }
.mlabel { font-weight: 700; }
.weightform { flex-wrap: wrap; } .weightform .input { flex: 1 1 120px; min-width: 0; }

/* Charts */
.chart { width: 100%; height: auto; display: block; margin-top: var(--space-3); }
.chart text { font-size: 11px; fill: var(--ink-2); font-family: var(--font-mono); }
.chart .grid { stroke: var(--line); stroke-opacity: 0.35; }
.chart .line { fill: none; stroke: var(--good); stroke-width: 2.5; stroke-linejoin: miter; }
.chart .dot { fill: var(--bg); stroke: var(--good); stroke-width: 2; }
.chart .goal { stroke: var(--accent); stroke-dasharray: 6 4; stroke-width: 1.5; }
.chart .bar { fill: var(--accent); } .chart .bar.over { fill: var(--bad); }

/* Scanner */
dialog.fullscreen { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; background: var(--shadow-ink); color: var(--ink); box-shadow: none; }
.scanner { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.scan-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; gap: var(--space-3); background: var(--bg); border-bottom: 2px solid var(--line);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) var(--space-3) max(var(--space-4), env(safe-area-inset-left)); }
.scan-title { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.iconbtn.dark { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.iconbtn.dark.on { background: var(--accent); border-color: var(--accent); color: var(--on); }
.scan-stage { position: relative; overflow: hidden; background: var(--shadow-ink); min-height: 240px; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-stage.nocam { display: grid; place-items: center; padding: var(--space-6); background-color: var(--bg); background-image: var(--page-motif, var(--asanoha)); background-size: var(--page-size, 26px 45.03px); }
.reticle { position: absolute; left: 50%; top: 50%; width: min(86%, 520px); aspect-ratio: 2.2 / 1; transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(14, 20, 17, 0.55); }
.reticle .c { position: absolute; width: 28px; height: 28px; border: 0 solid var(--accent); }
.reticle .tl { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; } .reticle .tr { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; }
.reticle .bl { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; } .reticle .br { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; }
.reticle .line { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: scanline 1.6s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-28px); } to { transform: translateY(28px); } }
.scan-msg { position: absolute; left: 0; right: 0; bottom: var(--space-4); margin: 0 auto; width: fit-content; max-width: calc(100% - 32px); text-align: center; font-size: var(--text-sm); padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink); }
.scan-stage.nocam .scan-msg { position: static; max-width: 36ch; font-size: var(--text-base); }
.scan-bottom { display: grid; gap: var(--space-3); background: var(--bg); border-top: 2px solid var(--line);
  padding: var(--space-4) max(var(--space-4), env(safe-area-inset-right)) calc(var(--space-4) + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left)); }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.scan-actions .btn { padding: 0 var(--space-2); }
#mf .input { flex: 1; min-width: 0; }
.scan-tip { justify-self: center; font-size: var(--text-xs); }
.photo-status { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); background: var(--surface); border: 1px solid var(--line); }
.photo-status .thumb { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.badge-status { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-sm); color: var(--ink); }
.badge-status.ok { color: var(--good); }
.badge-status.bad { color: var(--bad); text-transform: none; letter-spacing: 0; font-family: var(--font-sans); font-weight: 600; }
footer.note { margin-top: var(--space-10); font-size: var(--text-xs); color: var(--ink-2); }


/* Skin picker (Goals) */
.skin-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-top: var(--space-2); }
.skin-opt { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: center; text-align: left; width: 100%;
  min-height: 56px; padding: var(--space-3); border: 1px solid var(--line); border-radius: 2px; background: var(--surface-2); color: var(--ink);
  box-shadow: 3px 3px 0 0 var(--shadow-ink); cursor: pointer; font: inherit; }
.skin-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 3px 3px 0 0 var(--accent); }
.skin-opt .sn { display: block; font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.skin-opt small { display: block; color: var(--ink-2); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--font-label); font-weight: 600; }
.swatch { display: flex; width: 52px; height: 36px; border: 1px solid var(--line); flex: none; }
.swatch i { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  .reticle .line, .skeleton { animation: none !important; }
  *, *::before, *::after { transition: none !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
