/* zjt.im themes. Each theme sets the --z-* palette; one mapping block hands it to every site's own variables:
   blog and curling (--bg, --text, --accent ...), election (--paper, --ink, --hope ...), Twordle (--color-tone-*).
   ":root:not(#zz)" lifts specificity above each site's own light/dark rules. "House style" sets nothing. */
#zjt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 14px; font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 5px max(16px, env(safe-area-inset-right, 0px)) 5px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent); position: relative; z-index: 30; }
#zjt-bar .zen-in { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
#zjt-bar .zen-home { font-weight: 700; letter-spacing: .02em; }
#zjt-bar a { color: inherit; text-decoration: none; } #zjt-bar a:hover, #zjt-bar a:focus-visible { opacity: 1; text-decoration: underline; }
#zjt-bar [aria-current] { font-weight: 600; border-bottom: 2px solid currentColor; }
#zjt-bar select { font: inherit; color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 6px; padding: 1px 4px; margin-left: 4px; }
#zjt-bar select option { color: #111; background: #fff; }
#zjt-bar label { display: inline-flex; align-items: center; }
#zjt-bar .zen-player { display: inline-flex; align-items: center; gap: 4px; }
#zjt-bar button { font: inherit; color: inherit; background: transparent; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 999px; padding: 1px 10px; cursor: pointer; white-space: nowrap; }
#zjt-bar button:hover, #zjt-bar button:focus-visible { border-color: currentColor; }
#zjt-bar button[aria-pressed="true"] { background: color-mix(in srgb, currentColor 12%, transparent); }
#zjt-bar #zen-rate { margin-left: 0; }
#zjt-bar #zen-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; opacity: .85; }
.zen-reading { background: color-mix(in srgb, #ffd23f 28%, transparent); border-radius: 4px; box-shadow: 0 0 0 4px color-mix(in srgb, #ffd23f 28%, transparent); transition: background .3s; }
@media (max-width: 600px) {
  #zjt-bar { gap: 2px 8px; font-size: 12px; }
  #zjt-bar .zen-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #zjt-bar select { margin-left: 0; max-width: 7em; }
  #zjt-bar #zen-rate { max-width: 4.3em; }
  #zjt-bar button { padding: 1px 8px; }
  #zjt-bar .zen-in { gap: 2px 8px; }
}
#zjt-bar.zen-float .zen-player #zen-rate, #zjt-bar.zen-float #zen-stop[hidden] { display: none; }
#zjt-bar.zen-float { position: fixed; top: 52px; left: 0; right: 0; justify-content: center; border: 0; padding: 2px 8px; font-size: 12px; background: transparent; color: var(--color-tone-1, inherit); }

:root:not(#zz)[data-zen="ice"] { --z-onwarn: #111111; --z-bg: #eef5f9; --z-surface: #ffffff; --z-fg: #0d2436; --z-muted: #4a6476; --z-line: #c9dbe6; --z-soft: #dcebf4; --z-accent: #c8102e;
  --z-dem: #1f5f9e; --z-rep: #c8102e; --z-good: #23744a; --z-warn: #c9a227; --z-ontile: #ffffff; --z-font: "Barlow", system-ui, sans-serif; --z-head: "Barlow", system-ui, sans-serif;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: light; }
:root:not(#zz)[data-zen="supper"] { --z-onwarn: #1b100b; --z-bg: #24160f; --z-surface: #33201a; --z-fg: #f1e3cc; --z-muted: #c3a98a; --z-line: #4d3326; --z-soft: #3d281e; --z-accent: #d9a441;
  --z-dem: #8fb3d9; --z-rep: #ea8d74; --z-good: #8fbf7a; --z-warn: #d9a441; --z-ontile: #1b100b; --z-font: "Lora", Georgia, serif; --z-head: "Lora", Georgia, serif;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: dark; }
:root:not(#zz)[data-zen="terminal"] { --z-onwarn: #0a0f0a; --z-bg: #0a0f0a; --z-surface: #0f1a10; --z-fg: #b8f5ad; --z-muted: #6fae68; --z-line: #1f3a20; --z-soft: #13261a; --z-accent: #39ff14;
  --z-dem: #5fd7ff; --z-rep: #ff6b6b; --z-good: #39ff14; --z-warn: #ffb000; --z-ontile: #0a0f0a; --z-font: "IBM Plex Mono", ui-monospace, monospace; --z-head: "IBM Plex Mono", ui-monospace, monospace;
  --z-mono: "IBM Plex Mono", ui-monospace, monospace; color-scheme: dark; }
:root:not(#zz)[data-zen="newsprint"] { --z-onwarn: #ffffff; --z-bg: #f3f2ee; --z-surface: #fbfbf9; --z-fg: #111111; --z-muted: #555555; --z-line: #cfcbc2; --z-soft: #e7e4dc; --z-accent: #111111;
  --z-dem: #1d3f73; --z-rep: #8a1c1c; --z-good: #2d5d2d; --z-warn: #8a6d1c; --z-ontile: #ffffff; --z-font: "Source Serif 4", Georgia, serif; --z-head: "Oswald", "Arial Narrow", sans-serif;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: light; }
:root:not(#zz)[data-zen="blueprint"] { --z-onwarn: #123a6b; --z-bg: #123a6b; --z-surface: #16457d; --z-fg: #eaf3ff; --z-muted: #a9c4e6; --z-line: #3e6ea8; --z-soft: #1b4f8c; --z-accent: #ffd166;
  --z-dem: #9ad1ff; --z-rep: #ffb3a3; --z-good: #8be0a4; --z-warn: #ffd166; --z-ontile: #123a6b; --z-font: "Architects Daughter", "Comic Sans MS", cursive; --z-head: "Architects Daughter", "Comic Sans MS", cursive;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: dark; }
:root:not(#zz)[data-zen="sailing"] { --z-onwarn: #111111; --z-bg: #f2f5f7; --z-surface: #ffffff; --z-fg: #0b2545; --z-muted: #435a74; --z-line: #c5d2de; --z-soft: #e2ebf2; --z-accent: #0a5a7e;
  --z-dem: #134074; --z-rep: #b3261e; --z-good: #17703f; --z-warn: #c88a12; --z-ontile: #ffffff; --z-font: "Libre Franklin", system-ui, sans-serif; --z-head: "Playfair Display", Georgia, serif;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: light; }
:root:not(#zz)[data-zen="triplebees"] { --z-onwarn: #2a1240; --z-bg: #2a1240; --z-surface: #3b1659; --z-fg: #fff6d6; --z-muted: #dccdf0; --z-line: #6a3a96; --z-soft: #4a2070; --z-accent: #ffd23f;
  --z-dem: #9fd0ff; --z-rep: #ffa3ad; --z-good: #a6eaa6; --z-warn: #ffd23f; --z-ontile: #2a1240; --z-font: "Nunito", system-ui, sans-serif; --z-head: "Patrick Hand", "Comic Sans MS", cursive;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: dark; }
:root:not(#zz)[data-zen="sketch"] { --z-onwarn: #111111; --z-bg: #ffffff; --z-surface: #ffffff; --z-fg: #111111; --z-muted: #555555; --z-line: #111111; --z-soft: #f1f1f1; --z-accent: #111111;
  --z-dem: #2f6fb3; --z-rep: #b8443a; --z-good: #2e7d4f; --z-warn: #b8902a; --z-ontile: #ffffff; --z-font: "Patrick Hand", "Comic Sans MS", cursive; --z-head: "Patrick Hand", "Comic Sans MS", cursive;
  --z-mono: ui-monospace, Menlo, monospace; color-scheme: light; }

/* the mapping: every site's variables, set on :root and body (Twordle sets its own on body.nightmode) */
:root:not(#zz)[data-zen], :root:not(#zz)[data-zen] body {
  --bg: var(--z-bg); --surface: var(--z-surface); --text: var(--z-fg); --muted: var(--z-muted); --line: var(--z-line); --accent: var(--z-accent);
  --on-accent: var(--z-ontile); --on-red: var(--z-ontile); --on-ice: var(--z-ontile); --on-warn: var(--z-onwarn); --accent-soft: var(--z-soft); --mark: var(--z-soft); --code-bg: var(--z-surface); --serif: var(--z-head); --sans: var(--z-font); --mono: var(--z-mono);
  --ice: var(--z-dem); --soft: var(--z-soft); --red: var(--z-rep); --yellow: var(--z-warn);
  --paper: var(--z-bg); --ink: var(--z-fg); --ink-2: var(--z-muted); --rule: var(--z-fg); --faint: var(--z-soft); --hope: var(--z-dem); --doom: var(--z-rep);
  --win: var(--z-good); --note: var(--z-soft); --hand: var(--z-head); --body: var(--z-font);
  --color-tone-1: var(--z-fg); --color-tone-2: var(--z-muted); --color-tone-3: var(--z-muted); --color-tone-4: var(--z-line); --color-tone-5: var(--z-surface);
  --color-tone-6: var(--z-surface); --color-tone-7: var(--z-bg); --color-background: var(--z-bg); --key-bg: var(--z-line); --key-text-color: var(--z-fg);
  --modal-content-bg: var(--z-surface); --tile-text-color: var(--z-ontile); --key-evaluated-text-color: var(--z-ontile);
  font-family: var(--z-font);
}
:root:not(#zz)[data-zen] body:not(.colorblind) { --green: var(--z-good); --darkendGreen: var(--z-good); --darkendYellow: var(--z-warn); --color-correct: var(--z-good); --color-present: var(--z-warn); --color-absent: var(--z-muted); }
:root:not(#zz)[data-zen] body { background-color: var(--z-bg); color: var(--z-fg); }
:root:not(#zz)[data-zen] :is(h1, h2, h3) { font-family: var(--z-head); }
/* plain links only: classed links (buttons, chips) and the bar/dialogs keep their own colours */
:root:not(#zz)[data-zen] a:not([class]):not(#zjt-bar a, #zen-games a, #zen-sheet a) { color: var(--z-accent); }
/* textures */
:root:not(#zz)[data-zen="ice"] body { background-image: radial-gradient(circle at 92% 0%, transparent 0 60px, color-mix(in srgb, var(--z-rep) 12%, transparent) 60px 64px, transparent 64px 140px, color-mix(in srgb, var(--z-dem) 12%, transparent) 140px 144px, transparent 144px); background-attachment: fixed; }
:root:not(#zz)[data-zen="supper"] body { background-image: repeating-linear-gradient(90deg, transparent 0 46px, rgba(0, 0, 0, .12) 46px 48px, transparent 48px 97px, rgba(255, 255, 255, .025) 97px 99px); }
:root:not(#zz)[data-zen="terminal"] body { background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px); text-shadow: 0 0 6px color-mix(in srgb, var(--z-good) 35%, transparent); }
:root:not(#zz)[data-zen="newsprint"] :is(h1, h2) { text-transform: uppercase; letter-spacing: .03em; }
:root:not(#zz)[data-zen="blueprint"] body { background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 24px 24px; }
@media (prefers-reduced-motion: reduce) { :root:not(#zz)[data-zen="terminal"] body { text-shadow: none; } }
/* sailing: a faint chart grid and a wave line under headings; TripleBees: honeycomb and gold underlines */
:root:not(#zz)[data-zen="sailing"] body { background-image: linear-gradient(rgba(11,37,69,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(11,37,69,.035) 1px, transparent 1px); background-size: 40px 40px; }
:root:not(#zz)[data-zen="sailing"] :is(h1, h2) { letter-spacing: .01em; padding-bottom: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='6'%3E%3Cpath d='M0 3 Q6 0 12 3 T24 3' fill='none' stroke='%230a5a7e' stroke-width='1.4'/%3E%3C/svg%3E") left bottom / 24px 6px repeat-x; }
:root:not(#zz)[data-zen="triplebees"] body { background-image: radial-gradient(circle at 50% 50%, rgba(255,210,63,.05) 0 18px, transparent 19px); background-size: 46px 40px; }
:root:not(#zz)[data-zen="triplebees"] :is(h1, h2) { color: var(--z-accent); text-decoration: underline wavy color-mix(in srgb, var(--z-accent) 55%, transparent); text-underline-offset: 6px; }
/* games, feedback, sign-in, comments (zen.js) */
#zjt-bar #zen-me { font-weight: 600; }
@media (max-width: 600px) { #zjt-bar .zen-lbl2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
#zen-games { padding: 0; border: 0; border-radius: 14px; width: min(520px, 100vw); height: min(820px, 100dvh); max-width: 100vw; max-height: 100dvh; background: #fff; color: #111; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
#zen-games[data-game="sailnav"] { width: min(1200px, 100vw); }
#zen-games[open] { display: flex; flex-direction: column; }
#zen-games::backdrop { background: rgba(0,0,0,.55); }
#zen-games header { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font: 14px system-ui, sans-serif; border-bottom: 1px solid #ddd; }
#zen-games header a { margin-left: auto; color: #444; opacity: 1; text-decoration: none; padding: 4px 8px; }
#zen-games iframe { flex: 1; width: 100%; border: 0; background: #fff; }
#zen-games .zen-gnote { margin: 0; padding: 4px 10px; font: 11px/1.4 system-ui, sans-serif; color: #666; border-top: 1px solid #eee; }
#zen-games:not([data-game="sailnav"]) .zen-gnote { display: none; }
.zen-gtabs { display: flex; gap: 4px; }
.zen-gtabs button, .zen-x, #zen-sheet button, .zen-btn { font: 600 14px system-ui, sans-serif; border: 1px solid #c9c4ba; background: transparent; color: inherit; border-radius: 999px; padding: 5px 12px; cursor: pointer; text-decoration: none; display: inline-block; }
.zen-gtabs button[aria-selected="true"] { background: #1f5f9e; border-color: #1f5f9e; color: #fff; }
.zen-x { padding: 2px 10px; font-size: 18px; line-height: 1; }
@media (max-width: 700px) { #zen-games, #zen-games[data-game="sailnav"] { width: 100vw; height: 100dvh; border-radius: 0; } }
#zen-sheet { position: fixed; z-index: 60; right: 12px; top: 12px; bottom: 12px; width: min(380px, calc(100vw - 24px)); display: flex; flex-direction: column; background: var(--surface, #fff); color: var(--text, #111);
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
#zen-sheet header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent); }
#zen-sheet .zen-sheet-body { padding: 12px; overflow-y: auto; flex: 1; }
#zen-sheet textarea, #zen-sheet input[type=email] { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; margin: 6px 0; border-radius: 8px; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: transparent; color: inherit; }
#zen-sheet textarea { min-height: 110px; }
#zen-sheet .zen-hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
#zen-sheet .zen-small, .zen-small { font-size: 13px; opacity: .8; }
#zen-sheet .zen-link { border: 0; padding: 0; color: var(--accent, #1f5f9e); text-decoration: underline; font-weight: 500; }
.zen-q { margin: 6px 0 10px; padding: 4px 10px; border-left: 3px solid #ffd23f; font-style: italic; opacity: .85; }
.zen-c { padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); } .zen-c p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.zen-c.zen-owner b { color: var(--accent, #1f5f9e); }
@media (max-width: 700px) { #zen-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75dvh; border-radius: 14px 14px 0 0; } }
.zen-cpara { position: relative; }
.zen-cbtn { position: absolute; right: -46px; top: 0; font: 12px/1 system-ui, sans-serif; border: 1px solid transparent; background: transparent; color: inherit; border-radius: 999px; padding: 3px 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.zen-cpara:hover > .zen-cbtn, .zen-cbtn:focus-visible, .zen-cbtn.zen-has { opacity: .75; }
.zen-cbtn.zen-has { border-color: color-mix(in srgb, currentColor 25%, transparent); }
@media (max-width: 1100px) { .zen-cbtn { position: static; display: inline-block; margin-left: 6px; vertical-align: baseline; } .zen-cbtn:not(.zen-has) { display: none; } }
#zen-selc { position: fixed; z-index: 61; font: 600 13px system-ui, sans-serif; background: #1f5f9e; color: #fff; border: 0; border-radius: 999px; padding: 7px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
#zen-call { margin: 24px 0 8px; }
@media print { .zen-cbtn, #zen-selc, #zen-sheet, #zen-call { display: none !important; } }
#zjt-bar #zen-gear { display: none; }
@media (max-width: 600px) {
  #zjt-bar #zen-gear { display: inline-block; }
  #zjt-bar .zen-set { display: none; flex-basis: 100%; gap: 8px; }
  #zjt-bar.zen-open .zen-set { display: inline-flex; }
  #zjt-bar.zen-idle #zen-rate { display: none; }
}
#zen-sheet a:not(.zen-btn) { color: inherit; text-decoration: underline; }
/* skip link, floating Listen controls, phone tap targets, gear labels, one theme control */
.zen-skip { position: absolute; left: 8px; top: -60px; z-index: 70; padding: 8px 12px; border-radius: 8px; background: #111; color: #fff !important; font: 600 14px system-ui, sans-serif; }
.zen-skip:focus { top: 6px; }
#zjt-bar.zen-speaking .zen-player { position: fixed; right: 12px; bottom: 12px; z-index: 62; gap: 6px; padding: 8px 10px; border-radius: 999px;
  background: var(--z-surface, var(--surface, #fff)); color: var(--z-fg, var(--text, #111)); box-shadow: 0 6px 22px rgba(0,0,0,.3); font-size: 15px; }
#zjt-bar.zen-speaking .zen-player button { padding: 6px 12px; }
@media (max-width: 600px) {
  #zjt-bar a, #zjt-bar button, #zjt-bar select { min-height: 32px; display: inline-flex; align-items: center; }
  #zjt-bar a { padding: 0 4px; }
  #zjt-bar.zen-open .zen-lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; margin-right: 4px; }
  #zjt-bar.zen-open select { max-width: 11em; }
}
:root[data-zen] :is(header.bar #theme, button#theme) { display: none !important; }
#zen-offer { position: fixed; z-index: 64; left: 12px; bottom: 12px; width: min(360px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 14px;
  background: var(--surface, #fff); color: var(--text, #111); border: 1px solid color-mix(in srgb, currentColor 18%, transparent); box-shadow: 0 14px 40px rgba(0,0,0,.28);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
#zen-offer p { margin: 0 0 6px; } .zen-offer-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#zen-offer .zen-yes { background: var(--accent, #1f5f9e); border-color: var(--accent, #1f5f9e); color: var(--bg, #fff); }
@media print { #zen-offer { display: none !important; } }
