/* Shared styles for every page. Tool-specific rules sit at the bottom, one block per tool. */
:root {
  color-scheme: light dark;
  --bg: #f5f5f0; --panel: #fff; --ink: #202d29; --muted: #5d6963; --line: #dce2da; --soft: #edf1eb;
  --accent: #246448; --accent-hover: #174e35; --accent-soft: #e9f3e8; --on-accent: #fff;
  --danger: #aa3e2e; --screen: #142c26; --screen-ink: #c2d2c9;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
}
/* Dark: follows the device unless the header button picked a theme (<html data-theme>, set before this file loads).
   Every dark rule below comes as this pair: device-dark-and-not-forced-light, then forced dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141b18; --panel: #1d2722; --ink: #e5ebe4; --muted: #a8b6aa; --line: #344239; --soft: #253229;
    --accent: #98c99c; --accent-hover: #b5dcb5; --accent-soft: #2a3f2e; --on-accent: #132b1a;
    --danger: #ffab91; --screen: #0c1914;
  }
}
:root[data-theme="dark"] {
    --bg: #141b18; --panel: #1d2722; --ink: #e5ebe4; --muted: #a8b6aa; --line: #344239; --soft: #253229;
    --accent: #98c99c; --accent-hover: #b5dcb5; --accent-soft: #2a3f2e; --on-accent: #132b1a;
    --danger: #ffab91; --screen: #0c1914;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #599bde; outline-offset: 3px; }
.wrap { width: min(1080px, calc(100% - 48px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: brand + one "All tools" menu (a <details>, so it works without JS).
   The panel lists every tool by category; one row tall on phones so the tool stays in the first screen. */
.site-header { border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 18px; letter-spacing: -.5px; text-decoration: none; white-space: nowrap; }
.brand svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
.hdr-end { display: flex; align-items: center; gap: 8px; }
.theme-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: none; color: var(--ink); cursor: pointer; }
.theme-btn[hidden] { display: none; }
.theme-btn:hover { background: var(--soft); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun { display: block; } :root:not([data-theme="light"]) .theme-btn .moon { display: none; } }
:root[data-theme="dark"] .theme-btn .sun { display: block; } :root[data-theme="dark"] .theme-btn .moon { display: none; }
.menu > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary svg { width: 15px; height: 15px; color: var(--accent); }
.menu > summary:hover, .menu[open] > summary { background: var(--soft); }
.menu-panel { position: absolute; top: calc(100% + 1px); left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px #0f1f1826; padding: 22px max(24px, calc((100% - 1080px) / 2)) 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px 28px; max-height: calc(100vh - 70px); overflow-y: auto; }
.menu-panel b { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.menu-panel a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; margin: 0 -10px; border-radius: 7px; text-decoration: none; font-size: 14px; }
.menu-panel a:hover { background: var(--soft); }
.menu-panel a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* Page intro: kept to a heading and one line so the tool stays in the first screen. */
.intro { padding: 32px 0 20px; }
h1 { font-size: clamp(28px, 4.6vw, 44px); line-height: 1.12; letter-spacing: -1.4px; font-weight: 680; margin: 0 0 8px; }
h1 .sub { display: block; font-size: .5em; letter-spacing: -.3px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.intro p { margin: 0; color: var(--muted); }

/* Tool panel */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 8px 30px #152a2008; }
.tool-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.tool-top h2 { margin: 0; font-size: 15px; font-weight: 650; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 6px; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.monitor { padding: 24px; border-right: 1px solid var(--line); min-width: 0; }
.settings { padding: 24px; min-width: 0; }
.controls { display: flex; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 14px; font-weight: 600; text-decoration: none; }
.button:hover:not(:disabled) { background: var(--soft); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); flex: 1; }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); }
.button svg { width: 16px; height: 16px; flex: none; }
.status-row { display: flex; gap: 9px; align-items: flex-start; min-height: 44px; padding: 12px 0 4px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: #89958b; }
.status-row[data-tone="live"] .dot { background: #4e985a; box-shadow: 0 0 0 3px #4e985a26; }
.status-row[data-tone="error"] .dot { background: var(--danger); }
.status { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.status-row[data-tone="error"] .status { color: var(--danger); }
.small-label { font-size: 11px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 14px 0 8px; }
.reading { font: 12px var(--mono); color: var(--muted); white-space: nowrap; }
.reading strong { font-size: 24px; font-weight: 500; color: var(--ink); letter-spacing: -1px; }
label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 8px; }
select { width: 100%; min-width: 0; height: 44px; padding: 0 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; text-overflow: ellipsis; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; font-size: 13px; margin: 14px 0 0; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
dl.info { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px 10px; margin: 18px 0 20px; font-size: 13px; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; }
.privacy { display: flex; align-items: flex-start; justify-content: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 12px; }
.privacy svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

/* Dark "screen" used for the waveform and the camera preview */
.scope { position: relative; background: var(--screen); border-radius: 10px; overflow: hidden; }
.scope-top { position: absolute; top: 12px; left: 14px; right: 14px; display: flex; justify-content: space-between; color: var(--screen-ink); font: 10px/1.4 var(--mono); letter-spacing: 1px; pointer-events: none; z-index: 1; }
.scope canvas { display: block; width: 100%; height: 100%; }

/* Guide text below the tool */
.guide { margin-top: 48px; }
.guide-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.guide-heading h2 { font-size: 23px; letter-spacing: -.6px; margin: 0; font-weight: 620; }
.guide-heading::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
/* An odd last item would leave an empty cell: widen it, or use three columns when there are exactly three. */
.guide-grid > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
@media (min-width: 1000px) {
  .guide-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); gap: 32px 40px; }
  .guide-grid:has(> :nth-child(3):last-child) > :nth-child(3) { grid-column: auto; }
}
.guide h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 16px; font-weight: 650; }
.number { font: 11px var(--mono); color: var(--accent); background: var(--accent-soft); width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.guide p, .guide li { margin: 0 0 12px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.guide ul { padding-left: 18px; margin: 0 0 12px; }
.guide strong { color: var(--ink); font-weight: 600; }

/* "More tools" cards and the home page grid */
.more { margin-top: 56px; margin-bottom: 40px; }  /* keep .wrap's auto side margins */
.more h2 { font-size: 18px; margin: 0 0 14px; }
/* Fixed column counts so cards line up to the right edge and keep one width across sections. */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
@media (max-width: 999px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cards { grid-template-columns: 1fr; } }
/* Category tones. Each category class sets only a hue (--h); lightness and chroma are fixed, so every hue keeps the
   same contrast: --c on panel/bg/--c-soft ≥ 4.9:1 in light and ≥ 7.3:1 in dark. A category without a .t-* line falls
   back to the brand green hue. Browsers without oklch() get the plain green accent. */
.t-display { --h: 255; } .t-audio-video { --h: 305; } .t-input { --h: 60; } .t-text { --h: 195; } .t-fun-quizzes { --h: 10; } .t-developer { --h: 150; } .t-generators { --h: 105; }
.t-time { --h: 340; }
.card, .cat, .tile { --c: var(--accent); --c-soft: var(--accent-soft); --c-line: var(--line); }
@supports (color: oklch(50% .1 100)) {
  .card, .cat, .tile { --c: oklch(48% .12 var(--h, 150)); --c-soft: oklch(95.5% .03 var(--h, 150)); --c-line: oklch(84% .06 var(--h, 150)); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.card, .cat, .tile) { --c: oklch(82% .1 var(--h, 150)); --c-soft: oklch(31% .05 var(--h, 150)); --c-line: oklch(44% .06 var(--h, 150)); }
  }
  :root[data-theme="dark"] :is(.card, .cat, .tile) { --c: oklch(82% .1 var(--h, 150)); --c-soft: oklch(31% .05 var(--h, 150)); --c-line: oklch(44% .06 var(--h, 150)); }
}
/* Card: tinted icon tile + name + one line. The icon is the only per-tool art (one SVG in build.py TOOLS). */
.card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px 12px; align-content: start; align-items: center; height: 100%; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.card .ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--c-soft); color: var(--c); transition: background .2s, color .2s, transform .2s; }
.card .ico svg { width: 21px; height: 21px; }
.ico .k { stroke: var(--c-soft); transition: stroke .2s; }
.card b { font-size: 15px; line-height: 1.3; }
.card span { grid-column: 1 / -1; font-size: 13px; line-height: 1.55; color: var(--muted); }
@media (max-width: 480px) {   /* phones: one column, so put the icon beside both lines to keep the list short */
  .card { gap: 1px 14px; align-items: start; padding: 14px 16px; }
  .card .ico { grid-row: 1 / 3; }
  .card b { padding-top: 1px; }
  .card span { grid-column: 2; }
}
.card:hover { border-color: var(--c-line); box-shadow: 0 10px 24px -14px #10231a40; transform: translateY(-2px); }
.card:hover .ico { background: var(--c); color: var(--panel); transform: scale(1.06); }
.card:hover .ico .k { stroke: var(--c); }
@media (prefers-reduced-motion: reduce) {
  .card, .card .ico, .ico .k { transition: none; }
  .card:hover, .card:hover .ico { transform: none; }
}
.all-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px 28px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.all-tools h3 { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; font-weight: 650; }
.all-tools a { display: flex; align-items: center; min-height: 36px; font-size: 14px; text-decoration: none; }
.all-tools a:hover { color: var(--accent); text-decoration: underline; }
.all-tools summary { list-style: none; }
.all-tools summary::-webkit-details-marker { display: none; }
/* Category panels in the All tools menu and the folded list: same color formula as .card/.cat/.tile.
   The icon and count only show on phones; wider screens keep the plain column list. */
.menu-grp, .all-tools details { --c: var(--accent); --c-soft: var(--accent-soft); --c-line: var(--line); }
@supports (color: oklch(50% .1 100)) {
  .menu-grp, .all-tools details { --c: oklch(48% .12 var(--h, 150)); --c-soft: oklch(95.5% .03 var(--h, 150)); --c-line: oklch(84% .06 var(--h, 150)); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) :is(.menu-grp, .all-tools details) { --c: oklch(82% .1 var(--h, 150)); --c-soft: oklch(31% .05 var(--h, 150)); --c-line: oklch(44% .06 var(--h, 150)); }
  }
  :root[data-theme="dark"] :is(.menu-grp, .all-tools details) { --c: oklch(82% .1 var(--h, 150)); --c-soft: oklch(31% .05 var(--h, 150)); --c-line: oklch(44% .06 var(--h, 150)); }
}
.menu-grp .ico, .menu-grp b small, .all-tools summary .ico, .all-tools summary small { display: none; }
@media (max-width: 760px) {
  /* Menu: one panel per category, tinted header, tools in two columns. */
  .menu .menu-panel { grid-template-columns: 1fr; gap: 10px; }
  .menu-grp { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; }
  .menu-grp b { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; background: var(--c-soft); color: var(--ink); font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 650; }
  .menu-grp .ico, .all-tools summary .ico { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; color: var(--c); }
  .menu-grp .ico { background: var(--panel); }
  .menu-grp .ico svg, .all-tools summary .ico svg { width: 18px; height: 18px; }
  .menu-grp b small, .all-tools summary small { display: block; margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
  .menu .menu-grp a { margin: 0; padding: 6px 12px; border-radius: 0; line-height: 1.25; }
  /* Folded list: each category is one panel row that opens on tap, so the list grows with categories, not tools. */
  .all-tools { grid-template-columns: 1fr; gap: 8px; padding-top: 18px; }
  .all-tools details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
  .all-tools summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px 0 12px; border-radius: 11px; cursor: pointer; }
  .all-tools summary .ico { background: var(--c-soft); }
  .all-tools summary h3 { margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); }
  .all-tools summary::after { content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 3px 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
  .all-tools details[open] summary { border-radius: 11px 11px 0 0; background: var(--c-soft); }
  .all-tools details[open] summary .ico { background: var(--panel); }
  .all-tools details[open] summary::after { transform: rotate(225deg); margin-bottom: -3px; }
  .all-tools details a { min-height: 44px; padding-left: 52px; font-size: 15px; color: var(--ink); }
  .all-tools details[open] { padding-bottom: 6px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .all-tools summary::after { transition: none; }
}

/* FAQ under the guide. build.py turns each <details class="qa"> into FAQPage JSON-LD. */
/* Full width like the guide above it; only the answer text is held to a readable line length. */
.faq { margin-top: 44px; }
.faq h2 { display: flex; align-items: center; gap: 16px; font-size: 23px; letter-spacing: -.6px; margin: 0 0 14px; font-weight: 620; }
.faq h2::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; padding: 12px 0; font-weight: 600; font-size: 15px; cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--accent); flex: none; }
.qa[open] summary::after { content: "−"; }
.qa p, .qa li { margin: 0 0 12px; max-width: 780px; font-size: 14px; color: var(--muted); line-height: 1.8; }
.qa ul, .qa ol { padding-left: 20px; margin: 0 0 12px; }

/* Plain text pages (about, privacy, 404) */
.prose { max-width: 680px; padding-bottom: 48px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--muted); line-height: 1.8; }
/* Text-only pages (about, privacy): heading and body share one centered column. */
.prose:not(.notes), .intro:has(+ .prose:not(.notes)) { max-width: 680px; margin-inline: auto; }
.prose.notes { max-width: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
@media (max-width: 760px) { .prose.notes { grid-template-columns: 1fr; } }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--muted); font-size: 13px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Full-screen color layer shared by the screen and dead pixel tools.
   The class keeps it covering the viewport where the Fullscreen API is missing (iPhone Safari). */
.fill-layer { position: fixed; inset: 0; z-index: 100; display: none; cursor: none; }
.fill-layer.on { display: block; }
.fill-layer.awake { cursor: default; }
/* The hint lives inside the layer: only the fullscreen element and its children are drawn. */
.fill-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); padding: 8px 8px 8px 14px; border-radius: 10px; background: #000b; color: #fff; font-size: 13px; transition: opacity .4s; }
.fill-hint.fade { opacity: 0; pointer-events: none; }
.fill-hint button { flex: none; min-height: 36px; padding: 6px 14px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; }

/* Mic test */
.meter { height: 16px; position: relative; background: var(--soft); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, #619c67, #a7bd65 72%, #cf9a4d 88%, #c65940); transition: width .09s linear; }
.meter::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(5% - 3px), var(--panel) calc(5% - 3px), var(--panel) 5%); }
.ticks { display: flex; justify-content: space-between; font: 10px/1.6 var(--mono); color: var(--muted); margin: 6px 0 16px; }
.mic .scope { height: 160px; }
.meter-peak { position: absolute; top: 0; bottom: 0; left: -4px; width: 3px; background: var(--ink); z-index: 1; transition: left .1s linear; }
.recording { padding-top: 18px; border-top: 1px solid var(--line); }
.recording h3 { margin: 0 0 4px; font-size: 14px; }
.recording p { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.recording .button { width: 100%; }
.record-dot { width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 50%; }
audio { display: block; width: 100%; height: 36px; margin-top: 12px; }

/* Camera test */
.cam-grid { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), #ffffff40 calc(33.33% - .5px), #ffffff40 calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.67% - .5px), #ffffff40 calc(66.67% - .5px), #ffffff40 calc(66.67% + .5px), transparent calc(66.67% + .5px)),
  linear-gradient(transparent calc(33.33% - .5px), #ffffff40 calc(33.33% - .5px), #ffffff40 calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.67% - .5px), #ffffff40 calc(66.67% - .5px), #ffffff40 calc(66.67% + .5px), transparent calc(66.67% + .5px)); }
.scope.live .cam-grid { opacity: 1; }
.scope.shutter::after { content: ""; position: absolute; inset: 0; background: #fff; pointer-events: none; animation: cam-shutter .45s ease-out forwards; }
@keyframes cam-shutter { from { opacity: .9; } to { opacity: 0; } }
#shot:not([hidden]) img { animation: wheel-pop .38s cubic-bezier(.2, 1.4, .4, 1); }
@media (prefers-reduced-motion: reduce) { #shot:not([hidden]) img { animation: none; } }
.cam .scope { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.cam video { width: 100%; height: 100%; object-fit: contain; background: var(--screen); display: block; }
.cam video.mirror { transform: scaleX(-1); }
.cam .placeholder { position: absolute; color: var(--screen-ink); font-size: 13px; text-align: center; padding: 0 20px; }
.readouts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.readout { background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.readout strong { display: block; font: 500 20px/1.3 var(--mono); letter-spacing: -.5px; color: var(--ink); }
.shot { margin-top: 14px; }
.shot img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.shot a { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* White / black screen */
.screen-tool .preview { height: 240px; border-radius: 10px; border: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); padding: 0; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; animation: wheel-pop .3s ease-out; }
.screen-tool .preview { transition: background-color .35s ease, box-shadow .35s ease; box-shadow: 0 10px 34px -12px var(--glow, transparent); }
.fill-layer.blend { transition: background-color .3s ease; }   /* white/black screen only: the pixel test must switch instantly */
.range input.kelvin { -webkit-appearance: none; appearance: none; height: 14px; border-radius: 7px; background: var(--track); border: 1px solid var(--line); }
.range input.kelvin::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px #0005; }
.range input.kelvin::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 1px 4px #0005; }
.pixel-colors span { transition: transform .2s; }
.pixel-colors span.enter { animation: wheel-pop .35s ease-out backwards; }
.pixel-colors span.seen { position: relative; }
.pixel-colors span.seen::after { content: "✓"; position: absolute; right: -6px; top: -7px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 10px/16px system-ui, sans-serif; text-align: center; animation: wheel-pop .3s ease-out backwards; animation-delay: inherit; }
.dp-steps { display: flex; gap: 5px; flex: none; }
.dp-steps i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid currentColor; opacity: .5; transition: transform .2s, opacity .2s; }
.dp-steps i.done { background: currentColor; opacity: .7; }
.dp-steps i.now { background: currentColor; opacity: 1; transform: scale(1.35); }
@media (prefers-reduced-motion: reduce) {
  .swatch[aria-pressed="true"], .pixel-colors span.enter, .pixel-colors span.seen::after { animation: none; }
  .screen-tool .preview, .fill-layer.blend, .dp-steps i { transition: none; }
}
.range { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.range label { margin: 0; white-space: nowrap; }
.range input { flex: 1; min-width: 0; accent-color: var(--accent); }
.range output { font: 12px var(--mono); min-width: 40px; text-align: right; }

/* Dead pixel test */
.pixel-colors { display: flex; gap: 6px; margin: 16px 0 6px; flex-wrap: wrap; }
.pixel-colors span { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); }
.keys { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
kbd { font: 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--soft); }

/* FPS test */
.fps-big { display: flex; align-items: baseline; gap: 10px; }
.fps-big strong { font: 500 64px/1 var(--mono); letter-spacing: -3px; }
.fps .lanes { margin-top: 16px; padding: 10px 12px 12px; background: var(--screen); border-radius: 10px; }
.fps .lane-label { display: block; font: 10px/1.4 var(--mono); letter-spacing: 1px; color: var(--screen-ink); margin: 6px 0 3px; }
.fps .lane-label:first-child { margin-top: 0; }
.fps .lane-label i { font-style: normal; color: #f2b48a; }
.fps .lane { position: relative; height: 26px; }
.fps .ball { position: absolute; top: 0; left: 0; width: 26px; height: 26px; border-radius: 6px; background: #b5ed8d; will-change: transform; }
.fps .graph { display: block; width: 100%; height: 70px; margin-top: 12px; }
.button.wide { width: 100%; }

@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .site-header .wrap { min-height: 56px; gap: 12px; }
  .menu-panel { padding: 14px 16px 18px; grid-template-columns: 1fr 1fr; gap: 14px 16px; max-height: calc(100vh - 64px); }
  .menu-panel a { min-height: 44px; }
  /* 16px stops iPhone Safari zooming in when a field gets focus */
  input, select, textarea { font-size: 16px; }
  .faq { margin-top: 36px; }
  .intro { padding: 18px 0 14px; }
  .intro p { font-size: 14px; }
  .workspace { grid-template-columns: 1fr; }
  .monitor { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
  .settings { padding: 18px; }
  .tool-top { padding: 12px 18px; }
  .guide-grid { grid-template-columns: 1fr; gap: 24px; }
  .guide { margin-top: 36px; }
  .screen-tool .preview { height: 180px; }
  .fps-big strong { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } .fill-hint { transition: none; } }
input[type="color"] { display: block; width: 100%; height: 44px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.side-title { margin: 0 0 8px; font-size: 14px; }
dl.info.defs { grid-template-columns: 96px minmax(0, 1fr); margin-top: 0; }
dl.info.defs dd { text-align: left; font-family: inherit; font-size: 13px; line-height: 1.5; }
.home-tools { margin: 8px 0 24px; }
.settings .block { margin-top: 18px; }
.settings .block:first-of-type { margin-top: 18px; }
.row { display: flex; gap: 8px; }
.row select { flex: 1; }
.row .button { flex: none; }
.fixer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.warn { font-size: 12px; line-height: 1.6; margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff3e0; color: #7a3e00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warn { background: #3a2a14; color: #ffd8a8; } }
:root[data-theme="dark"] .warn { background: #3a2a14; color: #ffd8a8; }
.fix-opts { margin: 12px 0 10px; }
.fix-layer { position: fixed; inset: 0; z-index: 100; display: none; background: #000; touch-action: none; }
.fix-layer.on { display: block; }
.fix-layer canvas { position: absolute; cursor: move; image-rendering: pixelated; outline: 1px solid #fff4; }
.fix-bar { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); padding: 8px 8px 8px 14px; border-radius: 10px; background: #222; color: #fff; font-size: 13px; }
.fix-bar button { flex: none; min-height: 44px; padding: 6px 16px; border: 1px solid currentColor; border-radius: 7px; background: transparent; color: inherit; }
.recording .row select { flex: 0 0 88px; }
.recording .row .button { flex: 1; width: auto; }
.save-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--accent); }
.save-link[hidden] { display: none; }
dl.info.proc { grid-template-columns: minmax(0, 1fr) auto; margin-top: 0; }
/* Camera test: brightness note, average color swatch and the recorded clip. */
.readout-note { display: block; font-size: 12px; color: var(--muted); min-height: 1.4em; }
.color-chip { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 4px; border: 1px solid var(--line); background: var(--soft); }
.recording h3.next { margin-top: 20px; }
.clip { display: block; width: 100%; margin-top: 14px; border-radius: 8px; background: var(--screen); }
.clip[hidden] { display: none; }

/* Spin the wheel */
.wheel-tool [hidden] { display: none !important; }
.wheel-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wheel-box { position: relative; width: min(100%, 520px); aspect-ratio: 1; }
.wheel-button { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; touch-action: manipulation; }
.wheel-button canvas { display: block; width: 100%; height: 100%; }
.pointer { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 28px solid var(--ink); filter: drop-shadow(0 2px 2px #0003); pointer-events: none; }
.hub { position: absolute; top: 50%; left: 50%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--panel); border: 3px solid var(--line); box-shadow: 0 2px 10px #0002; font-size: clamp(11px, 2.6vw, 16px); font-weight: 750; letter-spacing: 1px; pointer-events: none; }
.result { width: min(100%, 520px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); }
.result .small-label { width: 100%; }
.result strong { flex: 1; min-width: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.5px; overflow-wrap: anywhere; }
.pointer { transform-origin: 50% 0; }
.pointer.flick { animation: wheel-flick .14s ease-out; }
@keyframes wheel-flick { 0% { transform: translateX(-50%) rotate(-14deg); } 100% { transform: translateX(-50%) rotate(0); } }
.result:not([hidden]) { animation: wheel-pop .38s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes wheel-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 200; }
@media (prefers-reduced-motion: reduce) { .pointer.flick, .result:not([hidden]) { animation: none; } }
.wheel-controls { display: flex; gap: 10px; width: min(100%, 520px); }
.wheel-controls .button { white-space: nowrap; }
.settings textarea { display: block; width: 100%; min-height: 200px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: 14px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
@media (max-width: 760px) { .settings textarea { font-size: 16px; } }
.settings .label-row label { margin: 0; }
.tool-row { display: flex; gap: 8px; margin-top: 10px; }
.tool-row .button { flex: 1; }
label.spaced { margin-top: 18px; }
.settings > .button.wide { margin-top: 16px; }
.text-button { min-height: 44px; min-width: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.settings .side-title { margin: 0; }
.history { margin: 0; padding-left: 24px; max-height: 220px; overflow: auto; font-size: 14px; }
.history li { padding: 3px 0; overflow-wrap: anywhere; }
.history li:first-child { font-weight: 650; }
/* Presentation: real full screen where the browser allows it, a window-covering layer elsewhere (iPhone). */
.wheel-stage:fullscreen, .wheel-stage.presenting { justify-content: center; padding: 24px; background: var(--bg); }
.wheel-stage.presenting { position: fixed; inset: 0; z-index: 100; }
.wheel-stage:fullscreen .wheel-box, .wheel-stage.presenting .wheel-box { width: min(92vw, calc(100vh - 220px)); }
.wheel-stage:fullscreen .result, .wheel-stage.presenting .result, .wheel-stage:fullscreen .wheel-controls, .wheel-stage.presenting .wheel-controls { width: min(92vw, 620px); }
.wheel-stage:fullscreen .result strong, .wheel-stage.presenting .result strong { font-size: 34px; }
body.no-scroll { overflow: hidden; }

/* CPS test */
.cps-tool [hidden] { display: none !important; }
.chips { display: flex; gap: 6px; margin-bottom: 14px; }
.chip { flex: 1; min-width: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 3px solid #599bde; outline-offset: 2px; }
.chip input:disabled + span { opacity: .5; cursor: not-allowed; }
.cps-pad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 300px; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--soft); color: inherit; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.cps-pad:active { background: var(--accent-soft); }
.cps-pad.running { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.cps-pad.done { border-style: solid; }
.pad-big { font-size: 40px; font-weight: 750; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pad-small { font-size: 14px; color: var(--muted); }
.cps-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; text-align: center; }
.cps-stats strong { display: block; font: 500 26px/1.3 var(--mono); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
#stop { margin-top: 12px; }
.cps-result { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.score-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.score-row > div { flex: 1; min-width: 140px; }
.score-row strong { display: block; font-size: 30px; line-height: 1.2; letter-spacing: -1px; }
.rating { padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }
#graph { display: block; width: 100%; height: 150px; }
dl.info.cps-info { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 0; }
dl.info.bests { grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.data th { font-size: 12px; color: var(--muted); font-weight: 650; }
.cps-pad { position: relative; overflow: hidden; --heat: 0; transition: box-shadow .2s; }
.cps-pad.running { box-shadow: inset 0 0 calc(var(--heat) * 70px) calc(var(--heat) * 6px) rgba(224, 164, 58, calc(var(--heat) * .75)); }
.cps-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--accent); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.cps-pad.running .cps-bar { transform: scaleX(1); }
.cps-ripple { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border: 3px solid var(--accent); border-radius: 50%; pointer-events: none; animation: cps-ring .5s ease-out forwards; }
@keyframes cps-ring { from { transform: scale(.2); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
.pad-big.bump { animation: cps-bump .12s ease-out; }
@keyframes cps-bump { from { transform: scale(1.12); } to { transform: none; } }
.cps-result:not([hidden]) { animation: wheel-pop .38s cubic-bezier(.2, 1.4, .4, 1); }
.cps-result.record #new-best { animation: cps-shine 1.2s ease-in-out 3; }
@keyframes cps-shine { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px #e0a43a55; } }
@media (prefers-reduced-motion: reduce) { .pad-big.bump, .cps-result:not([hidden]), .cps-result.record #new-best { animation: none; } }
@media (max-width: 760px) { .cps-pad { height: 230px; } .pad-big { font-size: 34px; } .chip span { font-size: 13px; } }

/* Morse code translator */
.morse-tool [hidden] { display: none !important; }
.morse-tool .label-row:first-child { margin-top: 0; align-items: center; }
.morse-tool .label-row select { width: auto; flex: none; }
.morse-tool textarea { display: block; width: 100%; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: 16px/1.6 var(--mono); }
.morse-out { min-height: 76px; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--soft); font: 16px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.morse-out:empty::before { content: "The translation appears here"; color: var(--muted); font-family: system-ui, sans-serif; font-size: 14px; }
.morse-out span.on { background: var(--accent); color: var(--on-accent); border-radius: 3px; }
.player { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.player .button { flex: 1; padding: 10px 12px; white-space: nowrap; }
.player .button svg { width: 14px; height: 14px; }
.morse-tape { position: relative; height: 52px; margin-top: 14px; overflow: hidden; border-radius: 8px; background: var(--soft); }
.morse-tape::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 35%; width: 2px; background: var(--danger); z-index: 1; }
.morse-track { position: absolute; top: 0; bottom: 0; left: 35%; }
.morse-track i { position: absolute; top: 12px; height: 12px; border-radius: 6px; background: var(--line); }
.morse-track i.on { background: var(--accent); }
.morse-track b { position: absolute; top: 30px; font: 600 12px/1.4 var(--mono); color: var(--muted); }
.lamp { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); border: 2px solid var(--line); }
.lamp.on { background: #ffd23f; border-color: #e0a800; box-shadow: 0 0 22px #ffd23faa; }
.morse-tool input[type=range] { width: 100%; height: 32px; accent-color: var(--accent); }
.morse-tool .label-row { margin-top: 12px; }
.morse-tool .settings .label-row:first-child { margin-top: 0; }
h3.side-title.block { margin-top: 24px; }
.morse-key { display: flex; align-items: center; justify-content: center; width: 100%; height: 96px; margin-top: 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--soft); color: inherit; font-size: 15px; font-weight: 650; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
.morse-key.pressed { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.flash-layer { position: fixed; inset: 0; z-index: 100; background: #fff; }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; align-items: start; }
table.data caption { text-align: left; font-weight: 650; padding-bottom: 6px; }
table.data td.code { font-family: var(--mono); letter-spacing: 1px; }
@media (max-width: 999px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .morse-tool .label-row select { font-size: 16px; } }

/* Character counter */
.counter-tool textarea { display: block; width: 100%; min-height: 220px; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.counts div { padding: 10px 12px; background: var(--panel); }
.counts dt { font-size: 12px; color: var(--muted); }
.counts dd { margin: 0; font: 500 22px/1.3 var(--mono); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.counter-tool .settings > .label-row:first-child { margin-top: 0; }
.counter-tool input[type=number] { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font-size: 15px; }
.counter-tool .row select { flex: 0 0 130px; }
.bar { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.bar.near span { background: #d08a00; }
.bar.over span { background: var(--danger); }
.limits { list-style: none; margin: 0; padding: 0; }
.limits li + li { margin-top: 10px; }
.limits .label-row { margin: 0; font-size: 13px; }
.counter-tool .bar { height: 8px; border-radius: 4px; }
.counter-tool .bar span { transition: width .3s ease-out, background-color .3s; }
.limits li.over .reading { color: var(--danger); font-weight: 650; }
.limits li.jolt { animation: counter-jolt .4s; }
@keyframes counter-jolt { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.counter-tool dd.lit { animation: counter-lit .6s ease-out; }
@keyframes counter-lit { from { color: var(--accent); transform: scale(1.12); } to { color: inherit; transform: none; } }
.counter-tool dd { transform-origin: left center; }
@media (prefers-reduced-motion: reduce) { .counter-tool .bar span { transition: none; } }
@media (max-width: 760px) { .counter-tool input[type=number] { font-size: 16px; } }
@media (max-width: 480px) { .counts dd { font-size: 19px; } }

/* Sound test */
.sound-tool [hidden] { display: none !important; }
.speakers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.speaker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 124px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: inherit; font-size: 15px; font-weight: 650; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.speaker svg { width: 34px; height: 34px; }
.speaker.playing, .sound-tool .button.playing { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.meter { display: block; width: 70%; height: 6px; border-radius: 3px; background: rgba(127, 127, 127, .18); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: currentColor; }
.meter-gap { display: block; height: 6px; }
.surround { margin-top: 14px; }
.surround-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.surround-grid .speaker { min-height: 72px; font-size: 13px; }
.status-line { min-height: 44px; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.sound-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.sound-block .label-row { margin-top: 0; }
.sweep-bar { margin: 0 0 4px; }
.sound-tool dl.info.proc { margin-top: 16px; }
.sound-tool .tool-row .button { padding-inline: 8px; white-space: nowrap; }
.sound-tool input[type=range] { width: 100%; height: 32px; accent-color: var(--accent); }
ol.steps { margin: 0; padding-left: 22px; }
ol.steps li + li { margin-top: 10px; }
@media (max-width: 760px) { .speaker { min-height: 108px; } }

/* Controller tester */
.pad-tool [hidden] { display: none !important; }
.pad-wait { text-align: center; }
.wait-icon { width: 64px; height: 44px; color: var(--accent); animation: wait-pulse 1.6s ease-in-out infinite; }
@keyframes wait-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .wait-icon { animation: none; } }
.wait-title { margin: 6px 0 0; font-size: 18px; font-weight: 700; }
.connect-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; text-align: left; }
.connect-grid section { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.connect-grid h3 { margin: 0 0 6px; font-size: 14px; }
.connect-grid p { margin: 0; font-size: 13px; line-height: 1.5; }
.pad-svg { display: block; width: 100%; max-width: 520px; margin: 0 auto; }
.pad-svg .body { fill: var(--soft); stroke: var(--line); stroke-width: 2; }
.pad-svg .pb, .pad-svg .trig-bg { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.pad-svg .pb.on, .pad-svg .trig-fill { fill: var(--accent); stroke: var(--accent); }
.pad-svg .pb { transition: fill .08s, stroke .08s; }
.pad-svg .pb.on { filter: drop-shadow(0 0 5px var(--accent)); }
.pad-svg .ring { fill: none; stroke: var(--line); stroke-width: 2; }
.pad-svg text { font: 600 11px system-ui, -apple-system, sans-serif; fill: var(--ink); text-anchor: middle; pointer-events: none; }
.pad-svg text.face { font-size: 12px; }
.pad-svg .pb.on + text { fill: var(--on-accent); }
.sticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stick-card { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.stick-card canvas { flex: none; width: 120px; height: 120px; }
.stick-read { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.stick-read strong { font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
#reset-circle { margin-top: 10px; }
.input-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.input-list li { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.input-list li.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.input-list strong { font: 500 12px var(--mono); }
.input-list.axes { margin-top: 6px; }
.pad-tool .settings .chips { margin-top: 6px; }
.pad-tool dl.info.proc { margin-top: 16px; }
.pad-svg .trig text { paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
@media (max-width: 760px) { .connect-grid { grid-template-columns: 1fr; } .pad-tool select { font-size: 16px; } }
@media (max-width: 600px) { .sticks { grid-template-columns: 1fr; } }

/* Enneagram test */
.enn-tool [hidden] { display: none !important; }
.enn-progress { margin: 0 0 16px; }
.enn-q { min-height: 3.2em; margin: 0 0 14px; font-size: 20px; font-weight: 650; line-height: 1.4; letter-spacing: -.2px; }
.enn-answers { display: grid; gap: 8px; }
.enn-a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.enn-a kbd { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 6px; font: 500 12px var(--mono); color: var(--muted); }
.enn-a:hover { background: var(--soft); }
.enn-a[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.enn-a[aria-checked="true"] kbd { color: inherit; border-color: currentColor; }
.enn-tool .tool-row { margin-top: 14px; }
.enn-desc section + section { margin-top: 12px; }
.enn-desc h3 { margin: 14px 0 4px; font-size: 15px; }
.enn-desc p { margin: 0; font-size: 14px; line-height: 1.6; }
.enn-bars { margin: 0; padding: 0; list-style: none; }
.enn-bars li { display: grid; grid-template-columns: 128px minmax(0, 1fr) 32px; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.enn-bars .bar { margin: 0; height: 8px; }
.enn-bars strong { font: 500 13px var(--mono); text-align: right; }
.enn-bars li.main { font-weight: 700; }
.enn-bars li:not(.main):not(.wing) .bar span { background: var(--muted); opacity: .55; }
.enn-scores { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: center; }
.enn-shape { display: block; width: 100%; overflow: visible; }
.enn-ring { fill: none; stroke: var(--line); stroke-width: 1.5; }
.enn-line { fill: none; stroke: var(--line); stroke-width: 1; }
.enn-area { fill: var(--accent); fill-opacity: .22; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; transform-origin: 0 0; animation: enn-grow .8s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes enn-grow { from { transform: scale(0); } to { transform: none; } }
.enn-shape circle:not(.enn-ring) { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.enn-shape circle.main { fill: var(--accent); stroke: var(--accent); }
.enn-shape circle.wing { fill: var(--accent-soft); stroke: var(--accent); }
.enn-shape text { font: 600 13px system-ui, sans-serif; fill: var(--muted); text-anchor: middle; dominant-baseline: central; }
.enn-shape text.main, .enn-shape text.wing { fill: var(--ink); font-weight: 750; }
.enn-bars .bar span { animation: enn-bar .7s ease-out both; }
@keyframes enn-bar { from { width: 0; } }
.enn-q.enter { animation: enn-in .25s ease-out; }
@keyframes enn-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .enn-scores { grid-template-columns: 1fr; } .enn-shape { max-width: 240px; margin: 0 auto; } }
@media (prefers-reduced-motion: reduce) { .enn-area, .enn-bars .bar span, .enn-q.enter { animation: none; } }
.enn-tips { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.enn-tips li + li { margin-top: 6px; }
.enn-tool #restart { margin-top: 14px; }
#after .hint { font-size: 13px; line-height: 1.55; }
.enn-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; }
.enn-types h3 { margin: 0 0 6px; font-size: 16px; }
.enn-types p { margin: 0; }
@media (max-width: 999px) { .enn-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .enn-types { grid-template-columns: 1fr; } .enn-q { font-size: 18px; } .enn-bars li { grid-template-columns: 112px minmax(0, 1fr) 30px; } }

/* Case converter */
.case-tool [hidden] { display: none !important; }
.case-tool textarea { display: block; width: 100%; min-height: 200px; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
.case-count { margin: 6px 0 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.case-grid:not(.code) > :last-child { grid-column: 1 / -1; }
.case-grid .button { padding: 10px 8px; font-weight: 600; }
.case-grid.code .button { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.case-label { margin: 16px 0 8px; }
.case-actions { margin-top: 16px; flex-wrap: wrap; }
.case-actions .button { flex: 1 1 0; min-width: 0; padding: 10px 12px; white-space: nowrap; }
.case-example { margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 14px; line-height: 1.5; }
.case-tool .hint + .small-label { display: block; margin-top: 12px; }
.case-tool .check { min-height: 44px; align-items: center; margin-top: 4px; }
.case-tool .check input { margin: 0; }
@media (max-width: 480px) {
  .case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-actions .button { flex: 1 1 calc(50% - 4px); }
}

/* Color blind test */
.cbt-tool [hidden] { display: none !important; }
.cbt-lead { margin: 0 0 16px; font-size: 15px; line-height: 1.6; }
.cbt-checklist { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.cbt-checklist li + li { margin-top: 4px; }
.cbt-plate { display: flex; justify-content: center; margin: 16px 0 12px; }
.cbt-plate canvas { display: block; width: min(100%, 340px); aspect-ratio: 1; border-radius: 50%; }
.cbt-answer { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin-bottom: 10px; }
.cbt-answer output { min-width: 2.5ch; font: 600 28px/1.2 var(--mono); text-align: center; }
.cbt-keys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cbt-keys .button { padding: 8px 0; font: 600 18px/1 var(--mono); }
.cbt-keys .del { grid-column: 6; grid-row: 1 / span 2; height: auto; }
.cbt-verdict { margin: 4px 0 8px; font-size: 22px; line-height: 1.3; }
.cbt-detail { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.cbt-rows { list-style: none; margin: 16px 0; padding: 0; }
.cbt-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cbt-rows strong { text-align: right; font-variant-numeric: tabular-nums; }
.cbt-dots { display: flex; gap: 5px; }
.cbt-dots span { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); }
.cbt-dots .ok { background: var(--accent); }
.cbt-dots .miss { background: transparent; border-color: var(--muted); }
.cbt-review { margin: 0 0 12px; font-size: 14px; }
.cbt-review summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.cbt-review table { margin-top: 6px; }
.cbt-plate canvas.enter { animation: cbt-in .35s ease-out; }
@keyframes cbt-in { from { opacity: 0; transform: scale(.94) rotate(-6deg); } to { opacity: 1; transform: none; } }
.cbt-dots span { animation: cbt-dot .3s ease-out both; }
.cbt-dots span:nth-child(2) { animation-delay: .08s; } .cbt-dots span:nth-child(3) { animation-delay: .16s; } .cbt-dots span:nth-child(4) { animation-delay: .24s; }
@keyframes cbt-dot { from { transform: scale(0); } }
.cbt-sim { list-style: none; margin: 8px 0 6px; padding: 0; }
.cbt-sim li { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.cbt-sim li.you { background: var(--accent-soft); font-weight: 650; }
.cbt-sim em { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); }
.cbt-swatches { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.cbt-swatches i { display: block; height: 26px; border-radius: 4px; }
@media (max-width: 480px) { .cbt-sim li { grid-template-columns: 1fr; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .cbt-plate canvas.enter, .cbt-dots span { animation: none; } }
@media (max-width: 480px) { .cbt-plate canvas { width: min(100%, 300px); } .cbt-rows li { grid-template-columns: minmax(0, 1fr) auto 56px; gap: 8px; } }

/* Fancy text generator */
.spark { position: fixed; z-index: 200; margin: -8px 0 0 -6px; color: #e0a43a; font-size: 13px; line-height: 1; pointer-events: none; animation: spark .65s ease-out forwards; }
.spark:nth-child(odd) { color: var(--accent); }
@keyframes spark { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); opacity: 0; } }
.fancy-row.copied { animation: fancy-pop .3s ease-out; }
@keyframes fancy-pop { 40% { transform: scale(1.02); } }
.case-tool textarea.flash { animation: case-flash .5s ease-out; }
@keyframes case-flash { from { background: var(--accent-soft); border-color: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .fancy-row.copied, .case-tool textarea.flash { animation: none; } }
.fancy-tool [hidden] { display: none !important; }
.fancy-input { display: flex; gap: 8px; align-items: stretch; }
.fancy-input textarea { flex: 1; min-width: 0; min-height: 52px; resize: vertical; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.fancy-input .button { flex: none; padding: 0 14px; }
.fancy-tool .status-line { min-height: 20px; margin: 6px 0 4px; }
.fancy-group { margin: 14px 0 6px; }
.fancy-list > .fancy-group:first-of-type { margin-top: 4px; }
.fancy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name copy" "out copy"; align-items: center; gap: 2px 12px; width: 100%; min-height: 56px; margin: 0 0 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fancy-row:hover { border-color: var(--accent); }
.fancy-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fancy-name { grid-area: name; font-size: 12px; font-weight: 600; color: var(--muted); }
.fancy-name small { font-weight: 400; margin-left: 8px; }
.fancy-out { grid-area: out; font-size: 19px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fancy-copy { grid-area: copy; padding: 6px 12px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 600; }
.fancy-row.copied { border-color: var(--accent); }
.fancy-row.copied .fancy-copy { background: var(--accent); color: var(--on-accent); }
.fancy-list.sample .fancy-out { color: var(--muted); }
.fancy-plain { border-color: var(--accent); background: var(--accent-soft); margin-top: 8px; }
.fancy-shuffle { margin-top: 10px; }
@media (max-width: 480px) { .fancy-name small { display: block; margin: 1px 0 0; } .fancy-out { font-size: 18px; } }

/* Mouse tester */
.mt-tool [hidden] { display: none !important; }
.mt-pad { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 280px; overflow: hidden; border: 2px dashed var(--line); border-radius: 12px; background: var(--soft); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.mt-pad:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mt-pad.touch { touch-action: none; cursor: default; }
.mt-mouse { width: auto; height: 150px; }
.mt-body { fill: var(--panel); stroke: var(--line); stroke-width: 2; }
.mt-key { fill: var(--panel); stroke: var(--muted); stroke-width: 1.5; }
.mt-key.on { fill: var(--accent); stroke: var(--accent); }
.mt-arrow { fill: var(--line); }
.mt-arrow.on { fill: var(--accent); }
.mt-hint { margin: 0; padding: 0 16px; font-size: 14px; color: var(--muted); text-align: center; }
.mt-dot { position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--accent); opacity: .5; pointer-events: none; animation: mt-fade .7s ease-out forwards; }
.mt-dot.b0, .mt-dot.b1, .mt-dot.b2, .mt-dot.b3, .mt-dot.b4 { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: none; border: 3px solid var(--accent); opacity: 1; animation: cps-ring .5s ease-out forwards; }
.mt-dot.b1 { border-color: #e0a43a; } .mt-dot.b2 { border-color: #3f6fb5; } .mt-dot.b3, .mt-dot.b4 { border-color: #c94f7c; }
@keyframes mt-fade { to { opacity: 0; transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .mt-dot { animation: none; } }
.mt-buttons { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.mt-buttons li { display: flex; flex-direction: column; align-items: center; min-height: 64px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; text-align: center; }
.mt-buttons strong { font: 500 20px/1.3 var(--mono); }
.mt-buttons small { min-height: 1.3em; font-size: 11px; color: var(--danger); }
.mt-buttons li.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mt-buttons li.on small { color: inherit; }
.mt-buttons li.bad { border-color: var(--danger); }
.mt-readouts .readout.bad { box-shadow: inset 0 0 0 1px var(--danger); }
.mt-readouts .readout.bad .readout-note { color: var(--danger); }
.mt-tool .status-line { min-height: 44px; }
.mt-log { margin-top: 8px; }
.mt-log td { font-variant-numeric: tabular-nums; }
.mt-log tr.bad td { color: var(--danger); }
.mt-log .mt-empty td { color: var(--muted); }
@media (max-width: 480px) { .mt-pad { height: 230px; } .mt-mouse { height: 120px; } .mt-buttons { gap: 4px; } .mt-buttons li { font-size: 11px; padding: 6px 2px; } }

/* Headphone test (builds on the sound test styles) */
/* Sound waves on a playing speaker: rings go out, and the icon swells with the measured level */
.speaker { position: relative; overflow: hidden; isolation: isolate; }
.speaker.playing::before, .speaker.playing::after { content: ""; position: absolute; left: 50%; top: 40%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border: 2px solid currentColor; border-radius: 50%; opacity: 0; z-index: -1; animation: speaker-wave 1.4s ease-out infinite; }
.speaker.playing::after { animation-delay: .7s; }
@keyframes speaker-wave { from { transform: scale(.5); opacity: .55; } to { transform: scale(2.6); opacity: 0; } }
.speaker.playing svg { transform: scale(calc(1 + var(--lvl, 0) * .3)); transition: transform .08s linear; }
.hp-orbit { display: block; width: 150px; height: 150px; margin: 6px auto 0; overflow: visible; }
.hp-path { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 4; }
.hp-head, .hp-nose, .hp-ear { fill: var(--soft); stroke: var(--muted); stroke-width: 1.5; }
.hp-orbit text { font: 600 9px system-ui, sans-serif; fill: var(--muted); text-anchor: middle; }
.hp-dot { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
@media (prefers-reduced-motion: reduce) { .speaker.playing::before, .speaker.playing::after { animation: none; } .speaker.playing svg { transform: none; } }
.hp-tones { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.hp-tones .button { padding-inline: 4px; white-space: nowrap; }
.hp-tool .sound-block > .button.wide { margin-bottom: 6px; }
.hp-tool input[type=range] { margin: 6px 0 0; }   /* the browser's side margin pushed it past the box */
.hp-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.hp-tool .tool-row .button { flex: 1 1 0; }
.hp-stop { margin-top: 16px; }
@media (max-width: 480px) { .hp-tool .tool-row { flex-wrap: wrap; } .hp-tool .tool-row .button { flex-basis: 100%; } }

/* ===== Home page =====
   Centred hero with search · one picture tile per category (each links to its section) · all tools by category · why band.
   Category colours come from the tone system above; nothing here is per tool. */
.hero { position: relative; isolation: isolate; text-align: center; padding: 72px 0 52px; }
.hero::before { content: ""; position: absolute; inset: 0 -24px; z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; background-position: center -1px; opacity: .55;
  -webkit-mask-image: radial-gradient(ellipse 55% 85% at 50% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 55% 85% at 50% 0%, #000 20%, transparent 75%); }
.hero::after { content: ""; position: absolute; inset: -1px -24px 0; z-index: -2; background: radial-gradient(ellipse 48% 62% at 50% 0%, var(--accent-soft), transparent 72%); }
.hero h1 { max-width: 820px; margin: 0 auto; font-size: clamp(34px, 5.6vw, 58px); line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); background: linear-gradient(transparent 68%, var(--accent-soft) 68%, var(--accent-soft) 92%, transparent 92%); }
.lede { max-width: 580px; margin: 20px auto 0; font-size: 18px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.find { position: relative; max-width: 560px; margin: 32px auto 0; text-align: left; }
.find[hidden] { display: none; }
.find input { width: 100%; height: 56px; padding: 0 52px 0 50px; font-size: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px #10231a0d, 0 14px 32px -18px #10231a4d; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.find input::placeholder { color: var(--muted); opacity: .85; }
.find input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.find svg { position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.find kbd { position: absolute; right: 16px; top: 16px; min-width: 24px; padding: 2px 7px; text-align: center; font: 12px/18px var(--mono); color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; pointer-events: none; }
.find input:focus ~ kbd, .find input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none) { .find kbd { display: none; } }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; list-style: none; padding: 0; margin: 24px 0 0; font-size: 14px; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts li::before { content: ""; width: 4px; height: 8px; margin: -3px 2px 0 3px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Category tiles: a small picture of what the tools in it do, then the name and count. One row of up to five on desktop;
   a plain list on phones. The pictures stay grey so the row reads calm; the category colour comes in on hover. */
.browse { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 14px; margin: 0 0 64px; }
/* Six or more categories are too narrow in one row, so they wrap into two even rows (3+3, 4+3, 4+4). Phones keep the list. */
@media (min-width: 601px) {
  .browse:has(> .tile:nth-of-type(6)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .browse:has(> .tile:nth-of-type(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.tile { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 14px 30px -24px #10231a59; transition: transform .2s, border-color .2s, box-shadow .2s; }
.tile { --tc: var(--c); }
.tile:hover { transform: translateY(-3px); border-color: var(--c-line); box-shadow: 0 20px 36px -22px #10231a66; }
.tile-art { --c: color-mix(in oklab, var(--muted) 72%, var(--soft)); --c-soft: var(--soft); --c-line: color-mix(in oklab, var(--muted) 28%, var(--soft)); transition: background-color .25s; }
.tile:hover .tile-art { --c: var(--tc); --c-soft: color-mix(in oklab, var(--tc) 12%, var(--panel)); --c-line: color-mix(in oklab, var(--tc) 40%, var(--panel)); }
.tile-art { position: relative; display: grid; place-items: center; height: 124px; overflow: hidden; background: var(--c-soft); border-bottom: 1px solid var(--line); }
.tile-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 12px 14px 13px; }
.tile-meta .ico { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--c-soft); color: var(--c); }
.tile-meta .ico svg { width: 18px; height: 18px; }
.tile-meta b { font-size: 15px; line-height: 1.25; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta small { font: 12px/1.4 var(--mono); color: var(--muted); }
.art-icon svg { width: 52px; height: 52px; color: var(--c); }
.art-top { position: absolute; top: 13px; left: 16px; right: 16px; display: flex; justify-content: space-between; font: 10px/1 var(--mono); letter-spacing: 1.4px; color: var(--c); opacity: .8; }
.art-top .art-rec::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--c-line); vertical-align: 1px; }
.art-scope .wave { position: absolute; left: 0; top: 30px; width: 200%; height: 62px; animation: art-wave 7s linear infinite; }
.art-scope .wave path { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.art-scope .wave-fill { stroke: var(--c-line); stroke-width: 7; opacity: .5; }
@keyframes art-wave { to { transform: translateX(-50%); } }
.art-bars { position: absolute; left: 16px; right: 16px; bottom: 14px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.art-bars i { height: 6px; border-radius: 2px; background: var(--c-line); }
.art-bars i:nth-child(-n+9) { background: var(--c); }
.art-pix svg { width: 80%; }
.art-pix .px rect { fill: var(--panel); stroke: var(--c-line); stroke-width: 1; }
.art-pix .px-on { fill: var(--c); }
.art-pix .px-ring { fill: none; stroke: var(--c); stroke-width: 1.5; stroke-dasharray: 3 3; }
.art-type { align-content: center; gap: 12px; }
.art-type b { font-size: 44px; font-weight: 720; letter-spacing: -1.5px; line-height: 1; color: var(--c); }
.art-type svg { width: 76px; fill: none; stroke: var(--c); stroke-width: 4; stroke-linecap: round; }
.art-wheel svg { width: auto; height: 84%; }
.art-wheel path:not(.art-pin) { stroke: var(--panel); stroke-width: 1.5; stroke-linejoin: round; }
.art-wheel .s0 { fill: var(--c); } .art-wheel .s1 { fill: var(--c-line); } .art-wheel .s2 { fill: color-mix(in oklab, var(--c) 55%, var(--c-line)); }
.art-wheel .art-hub { fill: var(--panel); stroke: var(--c); stroke-width: 3; }
.art-wheel .art-pin { fill: var(--c); }
.art-click svg { width: 72%; overflow: visible; }
.art-click .dot { fill: var(--c); }
.art-click .rip { fill: none; stroke: var(--c); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: art-rip 2.6s ease-out infinite; }
.art-click .r2 { animation-delay: 1.3s; }
.art-click .cur { fill: var(--c); stroke: var(--panel); stroke-width: 3; stroke-linejoin: round; }
@keyframes art-rip { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }


/* Section head */
.sec-head { margin: 0 0 4px; }
.sec-head h2 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.5px; font-weight: 680; }

/* Category sections */
.home-tools .cat { margin-top: 34px; scroll-margin-top: 20px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.cat-head .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--c-soft); color: var(--c); flex: none; }
.cat-head .ico svg { width: 19px; height: 19px; }
.cat-head h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; font-weight: 680; }
.cat-n { font: 12px/1 var(--mono); padding: 5px 9px; border-radius: 999px; color: var(--c); background: var(--c-soft); white-space: nowrap; }
.cat-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.home-tools [hidden] { display: none !important; }
.find-none { margin: 24px 0 0; padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; }

/* While searching, the results move up under the search box */
.searching .browse, .searching .why { display: none; }

/* Why this site: the two notes on the dark "screen" colour, closing the page */
.why { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 40px 48px; margin: 80px 0 64px; padding: 48px; color: #eef4ef; background: var(--screen); border-radius: 24px; }
.why::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(#ffffff17 1.2px, transparent 1.4px) 0 0 / 18px 18px;
  -webkit-mask-image: linear-gradient(110deg, #000, transparent 45%); mask-image: linear-gradient(110deg, #000, transparent 45%); }
.why h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.12; letter-spacing: -.9px; font-weight: 680; color: #fff; }
.why-intro p { margin: 0; font-size: 15px; color: var(--screen-ink); }
.why-note .ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 13px; color: #9fdcaa; background: #ffffff10; border: 1px solid #ffffff1f; }
.why-note .ico svg { width: 23px; height: 23px; }
.why-note h3 { margin: 0 0 8px; font-size: 17px; color: #fff; }
.why-note p { margin: 0; font-size: 14.5px; line-height: 1.75; color: var(--screen-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .why { border: 1px solid var(--line); } }
:root[data-theme="dark"] .why { border: 1px solid var(--line); }

@media (max-width: 960px) {
  .why { grid-template-columns: 1fr 1fr; }
  .why-intro { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .browse { gap: 10px; margin-bottom: 48px; }
  .tile-art { height: 96px; }
  .art-scope .art-top { display: none; }
  .art-scope .wave { top: 14px; height: 52px; }
  .art-bars { bottom: 10px; }
  .tile-meta { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 11px; }
  .tile-meta .ico { display: none; }
  .tile-meta b { font-size: 14px; }
}
@media (max-width: 760px) { .hero::before { inset: 0 -16px; } .hero::after { inset: -1px -16px 0; } }
@media (max-width: 600px) {
  .hero { padding: 36px 0 32px; }
  .hero h1 { font-size: 34px; letter-spacing: -.03em; }
  .lede { font-size: 15.5px; margin-top: 14px; }
  .find { margin-top: 22px; }
  .facts { margin-top: 16px; gap: 6px 16px; font-size: 13px; }
  /* Phones: one grouped list, no pictures, nothing to scroll sideways. */
  .browse { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; margin-bottom: 36px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .tile { flex-direction: row; border: 0; border-radius: 0; box-shadow: none; }
  .tile + .tile { border-top: 1px solid var(--line); }
  .tile:hover { transform: none; box-shadow: none; background: var(--soft); }
  .tile-art { display: none; }
  .tile-meta { flex: 1; grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 12px; min-height: 56px; padding: 0 16px; }
  .tile-meta .ico { display: grid; grid-row: auto; width: 32px; height: 32px; }
  .tile-meta b { font-size: 15.5px; font-weight: 620; }
  .tile-meta::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 1.6px 1.6px 0 0; transform: rotate(45deg); margin-right: 3px; }
  .sec-head h2 { font-size: 21px; }
  .why { grid-template-columns: 1fr; gap: 28px; margin: 56px 0 44px; padding: 32px 22px; border-radius: 20px; }
  .why h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .art-scope .wave, .art-click .rip { animation: none; }
  .art-click .r2 { display: none; }
  .art-click .r1 { transform: scale(1.2); opacity: .5; }
  .tile, .find input { transition: none; }
  .tile:hover { transform: none; }
}

/* Cookie choice (GA4) — only shown on toolhandful.com to visitors in a European time zone, or from the privacy page.
   Sits under the fullscreen tool layers (z-index 100) so it never covers a screen test. */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 600px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgb(0 0 0 / .18); font-size: 14px; }
.consent p { margin: 0; flex: 1 1 260px; }
.consent div { display: flex; gap: 8px; }
.consent .button.primary { flex: none; }
#consent-reset[hidden] { display: none; }

/* Keyboard test: monochrome states inherit the paired light/dark tokens above. */
.kb-stage { padding: 20px 24px; background: var(--panel); }
.kb-state { font: 12px var(--mono); color: var(--muted); }
.kb-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.kb-toolbar > div { flex: 1; min-width: 130px; }
.kb-toolbar label { margin-bottom: 4px; }
.kb-tool select, .kb-tool input { font-size: 16px; }
.kb-connect { margin: 12px 0; font-size: 13px; color: var(--muted); }
.kb-pad { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 14px; cursor: pointer; }
.kb-pad:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.kb-pad > p { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.kb-board { display: grid; grid-template-columns: minmax(0, 15fr) minmax(0, 3fr) minmax(0, 4fr); gap: 12px; }
.kb-board[data-size="tkl"] { grid-template-columns: minmax(0, 15fr) minmax(0, 3fr); }
.kb-board[data-size="compact"] { grid-template-columns: minmax(0, 1fr); }
.kb-main { display: grid; gap: 5px; min-width: 0; }
.kb-row { display: flex; gap: 4px; min-width: 0; }
.kb-key { position: relative; min-width: 0; height: 42px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 5px; display: flex; align-items: center; justify-content: center; padding: 2px; background: var(--panel); color: var(--ink); font: 10px/1.2 var(--mono); }
.kb-key > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-key.tested, .kb-swatch.tested { background: var(--soft); border-color: var(--muted); }
.kb-key.tested::after { content: '✓'; position: absolute; right: 2px; bottom: 1px; font-size: 8px; }
.kb-key.held, .kb-swatch.held { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.kb-key.held::after { content: '↓'; }
.kb-nav, .kb-num { display: grid; gap: 5px; min-width: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; }
.kb-nav { row-gap: 16.75px; }
.kb-num { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 16.75px; }
.kb-num [data-code="NumpadAdd"], .kb-num [data-code="NumpadEnter"] { grid-row: span 2; height: auto; }
.kb-num [data-code="Numpad0"] { grid-column: span 2; }
.kb-summary { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 16px; font-size: 14px; }
.kb-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin: 10px 0; }
.kb-swatch { width: 12px; height: 12px; border: 1px solid var(--line); border-radius: 3px; margin-left: 10px; }
.kb-swatch:first-child { margin-left: 0; }
.kb-last { margin: 8px 0; font: 13px/1.6 var(--mono); overflow-wrap: anywhere; }
.kb-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kb-panel { padding: 20px 24px; border-top: 1px solid var(--line); min-width: 0; }
.kb-panel h3 { margin: 0 0 10px; font-size: 15px; }
.kb-panel p { font-size: 13px; }
.kb-panel input { min-height: 44px; width: 110px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px 12px; }
.kb-chatter { padding-left: 20px; font: 12px/1.8 var(--mono); overflow-wrap: anywhere; }
.kb-log { width: 100%; table-layout: fixed; border-collapse: collapse; font: 12px/1.5 var(--mono); }
.kb-log th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 500; }
.kb-log td, .kb-log th { padding: 9px 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.kb-log th:first-child { width: 46%; }
.kb-log small { display: block; color: var(--muted); font-size: 11px; }
.kb-log strong { font-weight: 500; }
.kb-limits { font-size: 13px; color: var(--muted); }
.kb-stage:fullscreen, .kb-stage.kb-presenting { overflow-y: auto; padding: 24px; background: var(--panel); }
.kb-stage.kb-presenting { position: fixed; inset: 0; z-index: 100; }
@media (max-width: 700px) {
  .kb-stage, .kb-panel { padding: 16px; }
  .kb-toolbar { gap: 8px; }
  .kb-toolbar > div { flex-basis: 40%; min-width: 0; }
  .kb-toolbar > button { flex: 1; }
  .kb-pad { padding: 10px 6px; }
  .kb-board, .kb-board[data-size="tkl"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kb-main { grid-column: 1 / -1; gap: 4px; }
  .kb-row { gap: 2px; }
  .kb-key { font-size: clamp(8px, 2.4vw, 10px); height: 28px; border-radius: 3px; padding: 1px; }
  .kb-key.tested::after { font-size: 6px; right: 1px; }
  .kb-nav, .kb-num { gap: 4px; }
  .kb-nav .kb-key, .kb-num .kb-key { font-size: 10px; }
  .kb-panels { grid-template-columns: minmax(0, 1fr); }
  .kb-stage:fullscreen, .kb-stage.kb-presenting { padding: 12px; }
}

/* Binary translator */
.bt-tool textarea { display: block; width: 100%; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 16px/1.6 var(--mono); overflow-wrap: anywhere; }
.bt-tool textarea[readonly] { background: var(--soft); }
.bt-detected { font-size: 12px; color: var(--muted); }
.bt-error { font-size: 13px; color: var(--danger); overflow-wrap: anywhere; }
.bt-error:empty { margin: 0 0 14px; }
.bt-tool select, .bt-numbers select { text-overflow: clip; font-size: 16px; }
.bt-numbers { margin-top: 20px; }
.bt-number-body { padding: 24px; }
.bt-number-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.bt-number-fields input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 16px; }
.bt-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.bt-values > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.bt-values dt { font-size: 12px; color: var(--muted); }
.bt-values dd { margin: 6px 0 0; font: 16px/1.6 var(--mono); overflow-wrap: anywhere; }
.bt-example { font-family: var(--mono); overflow-wrap: anywhere; }
.bt-reference { margin-top: 30px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.bt-reference > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.bt-reference td:last-child { font-family: var(--mono); }
@media (max-width: 760px) { .bt-tool .tool-top { flex-wrap: wrap; } .bt-number-body { padding: 18px; } .bt-number-fields { grid-template-columns: minmax(0, 1fr); } .bt-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Yes or no wheel: page-scoped controls. Slice colors come from wheel.js. */
.yn-presets { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.yn-presets .button { flex: 1; padding: 10px 12px; white-space: normal; }
.yn-presets .button[aria-pressed="true"] { border-color: var(--ink); background: var(--soft); }
.yn-tool .wheel-box { max-width: 390px; }
.yn-tool .result { background: var(--soft); animation: none; }
.yn-tool #remove { display: none; }
.yn-tool .wheel-controls { flex-wrap: wrap; }
.yn-tool .wheel-controls .button { flex: 1; white-space: normal; }
.yn-tool select { font-size: 16px; text-overflow: clip; }
.yn-tool .yn-round { width: 100%; margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.yn-round:empty { display: none; }
.yn-tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.yn-tally > div { padding: 12px; background: var(--soft); border-radius: 8px; }
.yn-tally dt { font-size: 13px; color: var(--muted); }
.yn-tally dd { margin: 0; font: 24px/1.5 var(--mono); }
.yn-tool .button.wide { width: 100%; }
@media (max-width: 760px) { .yn-presets { padding: 12px 18px; } .yn-presets .button { flex-basis: 100%; } }

/* New personality questionnaires: no changes to the existing Enneagram flow. */
.pq-tool [hidden] { display: none !important; }
.pq-tool .tool-top { flex-wrap: wrap; }
.pq-small { color: var(--muted); font-size: 12px; }
.pq-main-button { width: 100%; border-color: var(--ink); background: var(--soft); }
.pq-progress-line { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--muted); }
.pq-progress-line progress { width: 100%; height: 8px; accent-color: var(--ink); }
.pq-question { font-size: clamp(20px, 2.4vw, 25px); line-height: 1.5; font-weight: 600; margin: 22px 0; overflow-wrap: anywhere; }
.pq-choices { display: grid; gap: 8px; }
.pq-answer { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 48px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; line-height: 1.5; }
.pq-answer kbd { display: grid; place-items: center; flex: none; width: 24px; height: 24px; font: 12px var(--mono); border-radius: 4px; background: var(--soft); }
.pq-answer[aria-pressed="true"] { background: var(--soft); border-color: var(--ink); }
.pq-answer[aria-pressed="true"] kbd { background: var(--ink); color: var(--panel); }
.pq-tool .tool-row { flex-wrap: wrap; }
.pq-tool .tool-row .button { white-space: normal; }
.pq-tool textarea { width: 100%; min-height: 160px; font-size: 16px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.pq-scores { list-style: none; margin: 20px 0; padding: 0; }
.pq-scores li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; margin-bottom: 18px; }
.pq-scores li > span { overflow-wrap: anywhere; font-size: 14px; }
.pq-scores strong { font: 22px/1.3 var(--mono); }
.pq-bar { grid-column: 1 / -1; height: 8px; background: var(--soft); border-radius: 4px; }
.pq-bar > span { display: block; height: 100%; background: var(--muted); border-radius: 4px; }
.pq-trait-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; }
@media (max-width: 760px) { .pq-trait-guide { grid-template-columns: minmax(0, 1fr); } }
.pq-answer { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Attachment reflection chart and notices; colors use the paired theme tokens. */
.as-style { margin: 12px 0; font-size: 26px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.as-notice { padding: 12px 14px; border: 1px solid var(--muted); border-radius: 8px; font-size: 14px; background: var(--soft); margin: 16px 0; }
.as-chart { display: block; width: min(100%, 390px); height: auto; margin: 18px auto; }
.as-grid-bg { fill: var(--soft); stroke: var(--muted); }
.as-grid-line { fill: none; stroke: var(--muted); stroke-dasharray: 4 4; }
.as-quadrants { fill: var(--muted); font: 13px system-ui, sans-serif; text-anchor: middle; }
.as-axes { fill: var(--ink); font: 12px system-ui, sans-serif; text-anchor: middle; }
#as-dot { fill: var(--ink); stroke: var(--panel); stroke-width: 3; }

/* JSON formatter */
.jf-tool [hidden] { display: none !important; }
.jf-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.jf-editor, .jf-result { padding: 24px; min-width: 0; }
.jf-editor { border-right: 1px solid var(--line); }
.jf-tool textarea { display: block; width: 100%; padding: 12px; resize: vertical; min-height: 180px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 16px/1.6 var(--mono); tab-size: 4; }
.jf-tool textarea[readonly] { background: var(--soft); }
.jf-tool input, .jf-tool select { font-size: 16px; }
.jf-tool select { text-overflow: clip; }
.jf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.jf-actions > .button { flex: 1; min-width: 88px; padding: 10px 12px; white-space: normal; }
.jf-file-label { margin: 0; cursor: pointer; }
.jf-options { display: flex; align-items: end; gap: 20px; }
.jf-options > div { flex: 1; }
.jf-options .check { align-items: center; min-height: 44px; margin: 0; }
.jf-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.jf-tabs > .button { flex: 1; }
.jf-tabs [aria-selected="true"] { border-color: var(--ink); background: var(--soft); }
.jf-error, .jf-warnings { font-size: 13px; color: var(--danger); overflow-wrap: anywhere; }
.jf-error:empty { display: none; }
.jf-error-context { margin: 12px 0; padding: 10px; background: var(--soft); border: 1px solid var(--danger); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--mono); }
.jf-error-context mark { color: var(--danger); background: var(--panel); }
.jf-status { font-size: 13px; overflow-wrap: anywhere; }
.jf-warnings { padding-left: 18px; }
.jf-tree { overflow-wrap: anywhere; font: 13px/1.6 var(--mono); }
.jf-tree summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.jf-children { margin-left: 10px; }
.jf-tree details details details details .jf-children { margin-left: 0; }
.jf-leaf { padding: 8px 0; white-space: pre-wrap; }
@media (max-width: 760px) { .jf-workspace { grid-template-columns: minmax(0, 1fr); } .jf-editor, .jf-result { padding: 18px; } .jf-editor { border-right: 0; border-bottom: 1px solid var(--line); } }

/* Base64 decode and encode */
.b64-tool [hidden] { display: none !important; }
.b64-body { padding: 24px; }
.b64-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.b64-grid > div { min-width: 0; }
.b64-tool textarea { width: 100%; display: block; padding: 12px; min-height: 180px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 16px/1.6 var(--mono); }
.b64-tool textarea[readonly] { background: var(--soft); }
.b64-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.b64-actions .button { flex: 1; min-width: 80px; padding: 10px; white-space: normal; }
.b64-actions [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.b64-tool fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 12px; }
.b64-tool .check { min-height: 44px; align-items: center; margin: 0; }
.b64-file-label { display: inline-flex; margin: 8px 0; cursor: pointer; white-space: normal; }
.b64-error { color: var(--danger); overflow-wrap: anywhere; }
.b64-error:empty { display: none; }
#b64-output { margin-bottom: 12px; }
#b64-hex, .b64-example { white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.7 var(--mono); background: var(--soft); border-radius: 8px; padding: 12px; }
#b64-preview { display: block; max-width: 100%; max-height: 360px; object-fit: contain; }
@media (max-width: 760px) { .b64-body { padding: 18px; } .b64-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; } }

/* Barcode generator */
.bc-tool [hidden] { display: none !important; }
.bc-body { padding: 24px; }
.bc-fields { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
.bc-fields > div, .bc-options > div { min-width: 0; }
.bc-tool input, .bc-tool select, .bc-tool textarea { font-size: 16px; }
.bc-tool input[type=text] { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.bc-tool select { text-overflow: clip; }
.bc-preview { padding: 16px 0; }
.bc-preview svg, .bc-card svg { display: block; max-width: 100%; height: auto; margin: auto; }
.bc-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: end; gap: 16px; margin: 18px 0; }
.bc-tool .check { min-height: 44px; align-items: center; margin: 0; }
.bc-tool input[type=color] { width: 100%; min-height: 44px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.bc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bc-actions .button { flex: 1; min-width: 110px; white-space: normal; padding: 10px; }
.bc-detail summary { min-height: 44px; cursor: pointer; padding: 10px 0; }
.bc-detail p, .bc-example { overflow-wrap: anywhere; font: 14px/1.7 var(--mono); }
.bc-error, .bc-warning { color: var(--danger); overflow-wrap: anywhere; white-space: pre-wrap; }
.bc-error:empty, .bc-warning:empty { display: none; }
.bc-tool textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); padding: 12px; font: 16px/1.6 var(--mono); resize: vertical; }
#bc-batch-results { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 16px; }
.bc-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.bc-card p { overflow-wrap: anywhere; }
.bc-card .button { margin: 8px 8px 0 0; white-space: normal; }
@media (max-width: 760px) { .bc-body { padding: 18px; } .bc-fields { grid-template-columns: minmax(0,1fr); gap: 12px; } .bc-options { grid-template-columns: repeat(2,minmax(0,1fr)); } #bc-batch-results { grid-template-columns: minmax(0,1fr); } }
@media print { body:has(.bc-tool) > :not(main), body:has(.bc-tool) main > :not(.bc-batch), body:has(.bc-tool) .bc-batch .tool-top, body:has(.bc-tool) .bc-batch .bc-body > :not(#bc-batch-results), body:has(.bc-tool) .bc-card .button, body:has(.bc-tool) .bc-card p { display: none !important; } body:has(.bc-tool), body:has(.bc-tool) main, body:has(.bc-tool) .bc-batch, body:has(.bc-tool) .bc-body { margin: 0; padding: 0; width: 100%; border: 0; box-shadow: none; background: white; } body:has(.bc-tool) .bc-card { break-inside: avoid; border: 0; } }

/* Random team generator */
.rt-tool [hidden], .rt-results[hidden], .rt-results [hidden] { display: none !important; }
.rt-body { padding: 24px; }
.rt-workspace { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
.rt-workspace > div { min-width: 0; }
.rt-tool textarea { width: 100%; display: block; padding: 12px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 16px/1.6 var(--mono); }
.rt-tool select { font-size: 16px; text-overflow: clip; }
.rt-tool input[type=number], .rt-rename { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 16px; }
.rt-tool .check { min-height: 44px; align-items: center; }
.rt-actions, .rt-duplicate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.rt-actions .button { flex: 1; min-width: 110px; padding: 10px 12px; white-space: normal; }
.rt-duplicate-row:has(#rt-remove[hidden]) { display: none; }
.rt-error { color: var(--danger); overflow-wrap: anywhere; }
.rt-error:empty { display: none; }
#rt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.rt-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--panel); break-inside: avoid; }
.rt-card h3 { margin: 0; }
.rt-team-title { display: block; width: 100%; min-height: 44px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); padding: 8px 12px; font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
.rt-card ul { margin: 12px 0 0; padding-left: 22px; }
.rt-card li { padding: 5px 0; overflow-wrap: anywhere; }
.rt-tag { display: inline-block; margin-left: 8px; padding: 0 6px; background: var(--accent-soft); color: var(--accent); border-radius: 5px; overflow-wrap: anywhere; }
.rt-presenting { overflow: hidden; }
.rt-results:is(:fullscreen, .rt-overlay) { width: 100%; height: 100%; max-width: none; margin: 0; padding: 24px; background: var(--bg); color: var(--ink); border-radius: 0; overflow-y: auto; }
.rt-results.rt-overlay { position: fixed; inset: 0; z-index: 100; }
.rt-results:is(:fullscreen, .rt-overlay) .rt-card li { font-size: clamp(18px, 2vw, 28px); }
.rt-results:is(:fullscreen, .rt-overlay) .rt-team-title { font-size: 24px; }
@media (max-width: 760px) { .rt-body { padding: 18px; } .rt-workspace { grid-template-columns: minmax(0, 1fr); gap: 18px; } .rt-results:is(:fullscreen, .rt-overlay) { padding: 12px; } }
@media print { body:has(.rt-tool) > :not(main), body:has(.rt-tool) main > :not(#rt-results), #rt-results .rt-actions, #rt-results .rt-result-hint, #rt-close, #rt-copy-note { display: none !important; } body:has(.rt-tool), body:has(.rt-tool) main, #rt-results { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; } #rt-results { color-scheme: light; --ink: CanvasText; --panel: Canvas; --bg: Canvas; --soft: Canvas; --line: GrayText; color: var(--ink); background: var(--panel); } #rt-results .rt-team-title { border: 0; padding: 0; } #rt-results .rt-card { break-inside: avoid; } #rt-results .rt-tag { color: var(--ink); background: var(--panel); } }

/* QR code generator */
.qr-tool [hidden] { display: none !important; }
.qr-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qr-inputs, .qr-output { padding: 24px; min-width: 0; }
.qr-inputs { border-right: 1px solid var(--line); }
.qr-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.qr-tabs button { flex: 1 1 22%; min-width: 72px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 14px; }
.qr-tabs [aria-selected=true] { background: var(--accent-soft); border-color: var(--accent); }
.qr-tool input:not([type=checkbox]):not([type=file]), .qr-tool textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 16px; }
.qr-tool textarea { display: block; resize: vertical; font: 16px/1.6 var(--mono); }
.qr-tool select { font-size: 16px; text-overflow: clip; }
.qr-fields > label:not(:first-child) { margin-top: 12px; }
.qr-tool .check { min-height: 44px; align-items: center; }
.qr-style { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.qr-style > div { min-width: 0; }
.qr-tool input[type=color] { padding: 4px; }
.qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qr-actions .button { flex: 1; min-width: 120px; padding: 10px; white-space: normal; }
.qr-file-label { margin: 0; cursor: pointer; }
.qr-preview { display: grid; place-items: center; min-height: 260px; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--soft); }
#qr-canvas { display: block; width: 100%; max-width: 400px; height: auto; image-rendering: pixelated; }
.qr-error, .qr-warning { color: var(--danger); overflow-wrap: anywhere; }
.qr-error:empty, .qr-warning:empty { display: none; }
#qr-meta, #qr-count, #qr-scan { overflow-wrap: anywhere; }
.qr-content { margin: 12px 0; }
.qr-content summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
@media (max-width: 760px) { .qr-workspace { grid-template-columns: minmax(0, 1fr); } .qr-inputs, .qr-output { padding: 18px; } .qr-inputs { border-right: 0; border-bottom: 1px solid var(--line); } }
/* Phones: the code sits right under the content field, so typing and the result share one screen. Style settings follow the downloads. */
@media (max-width: 760px) {
  .qr-workspace { display: flex; flex-direction: column; padding: 18px; }
  .qr-inputs, .qr-output { display: contents; }
  .qr-output > * { order: 1; }
  .qr-inputs > .qr-style, .qr-inputs > .qr-style ~ * { order: 2; }
  .qr-preview { min-height: 0; margin-top: 4px; }
  #qr-canvas { max-width: 240px; }
  .qr-inputs > .qr-style { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
}

/* Time zone converter: rows, search and wrapping 24-hour strips. */
.tz-body { padding: 24px; }
.tz-tool input:not([type=checkbox]), .tz-tool textarea { min-width: 0; width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: 16px/1.4 system-ui, sans-serif; }
.tz-search { max-width: 700px; }
#tz-matches { padding: 4px; margin: 8px 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; max-height: 360px; overflow-y: auto; }
#tz-matches button { display: block; width: 100%; min-height: 44px; border: 0; border-radius: 6px; padding: 10px; background: var(--panel); text-align: left; white-space: normal; overflow-wrap: anywhere; }
#tz-matches button:hover, #tz-matches button:focus { background: var(--accent-soft); }
.tz-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.tz-toolbar .check { margin: 0; min-height: 44px; align-items: center; }
.tz-toolbar > div { flex: 1; min-width: 120px; }
.tz-row { border-top: 1px solid var(--line); padding: 18px 0; }
.tz-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tz-row h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.tz-zone, .tz-notice { margin: 4px 0 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.tz-edit { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr) minmax(150px, 1fr); align-items: end; gap: 12px; }
.tz-clock { font-size: 23px; font-variant-numeric: tabular-nums; }
.tz-day { display: block; font-size: 13px; color: var(--accent); }
.tz-issue { padding: 12px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 8px; }
.tz-issue p { margin: 0; }
.tz-work summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.tz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tz-strip { margin: 18px 0; }
.tz-strip h3 { font-size: 14px; margin: 0 0 6px; overflow-wrap: anywhere; }
.tz-hours { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.tz-hour { min-width: 0; min-height: 44px; padding: 4px 0; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); color: var(--muted); font: 12px/1.3 var(--mono); }
.tz-hour span { display: block; }
.tz-hour[data-work=true] { background: var(--accent-soft); color: var(--accent); }
.tz-hour[data-all=true] { background: var(--accent); color: var(--on-accent); }
.tz-hour[aria-pressed=true] { outline: 2px solid var(--ink); outline-offset: -3px; }
#tz-share { margin: 8px 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .tz-body { padding: 18px; } .tz-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .tz-clock { grid-column: 1 / -1; } .tz-hours { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Pomodoro timer. All colors follow the site's light/dark tokens. */
.pm-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.pm-clock-panel { padding: 24px; border-right: 1px solid var(--line); text-align: center; min-width: 0; }
.pm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pm-tabs .button { padding: 10px 8px; white-space: normal; }
.pm-tabs [aria-selected=true] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.pm-mode-label { margin: 18px 0 4px; }
.pm-time { font-size: clamp(68px, 9vw, 100px); line-height: 1.1; letter-spacing: -4px; font-weight: 650; font-variant-numeric: tabular-nums; margin: 0 0 18px; }
.pm-progress { height: 8px; overflow: hidden; background: var(--soft); border-radius: 6px; margin: 0 0 18px; }
.pm-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.pm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-actions .button { padding: 10px 14px; }
.pm-status { min-height: 24px; margin: 14px 0 6px; color: var(--accent); overflow-wrap: anywhere; }
#pm-working { overflow-wrap: anywhere; }
#pm-view { margin: 14px 0 4px; }
.pm-honesty { margin-top: 16px; text-align: left; color: var(--muted); font-size: 12px; }
.pm-honesty p { margin: 8px 0; }
.pm-settings { padding: 24px; min-width: 0; }
.pm-settings h3, .pm-tasks h3 { margin: 0 0 10px; font-size: 17px; }
.pm-today { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 20px; margin: 12px 0 4px; }
.pm-options { margin: 18px 0 0; border-top: 1px solid var(--line); }
.pm-options summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 600; }
.pm-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pm-tool input:not([type=checkbox]):not([type=range]) { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--panel); color: var(--ink); font-size: 16px; }
.pm-tool .check { min-height: 44px; align-items: center; margin: 6px 0; }
.pm-tool .check[hidden] { display: none; }
#pm-volume { display: block; width: 100%; min-height: 44px; accent-color: var(--accent); }
.pm-error { color: var(--danger); font-size: 13px; margin: 6px 0; overflow-wrap: anywhere; }
.pm-tasks { border-top: 1px solid var(--line); padding: 24px; }
.pm-task-add { display: flex; gap: 8px; }
.pm-task-add input { flex: 1; }
#pm-task-list { padding: 0; margin: 14px 0; list-style: none; }
.pm-task { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; }
.pm-task .check { overflow-wrap: anywhere; margin: 0; min-width: 0; font-size: 15px; }
.pm-task .check span { min-width: 0; }
.pm-task .button { padding: 10px 12px; }
.pm-task-count { display: block; font-size: 12px; color: var(--muted); }
.pm-task[data-done=true] .pm-task-name { text-decoration: line-through; color: var(--muted); }
.pm-task[data-active=true] .pm-working-button { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pm-focus, .pm-clock-panel:fullscreen { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: var(--panel); padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); border: 0; display: flex; flex-direction: column; justify-content: safe center; }
.pm-focus > *, .pm-clock-panel:fullscreen > * { width: min(100%, 580px); margin-left: auto; margin-right: auto; }
.pm-focus #pm-view, .pm-clock-panel:fullscreen #pm-view { margin-left: auto; margin-right: auto; }
.pm-clock-panel.pm-focus { padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.pm-focus .pm-time, .pm-clock-panel:fullscreen .pm-time { font-size: clamp(80px, 15vw, 160px); }
@media (max-width: 760px) { .pm-workspace { grid-template-columns: minmax(0, 1fr); } .pm-clock-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; } .pm-settings, .pm-tasks { padding: 18px; } .pm-time { font-size: 80px; } .pm-task { grid-template-columns: minmax(0, 1fr) auto; } .pm-task .check { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .pm-tool *, .pm-focus * { animation: none !important; transition: none !important; } }
