/* © 2026 Filip Mráček / Chineseffect. All rights reserved. Proprietary design – see NOTICE.md. */
/* ───────────────────────────────────────────────────────────
   Chineseffect Dictionary – calm, Apple-like UI
   ─────────────────────────────────────────────────────────── */
:root {
  /* dark only – translucent surfaces let the slow aurora glow through */
  --bg: #000;
  --surface: rgba(28, 28, 32, .72);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-solid: #1c1c1e;
  --line: rgba(255, 255, 255, .09);
  --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #86868b;
  --accent: #2997ff; --accent-soft: rgba(41, 151, 255, .16);
  --green: #30d158; --orange: #ff9f0a; --red: #ff453a;
  --shadow: 0 0 0 1px rgba(255,255,255,.06), 0 10px 30px rgba(0,0,0,.25);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.08), 0 24px 70px rgba(0,0,0,.55);
  --r-s: 10px; --r: 16px; --r-l: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.25, .8, .25, 1);
  --top: 56px;
  --tab: 0px;
  --maxw: 880px;
  color-scheme: dark;
}
html { background: #000; }
body { background: transparent !important; }
body, .topbar, .tabbar, .search, .results, .panel, .flash__face, .sheet, .modal, .charcard, .examples, .sent-list, .btn, .chip, #q {
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh; padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
}
[lang="zh-Hans"], .zh-sent { font-family: var(--font-zh); }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0.4em 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; width: 100%; }
kbd {
  font: 500 11px/1 var(--font); padding: 3px 5px; border-radius: 5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line); vertical-align: middle;
}
.btn kbd, .pill kbd { background: transparent; color: inherit; opacity: .65; border-color: currentColor; margin-left: 6px; }
@media (hover: none) { .btn kbd, .pill kbd, .search__kbd, .rate__ivl kbd { display: none; } }
.muted { color: var(--text-2); }
.small { font-size: 0.86rem; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap-s { gap: 8px; } .center { justify-content: center; } .end { justify-content: flex-end; }
.pad { padding: 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ───── top bar ───── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar__inner { max-width: 1100px; margin: 0 auto; height: var(--top); padding: 0 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; margin-right: auto; }
.brand__tile {
  width: 30px; height: 30px; border-radius: 8px; background: #000; color: #fff; display: grid; place-items: center;
  font-size: 18px; font-weight: 500; box-shadow: 0 0 0 1px var(--line);
}
.brand__sub { color: var(--text-2); font-weight: 400; }
.loadbar { height: 2px; background: transparent; position: absolute; left: 0; right: 0; bottom: -1px; }
.loadbar__fill { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }

/* segmented control */
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px;
  border: 1px solid var(--line);
}
.seg > a, .seg > button {
  border: 0; background: transparent; color: var(--text); font: 500 14px/1 var(--font); padding: 8px 14px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: background .2s var(--ease), box-shadow .2s var(--ease), color .2s;
}
.seg > .is-on { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.seg > :not(.is-on) { color: var(--text-2); }
.seg > :not(.is-on):hover { color: var(--text); }
.seg--sm > a, .seg--sm > button { font-size: 13px; padding: 6px 11px; }
.seg .count { color: var(--text-3); font-weight: 400; margin-left: 2px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--text);
  display: inline-grid; place-items: center; cursor: pointer; font-size: 16px; flex: none;
  transition: background .2s;
}
.icon-btn svg { fill: currentColor; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn--sm { width: 30px; height: 30px; font-size: 14px; color: var(--text-2); }
.icon-btn--add { background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 500; }
.icon-btn--add:hover { background: var(--accent); color: #fff; }

/* tab bar (mobile) */
.tabbar { display: none; }
@media (max-width: 759px) {
  :root { --tab: 58px; }
  .seg--nav { display: none; }
  .brand__sub { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tab) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-3); font-size: 11px; font-weight: 500; }
  .tabbar svg { fill: currentColor; }
  .tabbar a.is-on { color: var(--accent); }
}

/* ───── layout ───── */
main { outline: none; }
.view { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 40px; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ───── buttons ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 500 15px/1 var(--font); padding: 11px 18px; border-radius: 980px; cursor: pointer;
  transition: transform .12s var(--ease), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn--ghost { background: var(--surface-2); border-color: transparent; }
.btn--sm { font-size: 13px; padding: 7px 12px; }
.btn--wide { width: 100%; max-width: 420px; padding: 15px 18px; font-size: 16px; }
.btn--danger-ghost { background: transparent; color: var(--red); border-color: transparent; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 2px; }
.pill { border: 1px dashed var(--line); background: var(--surface-2); color: var(--text-2); border-radius: 980px; padding: 6px 12px; font: 500 13px/1 var(--font); cursor: pointer; }
.badge {
  display: inline-block; font: 600 11px/1 var(--font); padding: 4px 7px; border-radius: 6px; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle; white-space: nowrap;
}
.badge--muted { background: var(--surface-2); color: var(--text-2); }
.badge--blue { background: var(--accent-soft); color: var(--accent); }
.badge--orange { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.badge--green { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.saved { color: var(--green); font-weight: 700; width: 36px; text-align: center; flex: none; }

.input, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 11px 13px; font: 16px/1.4 var(--font); outline: none; resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input--num { width: 90px; }

/* ───── tiles ───── */
.tile {
  --s: 56px;
  width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center;
  background: #000; color: #fff; border-radius: calc(var(--s) * .22); overflow: hidden; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.12); vertical-align: middle; user-select: none;
  transition: transform .2s var(--ease), box-shadow .2s;
}
[data-theme="dark"] .brand__tile { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
[data-theme="dark"] .tile { box-shadow: none; }
[data-theme="dark"] .tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); pointer-events: none; }
.tile__glyph { font-family: var(--font-zh); font-size: calc(var(--s) * .6); font-weight: 500; line-height: 1; transform: translateY(-1%); }
.tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile--xs { --s: 26px; } .tile--sm { --s: 36px; } .tile--md { --s: 64px; } .tile--lg { --s: 92px; } .tile--xl { --s: 128px; }
.tile.is-sel { box-shadow: 0 0 0 3px var(--accent); }
a:hover > .tile, .tile[role="button"]:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile[role="button"] { cursor: pointer; }

/* ───── search ───── */
.search { max-width: var(--maxw); margin: 0 auto; padding: 2px 16px 10px; }
.search__field { position: relative; }
.search__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); fill: var(--text-3); pointer-events: none; }
#q {
  width: 100%; height: 48px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 48px 0 46px; font: 400 19px/1 var(--font); color: var(--text); outline: none; box-shadow: var(--shadow);
  transition: box-shadow .2s, border-color .2s; -webkit-appearance: none; appearance: none;
}
#q:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
#q::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
#q:focus + .search__kbd { opacity: 0; }
.search__status { font-size: 12.5px; color: var(--text-3); margin: 6px 4px 0; }
.search__status:empty { display: none; }
html { scroll-padding-top: calc(var(--top) + 90px); }

/* results */
.results { list-style: none; margin: 4px 0; padding: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.results li + li { border-top: 1px solid var(--line); }
.res { display: flex; gap: 14px; align-items: center; padding: 12px 16px; color: var(--text); transition: background .15s; }
.res:hover, .res:focus-visible { background: var(--surface-2); outline: none; }
.res__tiles { display: flex; gap: 4px; flex: none; }
.res__text { display: flex; flex-direction: column; min-width: 0; gap: 2px; flex: 1; }
.res__thumb { flex: none; display: flex; margin-left: auto; }
.res__thumb .tile--md, .res__thumb .wtile.tile--md { --s: 52px; }
.res { min-height: 64px; }
.res__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.res__word { font-size: 20px; font-weight: 500; }
.res__def { color: var(--text-2); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 520px) { .res { gap: 12px; padding: 11px 14px; } }
}
.pinyin { color: var(--text-2); font-size: 15px; letter-spacing: .01em; }
.pinyin--lg { font-size: 19px; color: var(--text); }

/* panels / breakdown */
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel__head h3 { color: var(--text-2); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.breakdown__zh { font-size: 26px; line-height: 1.5; }
.breakdown__py { margin: 2px 0 4px; }
.breakdown__en { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2);
  color: var(--text); border: 1px solid transparent; font-size: 15px; cursor: pointer; max-width: 100%; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--line); background: var(--surface); }
.chip [lang="zh-Hans"] { font-size: 18px; }
.chip .pinyin { font-size: 13px; }
.chip__def { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.chip--try { padding: 6px 12px; border-radius: 980px; font-size: 14px; background: var(--surface); border-color: var(--line); }

/* home */
.home { display: grid; gap: 28px; padding-top: 8px; }
.try { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 12px; }
.tile-grid a { display: grid; place-items: center; }
.tips ul { padding-left: 18px; margin: 8px 0 0; } .tips li { margin: 4px 0; }

/* ───── word page ───── */
.word__nav { margin-bottom: 6px; }
.back { font-size: 16px; padding-left: 0; }
.word__hero:not(:has(.word__tiles)) .word__main h1 { font-size: 56px; }
.word__hero { display: flex; gap: 28px; align-items: flex-start; padding: 12px 0 28px; border-bottom: 1px solid var(--line); }
.word__tiles { display: flex; gap: 10px; flex-wrap: wrap; flex: none; max-width: 50%; }
.word__main { flex: 1; min-width: 0; }
.word__main h1 { font-size: 44px; font-weight: 500; margin-bottom: 6px; }
@media (max-width: 640px) {
  .word__hero { flex-direction: column; gap: 18px; }
  .word__tiles { max-width: none; }
  .word__tiles .tile--xl { --s: 104px; }
}
.reading { padding: 10px 0; }
.reading + .reading { border-top: 1px dashed var(--line); }
.reading__head { display: flex; align-items: center; gap: 10px; }
.defs { margin: 6px 0 0; padding-left: 22px; } .defs li { margin: 3px 0; } .defs li::marker { color: var(--text-3); font-size: .85em; }
.cls { margin-top: 8px; font-size: 15px; }
.sec { padding: 28px 0 8px; }
.sec > h2 { margin-bottom: 16px; }

.w { cursor: pointer; border-radius: 4px; transition: background .15s, box-shadow .15s; box-shadow: inset 0 -1.5px 0 transparent; }
.w:hover, .w.is-active { background: var(--accent-soft); box-shadow: inset 0 -1.5px 0 var(--accent); }
.zh-sent .w + .w { margin-left: 0; }

.chars { display: grid; gap: 14px; }
.charcard { display: flex; gap: 22px; background: var(--surface); border-radius: var(--r-l); padding: 18px; box-shadow: var(--shadow); }
.charcard__stroke { display: flex; flex-direction: column; gap: 10px; flex: none; }
.charcard__info { flex: 1; min-width: 0; }
.charline { display: flex; align-items: baseline; gap: 12px; }
.charline__c { font-size: 34px; font-weight: 500; }
.charcard__def { margin: 4px 0 10px; }
.radical { color: var(--text); font-size: 17px; }
.parts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.part { display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--surface-2); color: var(--text); }
.part__text { display: flex; flex-direction: column; line-height: 1.25; }
.part__text .badge { margin-top: 3px; align-self: flex-start; }
@media (max-width: 640px) { .charcard { flex-direction: column; align-items: stretch; } .charcard__stroke { align-items: center; } }

.stroke__canvas { width: var(--size); height: var(--size); background: #000; border-radius: calc(var(--size) * .14); display: grid; place-items: center; overflow: hidden; }
[data-theme="dark"] .stroke__canvas { box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.stroke__canvas svg { display: block; }
.stroke__msg { color: rgba(255,255,255,.6); font-size: 13px; text-align: center; display: grid; gap: 6px; padding: 12px; }
.stroke__msg span { font-size: 64px; color: #fff; }

.examples { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.ex { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.ex + .ex { border-top: 1px solid var(--line); }
.ex__main { flex: 1; min-width: 0; }
.ex__zh { font-size: 20px; line-height: 1.5; }
.ex__py { font-size: 13.5px; }
.ex__en { color: var(--text); font-size: 15px; margin-top: 2px; }

/* ───── cards ───── */
.cards-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.trainer-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.trainer-bar__count { margin-left: auto; color: var(--text-3); font-size: 13px; }
@media (max-width: 520px) { .trainer-bar__count { margin-left: 0; width: 100%; } .cards-head .btn { padding: 9px 14px; font-size: 14px; } }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 42px; height: 26px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); position: relative; transition: background .2s; }
.switch__thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch input:checked + .switch__track { background: var(--green); border-color: transparent; }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px var(--accent-soft); }

.flash { perspective: 1600px; outline: none; cursor: pointer; margin: 0 auto; max-width: 720px; }
.flash__inner { display: grid; transform-style: preserve-3d; transition: transform .5s var(--ease); }
.flash.is-flipped .flash__inner { transform: rotateY(180deg); }
.flash__face {
  grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); min-height: 300px;
  padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px;
}
.flash__back { transform: rotateY(180deg); }
.flash:focus-visible .flash__face { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg); }
.flash__label { position: absolute; top: 18px; left: 0; right: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.flash__face { position: relative; }
.flash__zh { font-size: clamp(26px, 5.4vw, 38px); line-height: 1.45; font-weight: 500; }
.flash__py { font-size: clamp(15px, 2.6vw, 19px); }
.flash__en { font-size: clamp(20px, 3.8vw, 27px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; max-width: 30ch; }
.flash__en--small { font-size: 17px; font-weight: 400; color: var(--text-2); }
.flash__note { font-size: 14px; color: var(--text-3); margin-top: 8px; }
.flash hr { max-width: 200px; margin: 6px auto; }

.answer { display: flex; justify-content: center; margin: 22px auto 0; max-width: 720px; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.rate__btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 16px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: 600 15px/1.1 var(--font);
  transition: transform .12s var(--ease), background .2s, border-color .2s;
}
.rate__btn:active { transform: scale(.96); }
.rate__ivl { font-size: 12px; font-weight: 500; color: var(--text-3); }
.rate__btn--1 .rate__label { color: var(--red); }
.rate__btn--2 .rate__label { color: var(--orange); }
.rate__btn--3 .rate__label { color: var(--green); }
.rate__btn--4 .rate__label { color: var(--accent); }
.rate__btn:hover { border-color: currentColor; }
.card-tools { display: flex; justify-content: center; margin-top: 14px; }

.empty { text-align: center; padding: 48px 16px; display: grid; gap: 12px; justify-items: center; }
.empty h2 { max-width: 22ch; }
.empty p { max-width: 46ch; }
.empty--sm { padding: 24px; }
.empty__check { width: 64px; height: 64px; border-radius: 50%; background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); display: grid; place-items: center; font-size: 30px; font-weight: 700; }

.list-tools { margin-bottom: 12px; }
.sent-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.sent { display: flex; gap: 12px; padding: 14px 16px; align-items: flex-start; }
.sent + .sent { border-top: 1px solid var(--line); }
.sent__main { flex: 1; min-width: 0; }
.sent__zh { font-size: 20px; line-height: 1.5; }
.sent__py { font-size: 13.5px; }
.sent__en { font-size: 15px; }
.sent__side { display: flex; align-items: center; gap: 2px; flex: none; }
.sent__side .badge { margin-right: 6px; }

/* ───── sheet (quick look) ───── */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 40; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 86dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .32s var(--ease); outline: none;
}
.sheet.is-open { transform: none; }
@media (min-width: 760px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; border-radius: 22px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; padding: 20px 24px 24px; }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet__grip { display: none; }
}
.sheet__grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 10px; }
.sheet__close { position: absolute; top: 12px; right: 12px; background: var(--surface-2); width: 30px; height: 30px; font-size: 13px; color: var(--text-2); }
.sheet__head { display: flex; align-items: center; gap: 16px; padding: 6px 36px 12px 0; }
.ql__tiles { display: flex; gap: 8px; flex-wrap: wrap; }
.ql__tiles .tile--lg { --s: 72px; }
.ql__title h2 { font-size: 30px; font-weight: 500; }
.ql__reading { padding: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ql__reading .pinyin { font-size: 18px; color: var(--text); }
.ql__def { width: 100%; margin: 0; color: var(--text-2); }
.ql__stroke { display: flex; gap: 16px; align-items: center; margin: 14px 0 4px; padding: 14px; background: var(--surface-2); border-radius: 18px; }
.ql__strokeinfo { display: grid; gap: 8px; min-width: 0; }
.ql__charinfo .charline__c { font-size: 26px; }
.sheet__actions { display: flex; justify-content: flex-end; margin-top: 16px; }
@media (max-width: 759px) { .sheet__actions .btn { width: 100%; } }

/* ───── modal ───── */
.modal {
  border: 0; padding: 0; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px);
}
.modal--wide { width: min(640px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0,0,0,.32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }
#modalBody { padding: 22px 24px 24px; }
#modalBody h3 { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; flex-wrap: wrap; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.btn-grid .btn { justify-content: flex-start; border-radius: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
.stats div { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; }
.stats strong { font-size: 20px; letter-spacing: -0.02em; }
.stats span { font-size: 12px; color: var(--text-2); }
#imPasteBox { margin-top: 10px; display: grid; gap: 8px; }
.about { margin-top: 22px; }
.about summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 8px 0 0; align-items: center; }
.keys dd { margin: 0; color: var(--text-2); }

.editor { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.field__hint { font-weight: 400; color: var(--text-3); }
.field__label .link-btn { margin-left: auto; font-size: 13px; font-weight: 500; }
.field__help { font-size: 12.5px; color: var(--text-3); }
.field--inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#edZh { font-size: 22px; font-family: var(--font-zh); }
.editor__preview { font-size: 20px; min-height: 0; padding: 0 2px; }
.editor__preview:empty { display: none; }

/* ───── toast ───── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--tab) + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 60;
  background: rgba(29,29,31,.92); color: #fff; padding: 11px 18px; border-radius: 980px; font-size: 14px; font-weight: 500;
  opacity: 0; transition: opacity .2s, transform .25s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
[data-theme="dark"] .toast { background: rgba(242,242,247,.94); color: #000; }
.noscript { padding: 24px; text-align: center; }

/* ───── theme toggle ───── */
.theme-btn .ico { display: none; }
:root[data-theme-pref="auto"] .theme-btn .ico--auto,
:root[data-theme-pref="light"] .theme-btn .ico--light,
:root[data-theme-pref="dark"] .theme-btn .ico--dark { display: block; }
.theme-btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .switch__track { background: #39393d; }
[data-theme="dark"] .seg > .is-on { background: #636366; box-shadow: none; }
[data-theme="dark"] .modal::backdrop, [data-theme="dark"] .sheet-backdrop { background: rgba(0,0,0,.6); }
[data-theme="dark"] .rate__btn, [data-theme="dark"] .chip--try { background: var(--surface); }

/* ───── tappable words: a faint underline per word shows where words begin and end ───── */
.zh-sent .w {
  background-image: linear-gradient(color-mix(in srgb, var(--text) 22%, transparent), color-mix(in srgb, var(--text) 22%, transparent));
  background-repeat: no-repeat; background-size: calc(100% - 4px) 1.5px; background-position: 50% 96%;
  border-radius: 3px; padding: 0 1px;
}
.zh-sent .w:hover, .zh-sent .w.is-active {
  background-color: var(--accent-soft);
  background-image: linear-gradient(var(--accent), var(--accent)); background-size: calc(100% - 4px) 2px;
  box-shadow: none;
}

/* ───── word panel ───── */
@media (min-width: 760px) { .sheet { width: 620px; max-height: 88vh; } }
.wp__back {
  position: absolute; top: 14px; left: 16px; border: 0; background: var(--surface-2); color: var(--accent);
  font: 500 14px/1 var(--font); padding: 7px 11px; border-radius: 980px; cursor: pointer;
}
.wp__back + .ql__tiles { margin-top: 34px; }
.sheet__head { flex-wrap: wrap; }
.wp__reading { padding: 8px 0; }
.wp__reading + .wp__reading { border-top: 1px dashed var(--line); }
.wp__rhead { display: flex; align-items: center; gap: 10px; }
.wp__def { margin: 2px 0 0; }
.wp__sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.wp__sec h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); font-weight: 600; }
.wp__sec h3 [lang] { text-transform: none; font-size: 15px; color: var(--text); }
.wp__compose { display: grid; gap: 8px; }
.wp__piece {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 8px 12px 8px 8px;
  border: 0; border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
}
.wp__piece > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.wp__piece:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--accent-soft)); }
.wp__chev { color: var(--text-3); font-size: 22px; }
.wp__char { display: flex; gap: 18px; align-items: flex-start; }
.wp__stroke { display: grid; gap: 8px; flex: none; justify-items: center; }
.wp__charinfo { min-width: 0; flex: 1; }
.wp__cdef { margin: 2px 0 8px; }
.wp__facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 6px; font-size: 14px; }
.wp__facts dt { color: var(--text-3); }
.wp__facts dd { margin: 0; }
.wp__link { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; font: 500 16px/1.4 var(--font-zh); cursor: pointer; }
.wp__sents { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wp__sents li { display: grid; font-size: 17px; }
.wp__sents mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.part { border: 0; font: inherit; cursor: pointer; text-align: left; }
.part:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--accent-soft)); }
@media (max-width: 520px) { .wp__char { flex-direction: column; align-items: stretch; } .wp__stroke { justify-self: center; } }

/* ───── listen buttons ───── */
.say {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 0; background: var(--accent-soft); color: var(--accent); cursor: pointer; vertical-align: middle;
  transition: transform .12s var(--ease), background .2s; -webkit-touch-callout: none; user-select: none;
}
.say svg path:not(:first-child) { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.say:hover { background: var(--accent); color: #fff; }
.say:active { transform: scale(.92); }
.say--lg { width: 42px; height: 42px; }
.say--lg svg { width: 22px; height: 22px; }
.say.is-playing .say__w1 { animation: wave 1s infinite; }
.say.is-playing .say__w2 { animation: wave 1s .2s infinite; }
@keyframes wave { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.no-tts .say { display: none; }
.flash__zhrow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.word__titlerow { display: flex; align-items: center; gap: 14px; }
.ql__title { display: flex; align-items: center; gap: 12px; }
.charline .say { align-self: center; }
.ex__zh .say, .breakdown__zh .say { margin-left: 4px; }
.rate__q { text-align: center; color: var(--text-2); font-size: 14px; margin: 0 0 10px; width: 100%; }
.answer { flex-direction: column; align-items: center; }
select.input { appearance: auto; width: auto; max-width: 60%; }

/* whole-word illustration: same black rounded tile, wide */
.wtile {
  --s: 56px; height: var(--s); aspect-ratio: 1070 / 507; flex: none; display: inline-block; background: #000;
  border-radius: calc(var(--s) * .22); overflow: hidden; position: relative; vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.wtile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wtile.tile--xl { --s: 128px; } .wtile.tile--lg { --s: 92px; } .wtile.tile--md { --s: 64px; } .wtile.tile--sm { --s: 36px; }
[data-theme="dark"] .wtile { box-shadow: none; }
[data-theme="dark"] .wtile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); pointer-events: none; }
@media (max-width: 640px) { .word__tiles .wtile.tile--xl { --s: 104px; } }

/* the trainer is a focused space – no search bar there */
body[data-view="cards"] .topbar .search { display: none; }
.wp__back + .ql__title { margin-top: 34px; }

/* ───── quiet pointer to chineseffect.com ───── */
.guide-line { margin: 14px 0 0; font-size: 13.5px; color: var(--text-3); }
.guide-line a { color: var(--text-2); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.guide-line a:hover { color: var(--accent); text-decoration-color: currentColor; }
.guide-line--home { margin: -14px 0 0; }
@media (hover: none) { .kbd-only { display: none; } }
.sec-head h3 .muted { font-weight: 400; margin-left: 6px; }

/* ───── footer: clearly visible, still calm ───── */
.site-foot { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 36px; }
.site-foot > p {
  margin: 0; padding-top: 26px; border-top: 1px solid var(--line);
  text-align: center; font-size: 16px; color: var(--text-2);
}
.site-foot a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.site-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
body[data-view="cards"] .site-foot { display: none; }

/* ───── English phrase lookup ───── */
.phrases { display: grid; gap: 10px; margin-bottom: 18px; }
.phrases__h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 22px 2px 10px; }
.phrases__h:first-child { margin-top: 6px; }
.phrases__h [lang], .phrases__h { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; }
.mt { padding: 0; overflow: hidden; }
.mt > .muted { padding: 16px; margin: 0; }
.mt .examples--flat { box-shadow: none; background: transparent; border-radius: 0; }

.home__hint { margin: -12px 0 0; font-size: 14.5px; color: var(--text-2); }
.home__hint + .guide-line--home { margin-top: -18px; }
.mt__note { margin: 0; padding: 0 16px 14px; font-size: 12.5px; color: var(--text-3); }

/* characters of a word open on their own */
.h1-char { color: inherit; border-radius: 8px; transition: background .15s, color .15s; }
.h1-char:hover, .h1-char:focus-visible { background: var(--accent-soft); color: var(--accent); }
.word__tap { margin: 4px 0 6px; }
.tile-link { display: inline-flex; border-radius: 22%; }
a.charline__c { color: inherit; }
a.charline__c:hover { color: var(--accent); }

/* ───── word explorer: layers surfacing from mist ───── */
.sheet {
  --depth: 0;
  background:
    radial-gradient(120% 55% at 50% -8%, color-mix(in srgb, var(--accent) calc(5% + var(--depth) * 4%), transparent), transparent 72%),
    var(--surface);
  transition: transform .32s var(--ease), opacity .2s, background .6s var(--ease);
}
.sheet::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 70%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 50% at 25% 40%, color-mix(in srgb, var(--text) 5%, transparent), transparent 70%),
    radial-gradient(35% 45% at 75% 30%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%);
  filter: blur(18px); opacity: .9; animation: mist 18s ease-in-out infinite alternate;
}
@keyframes mist { from { transform: translate3d(-4%, 0, 0) scale(1); } to { transform: translate3d(4%, 3%, 0) scale(1.08); } }
.sheet__body { position: relative; z-index: 1; }

.fog__item { animation: emerge .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.fog--deeper .fog__item { animation-name: emergeDeep; }
.fog--up .fog__item { animation-name: emergeUp; animation-duration: .5s; }
@keyframes emerge { from { opacity: 0; filter: blur(10px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes emergeDeep { from { opacity: 0; filter: blur(16px); transform: translateY(18px) scale(.96); } to { opacity: 1; filter: none; transform: none; } }
@keyframes emergeUp { from { opacity: 0; filter: blur(8px); transform: translateY(-10px) scale(1.02); } to { opacity: 1; filter: none; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fog__item, .sheet::before { animation: none !important; filter: none !important; } }

.trail { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 2px 40px 8px 0; font-size: 15px; }
.trail__step {
  border: 0; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text-2);
  font: 500 15px/1 var(--font-zh); padding: 6px 10px; border-radius: 980px; cursor: pointer; transition: background .2s, color .2s;
}
.trail__step:hover { color: var(--accent); background: var(--accent-soft); }
.trail__sep { color: var(--text-3); }
.trail__here { font: 600 15px/1 var(--font-zh); color: var(--text); padding: 6px 4px; }

.wp__meaning .defs { margin-top: 4px; }
.wp__also { margin: 8px 0 0; }
.wp__piece { padding: 10px 14px; gap: 14px; }
.wp__piecezh { font: 500 26px/1 var(--font-zh); min-width: 2.2em; }
.wp__piecetext { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.wp__hint { color: var(--text); }
.sheet__actions { justify-content: center; }
.sheet__actions .link-btn { font-size: 15px; }
@media (max-width: 759px) { .sheet__actions .btn { width: auto; } }
.wp__char { margin-top: 18px; align-items: center; }
.wp__origin { margin: 0 0 6px; font-size: 16px; line-height: 1.45; }
.wp__origin b { font-weight: 600; font-size: 18px; }

.phrases__sub { font-weight: 400; color: var(--text-3); }
.examples--sim { margin-bottom: 10px; }

.trail__key { margin-left: auto; font-size: 12px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.wp__piece:focus-visible, .part:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* usable word → CAPITALS, idea (bound form / component) → lower case */
.gl { font-size: 13.5px; color: var(--text-2); }
.gl--word { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; font-size: 12.5px; color: var(--text); }
.gl--idea { font-style: normal; }
.chip__def .gl { font-size: inherit; }
.chip__def .gl--word { font-size: 12px; }

.usedin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.usedin__item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 14px; text-align: left;
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; min-width: 0;
}
.usedin__item:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--accent-soft)); }
.usedin__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.usedin__c { font: 500 26px/1 var(--font-zh); flex: none; }
.usedin__t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usedin__t .gl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp__sec h3 .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }

.comp__def { font-size: 19px; margin: 6px 0 2px; }
.h2-sub { font-size: 15px; font-weight: 400; letter-spacing: 0; }
a.usedin__item { text-decoration: none; }

/* ───── fluid aurora background (dark only) ───── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #000; pointer-events: none; }
.aurora i {
  position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  opacity: .85; will-change: transform; mix-blend-mode: screen;
}
.aurora i:nth-child(1) { background: radial-gradient(circle at center, rgba(10, 132, 255, .55), transparent 62%); top: -25vmax; left: -15vmax; animation: drift1 38s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle at center, rgba(94, 92, 230, .5), transparent 62%); top: 10vmax; right: -30vmax; animation: drift2 46s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: radial-gradient(circle at center, rgba(48, 176, 199, .38), transparent 62%); bottom: -35vmax; left: 5vmax; animation: drift3 52s ease-in-out infinite alternate; }
.aurora i:nth-child(4) { background: radial-gradient(circle at center, rgba(191, 90, 242, .3), transparent 62%); bottom: -20vmax; right: -10vmax; width: 55vmax; height: 55vmax; animation: drift4 44s ease-in-out infinite alternate; }
.aurora i:nth-child(5) { background: radial-gradient(circle at center, rgba(255, 159, 10, .12), transparent 60%); top: 30vmax; left: 25vmax; width: 45vmax; height: 45vmax; animation: drift5 60s ease-in-out infinite alternate; }
.aurora::after { /* keep text crisp: darken the centre column and the edges */
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0,0,0,.45) 100%),
    linear-gradient(rgba(0,0,0,.12), rgba(0,0,0,.12));
}
@keyframes drift1 { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(18vmax, 10vmax, 0) scale(1.15); } 100% { transform: translate3d(6vmax, 24vmax, 0) scale(.95); } }
@keyframes drift2 { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(-22vmax, 12vmax, 0) scale(1.1); } 100% { transform: translate3d(-10vmax, -8vmax, 0) scale(1.2); } }
@keyframes drift3 { 0% { transform: translate3d(0,0,0) scale(1.05); } 50% { transform: translate3d(20vmax, -14vmax, 0) scale(.9); } 100% { transform: translate3d(34vmax, -4vmax, 0) scale(1.1); } }
@keyframes drift4 { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(-26vmax, -18vmax, 0) scale(1.25); } }
@keyframes drift5 { 0% { transform: translate3d(0,0,0) scale(.9); } 100% { transform: translate3d(-20vmax, 16vmax, 0) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none !important; } }

/* glass surfaces over the aurora */
.results, .panel, .examples, .sent-list, .charcard, .flash__face, .rate__btn, #q, .btn:not(.btn--primary), .chip, .usedin__item, .wp__piece, .part {
  -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%);
}
.topbar { background: rgba(0, 0, 0, .45); }
.tabbar { background: rgba(0, 0, 0, .55) !important; }
.sheet { background-color: rgba(22, 22, 26, .82) !important; -webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%); }
.modal { background: rgba(24, 24, 28, .86); -webkit-backdrop-filter: blur(40px) saturate(160%); backdrop-filter: blur(40px) saturate(160%); }
.seg { background: rgba(255,255,255,.06); }
.seg > .is-on { background: rgba(255,255,255,.16); box-shadow: none; }
.btn--ghost { background: rgba(255,255,255,.08); }
.flash__face { background: rgba(28, 28, 34, .62); }
.tile, .stroke__canvas { background: #000; }
#q { background: rgba(255,255,255,.07); }
.toast { background: rgba(242,242,247,.94); color: #000; }

/* ───── fixed header, content scrolls & bounces beneath it ───── */
html, body { height: 100%; overflow: hidden; }
body { padding-bottom: 0 !important; }
.topbar { position: fixed; top: 0; left: 0; right: 0; }
.scroller {
  position: fixed; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: auto;
  padding-top: var(--head-h, 132px);
  padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom));
  scroll-padding-top: calc(var(--head-h, 132px) + 12px);
}

/* ───── refined palette: iris accent instead of grey & green ───── */
:root {
  --accent: #8ab4ff;
  --accent-soft: rgba(120, 150, 255, .16);
  --iris: linear-gradient(135deg, #4f8cff 0%, #7a5cff 100%);
  --iris-soft: linear-gradient(135deg, rgba(79, 140, 255, .32), rgba(122, 92, 255, .32));
  --glow: 0 8px 28px rgba(96, 110, 255, .35);
  --green: #6fe3c8;
  --orange: #ffb35c;
  --red: #ff7a7a;
}
.btn--primary, .btn--primary:hover {
  background: var(--iris); color: #fff; border: 0; box-shadow: var(--glow);
}
.btn--primary:hover { filter: brightness(1.08); }
.seg { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.08); }
.seg > .is-on {
  background: var(--iris-soft); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(160, 175, 255, .35), 0 4px 14px rgba(90, 100, 255, .2);
}
.seg > :not(.is-on) { color: var(--text-2); }
.switch input:checked + .switch__track { background: var(--iris); box-shadow: 0 0 14px rgba(110, 120, 255, .45); }
.switch__track { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.1); }
.badge { background: rgba(120, 150, 255, .16); color: #a9c4ff; }
.badge--muted { background: rgba(255,255,255,.08); color: var(--text-2); }
.say { background: rgba(120, 150, 255, .16); color: #a9c4ff; }
.say:hover { background: var(--iris); color: #fff; }
.icon-btn--add { background: rgba(120, 150, 255, .16); color: #a9c4ff; }
.icon-btn--add:hover { background: var(--iris); color: #fff; }
.tabbar a.is-on { color: #a9c4ff; }
#q:focus { border-color: rgba(140, 160, 255, .7); box-shadow: 0 0 0 4px rgba(110, 120, 255, .18), var(--shadow); }
.w:hover, .w.is-active { background: rgba(120, 150, 255, .16); }
.rate__btn--1 .rate__label { color: var(--red); }
.rate__btn--2 .rate__label { color: var(--orange); }
.rate__btn--3 .rate__label { color: var(--green); }
.rate__btn--4 .rate__label { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flash__face { border: 1px solid rgba(255,255,255,.07); }
.loadbar__fill { background: var(--iris); }
.empty__check { background: rgba(111, 227, 200, .14); color: var(--green); }
[data-theme="dark"] .seg > .is-on, .seg > .is-on {
  background: var(--iris-soft) !important; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(160, 175, 255, .35), 0 4px 14px rgba(90, 100, 255, .2) !important;
}
[data-theme="dark"] .switch__track { background: rgba(255,255,255,.12); }
.topbar {
  background: linear-gradient(rgba(4, 6, 14, .9), rgba(6, 8, 18, .94)) !important;
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border-bottom-color: rgba(255,255,255,.06);
}
.topbar #q { background: rgba(255,255,255,.08); }

/* several readings of one character */
.readings-tabs { display: flex; flex-wrap: wrap; margin: 6px 0 8px; }
.readings-tabs > button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 16px; }
.rt__py { font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.rt__gl { font-size: 12px; color: var(--text-2); font-weight: 400; }
.readings-tabs > .is-on .rt__gl { color: rgba(255,255,255,.8); }
.reading-pane .reading__head { flex-wrap: wrap; }
.reading-pane .reading__head .say { width: 30px; height: 30px; }
.reading__names { margin-top: 10px; }
.fade-in { animation: emerge .5s cubic-bezier(.2,.7,.2,1) both; }

/* ── The Journey ───────────────────────────────────────── */
.journey {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px;
  padding: 18px 20px; border-radius: 20px; margin-top: 28px;
  background: linear-gradient(135deg, rgba(79,140,255,.16), rgba(122,92,255,.16));
  border: 1px solid rgba(140,130,255,.35);
  box-shadow: 0 10px 40px -18px rgba(122,92,255,.6);
}
.journey__text { margin: 0; font-size: 1.05rem; }
.journey__text strong { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.journey__stages { display: flex; flex-wrap: wrap; gap: 8px; }
.journey__sq {
  min-width: 44px; height: 44px; padding: 0 10px; display: inline-grid; place-items: center;
  border-radius: 12px; background: var(--iris); color: #fff; font-weight: 700; font-size: 1.05rem;
  text-decoration: none; font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 18px -6px rgba(122,92,255,.8); transition: transform .15s ease, box-shadow .15s ease;
}
.journey__sq:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 24px -6px rgba(122,92,255,.95); }
.journey__sq:active { transform: scale(.96); }

/* ───── calm palette: no purple; quiet frosted white instead of the iris gradient ───── */
:root {
  --iris: rgba(255, 255, 255, .9);
  --iris-soft: rgba(255, 255, 255, .11);
  --glow: none;
  --accent: #a9c4ff;
  --accent-soft: rgba(255, 255, 255, .08);
}
.btn--primary, .btn--primary:hover { background: rgba(255,255,255,.92); color: #0b0d12; box-shadow: none; }
.btn--primary:hover { filter: none; background: #fff; }
[data-theme="dark"] .seg > .is-on, .seg > .is-on {
  background: rgba(255,255,255,.12) !important; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12) !important;
}
.switch input:checked + .switch__track { background: rgba(255,255,255,.85); box-shadow: none; }
.badge { background: rgba(255,255,255,.08); color: var(--text-2); }
.say, .icon-btn--add { background: rgba(255,255,255,.08); color: #e8ecf5; }
.say:hover, .icon-btn--add:hover { background: rgba(255,255,255,.9); color: #0b0d12; }
.tabbar a.is-on { color: #fff; }
#q:focus { border-color: rgba(255,255,255,.28); box-shadow: 0 0 0 4px rgba(255,255,255,.06), var(--shadow); }
.w:hover, .w.is-active { background: rgba(255,255,255,.1); box-shadow: inset 0 -1.5px 0 rgba(255,255,255,.5); }
.rate__btn--4 .rate__label { background: none; -webkit-background-clip: initial; background-clip: initial; color: #fff; }
.loadbar__fill { background: rgba(255,255,255,.8); }

.journey {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: none;
}
.journey__text { color: var(--text-2); }
.journey__text strong { background: none; -webkit-background-clip: initial; background-clip: initial; color: #fff; font-weight: 600; }
.journey__sq {
  background: rgba(255,255,255,.08); color: #fff; font-weight: 600;
  border: 1px solid rgba(255,255,255,.16); box-shadow: none;
}
.journey__sq:hover { transform: translateY(-1px); background: rgba(255,255,255,.9); color: #0b0d12; box-shadow: none; }
/* background without the purple cast */
.aurora i:nth-child(2) { background: radial-gradient(circle at center, rgba(40, 90, 170, .38), transparent 62%); }
.aurora i:nth-child(4) { background: radial-gradient(circle at center, rgba(60, 110, 140, .22), transparent 62%); }
.tabs-seg > .is-on, .cards-seg > .is-on { background: rgba(255,255,255,.12) !important; }
/* header: black glass — content scrolls beneath, blurred */
.topbar {
  background: rgba(0, 0, 0, .55) !important;
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.topbar #q { background: rgba(255,255,255,.07); }

/* ── About (static, crawlable; home screen only) ── */
section.about { margin: 56px 0 28px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.07); color: var(--text-2); }
.about h2 { font-size: 1.35rem; color: var(--text); margin: 0 0 10px; letter-spacing: -.01em; }
.about h2 em { font-style: normal; color: #fff; }
.about__lead { max-width: 62ch; margin: 0 0 22px; line-height: 1.55; }
.about__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.about__grid > div { padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.about h3 { font-size: .98rem; color: var(--text); margin: 0 0 6px; }
.about__grid p { margin: 0; font-size: .92rem; line-height: 1.5; }
.about__note { margin: 18px 0 0; font-size: .9rem; }
.about__note a { color: var(--text); }
body:not([data-view="dict"]) section.about { display: none; }
.about h2, .about h3 { border: 0; padding: 0; text-align: left; }
.about p { text-align: left; border: 0; padding: 0; font-size: inherit; }
.about__grid p { font-size: .92rem; }
.about__note a { white-space: normal; }
.about__grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .about__grid { grid-template-columns: 1fr; } }

/* ── Word map ─────────────────────────────────────────── */
.wmap-sec .sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wm-hint { margin: -4px 0 10px; }
.wmap {
  position: relative; width: 100%; height: 420px; overflow: hidden;
  border-radius: 24px; background: radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,.045), rgba(255,255,255,.012) 70%);
  border: 1px solid rgba(255,255,255,.06);
  transition: height .6s cubic-bezier(.22,.9,.24,1);
  -webkit-tap-highlight-color: transparent;
}
.wm-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.wm-lines path {
  fill: none; stroke: rgba(255,255,255,.16); stroke-width: 1.2; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: wm-draw .7s cubic-bezier(.22,.9,.24,1) forwards;
}
.wm-lines path.is-leaving { animation: wm-fade .35s ease forwards; stroke-dashoffset: 0; }
@keyframes wm-draw { to { stroke-dashoffset: 0; } }
@keyframes wm-fade { to { opacity: 0; } }

.wm-node {
  position: absolute; left: 0; top: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  max-width: 128px; padding: 7px 11px 8px; border-radius: 14px;
  background: rgba(18, 20, 28, .72); border: 1px solid rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text); font: inherit; text-align: center; cursor: pointer;
  opacity: 0; will-change: transform, opacity;
  transition: transform .76s cubic-bezier(.22,.9,.24,1), opacity .5s ease, background .3s ease, border-color .3s ease, box-shadow .3s ease, padding .5s cubic-bezier(.22,.9,.24,1);
}
.wm-node:hover { background: rgba(34, 38, 50, .85); border-color: rgba(255,255,255,.2); }
.wm-node:focus-visible { outline: 2px solid rgba(255,255,255,.6); outline-offset: 2px; }
.wm-node:active { filter: brightness(1.2); }
.wm-zh {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 22px; line-height: 1.15; letter-spacing: .02em; color: var(--text-2);
  transition: font-size .5s cubic-bezier(.22,.9,.24,1);
}
.wm-c--hub { color: #fff; font-weight: 600; }
.wm-py { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.wm-gl { font-size: 11.5px; line-height: 1.25; color: var(--text-3, rgba(255,255,255,.5)); max-width: 112px; }
.wm-gl .gl { color: inherit; }

.wm-node--center {
  z-index: 2; max-width: 220px; padding: 12px 18px 13px;
  background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22);
  box-shadow: 0 14px 40px -14px rgba(0,0,0,.8), 0 0 0 6px rgba(255,255,255,.025);
}
.wm-node--center .wm-zh { font-size: 38px; color: #fff; }
.wm-node--center .wm-c { color: #fff; font-weight: 500; }
.wm-node--center .wm-py { font-size: 14px; color: var(--text); }
.wm-node--center .wm-gl { font-size: 13px; max-width: 200px; color: var(--text-2); }
.wm-node--center:hover { background: rgba(255,255,255,.16); }
.wm-node.is-leaving { transition-duration: .5s, .38s; }

@media (max-width: 560px) {
  .wm-node { max-width: 104px; padding: 6px 8px 7px; }
  .wm-zh { font-size: 19px; }
  .wm-gl { max-width: 92px; font-size: 11px; }
  .wm-node--center .wm-zh { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .wm-node, .wmap { transition: none !important; }
  .wm-lines path { animation: none; stroke-dashoffset: 0; }
}
/* word map: fixed node size, one-line gloss → no overlaps */
.wm-node { width: 132px; max-width: none; height: 66px; justify-content: center; padding: 6px 8px; }
.wm-gl { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; letter-spacing: .02em; }
.wm-zh { font-size: 20px; }
.wm-node--center { width: auto; min-width: 150px; max-width: 240px; height: auto; padding: 12px 20px 13px; }
.wm-node--center .wm-gl { white-space: normal; font-size: 12.5px; }
@media (max-width: 560px) {
  .wm-node { width: 100px; height: 60px; padding: 5px 6px; }
  .wm-zh { font-size: 18px; }
  .wm-node--center { min-width: 0; max-width: 140px; padding: 10px 12px; }
  .wm-node--center .wm-zh { font-size: 30px; }
}
.wm-node { height: 74px; gap: 2px; }
.wm-zh { white-space: nowrap; }
.wm-gl { line-height: 1.35; padding-bottom: 1px; }
@media (max-width: 560px) { .wm-node { height: 68px; } }
.wm-node.wm-node--center { height: auto; }
.ex-inside { margin: 22px 0 8px; font-size: 1rem; font-weight: 600; color: var(--text-2); }
.ex-inside a { color: var(--text); margin: 0 2px; }
.examples--inside { opacity: .92; }
/* 🔊 on phones: no callout/selection on long-press, no double-tap zoom delay */
.say { -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.say.is-slow { transform: scale(1.12); background: rgba(255,255,255,.9); color: #0b0d12; }

/* ── notices & toasts: same black glass as the header ── */
.toast, [data-theme="dark"] .toast {
  background: rgba(0,0,0,.62); color: #fff; border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 12px 40px -12px rgba(0,0,0,.7);
}
.notice {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 70;
  display: flex; align-items: flex-start; gap: 12px;
  width: min(440px, calc(100vw - 28px)); padding: 14px 14px 14px 16px; border-radius: 18px;
  background: rgba(0,0,0,.62); color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 18px 50px -16px rgba(0,0,0,.8);
  opacity: 0; transform: translate(-50%, 14px); pointer-events: none;
  transition: opacity .3s ease, transform .45s cubic-bezier(.22,.9,.24,1);
}
.notice.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.notice__ico { flex: none; margin-top: 1px; color: var(--text-2); }
.notice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; line-height: 1.4; }
.notice__body strong { font-weight: 600; color: #fff; }
.notice__body span { color: var(--text-2); }
.notice__x {
  flex: none; width: 28px; height: 28px; margin: -4px -2px 0 auto; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--text-2); font-size: 12px; cursor: pointer;
}
.notice__x:hover { background: rgba(255,255,255,.16); color: #fff; }
.notice { bottom: calc(14px + var(--tab, 0px) + env(safe-area-inset-bottom)); }

/* ── Illustrated characters rising out of the mist ── */
.ill-sec { transition: opacity .6s ease; }
.ill-sec.is-pending { opacity: 0; min-height: 0; }
.ill-sec.is-pending .tile-grid { min-height: 0; }
.tile-grid a.mist {
  opacity: 0; filter: blur(14px); transform: scale(.94) translateY(6px);
  transition: opacity 1.1s cubic-bezier(.22,.9,.24,1), filter 1.2s cubic-bezier(.22,.9,.24,1), transform 1.2s cubic-bezier(.22,.9,.24,1);
  will-change: opacity, filter, transform;
}
.tile-grid a.mist.is-in { opacity: 1; filter: blur(0); transform: none; will-change: auto; }
.tile-grid a.mist.is-in:hover { transform: translateY(-2px); transition-duration: .25s; }
@media (prefers-reduced-motion: reduce) {
  .tile-grid a.mist { filter: none; transform: none; transition: opacity .3s ease; }
}
.missing-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.missing-list li { display: flex; gap: 8px; align-items: baseline; }
.missing-list [lang] { font-size: 18px; }
.ill-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ill-by { font-weight: 400; font-size: .9em; color: var(--text-2); }
.ill-by a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.2); transition: color .2s, border-color .2s; }
.ill-by a:hover { color: #fff; border-color: rgba(255,255,255,.6); }

/* ── Videos (Chineseffect YouTube) ─────────────────────── */
.vids__head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 16px; }
.vids__head h2 { margin: 0; }
.vids__shuffle {
  display: inline-flex; align-items: center; gap: 7px; flex: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; padding: 7px 15px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: #0b0d12; border: 0;
  transition: transform .15s, background .15s;
}
.vids__shuffle:hover { background: #fff; transform: translateY(-1px); }
.vids__shuffle:active { transform: scale(.96); }
.vids__shuffle span { font-size: 16px; line-height: 1; }
.vid { margin: 0; display: grid; gap: 12px; justify-items: start; }
/* shape from the video itself (--ar = width / height); never taller than ~460px */
.vid__frame {
  position: relative; overflow: hidden; border-radius: 18px; background: #000;
  border: 1px solid rgba(255,255,255,.09);
  aspect-ratio: var(--ar, 1.7778); width: min(100%, 640px, calc(460px * var(--ar, 1.7778)));
}
.vid__frame iframe, .vid__play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid__play { padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.vid__play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .2s, transform .4s; }
.vid__play:hover img { opacity: 1; transform: scale(1.02); }
.vid__btn {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(10,10,18,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.35); transition: transform .15s, background .15s;
}
.vid__btn::after {
  content: ''; position: absolute; left: 26px; top: 21px;
  border-style: solid; border-width: 11px 0 11px 18px; border-color: transparent transparent transparent #fff;
}
.vid__play:hover .vid__btn { transform: scale(1.06); background: rgba(10,10,18,.7); }
.vid__cap { font-size: 18px; color: var(--text-2); }
.ex__vid {
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--text-2);
  font: inherit; font-size: 12px; padding: 2px 9px; border-radius: 999px; cursor: pointer; vertical-align: middle; white-space: nowrap;
}
.ex__vid:hover { background: rgba(255,255,255,.9); color: #0b0d12; }

/* ── Search field: brighter line + a Tron-style light cycle riding around it ── */
@property --cycle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.search__field { --ring: 2px; --trail: 70 190 255; --trail-hi: 160 230 255; border-radius: 16px; }
.search__field #q, .topbar .search__field #q { border-color: rgba(255,255,255,.3); }
.search__field #q:focus, .topbar .search__field #q:focus { border-color: rgba(255,255,255,.55); box-shadow: 0 0 0 4px rgba(150,210,255,.10), var(--shadow); }
.search__field::before, .search__field::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: var(--ring);
  /* the bike: a bright white head, a cyan light trail fading behind it */
  background: conic-gradient(from var(--cycle),
    transparent 0turn 0.62turn,
    rgb(var(--trail) / 0) 0.62turn,
    rgb(var(--trail) / .6) 0.88turn,
    rgb(var(--trail-hi) / .95) 0.975turn,
    #fff 0.995turn,
    transparent 1turn);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: lightcycle 5.5s linear infinite;
}
/* soft glow under the trail */
.search__field::after { filter: blur(6px); opacity: .7; --ring: 2.5px; }
@keyframes lightcycle { to { --cycle: 360deg; } }
/* away from the home screen (word pages, results, cards): quiet */
.search__field::before { opacity: .3; }
.search__field::after { opacity: .15; }
.search__field::before, .search__field::after { animation-duration: 9s; }
/* home screen (dictionary, empty box): full brightness */
body[data-view="dict"] .search__field:has(#q:placeholder-shown)::before { opacity: 1; animation-duration: 5.5s; }
body[data-view="dict"] .search__field:has(#q:placeholder-shown)::after { opacity: .7; animation-duration: 5.5s; }
/* searching (typing in the box): the bike turns orange */
.search__field:focus-within { --trail: 255 140 40; --trail-hi: 255 200 120; }
body .search__field:focus-within::before { opacity: .9; animation-duration: 7s; }
body .search__field:focus-within::after { opacity: .55; animation-duration: 7s; }
.search__field #q:focus, .topbar .search__field #q:focus { border-color: rgba(255,190,120,.55); box-shadow: 0 0 0 4px rgba(255,150,60,.10), var(--shadow); }
@media (prefers-reduced-motion: reduce) {
  .search__field::before, .search__field::after { animation: none; display: none; }
}

/* header scrolls away on word pages & cards (see placeHeader in app.js) */
.topbar { will-change: transform; }
