:root {
  /* light palette (base) */
  --bg: #fbf9f5;
  --surface: #ffffff;
  --text: #1e1b16;
  --muted: #6b6459;
  --line: #e5ddcf;
  --accent: #b0472b;
  --accent-soft: #f2e4dd;
  --link: #9a3d24;
  --sound: #2f6f8f;
  --sound-soft: #e0edf2;
  --radius: 10px;
  --maxw: 940px;
  font-synthesis-weight: none;
  color-scheme: light;
}

/* dark palette — one copy, applied for system-dark (unless the user forced
   light) and for an explicit dark choice */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17150f;
    --surface: #201d16;
    --text: #ede7db;
    --muted: #a49b8a;
    --line: #3a3527;
    --accent: #e07a56;
    --accent-soft: #3a271f;
    --link: #eb9576;
    --sound: #7fbdd8;
    --sound-soft: #1f3138;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17150f;
  --surface: #201d16;
  --text: #ede7db;
  --muted: #a49b8a;
  --line: #3a3527;
  --accent: #e07a56;
  --accent-soft: #3a271f;
  --link: #eb9576;
  --sound: #7fbdd8;
  --sound-soft: #1f3138;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}
a { color: var(--link); }
h1, h2 { line-height: 1.25; overflow-wrap: break-word; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--accent-soft);
  padding: .1em .35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
/* form controls at ≥16px so iOS Safari doesn't zoom the viewport on focus */
input, select, textarea { font-size: 16px; }

/* header + search */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.brand span { color: var(--muted); font-weight: 600; }
.site-nav {
  order: 1;
  display: flex;
  gap: 16px;
  font-size: .95rem;
}
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.site-nav a:hover { color: var(--text); }
.search {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 100%;
  order: 4;
  position: relative;
}
@media (min-width: 760px) {
  .search { flex: 1 1 280px; order: 2; }
}

/* compact mobile header: logo mark only, single line of controls, search below */
@media (max-width: 560px) {
  .site-header { padding: 11px 14px; gap: 10px 12px; }
  .brand { font-size: 1.5rem; }
  .brand span { display: none; }
  .site-nav { font-size: 1rem; gap: 18px; }
  .theme-toggle { width: 40px; height: 40px; }
  .search input[type=search] { padding: 11px 12px; }
  .search button { padding: 11px 16px; }
}

/* theme toggle */
.theme-toggle {
  order: 3;
  margin-left: auto;
  flex: none;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 20px; height: 20px; display: none; }
:root:not([data-theme]) .theme-toggle .ti-auto { display: block; }
:root[data-theme="light"] .theme-toggle .ti-light { display: block; }
:root[data-theme="dark"] .theme-toggle .ti-dark { display: block; }

/* typeahead dropdown */
.suggest {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  overflow: hidden;
  max-height: 60vh;
  overflow-y: auto;
}
.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.suggest-item:last-child { border-bottom: 0; }
.suggest-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.suggest-item.active .s-gloss { color: var(--text); }
.suggest-item .s-glyph { font-size: 1.7rem; line-height: 1; flex: none; }
.suggest-item .s-gloss {
  flex: 1;
  font-size: .9rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggest-item .s-reason {
  flex: none;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  opacity: .8;
}
.search input[type=search] {
  flex: 1 1 180px;
  min-width: 0;
  padding: 9px 12px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.search button {
  padding: 9px 16px;
  font-size: .95rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- home ---------- */
.hero {
  position: relative;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(120% 120% at 15% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  padding: clamp(28px, 6vw, 64px) clamp(20px, 5vw, 52px);
  margin-top: 8px;
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  margin: 0 0 .35em;
  letter-spacing: -0.01em;
}
.lede { font-size: 1.08rem; color: var(--muted); max-width: 42em; margin: 0 0 1.4em; }

/* drifting kanji backdrop */
.drift {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
  color: var(--accent);
}
.drift span {
  position: absolute;
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 600;
  opacity: .08;
  top: 100%;
  left: calc(var(--i) * 4%);
  animation: drift-up linear infinite;
  animation-duration: calc(19s + (var(--i) * 1.7s));
  animation-delay: calc(var(--i) * -2.6s);
  will-change: transform;
}
@keyframes drift-up {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(-135vh) rotate(28deg); }
}

.hero-search { max-width: 560px; margin-bottom: 18px; }
.hero-search input[type=search] {
  flex: 1 1 auto;
  padding: 13px 16px;
  font-size: 1.05rem;
  background: var(--bg);
}
.hero-search button { padding: 13px 22px; font-size: 1rem; }

.examples { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.examples a {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  background: var(--bg);
  font-size: 1rem;
  color: var(--text);
}
.examples a:hover { border-color: var(--accent); }
.examples a.surprise { color: var(--link); border-style: dashed; }

/* explore grid */
.explore { margin-top: 36px; }
.explore-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.explore-head h2 {
  font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0;
}
.explore-actions { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; font-size: .88rem; }
.explore-actions a { color: var(--link); text-decoration: none; }
.reshuffle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: .82rem;
  cursor: pointer;
}
.reshuffle:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.reshuffle:disabled { opacity: .5; cursor: default; }
.featured-grid {
  list-style: none; padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.featured-grid a {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .12s, border-color .12s;
}
.featured-grid a:hover { border-color: var(--accent); transform: translateY(-2px); }
.featured-grid .glyph { font-size: 2.4rem; line-height: 1; }
.featured-grid .gloss {
  font-size: .78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-grid.just-shuffled a { animation: pop .28s ease-out both; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .drift span { animation: none; opacity: .06; top: auto; bottom: 8%; }
  .featured-grid.just-shuffled a { animation: none; }
  .featured-grid a { transition: none; }
}

/* results */
.results-heading { font-size: 1.3rem; }
.result-section { margin: 26px 0; }
.result-section h2 {
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.result-section h2 .kana { text-transform: none; letter-spacing: 0; color: var(--text); }
.note { color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.empty { color: var(--muted); }
.result-grid {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.result-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.result-grid a:hover { border-color: var(--accent); }
.result-grid .glyph { font-size: 2rem; line-height: 1; }
.result-grid .gloss { font-size: .85rem; color: var(--muted); }
.count { color: var(--muted); font-size: .85rem; }

/* kanji detail — mobile: single flowing column, interleaved via `order`.
   The .kd-info / .kd-visual wrappers collapse (display:contents) so their
   sections become direct flex children of .kd-hero. */
.kd-hero {
  display: flex;
  flex-direction: column;
  gap: 26px;
  margin-bottom: 4px;
}
.kd-info,
.kd-visual { display: contents; }
.kanji-card    { order: 1; }
.kd-meanings   { order: 2; }
.kd-origin     { order: 3; }
.kd-components { order: 4; }

.kd-info h2,
.kd-visual h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin: 0 0 .5em;
}
.origin-text { font-size: 1.08rem; line-height: 1.7; max-width: 42em; margin: 0; }

/* the character card */
.kanji-card {
  margin: 0 auto;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .06);
}
.kanji-card .stroke-view {
  border-radius: 10px;
  background: var(--bg);
}
.kanji-card .stroke-controls { margin: 0; }
.kanji-card-cap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.cc-char { font-size: 1.7rem; line-height: 1; font-weight: 600; }
.cc-count { color: var(--muted); font-size: .82rem; }

.stroke-view { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stroke-view svg { display: block; width: 100%; height: auto; color: var(--text); }
.stroke-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.stroke-controls button {
  font-size: .9rem;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.kvg-num { paint-order: stroke; }

/* kanji detail — desktop: two columns, inline stroke toolbar */
@media (min-width: 860px) {
  .kd-hero { flex-direction: row; align-items: flex-start; gap: 44px; }
  .kd-info,
  .kd-visual {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 1 1 0;
    min-width: 0;
  }
  .kd-visual { gap: 22px; }
  .kanji-card, .kd-meanings, .kd-origin, .kd-components { order: 0; }
  .kanji-card { margin: 0; align-self: start; }
  .kanji-card .stroke-controls { justify-content: center; }
  .stroke-controls { display: flex; flex-wrap: wrap; gap: 6px; }
  .stroke-controls button { min-height: 0; padding: 6px 11px; font-size: .84rem; flex: 1 1 auto; }
}

.kd-block { margin-top: 34px; }
.kd-block h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .5em; }
.meanings { font-size: 1.2rem; margin: 0 0 12px; }
.readings > div { margin: 3px 0; }
.rlabel { display: inline-block; min-width: 5.5em; color: var(--muted); font-size: .85rem; }
.kana { font-size: 1.05rem; }
.muted { color: var(--muted); }

/* components */
.component-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.component {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: default;
}
.component.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.component .c-glyph { font-size: 2.2rem; line-height: 1; }
.component .c-meta { display: flex; flex-direction: column; gap: 2px; }
.c-role { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.c-pos { font-size: .78rem; color: var(--muted); }
.role-sound-hint .c-role { color: var(--sound); }
.role-sound-hint { background: var(--sound-soft); }
.role-radical .c-role { color: var(--accent); }
.phon-note, .origin-tag { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.phon-note { background: var(--sound-soft); border-radius: var(--radius); padding: 8px 12px; }

/* stroke highlight via component hover */
.stroke-view.dim .kvg-stroke { opacity: .16; transition: opacity .15s; }
.stroke-view.dim .kvg-stroke.hl { opacity: 1; stroke: var(--accent); }

/* facts */
.kd-facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 24px; margin: 0; }
.kd-facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kd-facts dd { margin: 2px 0 0; }

/* credits */
.credit { margin: 26px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.credit dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; max-width: 40em; }
.credit dt { color: var(--muted); }

/* about / privacy — long-form prose */
.legal { max-width: 44em; }
.legal h1 { margin-bottom: .4em; }
.legal h2 { font-size: 1.05rem; margin: 1.8em 0 .4em; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 1.2em; }
.legal li { margin: .4em 0; }
.legal-meta { color: var(--muted); font-size: .9rem; }

.site-footer { border-top: 1px solid var(--line); padding: 22px 20px 30px; text-align: center; color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--link); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; margin-bottom: 12px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* linkified kanji in prose */
.kref {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}
.kref:hover { color: var(--accent); border-bottom-color: var(--accent); }
.c-glyph .kref { border-bottom: 0; }

/* common words */
.word-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.word-list li {
  display: grid;
  grid-template-columns: minmax(4em, max-content) minmax(4em, max-content) 1fr;
  gap: 4px 16px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.word-list li:last-child { border-bottom: 0; }
.wl-word { font-size: 1.15rem; color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; }
.wl-word:hover { border-bottom-color: var(--accent); }
.wl-reading { color: var(--muted); font-size: .95rem; }
.wl-gloss { color: var(--muted); font-size: .9rem; }

/* word detail (/word/:word) */
.word-detail { max-width: 760px; }
.wd-head { margin-bottom: 8px; }
.wd-word { font-size: clamp(2.6rem, 12vw, 4rem); line-height: 1.05; margin: 0; }
.wd-readings { margin-top: 10px; display: grid; gap: 4px; }
.wd-entry { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.wd-reading { font-size: 1.15rem; }
.wd-gloss { color: var(--muted); }
.wd-note { margin-top: 14px; }
ul.wd-breakdown { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 4px 0 0; }
ul.wd-breakdown > li { min-width: 0; }
.wd-breakdown .kanji-chip { width: 100%; max-width: none; min-width: 0; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; }
.wd-breakdown .kc-glyph { font-size: 2.6rem; }
.wd-breakdown .kc-reading { color: var(--muted); font-size: .9rem; }
.wd-breakdown .kc-gloss { white-space: normal; line-height: 1.4; }
.wd-hint { font-size: .85rem; margin-top: 12px; }

/* related kanji rails */
.related-row { margin: 14px 0; }
.related-label {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 6px;
}
.kanji-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kanji-chips a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  max-width: 240px;
}
.kanji-chips a:hover { border-color: var(--accent); }
.kc-glyph { font-size: 1.5rem; line-height: 1; flex: none; }
.kc-gloss { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* browse filters + pager */
.browse-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin: 16px 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.browse-filters label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.browse-filters select {
  padding: 9px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
}
.browse-filters button {
  min-height: 44px;
  padding: 8px 18px; border: 0; border-radius: 7px;
  background: var(--accent); color: #fff; cursor: pointer; font-size: .95rem;
}
.browse-reset { align-self: center; color: var(--link); font-size: .9rem; padding: 8px 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 24px 0; font-size: .9rem; }
.pager a { color: var(--link); text-decoration: none; }
.pager span { color: var(--muted); }
.pager .pager-mid { color: var(--text); }

/* radical picker */
.rad-selected[hidden] { display: none; }
.rad-selected {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0; padding: 8px 12px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft);
}
.rad-selected #rad-selected-list { font-size: 1.3rem; }
.rad-selected button { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; padding: 3px 10px; cursor: pointer; font-size: .8rem; }
.rad-grid { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.rad-group { display: grid; grid-template-columns: 2.2em 1fr; gap: 8px; align-items: start; }
.rad-strokes { font-size: .78rem; color: var(--muted); padding-top: 8px; text-align: right; }
.rad-parts { display: flex; flex-wrap: wrap; gap: 5px; }
.rad-btn {
  min-width: 40px; height: 40px; padding: 0 .3em;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface); color: var(--text);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.rad-btn:hover { border-color: var(--accent); }
.rad-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.rad-results-wrap { margin-top: 20px; }

/* ============================ mobile ============================ */
@media (max-width: 640px) {
  .wrap { padding: 22px 16px 56px; }
  .kd-hero { gap: 20px; }
  .kanji-card { max-width: 320px; }
  .kanji-card .stroke-view { max-width: 260px; margin: 0 auto; }

  /* home hero — fewer drifting glyphs, gentler on low-end GPUs */
  .drift span:nth-child(n+13) { display: none; }
  .hero { padding: 26px 18px; }
  .hero h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .lede { font-size: 1rem; }
  .hero-search { flex-wrap: wrap; }
  .hero-search input[type=search],
  .hero-search button { flex: 1 1 100%; }
  .hero-search button { min-height: 46px; }
  .featured-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

  /* result / chip grids */
  .result-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .kanji-chips a { max-width: none; flex: 1 1 46%; }

  /* kanji detail */
  .kd-block { margin-top: 26px; }
  .rlabel { display: block; min-width: 0; margin-bottom: 1px; }
  .readings > div { margin: 7px 0; }
  .word-list li { grid-template-columns: 1fr; gap: 1px; padding: 9px 0; }
  .component { flex: 1 1 100%; }

  /* browse filters — compact 2-up grid; Sort + actions span the row */
  .browse-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
  .browse-filters label { font-size: .8rem; }
  .browse-filters select { width: 100%; }
  .browse-filters label:nth-child(5),   /* Sort */
  .browse-filters button,
  .browse-reset { grid-column: 1 / -1; }
  .browse-filters button { width: 100%; }
  .browse-reset { align-self: start; }

  /* radical picker — larger tap targets */
  .rad-group { grid-template-columns: 1.4em 1fr; gap: 6px; }
  .rad-strokes { padding-top: 13px; }
  .rad-parts { gap: 6px; }
  .rad-btn { min-width: 44px; height: 44px; }

  /* credits — stack term/definition */
  .credit dl { grid-template-columns: 1fr; gap: 1px; }
  .credit dt { margin-top: 8px; }
  .credit dd { margin: 0; }
}
