/* Steepbook web app. A printed, poster-like look: paper with a fine grain, big condensed "stamp"
   headlines, italic serif labels, flat colour blocks and heavy ink rules, in Steepbook's colours
   (matcha green, Yixing clay, pine and paper). Body text stays a plain sans at a comfortable size
   and measure; the grain sits under the content, never over the text. */

@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("/fonts/plus-jakarta-sans-extrabold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* Display faces (SIL OFL): Bricolage Grotesque, variable in width for the condensed headlines,
   and Instrument Serif italic for the hand-set labels. Latin subsets. */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2"); font-weight: 700 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Matcha & Clay (STEEPBOOK.md) is the default, light and dark; Çay Red is the app's second
   palette (Settings → Theme, html[data-palette="cay"]). Role names match the spec's tables. */
:root {
  /* Paper and ink */
  --bg: #F6F3EA;
  --bg-alt: #F1EDE2;
  --card: #FBF9F2;
  --card-2: #EEEADD;
  --line: #DCD8C6;
  --rule: #1A2216;
  --ink: #1A2216;
  --ink-2: #3D4636;
  --ink-3: #5F6856;
  /* Roles */
  --primary: #4E7A22;
  --on-primary: #FBFDF5;
  --primary-wash: #E3EDCF;
  --accent: #A0492B;
  --accent-wash: #F6DED3;
  --pin: #2F4A36;
  --pin-wash: #DCEADF;
  --block: #1F2A1C;
  --block-ink: #CDE6A3;
  --button-bg: var(--block);
  --button-ink: var(--block-ink);
  /* Illustration fills that need to stay dark-ish in both themes. */
  --il-dark: var(--block);
  --il-claypot: var(--accent);
  --shadow: 0 30px 60px -20px rgba(30, 45, 15, .26), 0 12px 24px -12px rgba(30, 45, 15, .16);
  --scrim: rgba(12, 18, 8, .45);
  --radius: 22px;
  --max: 1180px;
  --display: "Bricolage Grotesque", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --script: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Fine paper grain, drawn under the content as a background layer. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.13 0 0 0 0 0.08 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* Speckled "printed ink" mask, for the biggest headlines only. */
  --ink-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='i'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -14 11.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23i)'/%3E%3C/svg%3E");
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* Dark: follows the system unless the visitor picked a theme (html[data-theme], set before first paint). */
:root[data-theme="dark"] {
    --bg: #121510;
    --bg-alt: #161A13;
    --card: #1A1E17;
    --card-2: #22271E;
    --line: #2E3428;
    --rule: #EEF0E6;
    --ink: #EEF0E6;
    --ink-2: #C9CEBF;
    --ink-3: #9AA190;
    --primary: #A9D46E;
    --on-primary: #142007;
    --primary-wash: #2A3A1A;
    --accent: #E8946F;
    --accent-wash: #3B2219;
    --pin: #9FD0AE;
    --pin-wash: #1F3326;
    --block: #CDE6A3;
    --block-ink: #1A2410;
    --il-dark: #2F3A28;
    --il-claypot: #B4593A;
    --shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 0.95 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg: #121510;
    --bg-alt: #161A13;
    --card: #1A1E17;
    --card-2: #22271E;
    --line: #2E3428;
    --rule: #EEF0E6;
    --ink: #EEF0E6;
    --ink-2: #C9CEBF;
    --ink-3: #9AA190;
    --primary: #A9D46E;
    --on-primary: #142007;
    --primary-wash: #2A3A1A;
    --accent: #E8946F;
    --accent-wash: #3B2219;
    --pin: #9FD0AE;
    --pin-wash: #1F3326;
    --block: #CDE6A3;
    --block-ink: #1A2410;
    --il-dark: #2F3A28;
    --il-claypot: #B4593A;
    --shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 0.95 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    color-scheme: dark;
  } }

/* Çay Red, light then dark. */
:root[data-palette="cay"] {
    --bg: #F8F3EE;
    --bg-alt: #F3ECE5;
    --card: #FFFBF8;
    --card-2: #F1E8E2;
    --line: #E4D6CE;
    --rule: #22110E;
    --ink: #22110E;
    --ink-2: #4A3530;
    --ink-3: #6E5A55;
    --primary: #A8241C;
    --on-primary: #FFF6F3;
    --primary-wash: #F7DCD6;
    --accent: #9C6E14;
    --accent-wash: #F6E8C9;
    --pin: #1F6F78;
    --pin-wash: #D4ECEC;
    --block: #3A0F0C;
    --block-ink: #F4C46A;
    --il-dark: #3A0F0C;
    --il-claypot: #A8241C;
  }
:root[data-palette="cay"][data-theme="dark"] {
    --bg: #170E0D;
    --bg-alt: #1B1110;
    --card: #211514;
    --card-2: #2A1B19;
    --line: #3A2826;
    --rule: #F6ECE8;
    --ink: #F6ECE8;
    --ink-2: #D9C9C4;
    --ink-3: #B09C97;
    --primary: #F0705A;
    --on-primary: #2A0805;
    --primary-wash: #42191A;
    --accent: #E9BE62;
    --accent-wash: #3A2C12;
    --pin: #6CC9C9;
    --pin-wash: #143234;
    --block: #E9BE62;
    --block-ink: #2A0A06;
    --il-dark: #4A2420;
    --il-claypot: #C2402F;
    --shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 0.95 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
@media (prefers-color-scheme: dark) { :root[data-palette="cay"]:not([data-theme="light"]) {
    --bg: #170E0D;
    --bg-alt: #1B1110;
    --card: #211514;
    --card-2: #2A1B19;
    --line: #3A2826;
    --rule: #F6ECE8;
    --ink: #F6ECE8;
    --ink-2: #D9C9C4;
    --ink-3: #B09C97;
    --primary: #F0705A;
    --on-primary: #2A0805;
    --primary-wash: #42191A;
    --accent: #E9BE62;
    --accent-wash: #3A2C12;
    --pin: #6CC9C9;
    --pin-wash: #143234;
    --block: #E9BE62;
    --block-ink: #2A0A06;
    --il-dark: #4A2420;
    --il-claypot: #C2402F;
    --shadow: 0 30px 70px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
    --scrim: rgba(0, 0, 0, .6);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 0.95 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
    color-scheme: dark;
  } }

/* ---------------------------------------------------------------- Steepbook web app
   Tokens and fonts above are copied from the site's styles.css (keep them in step).
   Layout: a side rail on wide screens, a bottom tab bar on phones; cards on paper. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--grain), var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
.boot { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 100vh; font-family: var(--script); font-style: italic; font-size: 26px; color: var(--ink); }
.boot-dots span { animation: sb-dot 1.44s infinite; }
.boot-dots span:nth-child(2) { animation-delay: .18s; }
.boot-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes sb-dot { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* <sb-gaiwan> (tea-loader.js): the hopping, steaming gaiwan, poster style, from the theme tokens. */
sb-gaiwan { display: inline-block; line-height: 0; flex: none; }
.sbl { overflow: visible; display: block; }
.sbl-ink { stroke: var(--rule); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.sbl-leaf { fill: var(--primary); }
.sbl-dark { fill: var(--il-dark); }
.sbl-paper { fill: var(--card); }
.sbl-clay { fill: var(--accent); }
.sbl-shine { fill: none; stroke: var(--on-primary); stroke-width: 2.4; stroke-linecap: round; opacity: .7; }
.sbl-tick { fill: none; stroke: var(--rule); stroke-width: 2.5; stroke-linecap: round; opacity: .45; }
.sbl-shadow { fill: color-mix(in srgb, var(--rule) 20%, transparent); transform-box: fill-box; transform-origin: center; animation: sbl-shade .9s infinite; }
.sbl-steam { fill: none; stroke: var(--ink-3); stroke-width: 3; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: bottom; animation: sbl-steam 1.8s ease-out infinite; }
.sbl-steam.w2 { animation-delay: .9s; }
.sbl-body { transform-box: view-box; transform-origin: 80px 128px; animation: sbl-hop .9s infinite; }
@keyframes sbl-hop {
  0%   { transform: translateY(0) scale(1.12, .86); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  12%  { transform: translateY(-6px) scale(.94, 1.08); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  48%  { transform: translateY(-40px) scale(1, 1); animation-timing-function: cubic-bezier(.6, 0, .9, .4); }
  88%  { transform: translateY(-4px) scale(.95, 1.07); animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  100% { transform: translateY(0) scale(1.12, .86); }
}
@keyframes sbl-shade { 0%, 100% { transform: scale(1.08, 1); opacity: 1; } 48% { transform: scale(.62, .8); opacity: .55; } }
@keyframes sbl-steam { 0% { opacity: 0; transform: translateY(14px) scaleY(.6); } 30% { opacity: .8; } 100% { opacity: 0; transform: translateY(-14px) scaleY(1.1); } }
@media (prefers-reduced-motion: reduce) { .sbl-body, .sbl-shadow, .boot-dots span { animation: none; } .sbl-steam { animation: none; opacity: .6; } }

/* Icons: sized to the text around them unless a screen sets its own (the SVGs carry no size,
   so without this they collapse to nothing and only their flex gap shows). */
.icon { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.icon svg { width: 1.25em; height: 1.25em; }

/* Shell */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.rail { display: none; }
.main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 820px; width: 100%; min-width: 0; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; border-radius: 14px; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); background: var(--primary-wash); }
@media (min-width: 900px) {
  .shell { grid-template-columns: 236px 1fr; }
  .rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); }
  .rail .brand { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 30px; letter-spacing: -.01em; text-transform: uppercase; padding: 0 10px 14px; color: var(--ink); text-decoration: none; }
  .rail .tab { grid-template-columns: 24px 1fr; justify-items: start; align-items: center; gap: 12px; padding: 10px 12px; font-size: 15px; text-align: left; }
  .rail .spacer { flex: 1; }
  .tabbar { display: none; }
  .main { padding: 28px 32px 64px; }
}

/* Page headers */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.page-title { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 78%; text-transform: uppercase; font-size: clamp(38px, 8vw, 54px); line-height: .92; letter-spacing: -.01em; }
.page-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.section-title { margin: 26px 0 10px; font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: 22px; letter-spacing: .01em; display: flex; justify-content: space-between; align-items: baseline; }
.section-title small { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.overline { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.overline.primary { color: var(--primary); }
.script { font-family: var(--script); font-style: italic; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.stack.tight { gap: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .grid-3.collapse { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.wash { background: var(--primary-wash); border-color: transparent; }
.card.block { background: var(--primary); color: var(--on-primary); border: 0; }
.card.block { background: var(--block); color: var(--block-ink); border: 0; }
.card-link { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.card-link:hover { border-color: var(--primary); }
.well { background: var(--card-2); border-radius: 16px; padding: 12px; }
.list { display: grid; }
.list > .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.list > .item:first-child { border-top: 0; }
.list > .item:hover { background: var(--card-2); }
.item .title { font-weight: 700; }
.item .sub { color: var(--ink-3); font-size: 13px; }
.chev { color: var(--ink-3); }

/* Numbers */
.big-num { font-family: var(--mono); font-weight: 700; font-size: 34px; line-height: 1; color: var(--primary); }
.num { font-family: var(--mono); font-weight: 700; }
.unit { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--button-bg); color: var(--button-ink); border-color: transparent; }
.btn.action { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; color: var(--primary); padding: 0 8px; }
.btn.danger { color: var(--accent); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.fab { position: fixed; right: 18px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 25; box-shadow: var(--shadow); }
@media (min-width: 900px) { .fab { display: none; } }

/* Chips and segmented choices */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--card-2); color: var(--ink-2); white-space: nowrap; }
.chip.weak { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.chip.bitter { background: color-mix(in srgb, var(--ink-2) 16%, transparent); color: var(--ink-2); }
.chip.balanced, .chip.pin { background: var(--pin-wash); color: var(--pin); }
.chip.primary { background: var(--primary-wash); color: var(--primary); }
.choice { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; white-space: nowrap; }
.choice[aria-pressed="true"] { background: var(--button-bg); color: var(--button-ink); border-color: transparent; }
.choices { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.segmented button { border: 0; background: none; padding: 9px 6px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.segmented button[aria-pressed="true"] { background: var(--button-bg); color: var(--button-ink); font-weight: 800; }

/* Fields */
.field { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.field label, .field .label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
textarea.input { min-height: 88px; resize: vertical; }
.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 14px; display: grid; gap: 2px; }
.tile input::placeholder { color: var(--ink-3); opacity: .45; }
.tile input { border: 0; background: none; padding: 0; font-family: var(--mono); font-weight: 700; font-size: 22px; width: 100%; outline: none; }
.tile.accent { background: var(--primary-wash); border-color: transparent; }

/* Stars */
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--line); font-size: 26px; line-height: 1; }
.stars button.on { color: var(--primary); }
.stars.static { font-size: 14px; color: var(--primary); letter-spacing: 1px; }

/* Sheets (modal) */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: grid; align-items: end; justify-items: center; }
.sheet { width: min(720px, 100%); max-height: 94vh; overflow: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 10px; background: var(--bg); }
.sheet-head h2 { margin: 0; font-size: 18px; color: var(--primary); }
@media (min-width: 720px) { .scrim { align-items: center; } .sheet { border-radius: 26px; max-height: 88vh; } }

/* Banners and toasts */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--primary-wash); color: var(--ink); margin-bottom: 14px; }
.banner.warn { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 60; background: var(--block); color: var(--block-ink); padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
/* With a sheet open the toast moves to the top, clear of the sheet's buttons. */
.scrim ~ .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty .script { font-size: 24px; color: var(--ink-2); display: block; margin-bottom: 6px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.prose p { margin: 0 0 10px; }
.prose ul { margin: 0 0 10px; padding-left: 20px; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Spot illustrations (Illustrations.kt): poster-style flat blocks under an ink line, from theme tokens. */
.illustration { width: calc(var(--il-size, 120px) * 160 / 140); height: var(--il-size, 120px); flex: none; }
.illustration svg { width: 100%; height: 100%; display: block; overflow: visible; }
.illustration .il-ink { stroke: var(--rule); stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; }
.illustration .il-leaf { fill: var(--primary); }
.illustration .il-dark { fill: var(--il-dark); }
.illustration .il-paper { fill: var(--card); }
.illustration .il-pin { fill: var(--pin); }
.illustration .il-clay { fill: var(--accent); }
.illustration .il-claypot { fill: var(--il-claypot); }
.illustration .il-wash { fill: var(--primary-wash); }
.illustration .il-none { fill: none; }
.illustration .il-shadow { fill: color-mix(in srgb, var(--rule) 18%, transparent); }
.illustration .il-line, .illustration .il-crimp { fill: none; stroke: var(--rule); stroke-width: 2.5; stroke-linecap: round; opacity: .5; }
.illustration .il-line.light { stroke: var(--card); opacity: .65; }
.illustration .il-crimp { stroke: var(--block-ink); stroke-dasharray: 4 4; opacity: 1; }
.illustration .il-vein { fill: none; stroke: var(--rule); stroke-width: 2.2; stroke-linecap: round; opacity: .55; }
.illustration .il-stream { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.illustration .il-steam { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-linecap: round; opacity: .7; }
.illustration .il-trend { fill: none; stroke: var(--rule); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }

/* Page heads with a drawing: title left, illustration right, actions under the title. */
.page-head.with-art { align-items: center; }
.page-head .page-actions { margin-top: 12px; }
.page-art { margin: -6px -4px -6px 8px; }
@media (max-width: 520px) { .page-art { --il-size: 86px !important; margin-right: -8px; } }
.empty-art { margin: 0 auto 10px; }

/* "Paper" headlines: the site's speckled printed-ink texture on the condensed display type. */
.page-title, .section-title > span:first-child {
  -webkit-mask-image: var(--ink-mask); mask-image: var(--ink-mask);
  -webkit-mask-size: 320px; mask-size: 320px;
}
.section-title > span:first-child { -webkit-mask-size: 220px; mask-size: 220px; }

/* Steep timer (timer/SteepTimer.kt): full screen over the app, the countdown in a ring. */
.timer { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); overflow-x: hidden; background: var(--grain), var(--bg); overflow-y: auto; }
.timer-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; max-width: 720px; width: 100%; margin: 0 auto; }
.timer-title { flex: 1; min-width: 0; text-align: center; }
.timer-title h2 { margin: 2px 0 0; font-family: var(--display); font-weight: 800; font-stretch: 80%; text-transform: uppercase; font-size: 24px; line-height: 1; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-body { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 14px; padding: 8px 16px calc(28px + env(safe-area-inset-bottom)); max-width: 720px; width: 100%; margin: 0 auto; }
.timer-count { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.timer-ring { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.timer-ring-svg, .timer-ring-svg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.timer-ring .ring-track { fill: var(--card); stroke: var(--card-2); stroke-width: 18; }
.timer-ring .ring-fill { fill: none; stroke: var(--primary); stroke-width: 18; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.timer-ring:not(.running) .ring-fill { stroke: var(--primary-wash); }
.timer-readout { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.timer-num { font-family: var(--mono); font-weight: 700; font-size: clamp(64px, 20vw, 96px); line-height: 1; color: var(--ink); }
.timer-ring.running .timer-num { color: var(--primary); }
.timer-unit { font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.timer-state { font-family: var(--script); font-style: italic; font-size: 22px; color: var(--ink-2); text-align: center; }
.timer-controls { gap: 14px; justify-content: center; }
.timer-nudge { min-width: 72px; font-family: var(--mono); }
.timer-go { display: inline-flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 30px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; font-size: 18px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.timer-go svg { width: 22px; height: 22px; }
.timer-go.running { background: var(--block); color: var(--block-ink); }
.timer-chips { justify-content: center; margin: 4px 0 0; }
.timer-foot { text-align: center; max-width: 420px; }
.timer ~ .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }
@media (max-width: 520px) { .timer-go { padding: 0 20px; } .timer-nudge { min-width: 60px; padding: 0 10px; } .timer-head .btn .label { display: none; } .timer-title h2 { font-size: 20px; } }

/* Settings: palette picker */
.palettes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.palette { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; text-align: left; }
.palette[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.palette-swatches { display: inline-flex; flex: none; }
.palette .sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--card); margin-left: -5px; box-shadow: 0 0 0 1px var(--line); }
.palette .sw:first-child { margin-left: 0; }
.palette.matcha .sw.a { background: #4E7A22; } .palette.matcha .sw.b { background: #A0492B; } .palette.matcha .sw.c { background: #1F2A1C; }
.palette.cay .sw.a { background: #A8241C; } .palette.cay .sw.b { background: #9C6E14; } .palette.cay .sw.c { background: #1F6F78; }

/* Chips added for tea */
.chip.weak, .chip.clay { background: var(--accent-wash); color: var(--accent); }
.primary-text { color: var(--primary); }
