/* ==========================================================================
   toolbox.css - "ארגז הכלים": a dense portal-style index of in-page tools.
   Site palette (dark luxury by default, light on demand), Hebrew RTL.
   ========================================================================== */

:root {
  --bg: #080808;
  --bg2: #101010;
  --bg3: #181818;
  --bg4: #222;
  --gold: #c9a96e;
  --gold-soft: rgba(201, 169, 110, 0.12);
  --cream: #f5f0e8;
  --text: #d4cfc7;
  --text-dim: #a39d93;
  --border: rgba(201, 169, 110, 0.16);
  --border-strong: rgba(201, 169, 110, 0.42);
  --good: #7fc79a;
  --bad: #f08a7a;
  --on-gold: #0b0b0b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font-body: "Heebo", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Frank Ruhl Libre", "David", Georgia, serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
  --font-display: var(--font-serif);
  --color-accent: var(--gold);
  --radius: 10px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  /* the portfolio's light palette (public/index.html), so both pages read as one site */
  --bg: #fbf9f4;
  --bg2: #f5f3ee;
  --bg3: #f0eee9;
  --bg4: #e6e2d8;
  --gold: #745a27;
  --gold-dim: #5a4312;
  --gold-soft: rgba(116, 90, 39, 0.08);
  --cream: #1b1c19;
  --text: #1b1c19;
  --text-dim: #4d463a;
  --border: rgba(116, 90, 39, 0.15);
  --border-strong: rgba(116, 90, 39, 0.35);
  --good: #1f7a45;
  --bad: #b3261e;
  --on-gold: #ffffff;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-btn {
  position: fixed; top: -60px; right: 16px; z-index: 100;
  background: var(--gold); color: var(--on-gold); border: 0; border-radius: 8px;
  padding: 10px 16px; font-weight: 700; transition: top .15s;
}
.skip-btn:focus { top: 12px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.ticker {
  display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center;
  font-size: 12.5px; color: var(--text-dim);
  padding: 5px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.ticker b { color: var(--gold); font-weight: 500; }

.masthead {
  max-width: 1380px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 18px;
}

.brand {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0;
  color: var(--gold); text-align: right; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--cream); }
.brand-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
#tool-count { font-family: var(--font-mono); color: var(--gold); }

.search-wrap { position: relative; flex: 1; max-width: 640px; margin-inline: auto; }
.search-wrap input {
  width: 100%; height: 46px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg2);
  padding: 0 46px 0 46px; font-size: 16px; color: var(--cream);
}
.search-wrap input::placeholder { color: var(--text-dim); opacity: 1; }
.search-wrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-icon { position: absolute; right: 16px; top: 14px; color: var(--gold); pointer-events: none; }
.search-hint {
  position: absolute; left: 14px; top: 12px; font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 6px; color: var(--text-dim);
}

.top-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.pill-btn {
  border: 1px solid var(--border-strong); background: transparent; color: var(--gold);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 500;
}
.pill-btn:hover { background: var(--gold-soft); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong); background: transparent; color: var(--gold);
}
.icon-btn:hover { background: var(--gold-soft); }
.icon-btn[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.icon-btn[aria-pressed="true"] path { fill: currentColor; }

/* the search field is in the masthead on every view */
.search-slot { flex: 1; min-width: 0; display: flex; }
#masthead-search .search-wrap { flex: 1; }

/* ---------- main ---------- */
main { flex: 1; width: 100%; max-width: 1380px; margin: 0 auto; padding: 22px 20px 40px; }
main:focus { outline: none; }

/* ---------- hero: search first ---------- */
.hero { text-align: center; padding: 30px 0 34px; }
.hero-eyebrow { margin: 0 0 12px; font-size: 13.5px; color: var(--gold); }
.hero-eyebrow .latin, #hero-count { font-family: var(--font-mono); font-size: 13px; }
#hero-count { font-family: var(--font-mono); }
.hero-title {
  margin: 0; font-family: var(--font-display); font-weight: 700; color: var(--cream);
  font-size: clamp(32px, 4.6vw, 54px); line-height: 1.1;
}
.hero-sub { margin: 12px auto 0; max-width: 620px; font-size: 17px; color: var(--text-dim); }

.palette {
  max-width: 780px; margin: 30px auto 0; text-align: right;
  background: var(--bg2); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow); overflow: hidden;
}
.palette-body { padding: 8px 10px 6px; }
.palette-label {
  margin: 6px 12px; font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: 1px; color: var(--text-dim);
}
.cmd-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.cmd-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px;
  padding: 0 12px; border: 0; border-radius: 10px; background: transparent; text-align: right;
}
.cmd-row:hover, .cmd-row:focus-visible { background: var(--gold-soft); }
.cmd-name { flex: 1; font-size: 15.5px; font-weight: 500; color: var(--cream); }
.cmd-cat { font-size: 12.5px; color: var(--text-dim); }
.cmd-row .kbd { color: var(--gold); min-width: 20px; text-align: center; }
.palette-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 18px;
  padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-dim);
}
.palette-foot .text-btn { text-decoration: none; font-size: 12.5px; min-height: 24px; }
.palette-foot .text-btn:hover { text-decoration: underline; }

.lead-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.lead-open { display: inline-block; margin-top: 2px; font-weight: 700; font-size: 14px; text-decoration: none; }
.lead-open:hover { text-decoration: underline; }

/* ---------- groups: five tiles, one panel ---------- */
.groups { margin-top: 44px; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--cream); }
.section-rule { flex: 1; border-top: 1px solid var(--border-strong); }
.section-meta { font-size: 13px; color: var(--text-dim); }

.group-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.group-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: right;
  min-height: 176px; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--bg2); border: 1px solid var(--border); border-top: 3px solid var(--border-strong);
  transition: border-color .2s, background-color .2s, transform .2s;
}
.group-tile:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.group-tile[aria-expanded="true"] { border-color: var(--gold); border-top-color: var(--gold); background: var(--gold-soft); }
.group-letter { font-family: var(--font-display); font-size: 46px; font-weight: 700; line-height: 1; color: var(--gold); }
.group-name { margin-top: 8px; font-family: var(--font-display); font-size: 21px; font-weight: 700; color: var(--cream); line-height: 1.2; }
.group-cats { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; flex: 1; }
.group-count { font-size: 12.5px; font-weight: 500; color: var(--gold); }

.group-panel {
  margin-top: 14px; padding: 18px 18px 4px;
  background: var(--bg2); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-family: var(--font-display); font-size: 24px; color: var(--gold); }
.panel-head h3:focus { outline: none; }
.group-all { margin-inline-start: auto; color: var(--gold); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.group-all:hover { text-decoration: underline; }
/* the categories of the current domain, on category, domain and tool pages */
.sib-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.sib-link { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 13.5px; text-decoration: none; }
.sib-link:hover { border-color: var(--gold); color: var(--cream); }
.sib-link[aria-current="page"] { background: var(--gold-soft); border-color: var(--gold); color: var(--text); font-weight: 700; }
.sib-all { font-weight: 600; }
.sheet-handle, .sheet-scrim { display: none; }
.group-panel .box { background: var(--bg); }
.box-num { font-family: var(--font-serif); font-weight: 700; color: var(--gold); font-size: 16px; margin-left: 2px; }
.box-head { justify-content: flex-start; }
.box-head .count { margin-inline-start: auto; }
.lead-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.lead-card h2 {
  margin: 0 0 8px; font-family: var(--font-serif); font-size: 18px; color: var(--gold); font-weight: 700;
}
.lead-card p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-dim); }
.lead-card .chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-card.highlight { border-color: var(--border-strong); background: linear-gradient(135deg, var(--gold-soft), var(--bg2) 60%); }
.lead-card .big-btn {
  display: block; width: 100%; text-align: right; background: none; border: 0; padding: 0;
  font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: var(--cream);
}
.lead-card .big-btn:hover { color: var(--gold); }

.chip {
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  border-radius: 6px; padding: 3px 10px; font-size: 13px;
}
.chip:hover { border-color: var(--gold); color: var(--cream); }
.empty-note { font-size: 13px; color: var(--text-dim); margin: 0; }

/* a category card ends with the link to its page */
.box-more { display: block; padding: 9px 14px 11px; border-top: 1px solid var(--border); color: var(--gold); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.box-more:hover { background: var(--gold-soft); text-decoration: underline; }

/* tags: links on a tool page and on a tag page, toggle buttons on a category page */
.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg3); color: var(--text); font-size: 13.5px; line-height: 1.3; text-decoration: none; }
.tag-chip::before { content: "#"; color: var(--gold); }
.tag-chip:hover { border-color: var(--gold); color: var(--cream); }
.tag-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.tag-chip[aria-pressed="true"]::before, .tag-chip[aria-pressed="true"] .tag-count { color: var(--on-gold); }
.tag-count { font-size: 12px; color: var(--text-dim); }

/* list pages: a category or a tag */
.list-title { margin: 0 0 6px; font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--cream); line-height: 1.15; }
.list-title:focus { outline: none; }
.list-tools-bar { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; }
#list-filter { flex: 0 1 340px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg2); color: var(--cream); font: inherit; }
.list-count { font-size: 13.5px; color: var(--text-dim); }
.list-tools { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); padding: 12px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); }
.list-tools .tool-link { padding: 8px 8px; }
.list-group { margin-bottom: 20px; }
.list-group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-family: var(--font-serif); font-size: 20px; }
.list-group h2 a { color: var(--cream); text-decoration: none; }
.list-group h2 a:hover { color: var(--gold); text-decoration: underline; }
.list-group .count { font-family: var(--font-mono); font-size: 12px; color: var(--gold); }
.side-all { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 9px; color: var(--gold); font-weight: 500; }

/* category cards: a grid that fills the row, so two or four cards never leave an empty column */
.boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; padding-bottom: 14px; }

.box {
  min-width: 0;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  border-top: 3px solid var(--gold); overflow: hidden;
  scroll-margin-top: 120px;
}
.box-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 14px 8px; border-bottom: 1px solid var(--border); background: var(--bg3);
}
.box-head h2 { margin: 0; font-family: var(--font-serif); font-size: 19px; font-weight: 700; color: var(--cream); }
.box-head .count { font-family: var(--font-mono); font-size: 12px; color: var(--gold); }
.box-blurb { margin: 0; padding: 8px 14px 0; font-size: 12.5px; color: var(--text-dim); }
.box-list {
  list-style: none; margin: 0; padding: 8px 10px 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px 10px;
}
.box-list.single { grid-template-columns: 1fr; }
.tool-link {
  display: block; width: 100%; text-align: right; background: none; border: 0;
  padding: 3px 6px; border-radius: 5px; font-size: 14px; color: var(--text);
  line-height: 1.4;
}
.tool-link::before { content: "›"; color: var(--gold); margin-left: 6px; }
.tool-link:hover, .tool-link:focus-visible { background: var(--gold-soft); color: var(--cream); }
.tool-link .badge, .badge {
  font-size: 10.5px; font-family: var(--font-mono); color: var(--on-gold); background: var(--gold);
  border-radius: 4px; padding: 0 4px; margin-right: 4px; vertical-align: 1px;
}

.view-title { font-family: var(--font-serif); color: var(--cream); font-size: 24px; margin: 0 0 14px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.result-card {
  text-align: right; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px;
}
.result-card:hover, .result-card:focus-visible { border-color: var(--gold); }
.result-card strong { display: block; color: var(--cream); font-size: 15.5px; font-weight: 500; }
.result-card span { display: block; color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.search-empty { grid-column: 1 / -1; margin: 0 0 4px; font-size: 15px; color: var(--text-dim); }
.result-card em { font-style: normal; font-size: 11.5px; color: var(--gold); font-family: var(--font-mono); }

/* ---------- tool view ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; margin-bottom: 12px; color: var(--text-dim); }
.mode-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.mode-link { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.3; }
.mode-link:hover { border-color: var(--gold); color: var(--gold); }
.mode-link[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; }
.crumbs button, .crumbs a { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: none; }
.crumbs button:hover, .crumbs a:hover { text-decoration: underline; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; align-items: start; }

.tool-main {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  border-top: 3px solid var(--gold); padding: 18px 22px 24px; min-width: 0;
}
.tool-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.tool-head h1 { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1.2; color: var(--cream); }
.tool-head h1:focus { outline: none; }
.tool-desc { margin: 6px 0 0; color: var(--text-dim); font-size: 14.5px; }
.tool-actions { display: flex; gap: 8px; flex-shrink: 0; }

.tool-side {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow: auto;
}
.side-title { margin: 0 0 6px; font-size: 15px; font-family: var(--font-serif); color: var(--gold); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list .tool-link[aria-current="page"] { background: var(--gold-soft); color: var(--cream); font-weight: 500; }

/* ---------- form engine ---------- */
.tool-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > .field-label { font-size: 13px; color: var(--text-dim); }
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
.field select, .field textarea, .tb-input {
  width: 100%; min-height: 40px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--cream); padding: 7px 10px; font-size: 15px;
}
.field textarea, textarea.tb-input { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .tb-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field input[type="color"] { width: 100%; height: 40px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); padding: 3px; }
.field input[type="range"] { width: 100%; accent-color: var(--gold); }
.field.check { flex-direction: row; align-items: center; gap: 8px; min-height: 40px; }
.field.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.field.check label { font-size: 14px; color: var(--text); }
.range-value { font-family: var(--font-mono); color: var(--gold); font-size: 12.5px; }
.ltr { direction: ltr; text-align: left; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

.btn {
  border: 0; border-radius: 8px; background: var(--gold); color: var(--on-gold);
  padding: 9px 18px; font-weight: 700; font-size: 14.5px; min-height: 40px;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--gold); border: 1px solid var(--border-strong); font-weight: 500; }
.btn.ghost:hover { background: var(--gold-soft); }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: 13.5px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }

.tool-output { margin-top: 18px; }
.out-empty { color: var(--text-dim); font-size: 14px; margin: 0; }
.out-error { color: var(--bad); font-size: 14.5px; margin: 0; }
.out-rows { display: grid; gap: 6px; }
.out-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.out-label { color: var(--text-dim); font-size: 14px; }
.out-value {
  background: none; border: 0; padding: 0; text-align: left; color: var(--cream);
  font-size: 17px; font-weight: 500; unicode-bidi: plaintext; word-break: break-word;
}
.out-value:hover { color: var(--gold); }
.out-row.main { border-color: var(--border-strong); background: var(--gold-soft); padding: 12px 14px; }
.out-row.main .out-value { font-size: 26px; font-weight: 700; color: var(--gold); font-family: var(--font-serif); }
.out-note { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }
.out-text {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  white-space: pre-wrap; word-break: break-word; color: var(--cream); font-size: 16px;
}
.out-big { font-size: 34px; font-family: var(--font-serif); color: var(--gold); text-align: center; padding: 18px; }

.tb-table-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; }
.tb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb-table th, .tb-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: right; }
.tb-table th { background: var(--bg3); color: var(--gold); font-weight: 500; position: sticky; top: 0; }
.tb-table td.num { unicode-bidi: plaintext; font-variant-numeric: tabular-nums; }
.tb-table tr:last-child td { border-bottom: 0; }

.text-tool { display: grid; gap: 10px; }
.text-tool .io-label { font-size: 13px; color: var(--text-dim); display: flex; justify-content: space-between; }
.text-tool textarea { min-height: 150px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); opacity: 0;
  background: var(--gold); color: var(--on-gold); padding: 9px 18px; border-radius: 999px;
  font-weight: 500; font-size: 14px; pointer-events: none; transition: .2s; z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  border-top: 1px solid var(--border); padding: 18px 20px 70px; text-align: center;
  color: var(--text-dim); font-size: 13px; background: var(--bg2);
}
.foot p { margin: 4px auto; max-width: 900px; }
.text-btn { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; }

/* ---------- shared widgets used by custom tools ---------- */
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.center { text-align: center; }
.dim { color: var(--text-dim); }
.gold { color: var(--gold); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.display {
  font-family: var(--font-mono); font-size: clamp(40px, 9vw, 76px); color: var(--cream);
  text-align: center; letter-spacing: 1px; direction: ltr; font-variant-numeric: tabular-nums;
}
.tb-canvas { width: 100%; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); touch-action: none; display: block; }
.swatch { width: 100%; height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.swatches button { height: 70px; border-radius: 8px; border: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: center; font-family: var(--font-mono); font-size: 12px; padding-bottom: 4px; }
.grid-board { display: grid; gap: 6px; margin: 0 auto; }
.grid-board button, .cell {
  aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg3);
  font-size: 22px; font-weight: 700; color: var(--cream); display: flex; align-items: center; justify-content: center;
}
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.list-plain li { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.list-plain li .grow { flex: 1; }
.kbd { font-family: var(--font-mono); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; font-size: 12px; }
.progress { height: 10px; background: var(--bg3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gold); transition: width .3s; }
.nafi-tag { display: inline-block; font-size: 12px; color: var(--gold); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 10px; margin-bottom: 10px; }

/* ---------- the dreidel (nafi.js, from Nafi's "סייברבון"): a CSS cube with a pyramid point ----------
   the stage is a fixed dark "screen" with the original neon faces and glow, like the arcade canvases;
   the stats, buttons and panels around it are ordinary toolbox widgets and follow the skin */
.dreidel-stats { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.dreidel-stats .out-row { flex-direction: column; align-items: center; gap: 2px; }
.dreidel-stats .out-value { font-size: 24px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.dreidel-stage {
  --neon-blue: #00f3ff; --neon-purple: #bc13fe; --neon-gold: #ffd700; --neon-pink: #ff0055;
  position: relative; height: 300px; margin-top: 12px; perspective: 1200px;
  display: flex; align-items: center; justify-content: center; padding-bottom: 40px;
  background: radial-gradient(circle at 50% 45%, #1a1a2e 0%, #000 100%);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.dreidel-floor {
  position: absolute; bottom: 34px; left: 50%; width: 140px; height: 20px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 243, 255, 0.28), transparent 70%); border-radius: 50%;
}
.dreidel {
  position: relative; width: 100px; height: 100px; transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(25deg); transition: transform 3s cubic-bezier(0.1, 0.7, 0.1, 1);
}
.dreidel-face {
  --neon: var(--neon-blue);
  position: absolute; width: 100px; height: 100px; display: flex; align-items: center; justify-content: center;
  background: rgba(18, 18, 30, 0.85); border: 2px solid var(--neon); color: #fff;
  font-family: "Heebo", system-ui, sans-serif; font-size: 60px; font-weight: 800; line-height: 1;
  text-shadow: 0 0 10px #fff; box-shadow: 0 0 15px var(--neon) inset; backface-visibility: hidden;
}
.dreidel-face.side-front { transform: translateZ(50px); }
.dreidel-face.side-right { --neon: var(--neon-gold); transform: rotateY(90deg) translateZ(50px); }
.dreidel-face.side-back { --neon: var(--neon-purple); transform: rotateY(180deg) translateZ(50px); }
.dreidel-face.side-left { --neon: var(--neon-pink); transform: rotateY(-90deg) translateZ(50px); }
.dreidel-face.side-top { transform: rotateX(90deg) translateZ(50px); background: var(--neon-blue); box-shadow: 0 0 30px var(--neon-blue); }
/* the point: four border triangles hinged on the cube's bottom edges, tilted 38.7deg so the tips meet (80 * sin = 50) */
.dreidel-point {
  position: absolute; top: 100px; left: 0; width: 0; height: 0; transform-origin: top;
  border-left: 50px solid transparent; border-right: 50px solid transparent; border-top: 80px solid var(--neon-blue);
}
.dreidel-point.side-front { transform: translateZ(50px) rotateX(-38.7deg); }
.dreidel-point.side-right { transform: rotateY(90deg) translateZ(50px) rotateX(-38.7deg); border-top-color: var(--neon-gold); }
.dreidel-point.side-back { transform: rotateY(180deg) translateZ(50px) rotateX(-38.7deg); border-top-color: var(--neon-purple); }
.dreidel-point.side-left { transform: rotateY(-90deg) translateZ(50px) rotateX(-38.7deg); border-top-color: var(--neon-pink); }
.dreidel-handle { position: absolute; top: -50px; left: 43px; width: 14px; height: 50px; transform-style: preserve-3d; }
.dreidel-handle span {
  position: absolute; inset: 0; box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  background: linear-gradient(90deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
}
.dreidel-handle span + span { transform: rotateY(90deg); filter: brightness(0.85); }
.dreidel-result { min-height: 34px; margin: 14px 0 0; font-size: 20px; font-weight: 500; color: var(--cream); }
.dreidel-result b { color: var(--gold); font-size: 26px; }
.dreidel-over { margin-top: 14px; border-color: var(--border-strong); }
.dreidel-over h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--gold); }
.dreidel-over h2:focus { outline: none; }
.dreidel-over p { margin: 0 0 10px; }
@media (max-width: 480px) {
  .dreidel-stage { height: 260px; }
  .dreidel-stats .out-value { font-size: 20px; }
}

/* ---------- Nafi light: the portfolio's light mode ----------
   dark nav bar over a warm off-white page, square cards with a hairline gold border and a soft
   shadow, light-weight serif headings, faint oversized numerals, outlined square buttons */
:root[data-theme="light"]:not([data-skin]) .top {
  /* the header keeps the dark palette, exactly like #nav on the portfolio */
  --bg: #080808; --bg2: #0e0e0e; --bg3: #141414; --bg4: #222;
  --gold: #c9a96e; --gold-soft: rgba(201, 169, 110, 0.12);
  --cream: #f5f0e8; --text: #d4cfc7; --text-dim: #a39d93;
  --border: rgba(201, 169, 110, 0.16); --border-strong: rgba(201, 169, 110, 0.42);
  --on-gold: #0b0b0b; --shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  background: rgba(8, 8, 8, 0.92); color: var(--text);
  border-bottom: 1px solid rgba(116, 90, 39, 0.15);
}
:root[data-theme="light"]:not([data-skin]) .ticker { background: #0e0e0e; }
:root[data-theme="light"]:not([data-skin]) .pill-btn,
:root[data-theme="light"]:not([data-skin]) .icon-btn,
:root[data-theme="light"]:not([data-skin]) .btn,
:root[data-theme="light"]:not([data-skin]) .chip,
:root[data-theme="light"]:not([data-skin]) .cmd-row,
:root[data-theme="light"]:not([data-skin]) .skin-option,
:root[data-theme="light"]:not([data-skin]) .tool-link,
:root[data-theme="light"]:not([data-skin]) .search-wrap input,
:root[data-theme="light"]:not([data-skin]) .field input,
:root[data-theme="light"]:not([data-skin]) .field select,
:root[data-theme="light"]:not([data-skin]) .field textarea,
:root[data-theme="light"]:not([data-skin]) .tb-input,
:root[data-theme="light"]:not([data-skin]) .out-row,
:root[data-theme="light"]:not([data-skin]) .out-text,
:root[data-theme="light"]:not([data-skin]) .skin-menu { border-radius: 0; }
:root[data-theme="light"]:not([data-skin]) .icon-btn { border-radius: 50%; }
:root[data-theme="light"]:not([data-skin]) .pill-btn { letter-spacing: 1px; }
:root[data-theme="light"]:not([data-skin]) .btn { background: var(--gold); color: #fff; }
:root[data-theme="light"]:not([data-skin]) .btn:hover { filter: none; background: var(--gold-dim); box-shadow: 0 4px 16px rgba(116, 90, 39, 0.3); }
:root[data-theme="light"]:not([data-skin]) .btn.ghost { background: transparent; color: var(--gold); border-color: var(--gold); }
:root[data-theme="light"]:not([data-skin]) .chip { background: transparent; border-color: rgba(201, 169, 110, 0.45); color: var(--gold-dim); font-size: 12.5px; }
:root[data-theme="light"]:not([data-skin]) .field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
:root[data-theme="light"]:not([data-skin]) .field select,
:root[data-theme="light"]:not([data-skin]) .field textarea,
:root[data-theme="light"]:not([data-skin]) .tb-input { background: #fff; border-color: rgba(116, 90, 39, 0.2); }

:root[data-theme="light"]:not([data-skin]) .palette,
:root[data-theme="light"]:not([data-skin]) .lead-card,
:root[data-theme="light"]:not([data-skin]) .group-tile,
:root[data-theme="light"]:not([data-skin]) .group-panel,
:root[data-theme="light"]:not([data-skin]) .tool-main,
:root[data-theme="light"]:not([data-skin]) .tool-side,
:root[data-theme="light"]:not([data-skin]) .result-card {
  background: var(--bg2); border: 1px solid rgba(116, 90, 39, 0.1); border-radius: 0; box-shadow: var(--shadow);
}
:root[data-theme="light"]:not([data-skin]) .palette .search-wrap input { background: #fff; }
:root[data-theme="light"]:not([data-skin]) .lead-card.highlight { background: var(--bg2); }
:root[data-theme="light"]:not([data-skin]) .box { background: var(--bg); border: 1px solid rgba(116, 90, 39, 0.1); border-radius: 0; }
:root[data-theme="light"]:not([data-skin]) .box-head { background: transparent; }
:root[data-theme="light"]:not([data-skin]) .tool-main { border-top: 1px solid rgba(116, 90, 39, 0.1); }

/* type: light serif headings, small tracked labels */
:root[data-theme="light"]:not([data-skin]) .hero-title,
:root[data-theme="light"]:not([data-skin]) .section-head h2,
:root[data-theme="light"]:not([data-skin]) .panel-head h3,
:root[data-theme="light"]:not([data-skin]) .tool-head h1,
:root[data-theme="light"]:not([data-skin]) .group-name,
:root[data-theme="light"]:not([data-skin]) .box-head h2,
:root[data-theme="light"]:not([data-skin]) .lead-card .big-btn { font-weight: 500; }
:root[data-theme="light"]:not([data-skin]) .palette-label,
:root[data-theme="light"]:not([data-skin]) .lead-card h2,
:root[data-theme="light"]:not([data-skin]) .section-meta {
  font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 2px; color: var(--gold);
}
:root[data-theme="light"]:not([data-skin]) .section-rule {
  border: 0; height: 1px; background: linear-gradient(to left, transparent, rgba(116, 90, 39, 0.25), transparent);
}

/* group tiles: a faint oversized letter, like the 01-06 numerals on the project cards */
:root[data-theme="light"]:not([data-skin]) .group-tile { position: relative; overflow: hidden; }
:root[data-theme="light"]:not([data-skin]) .group-letter {
  position: absolute; top: 6px; left: 14px; font-size: 92px; font-weight: 500; color: rgba(201, 169, 110, 0.22);
}
:root[data-theme="light"]:not([data-skin]) .group-name { margin-top: 52px; }
:root[data-theme="light"]:not([data-skin]) .group-tile:hover { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); border-color: rgba(116, 90, 39, 0.2); }
:root[data-theme="light"]:not([data-skin]) .group-tile[aria-expanded="true"] { border-color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold), var(--shadow); background: var(--bg2); }
:root[data-theme="light"]:not([data-skin]) .foot { background: transparent; border-top: 1px solid rgba(116, 90, 39, 0.15); }

/* ---------- responsive ---------- */
/* eight tiles: four or two in a row, never three with an orphan row */
@media (max-width: 1000px) {
  .group-tile { min-height: 132px; padding: 14px; }
  .group-name { font-size: 18px; }
  .group-cats { display: none; }
}
@media (max-width: 760px) {
  .hero { padding: 26px 0 28px; }
  .hero-sub { font-size: 15px; }
  .palette { margin-top: 20px; }
  .cmd-list { grid-template-columns: 1fr; }
  .cmd-list li:nth-child(n+6) { display: none; }
  .cmd-row .kbd, .palette-foot > span { display: none; }
  .group-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .group-tile { min-height: 132px; padding: 14px; }
  .group-letter { font-size: 36px; }
  .group-name { font-size: 18px; }
  .group-cats { display: none; }
  .section-head h2 { font-size: 24px; }
  /* the group panel becomes a bottom sheet */
  .sheet-scrim:not([hidden]) {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55);
  }
  .group-panel, :root[data-theme="light"] .group-panel, :root[data-skin] .group-panel,
  :root[data-theme="light"]:not([data-skin]) .group-panel {
    position: fixed; inset: auto 0 0 0; z-index: 41; margin: 0;
    max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--bg2); border: 1px solid var(--border-strong); border-bottom: 0;
    border-radius: 18px 18px 0 0; padding: 8px 16px 24px;
    animation: sheet-up .28s cubic-bezier(.2, .7, .2, 1);
  }
  .panel-head { position: sticky; top: -8px; z-index: 1; background: var(--bg2); padding: 18px 0 10px; margin-bottom: 6px; }
  .sheet-handle { display: block; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 44px; height: 4px; border-radius: 999px; background: var(--border-strong); }
  .group-panel .boxes { grid-template-columns: 1fr; }
  /* the sheet covers the page: the floating accessibility button would sit on its links */
  :root.sheet-open #a11y-trigger { display: none; }
  .box { scroll-margin-top: 70px; }
  :root.sheet-open, :root.sheet-open body { overflow: hidden; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }

/* the domains sheet of the phone tab bar: every domain, the current one open on its categories */
.nav-sheet {
  position: fixed; inset: auto 0 0 0; z-index: 41;
  max-height: 82vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg2); border: 1px solid var(--border-strong); border-bottom: 0;
  border-radius: 18px 18px 0 0; padding: 8px 16px 24px;
  animation: sheet-up .28s cubic-bezier(.2, .7, .2, 1);
}
:root[data-skin="index"] .nav-sheet, :root[data-skin="rounded"] .nav-sheet, :root[data-skin="stream"] .nav-sheet { background: var(--bg); }
.nav-sheet[hidden] { display: none; }
.nav-sheet .sheet-handle { display: block; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 44px; height: 4px; border-radius: 999px; background: var(--border-strong); }
.nav-sheet .panel-head { position: sticky; top: -8px; z-index: 1; background: inherit; padding: 18px 0 10px; margin-bottom: 6px; }
.nav-domains { list-style: none; margin: 0; padding: 0; }
.nav-domains > li + li { border-top: 1px solid var(--border); }
.nav-domain { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; color: var(--cream); text-decoration: none; }
.nav-domain:hover { color: var(--gold); }
.nav-letter { display: inline-grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: var(--gold-soft); color: var(--gold); font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.nav-name { flex: 1; font-size: 16.5px; font-weight: 600; }
.nav-count { font-size: 12.5px; color: var(--gold); white-space: nowrap; }
.nav-domain[aria-current="page"] .nav-name, .nav-domains li.is-current .nav-name { color: var(--gold); }
.nav-domains .sib-bar { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding-inline: 46px 0; }
:root.nav-open #a11y-trigger { display: none; }
:root.nav-open, :root.nav-open body { overflow: hidden; }
/* its own scrim, outside #browse, which is hidden away from the home page */
.nav-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); }
.nav-scrim[hidden] { display: none; }

@media (max-width: 900px) {
  /* one row: brand, search, buttons */
  .masthead { padding: 10px 16px; gap: 12px; }
  .brand-sub, .search-hint { display: none; }
  .search-wrap { max-width: none; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-side { position: static; max-height: none; }
  .box, .tool-side { scroll-margin-top: 120px; }
  /* touch targets of at least 40px in the lists */
  .side-list .tool-link, .list-tools .tool-link, .group-panel .tool-link { padding: 10px 8px; }
  .lead-card .chip { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 12px; }
  .lead-open, .palette-foot .text-btn { min-height: 40px; display: inline-flex; align-items: center; }
  .tag-chip { min-height: 40px; }
}
/* between a phone and a tablet the one-row masthead is tight: the random button waits in the hero */
@media (min-width: 601px) and (max-width: 760px) {
  #random-tool { display: none; }
}
/* a phone on its side: a sticky header would take a quarter of the screen */
@media (max-height: 560px) {
  .top { position: static; }
}
@media (max-width: 600px) {
  .top { position: static; }
  /* two rows: brand and buttons, then the search field */
  .masthead { flex-wrap: wrap; gap: 8px 10px; }
  #masthead-search { order: 3; flex-basis: 100%; }
  .top-actions { margin-inline-start: auto; }
  .search-wrap input { height: 44px; }
  .search-icon { top: 13px; }
  /* away from the home page the date line steps aside, so the page starts near the top */
  body:not([data-view="index"]) .ticker { display: none; }
  /* tool page: the title shares its row with the buttons, the description gets the full width */
  .tool-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; margin-bottom: 10px; }
  .tool-head > div:first-child { display: contents; }
  .tool-head h1 { grid-column: 1; grid-row: 1; }
  .tool-head .tool-desc { grid-column: 1 / -1; }
  .tool-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .tool-actions .icon-btn { width: 36px; height: 36px; }
  .crumbs { margin-bottom: 8px; }
  /* the modes of a family and the tags of a tool: one scrolling row each instead of several wrapped rows */
  .mode-bar, #tool-tags, #list-tags, .sib-bar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    margin-inline: -14px; padding-inline: 14px;
  }
  #list-tags { margin-inline: -16px; padding-inline: 16px; }
  .mode-bar::-webkit-scrollbar, #tool-tags::-webkit-scrollbar, #list-tags::-webkit-scrollbar, .sib-bar::-webkit-scrollbar { display: none; }
  .sib-bar { margin-block: 0 10px; }
  .sib-link { flex-shrink: 0; white-space: nowrap; min-height: 38px; }
  .mode-bar { margin-block: 2px 12px; }
  .mode-link, #tool-tags .tag-chip, #list-tags .tag-chip { flex-shrink: 0; white-space: nowrap; }
  .view-title { font-size: 20px; }
  .result-grid { grid-template-columns: 1fr; }
  .list-tools-bar { flex-wrap: wrap; gap: 8px; }
  #list-filter { flex: 1 1 100%; }
  .box, .tool-side { scroll-margin-top: 10px; }
  main { padding: 14px 16px 30px; }
  .brand-name { font-size: 23px; }
  .pill-btn { padding: 7px 12px; font-size: 13px; }
  .ticker { font-size: 11.5px; gap: 2px 12px; }
  .tool-main { padding: 14px 14px 20px; }
  .tool-head h1 { font-size: 24px; }
  .box-list { grid-template-columns: 1fr; }
  .out-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .out-value { text-align: right; }
}

/* ---------- phone tab bar (posters.html): home, search, categories, favourites ---------- */
.tab-bar { display: none; }
@media (max-width: 760px) {
  .tab-bar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; inset: auto 0 0 0; z-index: 30;
    background: color-mix(in srgb, var(--bg2) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-strong);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab-bar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 58px; border: 0; background: none; color: var(--text-dim);
    font-size: 11.5px; font-weight: 500;
  }
  .tab-bar button[aria-current="page"] { color: var(--gold); }
  .tab-bar button[aria-current="page"] svg { stroke-width: 2.3; }
  body:has(.tab-bar) .foot { padding-bottom: 96px; }
  body:has(.tab-bar) .toast { bottom: 84px; }
  body:has(.tab-bar) #a11y-trigger { bottom: 70px; inset-inline-end: 12px; width: 44px; height: 44px; }
  body:has(.tab-bar) #a11y-trigger svg { width: 24px; height: 24px; }
}

/* three header buttons since the theme picker: keep the masthead on one row on small phones */
@media (max-width: 420px) {
  .brand-mark { display: none; }
  .masthead { gap: 8px; }
  .top-actions { gap: 6px; }
}
@media (max-width: 350px) {
  #random-tool { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* the loading line of lazily loaded tools (games, instruments: TB.lazyRender in arcade.js) */
.gm-loading { padding: 40px 10px; text-align: center; color: var(--text-dim); }

/* ---------- tools are links (2026-11-05): they look exactly like the buttons they replaced ---------- */
a.tool-link, a.chip, a.result-card { text-decoration: none; }
a.chip { display: inline-block; }
a.result-card { display: block; color: inherit; }
.tool-loading { animation: tb-pulse 1.2s ease-in-out infinite; }
@keyframes tb-pulse { 50% { opacity: 0.5; } }
:root.a11y-reduce-motion .tool-loading { animation: none; }
@media (prefers-reduced-motion: reduce) { .tool-loading { animation: none; } }

/* ---------- "found a mistake?" dialog ---------- */
.report-dialog {
  width: min(480px, calc(100vw - 32px)); padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg2); color: var(--text); box-shadow: var(--shadow);
}
.report-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.report-dialog h2 { margin: 0 0 6px; font-family: var(--font-serif); font-size: 20px; color: var(--cream); }
.report-dialog form { display: grid; gap: 12px; }
.report-intro { margin: 0; font-size: 14px; color: var(--text-dim); }
.report-status { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--gold); }
.report-dialog .btn-row { margin-top: 0; }
