:root {
  --bg: #0a0b10;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #14131f 0%, #0a0b10 55%);
  --surface: #13151d;
  --surface-2: #191c26;
  --surface-3: #20242f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf0;
  --muted: #9aa0ad;
  --faint: #6b7280;
  --accent: #7c6cff;
  --accent-2: #9d7bff;
  --accent-soft: rgba(124, 108, 255, 0.13);
  --accent-line: rgba(124, 108, 255, 0.4);
  --ud: #e0a93b;
  --ud-soft: rgba(224, 169, 59, 0.13);
  --ud-line: rgba(224, 169, 59, 0.4);
  --new: #2dd4bf;
  --new-soft: rgba(45, 212, 191, 0.12);
  --new-line: rgba(45, 212, 191, 0.4);
  --good: #4ade80;
  --warn: #fbbf24;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 8px 24px -8px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-accent: 0 8px 26px -10px rgba(124, 108, 255, 0.6);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: rgba(124, 108, 255, 0.35); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

:where(button, a, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.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;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

/* ---------- header ---------- */
header { margin-bottom: 32px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.brand .mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: var(--shadow-accent);
  color: #fff;
}
.brand .mark svg { width: 22px; height: 22px; }
h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 680;
  margin: 0;
  line-height: 1.1;
}
.tagline {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0;
}
.tagline b { color: var(--text); font-weight: 600; }
.about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.about-link:hover { color: var(--accent-2); border-color: var(--accent-line); }
.about-link svg { width: 14px; height: 14px; }

/* ---------- cards / steps ---------- */
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px 24px;
  box-shadow: var(--shadow-2);
}
.step + .connector { margin: 14px 0; }

.step-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.step-num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.step-head h2 {
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  margin: 0;
}
.step-head .hint {
  color: var(--faint);
  font-size: 13px;
  margin-left: auto;
}

.connector {
  display: flex;
  justify-content: center;
  color: var(--faint);
}
.connector svg { width: 22px; height: 22px; }

/* ---------- inputs ---------- */
.field { display: flex; gap: 10px; }
.input-shell {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.input-shell > svg.lead {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--faint);
  pointer-events: none;
}
input[type="text"], textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 12px 14px 12px 40px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea {
  padding-left: 14px;
  resize: vertical;
  min-height: 48px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  font-size: 14.5px;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
  border-color: var(--accent-line);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#fragInput { resize: none; overflow: hidden; }
.input-shell input, .input-shell textarea { padding-right: 38px; }

.clear-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--faint);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.clear-btn:hover { color: var(--text); background: var(--surface-3); }
.clear-btn svg { width: 14px; height: 14px; }

/* ---------- example chips ---------- */
.examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--faint);
}
.ex-chip {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s, transform 0.06s;
}
.ex-chip:hover { color: var(--accent-2); border-color: var(--accent-line); background: var(--accent-soft); }
.ex-chip:active { transform: translateY(1px); }
.ex-chip code { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }

button.btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: 11px;
  padding: 0 18px;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: transform 0.08s, filter 0.15s, opacity 0.15s;
}
button.btn:hover { filter: brightness(1.07); }
button.btn:active { transform: translateY(1px); }
button.btn svg { width: 17px; height: 17px; }
button.btn.ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  font-weight: 550;
}
button.btn.ghost:hover { background: var(--surface-3); filter: none; }

/* ---------- options row ---------- */
.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.opt { display: inline-flex; align-items: center; gap: 7px; }
.opt label { cursor: pointer; user-select: none; }
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.seg button.on { background: var(--accent-soft); color: var(--accent-2); }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 20px; transition: 0.18s;
}
.slider::before {
  content: ""; position: absolute; height: 14px; width: 14px;
  left: 2px; top: 2px; background: var(--muted);
  border-radius: 50%; transition: 0.18s;
}
.switch input:checked + .slider { background: var(--accent-soft); border-color: var(--accent-line); }
.switch input:checked + .slider::before { transform: translateX(14px); background: var(--accent-2); }

/* ---------- pronunciation result (step 1) ---------- */
.pron-result { margin-top: 16px; display: none; }
.pron-result.show { display: block; }

.pron-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.pron-card:hover { border-color: var(--accent-line); background: var(--surface-3); }
.pron-multi-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--accent-2);
  margin: 2px 0 10px;
}
.pron-multi-hint svg { width: 14px; height: 14px; flex: none; }
.pron-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 11px;
  flex-wrap: wrap;
}
.pron-word { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.syl-badge {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
}
.pron-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 550;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.copied { color: var(--good); border-color: rgba(74,222,128,0.4); }

.phonemes {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.03em;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 4px;
  line-height: 1.4;
}
.ph {
  font: inherit;
  letter-spacing: inherit;
  background: transparent;
  padding: 2px 5px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.1s, color 0.1s;
}
.ph.vowel { color: var(--text); }
.ph.stress1 { color: var(--accent-2); font-weight: 600; }
.ph:hover, .ph.tail { background: var(--accent-soft); color: var(--accent-2); }
.ph.tail { border-color: var(--accent-line); }

.pron-tip {
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.5;
}
.pron-tip svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }

.notfound {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  display: none;
}
.notfound.show { display: block; }
.notfound b { color: var(--text); }

.search-help {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--faint);
}
.search-help b {
  font-family: var(--mono);
  color: var(--accent-2);
  font-weight: 700;
  padding: 0 1px;
}
.search-help code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* ---------- word sense panel ---------- */
.sense-panel {
  margin: 14px 0 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.sense-panel > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.sense-panel > summary::-webkit-details-marker { display: none; }
.sense-panel > summary > svg:first-child { width: 16px; height: 16px; color: var(--accent-2); }
.sense-panel .sense-opt {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--faint);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
}
.sense-panel .chev {
  width: 16px; height: 16px;
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.2s;
}
.sense-panel[open] .chev { transform: rotate(180deg); }
.sense-body {
  padding: 4px 14px 16px;
  border-top: 1px solid var(--border);
}
.sense-body .field { margin-top: 14px; }
.sense-hint {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--faint);
}
.sense-hint code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.sense-status { display: block; margin-top: 6px; color: var(--accent-2); font-weight: 600; }
.sense-status.warn { color: var(--warn); }
.sense-ai {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sense-ai .input-shell { flex: 1; min-width: 200px; }
.sense-ai input { font-size: 13.5px; padding-top: 10px; padding-bottom: 10px; }

/* ---------- phoneme keyboard ---------- */
.phone-panel > summary > svg:first-child { color: var(--accent-2); }
.phone-body {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
}
.ph-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 10px 0 7px;
}
.ph-group-label:first-child { margin-top: 0; }
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.ph-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: var(--mono);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px 6px;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s, transform 0.06s;
}
.ph-key b { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: 0.03em; }
.ph-key span { font-size: 10px; color: var(--faint); font-family: var(--sans); }
.ph-key svg { width: 15px; height: 15px; color: var(--muted); margin: 2px 0 1px; }
.ph-key:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.ph-key:hover b { color: var(--accent-2); }
.ph-key:active { transform: translateY(1px); }
.ph-ops {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ph-ops .ph-key { flex: 1; min-width: 74px; max-width: 130px; }
.ph-ops .ph-key b { color: var(--accent-2); }

/* ---------- result tabs ---------- */
.tab-bar {
  display: flex;
  gap: 6px;
  margin: 4px 0 16px;
  overflow-x: auto;
  padding-bottom: 3px;
}
.tab-bar::-webkit-scrollbar { height: 6px; }
.tab-bar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 10px;
  cursor: pointer;
  max-width: 230px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.tab:hover { background: var(--surface-3); color: var(--text); }
.tab.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.tab.live .tab-label { font-family: var(--sans); font-weight: 600; }
.tab-close {
  display: inline-flex;
  opacity: 0.55;
  border-radius: 4px;
  flex: none;
}
.tab-close svg { width: 13px; height: 13px; display: block; }
.tab-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.tab-add {
  color: var(--faint);
  border-style: dashed;
  font-weight: 550;
}
.tab-add:hover { color: var(--accent-2); border-color: var(--accent-line); }
.tab-add svg { width: 14px; height: 14px; flex: none; }
.tab-add[disabled] { opacity: 0.4; pointer-events: none; }
.tab-new-flash { animation: tabflash 0.9s ease; }
@keyframes tabflash {
  0% { background: var(--accent); color: #fff; }
  100% { background: var(--surface-2); color: var(--muted); }
}

/* ---------- search results (step 2) ---------- */
.results { margin-top: 18px; }
.results-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.results-meta > svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.results-meta > span:first-of-type { flex: 1; min-width: 0; }
.fuzz-note { color: var(--accent-2); font-weight: 600; }
.results-meta .icon-btn { flex: none; }

/* matched-fragment highlight inside chip pronunciations */
.word-chip .p .hl {
  font-style: normal;
  color: var(--accent-2);
  font-weight: 700;
}

/* dimmed state while the AI sense filter is thinking */
.results.filtering > *:not(.filter-pill) { opacity: 0.35; pointer-events: none; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 12px;
}

/* actionable empty state */
.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.empty .ex-frag { font-family: var(--mono); letter-spacing: 0.02em; }

/* ---------- slant-rhyme (fuzzy) group editor ---------- */
#fuzzyCfg { padding: 4px 7px; }
#fuzzyCfg svg { width: 14px; height: 14px; }
#fuzzyCustomTag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 0 4px;
}
/* browsers without <dialog> render it as a plain visible element — hide the
   closed state explicitly so the JS open/close fallback actually works */
.fz-dialog:not([open]) { display: none; }
.fz-dialog {
  width: min(660px, calc(100vw - 28px));
  max-height: min(84vh, 720px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-2);
}
.fz-dialog::backdrop { background: rgba(5, 6, 10, 0.72); }
.fz-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.fz-head svg { width: 17px; height: 17px; color: var(--accent-2); flex: none; }
.fz-head h2 { font-size: 16px; font-weight: 650; margin: 0; flex: 1; }
.fz-head .clear-btn { position: static; transform: none; }
.fz-hint {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--faint);
  margin: 0 0 14px;
}
.fz-hint b { color: var(--muted); }
.fz-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.fz-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px 9px;
  min-height: 58px;
}
.fz-box.droppable {
  cursor: pointer;
  border-style: dashed;
  border-color: var(--accent-line);
}
.fz-box.droppable:hover { background: var(--accent-soft); }
.fz-box-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: 6px;
}
.fz-row { display: flex; flex-wrap: wrap; gap: 5px; }
.fz-chip { padding: 5px 8px 4px; }
.fz-chip b { font-size: 12.5px; }
.fz-chip.picked {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.fz-chip.picked b { color: var(--accent-2); }
.fz-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.fz-actions .btn { padding: 9px 16px; font-size: 13.5px; }
.fz-spacer { flex: 1; }

/* back to top */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 48px; /* clears the host's "Built with RunCabin" badge (bottom-right) */
  z-index: 10;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, transform 0.06s;
}
.to-top:hover { color: var(--accent-2); border-color: var(--accent-line); }
.to-top:active { transform: translateY(1px); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- double rhymes ---------- */
.double-section {
  margin-bottom: 20px;
  padding: 14px 14px 4px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 70%);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
}
.double-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin: 0 0 11px;
}
.double-head svg { width: 15px; height: 15px; }
.word-chip.is-double { border-color: var(--accent-line); }
.dbl-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: 1px;
}
.results-meta .frag {
  font-family: var(--mono);
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  padding: 1px 7px;
  letter-spacing: 0.03em;
}
.syl-group { margin-bottom: 18px; }
.syl-group h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin: 0 0 9px;
}
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 7px;
}
.word-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px 9px;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--text);
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
}
.word-chip:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.word-chip:active { transform: translateY(1px); box-shadow: none; }
.chip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.word-chip .w { font-size: 14.5px; font-weight: 550; }
.word-chip .p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}
.freq-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.freq-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  min-width: 0;
}

/* ---------- Urban Dictionary attribution ---------- */
.ud-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ud);
  text-decoration: none;
  background: var(--ud-soft);
  border: 1px solid var(--ud-line);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
}
.ud-badge:hover { filter: brightness(1.12); }
.ud-badge svg { width: 12px; height: 12px; }
.ud-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ud);
  background: var(--ud-soft);
  border: 1px solid var(--ud-line);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: 1px;
}
.ud-note { color: var(--ud); }
.ud-note svg { color: var(--ud); }
.ud-note b { color: var(--ud) !important; }
footer .ud-badge { font-size: 11px; }

/* ---------- "new this decade" attribution ---------- */
.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--new);
  text-decoration: none;
  background: var(--new-soft);
  border: 1px solid var(--new-line);
  border-radius: 6px;
  padding: 1px 7px;
  margin-left: 4px;
  vertical-align: middle;
}
.new-badge:hover { filter: brightness(1.12); }
.new-badge svg { width: 12px; height: 12px; }
.new-tag {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--new);
  background: var(--new-soft);
  border: 1px solid var(--new-line);
  border-radius: 4px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: 1px;
}
.more-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--faint);
}
.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- footer ---------- */
footer {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.6;
}
footer a { color: var(--muted); }
.loading-pill {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.spinner {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-2);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- about page ---------- */
.about-page .step { margin-bottom: 18px; }
.about-page .step-head { margin-bottom: 10px; }
.about-page .step-head .ic {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
}
.about-page .step-head .ic svg { width: 14px; height: 14px; }
.about-page p, .about-page li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 10px;
}
.about-page ul { margin: 0 0 10px; padding-left: 20px; }
.about-page li { margin-bottom: 6px; }
.about-page p:last-child, .about-page li:last-child { margin-bottom: 0; }
.about-page b { color: var(--text); font-weight: 600; }
.about-page code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 1px 5px;
}
.about-page .fuzzy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 10px;
  font-size: 13px;
}
.about-page .fuzzy-table td {
  padding: 5px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.about-page .fuzzy-table td:first-child { color: var(--text); white-space: nowrap; }
.about-page .fuzzy-table code { white-space: nowrap; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--accent-2); }
.back-link svg { width: 14px; height: 14px; }

@media (max-width: 560px) {
  .wrap { padding: 32px 14px 60px; }
  .field { flex-direction: column; }
  button.btn { padding: 12px 18px; justify-content: center; }
  .pron-actions { width: 100%; margin-left: 0; }
  .opt { max-width: 100%; }
  .seg { overflow-x: auto; max-width: 100%; }
  .seg button { padding: 8px 11px; white-space: nowrap; }
  .icon-btn { padding: 7px 11px; }
  .ph-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .to-top { right: 14px; bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
