/* Day and night for every page. Day: warm paper, navy ink, ink-blue accent (Oct 20). Night: ink night (Oct 20), the same values as the app's nightColors in src/theme.ts.
   theme.js sets data-theme on <html> before the page draws (the visitor's choice, else their phone's setting).
   These beat each page's own :root colours because [data-theme] is more specific. */
:root[data-theme="light"] {
  --paper: #F6F4EF; --dot: #E3DFD6; --card: #FFFFFF; --ink: #1D2B45; --muted: #646B78; --faint: #A3A39C; --line: #E3DFD6;
  --hi: #DCE7F2; --pop: #2E5E8C; --accent: #2E5E8C; --glow: transparent; --pencil: #9A958C; --tile: #EDEAE3;
  --ok: #E3EFE0; --no: #F6E3DC; --shadow: rgba(29,43,69,.07); --lift: 0 0 0 1px #E3DFD6, 0 6px 18px -10px rgba(29,43,69,.14);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #11151D; --dot: #262D3A; --card: #1A202B; --ink: #E4E6EA; --muted: #959DAA; --faint: #5E6674; --line: #262D3A;
  --hi: rgba(141,176,214,.18); --pop: #8DB0D6; --accent: #8DB0D6; --glow: transparent; --pencil: #5E6674; --tile: #1F2632;
  --ok: rgba(120,180,130,.16); --no: rgba(141,176,214,.12); --shadow: rgba(0,0,0,.5); --lift: inset 0 0 0 1px #262D3A, 0 10px 30px -14px rgba(0,0,0,.6);
  color-scheme: dark;
}
html { transition: background-color .3s ease; }

/* The day/night switch, added to the menu by theme.js. */
.theme-toggle { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

/* Beta, next to the wordmark on every page. */
.beta-tag { margin: 0 auto 0 8px; padding: 3px 7px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted);
  font: 400 13px/1 var(--body, system-ui); align-self: center; }

/* Premium pass (Oct 19): no dot grid, a faint paper grain instead; no hand-drawn underline on the wordmark. */
:root[data-theme] body { background-color: var(--paper); background-size: 180px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' 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 .045 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="light"] { --paper: #F6F4EF; --line: #E3DFD6; }
.wordmark .underline { display: none; }
.wordmark { padding-bottom: 0 !important; }
.beta-tag { font-size: 9.5px; padding: 3px 6px; }
/* One typeface everywhere: Lora (SIL Open Font License, see fonts/OFL-Lora.txt). A soft serif that sits well next to Poffu.
   Two weights (400, 600), no italics, no tracked capitals. */
:root[data-theme] { --display: "Lora", Georgia, serif; --body: "Lora", Georgia, serif; --voice: "Lora", Georgia, serif; --mono: "Lora", Georgia, serif; }
body, button, input, textarea, select { font-family: "Lora", Georgia, serif; }
h1.title, h2.title, .fgroup .gh b { font-family: "Lora", Georgia, serif !important; font-weight: 500 !important; font-stretch: 100% !important; letter-spacing: -0.02em !important; }
* { font-style: normal !important; }
.note { font-family: Caveat, cursive !important; font-weight: 700 !important; font-size: 23px !important; line-height: 1.02 !important; }
.wordmark { font-family: "Lora", Georgia, serif !important; font-weight: 600 !important; font-stretch: 100% !important; letter-spacing: -0.04em !important; font-size: 24px !important; }

/* Ink night (Oct 20): no coral, no pure white. The main button is the soft blue with dark text, never a light pill;
   your own messages and picked options sit on a dark tile instead of a light slab. Plain paper, no glow or dot grid. */
:root[data-theme="dark"] body { background-image: none !important; }
:root[data-theme="dark"] :is(.btn:not(.ghost), .answer.pill .send, .cnext, .playb, .composer i.go) { background: var(--accent) !important; color: var(--paper) !important; border-color: var(--accent) !important; }
:root[data-theme="dark"] :is(.me div, .bub.me, .pme) { background: #262D3A !important; color: var(--ink) !important; }
:root[data-theme="dark"] :is(.opt.on, .chip.on, .opt2.pick, .opt2.lit, .copt.lit) { background: var(--hi) !important; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--accent) !important; }
:root[data-theme="dark"] :is(.tick, .badge) { background: var(--accent) !important; color: var(--paper) !important; }
:root[data-theme="dark"] .mic.on { color: var(--paper) !important; }
