:root {
  --brand: #0f2a4a;
  --bg: #f3f6fa; --panel: #ffffff; --panel-2: #f7f9fc; --text: #0f1b2d; --muted: #64748b;
  --line: #e2e8f0; --accent: #1d9bd8; --accent-2: #4cb6ea; --accent-soft: #e3f3fc; --on-accent: #ffffff;
  --good: #0f9f6e; --good-soft: #dcf7ec; --bad: #e0443e; --bad-soft: #fde4e3;
  --amber: #b45309; --amber-soft: #fef3c7; --mark: #fff0a8;
  --shadow: 0 1px 2px rgb(15 27 45 / .04), 0 8px 24px rgb(15 27 45 / .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #d3e9f8;
    --bg: #0c131d; --panel: #131c29; --panel-2: #192433; --text: #e8eef6; --muted: #8b9bb0;
    --line: #233043; --accent: #4cb6ea; --accent-2: #7ccbf2; --accent-soft: #11304a; --on-accent: #06121e;
    --good: #34d399; --good-soft: #0f3a2c; --bad: #f87171; --bad-soft: #3e1a1a;
    --amber: #fbbf24; --amber-soft: #3a2c0b; --mark: #5a4a10;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
  }
}
:root[data-theme="dark"] {
  --brand: #d3e9f8;
  --bg: #0c131d; --panel: #131c29; --panel-2: #192433; --text: #e8eef6; --muted: #8b9bb0;
  --line: #233043; --accent: #4cb6ea; --accent-2: #7ccbf2; --accent-soft: #11304a; --on-accent: #06121e;
  --good: #34d399; --good-soft: #0f3a2c; --bad: #f87171; --bad-soft: #3e1a1a;
  --amber: #fbbf24; --amber-soft: #3a2c0b; --mark: #5a4a10;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: 20px; letter-spacing: -.01em; margin: 0 0 8px; }
p { margin: 0 0 12px; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 .4em; border: 1px solid currentColor; border-radius: 6px;
  font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; opacity: .55; text-align: center;
}
@media (hover: none) { kbd { display: none; } }
[hidden] { display: none !important; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.logo {
  display: grid; place-items: center; height: 32px; padding: 0 10px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  font-size: 16px; font-weight: 800; letter-spacing: -.02em; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.brand-sub { color: var(--muted); font-weight: 500; font-size: 14px; }
@media (max-width: 560px) { .brand-sub { display: none; } }
.top nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.top nav a, .navbtn {
  padding: 6px 12px; border-radius: 999px; color: var(--muted); font-family: inherit; font-weight: 500; font-size: 15px; line-height: 1.4; background: none; border: 0; cursor: pointer;
}
.top nav a:hover, .navbtn:hover { color: var(--text); background: var(--panel); }
.top nav a.on { color: var(--text); background: var(--panel); box-shadow: var(--shadow); }
body.focus .top { display: none; }

main { max-width: 680px; margin: 0 auto; padding: 20px 16px 96px; }

/* surfaces */
.panel, .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.subtle { background: transparent; box-shadow: none; padding: 12px 16px; }
.narrow { max-width: 380px; margin: 48px auto; }
.center { text-align: center; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.row.center { justify-content: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--bad); font-weight: 500; }
.inline { display: inline; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 15px; }
.section { margin: 28px 4px 10px; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* inputs and buttons */
input[type=text], input[type=password], input[type=url] {
  width: 100%; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, input[type=password]:focus, input[type=url]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text);
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.3; cursor: pointer; transition: transform .08s, background .15s, border-color .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn:active { transform: scale(.97); }
.btn.primary { --btn-bg: color-mix(in srgb, var(--accent) 86%, var(--brand)); background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.bad { color: var(--bad); }
.btn.big { padding: 14px 20px; font-size: 16px; border-radius: 14px; }
.btn.wide { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-family: inherit; font-weight: 500; font-size: 14px; line-height: 1.4; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }

/* home */
.banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; padding: 16px 20px;
  border-radius: var(--radius); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); box-shadow: var(--shadow);
}
.banner .muted { color: inherit; opacity: .8; font-size: 14px; }
.banner .count { font-size: 30px; font-weight: 800; }
.drop {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px; margin-bottom: 12px;
  border: 1.5px dashed var(--line); border-radius: 14px; background: var(--panel-2); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop.has-file { border-style: solid; border-color: var(--good); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 18px; }
.episodes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ep { display: grid; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); transition: transform .12s, box-shadow .12s; }
.ep:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ep-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ep-title { font-weight: 650; }
.empty { padding: 16px; }
.pill { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.indigo { background: var(--accent-soft); color: var(--accent); }
.pill.green { background: var(--good-soft); color: var(--good); }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar.thin { height: 5px; margin-top: 6px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.foot { margin-top: 32px; text-align: center; }

/* episode */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stats div { padding: 12px; border-radius: 14px; background: var(--panel-2); display: grid; }
.stats b { font-size: 24px; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: 13px; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.steps li.current { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps li:not(.current):not(.done) { opacity: .6; }
.steps .num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-weight: 700; }
.steps .done .num { background: var(--good); border-color: var(--good); color: white; }
.ready-card { text-align: center; padding: 28px 22px; background: linear-gradient(180deg, var(--good-soft), var(--panel)); }
.ready-emoji { font-size: 48px; line-height: 1; margin-bottom: 8px; }

/* focus screens */
.focusbar { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; margin-bottom: 16px; }
.close { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.close:hover { color: var(--text); }
.focus-title { font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focusbar .bar { grid-column: 1 / -1; }
.bar-label { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.card { padding: 26px; }
.kind, .kind-row { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.kind-row { display: flex; justify-content: space-between; align-items: center; }
.lemma { font-size: clamp(32px, 8vw, 44px); font-weight: 750; letter-spacing: -.03em; line-height: 1.15; margin: 6px 0 14px; overflow-wrap: anywhere; }
.quote { margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0 12px 12px 0; }
.quote blockquote { margin: 0 0 6px; font-size: 19px; line-height: 1.45; }
.line-tr { margin-top: 8px; color: var(--muted); font-style: italic; }
/* «Антиспойлер»: the line sits under shimmering dots like a Telegram spoiler until tapped */
.spoiler { --dot: var(--muted); cursor: pointer; border-radius: 6px; color: transparent; user-select: none; -webkit-user-select: none;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: color .35s ease;
  background-image: radial-gradient(circle, var(--dot) .8px, transparent 1.3px), radial-gradient(circle, var(--dot) .6px, transparent 1.1px),
    radial-gradient(circle, color-mix(in srgb, var(--dot) 60%, transparent) 1px, transparent 1.5px);
  background-size: 11px 9px, 7px 13px, 17px 11px; background-color: color-mix(in srgb, var(--dot) 10%, transparent);
  animation: spoiler-shimmer 2.4s linear infinite; }
.spoiler mark { background: transparent; color: transparent; transition: inherit; }
.spoiler:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spoiler.open { color: inherit; background: none; cursor: auto; user-select: auto; -webkit-user-select: auto; animation: none; }
.spoiler.open mark { background: var(--mark); color: inherit; }
@keyframes spoiler-shimmer { from { background-position: 0 0, 3px 2px, 1px 4px; } to { background-position: 11px -9px, -7px 13px, 17px -11px; } }
@media (prefers-reduced-motion: reduce) { .spoiler { animation: none; } }
mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 4px; }
.translation { font-size: 26px; font-weight: 700; color: var(--accent); margin: 2px 0 6px; }
.explain { color: var(--muted); margin: 0 0 16px; }
.answer3 { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; margin-top: 12px; }
@media (max-width: 480px) { .answer3 { grid-template-columns: 1fr 1fr; } .answer3 .ghost { grid-column: 1 / -1; order: 3; } }
#back { margin-top: 16px; }

/* drill */
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--good); }
.options { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); font-family: inherit; font-weight: 500; font-size: 17px; line-height: 1.3; cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
}
button.option:hover { border-color: var(--accent); background: var(--accent-soft); }
button.option:active { transform: scale(.985); }
.option.right { border-color: var(--good); background: var(--good-soft); font-weight: 650; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.option.dim { opacity: .45; }
.answered .option.right { animation: pulse .5s ease; }
.answered .option.wrong { animation: shake .35s ease; }
.feedback { margin-top: 14px; padding: 14px 16px; border-radius: 14px; }
.feedback.good { background: var(--good-soft); }
.feedback.bad { background: var(--bad-soft); }
.feedback b { margin-right: 8px; }
.feedback .explain { margin: 8px 0 0; }
@keyframes pulse { 50% { transform: scale(1.02); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.spinner { width: 34px; height: 34px; margin: 6px auto 14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.big-ready { position: relative; overflow: hidden; padding: 40px 22px; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: fall 2.6s ease-in 1 forwards; }
.confetti i:nth-child(4n+1) { background: var(--accent); }
.confetti i:nth-child(4n+2) { background: #f59e0b; }
.confetti i:nth-child(4n+3) { background: var(--good); }
.confetti i:nth-child(4n) { background: #ec4899; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(340px) rotate(540deg); } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.chip { position: relative; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel-2);
  font-weight: 500; transition: opacity .25s, background .25s, border-color .25s, color .25s, transform .15s;
}
.chip:hover span { border-color: var(--accent); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
/* calibration: known words pop and leave a ghost outline you can click to bring them back */
.chips.pop .chip input:checked + span { opacity: .28; background: transparent; border-style: dashed; border-color: var(--muted); color: var(--muted); }
.chips.pop .chip:hover input:checked + span { opacity: .6; }
.chip.popping span { animation: pop .38s cubic-bezier(.3, 1.6, .5, 1); }
.chip.popping::after {
  content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 2px solid var(--accent);
  animation: ring .45s ease-out forwards; pointer-events: none;
}
.chip.unpopping span { animation: unpop .3s ease-out; }
@keyframes pop { 0% { transform: scale(1); opacity: 1; } 35% { transform: scale(1.22); opacity: 1; } 100% { transform: scale(.94); } }
@keyframes ring { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.45); } }
@keyframes unpop { 0% { transform: scale(.8); } 70% { transform: scale(1.06); } 100% { transform: scale(1); } }
/* episode batch: the words you don't know get a red tint */
.chips.unknown .chip input:checked + span { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.dock {
  position: sticky; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.dock b { font-size: 18px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.answer3.grades { grid-template-columns: repeat(3, 1fr); }
.answer3.front { grid-template-columns: 1fr 1fr; }
.answer3.front form, .answer3.front form .btn { width: 100%; }
.review-more { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
@media (max-width: 480px) { .review-more .btn { flex: 1 1 30%; padding-inline: 6px; font-size: 14px; } .review-more kbd { display: none; } }
@media (max-width: 480px) { .answer3.grades .btn { padding-inline: 6px; font-size: 15px; white-space: nowrap; } }

/* wide pages */
main.wide { max-width: 1120px; }
.home { display: grid; gap: 24px; }
@media (min-width: 900px) { .home { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .home-side { position: sticky; top: 76px; } }
.hero { padding: 8px 4px 18px; }
.hero h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 8px; }
.hero p { max-width: 560px; font-size: 17px; }
.upload { padding: 16px; }
.upload-form { display: grid; gap: 10px; }
@media (min-width: 700px) { .upload-form { grid-template-columns: 1.1fr 1fr auto; align-items: stretch; } }
.upload-form .drop, .upload-form input[type=text] { margin: 0; }
.upload-form .drop { padding: 12px 14px; }
.section .muted { font-weight: 500; margin-left: 4px; }
.episodes.grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ep-num { display: flex; align-items: baseline; gap: 8px; }
.ep-num b { font-size: 30px; letter-spacing: -.03em; }
.episodes .empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 4px; padding: 36px 16px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty-art { font-size: 40px; }
.home-side .panel { padding: 18px; }
.level { display: grid; gap: 2px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.level b { font-size: 34px; letter-spacing: -.03em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles > * { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); color: var(--text); }
.tiles a:hover { background: var(--accent-soft); }
.tiles b { font-size: 22px; }
.tiles span { font-size: 12px; color: var(--muted); }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.side-head h2 { font-size: 17px; margin: 0; }
.mini-dict { list-style: none; margin: 0; padding: 0; }
.mini-dict li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.mini-dict li:last-child { border-bottom: 0; }
.mini-dict span { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip p { margin: 4px 0 0; }

/* episode title rename */
.title-row { display: flex; align-items: center; gap: 8px; }
.title-row h1 { margin: 0; }
.iconbtn { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 15px; }
.iconbtn:hover { color: var(--accent); border-color: var(--accent); }
.rename { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 4px; }
.rename input { margin: 0; }
.title-row[data-open] { display: none; }
.dict-link { margin-top: 14px; }

/* dictionary */
.dict-head h1 { margin-bottom: 4px; }
.dict-tools { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 600px) { .dict-tools { grid-template-columns: 1fr auto; align-items: center; } }
input[type=search] { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--text); font: inherit; outline: none; }
input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.seg a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.dict { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dict li {
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.3fr) auto; grid-template-areas: "word tr act" "line line line";
  gap: 4px 14px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
}
.dict li.known { background: var(--panel-2); }
@media (max-width: 560px) { .dict li { grid-template-columns: 1fr auto; grid-template-areas: "word act" "tr tr" "line line"; } }
.dict-word { grid-area: word; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dict-word b { font-size: 17px; }
.dict-tr { grid-area: tr; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.dict-line { grid-area: line; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-act { grid-area: act; }
.tr-text { padding: 2px 6px; margin-left: -6px; border-radius: 8px; cursor: text; border: 1px dashed transparent; }
.tr-text:hover, .tr-text:focus { border-color: var(--line); outline: none; background: var(--panel-2); }
.tr-text.empty { color: var(--muted); font-style: italic; }
.tr-input { padding: 4px 8px; border: 1px solid var(--accent); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; min-width: 0; width: 100%; box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.tr-text.saved { animation: saved 1s ease; }
@keyframes saved { 0% { background: var(--good-soft); } 100% { background: transparent; } }
.tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.tag.indigo { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chipbtn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chipbtn:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 560px) {
  .top { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; }
  .top nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a, .navbtn { padding: 6px 10px; font-size: 14px; white-space: nowrap; }
}

/* preSub wordmark: thin «pre», heavy «Sub», deep navy */
.wordmark { color: var(--brand); font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.wordmark .pre { font-weight: 300; letter-spacing: -.02em; }
.tr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 14px; }
.feedback .tr-meta { margin: 8px 0 0; }

/* pronunciation */
.pron { display: flex; align-items: center; gap: 10px; margin: -8px 0 14px; }
.ipa { color: var(--muted); font-family: "Charis SIL", "Doulos SIL", "Lucida Sans Unicode", "Segoe UI", sans-serif; font-size: 16px; }
.dict-word .ipa { font-size: 14px; }
.speak {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 16px; line-height: 1;
  transition: transform .08s, border-color .15s;
}
.speak:hover { border-color: var(--accent); }
.speak:active { transform: scale(.92); }
.speak.busy { opacity: .55; }
.autospeak { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.autospeak[hidden] { display: none; }
.speak-hint { color: var(--muted); font-size: 13px; margin-left: 8px; }
.speak.busy { opacity: .55; }
.autospeak { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.autospeak[hidden] { display: none; }
.speak-hint { color: var(--muted); font-size: 13px; margin-left: 8px; }
.speak.small { width: 28px; height: 28px; font-size: 13px; vertical-align: middle; margin-left: 6px; }
.install-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.install-row img { border-radius: 10px; }
.install p { margin: 0; }
@media (display-mode: standalone) { .top { padding-top: max(10px, env(safe-area-inset-top)); } }

/* subtitles search */
input[type=number] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); color: var(--text); font: inherit; outline: none; -moz-appearance: textfield;
}
input[type=number]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.subs-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.subs-form input[name=q] { grid-column: 1 / -1; margin: 0; }
@media (min-width: 700px) { .subs-form { grid-template-columns: 1fr 96px 96px auto; } .subs-form input[name=q] { grid-column: auto; } }
.or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.subs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.subs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.subs-info { display: grid; gap: 2px; min-width: 0; }
.subs-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }

/* login + landing */
.big-mark { font-size: 40px; margin-bottom: 12px; }
.tg-login { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 44px; margin: 14px 0 8px; }
.tg-login p { margin: 0; }
.landing-hero { display: grid; gap: 28px; align-items: center; padding: 24px 4px 8px; }
@media (min-width: 860px) { .landing-hero { grid-template-columns: 1.2fr 1fr; padding-top: 48px; } }
.landing-hero h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 16px; }
.landing-hero .accent { color: var(--accent); }
.lead { font-size: 18px; max-width: 560px; }
.landing-login .tg-login { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.landing-stack { position: relative; padding: 18px 10px 18px 0; }
.landing-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.landing-card.back { position: absolute; inset: 18px 10px 18px 0; opacity: .75; box-shadow: none; overflow: hidden; }
.landing-card.back .lemma, .landing-card.back .translation { opacity: .45; }
.landing-card.b1 { transform: rotate(-7deg) translate(-14px, 10px); }
.landing-card.b2 { transform: rotate(5deg) translate(16px, -14px); }
.landing-card.back .kind, .landing-card.back .lemma { margin-left: 12px; }
@media (hover: hover) {
  .landing-stack .landing-card { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  .landing-stack:hover .landing-card:not(.back) { transform: rotate(2.5deg) translateY(-4px); }
  .landing-stack:hover .b1 { transform: rotate(-10deg) translate(-26px, 16px); }
  .landing-stack:hover .b2 { transform: rotate(8deg) translate(26px, -20px); }
}
/* Telegram's own blue, so the button reads as «Telegram» before it is read */
.btn.tg { --tg: #2aabee; background: linear-gradient(180deg, #37b4f2, #229ed9); border-color: transparent; color: #fff; border-radius: 999px; padding: 14px 26px 14px 20px; box-shadow: 0 8px 22px -6px rgb(34 158 217 / .55); }
.btn.tg:hover { background: linear-gradient(180deg, #2aa9e8, #1b8fc6); border-color: transparent; }
.tg-plane { width: 22px; height: 22px; fill: currentColor; flex: none; }
.btn.later { background: none; border: 0; padding: 8px 4px; color: var(--muted); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.btn.later:hover { color: var(--text); text-decoration-color: currentColor; }
/* landing: a quiet tint at the top instead of decoration; the content fills the page */
body:has(.landing-hero) { background: radial-gradient(ellipse 90% 520px at 50% -120px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 75%) no-repeat, var(--bg); }
.landing-section { margin-top: 56px; }
.landing-section h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -.025em; margin-bottom: 6px; }
.landing-section > p { margin-bottom: 18px; }
/* «где угодно»: text + laptop/phone mockups drawn in CSS; sizes in cqw so the pair scales as one picture */
.landing-anywhere { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .landing-anywhere { grid-template-columns: 1fr 1.35fr; } }
.anywhere-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 14px; }
.anywhere-list li { display: grid; gap: 3px; padding-left: 16px; border-left: 3px solid var(--accent-soft); }
.anywhere-list kbd { display: inline-block !important; }
.anywhere-list kbd { opacity: .7; }
.devices-mock { container-type: inline-size; position: relative; padding: 0 12cqw 7cqw 0; }
.devices-mock .floor { position: absolute; left: 4%; right: 6%; bottom: 2cqw; height: 5cqw; border-radius: 50%; background: radial-gradient(closest-side, rgb(15 27 45 / .2), transparent); filter: blur(6px); }
.devices-mock .laptop { position: relative; }
.devices-mock .lid { position: relative; padding: 1.3cqw 1.3cqw 1.6cqw; border-radius: 2.6cqw 2.6cqw 1cqw 1cqw; background: #0e0e11; box-shadow: inset 0 0 0 .25cqw #2a2a30, 0 3cqw 5cqw -2cqw rgb(0 0 0 / .35); }
.devices-mock .lid::before { content: ""; position: absolute; top: 1.3cqw; left: 50%; width: 9cqw; height: 1.2cqw; transform: translateX(-50%); border-radius: 0 0 .8cqw .8cqw; background: #0e0e11; z-index: 2; }
.devices-mock .lid .scr { aspect-ratio: 16 / 10; border-radius: .9cqw; overflow: hidden; background: var(--bg); font-size: 1.55cqw; display: flex; flex-direction: column; }
.devices-mock .base { position: relative; height: 1.6cqw; margin: 0 -6.5cqw; border-radius: .3cqw .3cqw 3cqw 3cqw; background: linear-gradient(180deg, #e4e4e8 0%, #c9c9cf 45%, #9d9da5 100%); }
.devices-mock .base::before { content: ""; position: absolute; left: 41%; right: 41%; top: 0; height: 45%; border-radius: 0 0 1.2cqw 1.2cqw; background: linear-gradient(#b9b9c0, #a5a5ad); }
.devices-mock .phone { position: absolute; right: 0; bottom: 3cqw; width: 29cqw; }
.devices-mock .ph { position: relative; padding: .9cqw; border-radius: 5.2cqw; background: linear-gradient(145deg, #3a3a40, #121215 40%, #2a2a2f); box-shadow: 0 3cqw 6cqw -2cqw rgb(0 0 0 / .45), inset 0 0 0 .2cqw #4a4a52; }
.devices-mock .ph::before, .devices-mock .ph::after { content: ""; position: absolute; width: .45cqw; border-radius: .3cqw; background: #2a2a2f; }
.devices-mock .ph::before { left: -.35cqw; top: 22%; height: 9%; }
.devices-mock .ph::after { right: -.35cqw; top: 28%; height: 14%; }
.devices-mock .ph .scr { position: relative; aspect-ratio: 9 / 19.5; border-radius: 4.4cqw; overflow: hidden; background: var(--bg); font-size: 1.75cqw; display: flex; flex-direction: column; }
.devices-mock .island { position: absolute; top: 1.1cqw; left: 50%; width: 30%; height: 2.6cqw; transform: translateX(-50%); border-radius: 2cqw; background: #000; z-index: 2; }
.devices-mock .status { display: flex; justify-content: space-between; align-items: center; padding: 1.2cqw 2.6cqw 0 3.2cqw; height: 4.6cqw; font-weight: 700; font-size: .85em; }
.devices-mock .status .ic { display: flex; gap: .35em; align-items: center; }
.devices-mock .status .ic b { display: inline-block; width: 1.4em; height: .7em; border: .12em solid currentColor; border-radius: .2em; position: relative; }
.devices-mock .status .ic b::after { content: ""; position: absolute; inset: .1em .35em .1em .1em; background: currentColor; border-radius: .05em; }
.devices-mock .status .ic i { display: inline-block; width: .9em; height: .7em; background: linear-gradient(90deg, currentColor 20%, transparent 20% 40%, currentColor 40% 60%, transparent 60% 80%, currentColor 80%); clip-path: polygon(0 100%, 100% 0, 100% 100%); }
.devices-mock .home-ind { width: 34%; height: .5em; margin: .6em auto .7em; border-radius: 1em; background: var(--text); opacity: .85; }
.devices-mock .wordmark { font-weight: 800; letter-spacing: -.03em; color: var(--brand); }
.devices-mock .wordmark .pre { font-weight: 500; }
.devices-mock .a-top { display: flex; align-items: center; gap: 2em; padding: .8em 1.6em; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .85em; }
.devices-mock .a-top .wordmark { margin-right: auto; font-size: 1.25em; }
.devices-mock .a-top .on { color: var(--text); font-weight: 650; position: relative; }
.devices-mock .a-top .on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.95em; height: .18em; border-radius: 1em; background: var(--accent); }
.devices-mock .a-body { flex: 1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.4em; padding: 1.6em 2em; }
.devices-mock .a-card { background: var(--panel); border: 1px solid var(--line); border-radius: 1.1em; padding: 1.2em 1.4em; box-shadow: 0 .2em .8em rgb(0 0 0 / .05); display: grid; gap: .55em; align-content: start; }
.devices-mock .a-meta { color: var(--muted); font-size: .8em; display: flex; justify-content: space-between; }
.devices-mock .a-bar { height: .38em; border-radius: 1em; background: var(--line); overflow: hidden; }
.devices-mock .a-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.devices-mock .a-word { font-weight: 800; font-size: 2.3em; letter-spacing: -.035em; line-height: 1.05; }
.devices-mock .a-ipa { color: var(--muted); font-size: .9em; }
.devices-mock .a-line { padding: .45em .75em; border-left: .22em solid var(--accent); background: var(--panel-2); border-radius: 0 .55em .55em 0; }
.devices-mock .a-opts { display: grid; gap: .45em; }
.devices-mock .a-opt { display: flex; align-items: center; gap: .6em; padding: .55em .75em; border: 1px solid var(--line); border-radius: .7em; background: var(--panel); }
.devices-mock .a-opt kbd { display: inline-block; opacity: 1; font: 600 .75em/1.6 ui-monospace, Menlo, monospace; min-width: 1.7em; margin: 0; text-align: center; border: 1px solid var(--line); border-radius: .4em; color: var(--muted); }
.devices-mock .a-opt.ok { border-color: var(--good); background: var(--good-soft); }
.devices-mock .a-opt.ok kbd { border-color: var(--good); color: var(--good); }
.devices-mock .a-side { display: grid; gap: .8em; align-content: start; }
.devices-mock .a-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 1em; padding: .9em 1.1em; }
.devices-mock .a-stat b { display: block; font-size: 1.7em; letter-spacing: -.03em; line-height: 1.1; }
.devices-mock .a-stat span { color: var(--muted); font-size: .8em; }
.devices-mock .a-streak { display: flex; gap: .3em; margin-top: .4em; }
.devices-mock .a-streak i { flex: 1; height: 1.6em; border-radius: .35em; background: var(--accent-soft); }
.devices-mock .a-streak i.on { background: var(--accent); }
.devices-mock .ph-body { flex: 1; display: flex; flex-direction: column; gap: .7em; padding: .6em 1.1em 0; }
.devices-mock .ph-title { display: flex; justify-content: space-between; align-items: baseline; }
.devices-mock .ph-title b { font-size: 1.35em; letter-spacing: -.02em; }
.devices-mock .ph-title span { color: var(--muted); font-size: .8em; }
.devices-mock .ph-card { flex: 1; display: grid; align-content: center; gap: .5em; padding: 1.2em 1.1em; border-radius: 1.3em; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 .3em 1.2em rgb(0 0 0 / .06); }
.devices-mock .ph-card .a-word { font-size: 2.6em; }
.devices-mock .tr { color: var(--accent); font-weight: 750; font-size: 1.3em; letter-spacing: -.01em; margin-top: .2em; }
.devices-mock .grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4em; font-size: .78em; font-weight: 650; text-align: center; white-space: nowrap; }
.devices-mock .grades span { padding: .85em .2em; border-radius: .8em; background: var(--panel); border: 1px solid var(--line); }
.devices-mock .grades .bad { color: var(--bad); }
.devices-mock .grades .good { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.devices-mock mark { background: var(--mark); color: inherit; border-radius: .3em; padding: 0 .2em; }
/* «Культовые фразы»: each card is a paused frame with dual subtitles (EN white, RU yellow) */
.landing-quotes { display: grid; gap: 22px; padding: 6px 4px; }
@media (min-width: 640px) { .landing-quotes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .landing-quotes { grid-template-columns: repeat(3, 1fr); } }
.quote-card { margin: 0; display: grid; gap: 10px; align-content: start; transform: rotate(var(--tilt, -1deg)); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.quote-card:nth-child(2n) { --tilt: 1.2deg; }
.quote-card:nth-child(3n) { --tilt: -.6deg; }
@media (hover: hover) { .quote-card:hover { transform: rotate(0) translateY(-4px); } }
.quote-card .frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  background: radial-gradient(ellipse 70% 60% at 30% 25%, hsl(var(--hue) 45% 38%), transparent 70%),
              radial-gradient(ellipse 60% 70% at 85% 70%, hsl(calc(var(--hue) + 40) 40% 26%), transparent 70%), hsl(var(--hue) 30% 9%);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 14px 14px 22px; }
.quote-card .show { position: absolute; top: 10px; left: 12px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgb(255 255 255 / .65); }
.subs-lines { display: grid; justify-items: center; gap: 4px; text-align: center; text-shadow: 0 1px 2px rgb(0 0 0 / .9), 0 0 6px rgb(0 0 0 / .6); }
.subs-lines span { padding: 1px 8px; border-radius: 4px; background: rgb(0 0 0 / .45); }
.subs-lines .en { color: #fff; font-weight: 600; font-size: 18px; line-height: 1.3; }
.subs-lines .ru { color: #ffe066; font-size: 15px; line-height: 1.3; }
.subs-lines mark { background: none; color: #ffe066; text-decoration: underline 2px; text-underline-offset: 3px; }
.quote-card .scrub { position: absolute; left: 12px; right: 12px; bottom: 8px; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .2); }
.quote-card .scrub i { display: block; height: 100%; border-radius: inherit; background: #e50914; background: var(--accent-2); }
.quote-card figcaption { padding: 0 4px; }
.landing-card .speak { cursor: default; }
.landing-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 12px; }
@media (min-width: 760px) { .landing-steps { grid-template-columns: repeat(3, 1fr); } }
.landing-steps li { display: grid; gap: 6px; padding: 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.quota { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quota div { display: grid; }
.quota b { font-size: 20px; }

/* owner stats */
.stats.four { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .stats.four { grid-template-columns: repeat(4, 1fr); } }
.stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.stats-head h1 { margin: 0; }
.period { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--panel-2); }
.period a { padding: 4px 10px; border-radius: 999px; color: var(--muted); font-size: 14px; }
.period a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-people, .vbar { background: color-mix(in srgb, var(--accent) 38%, var(--panel)); }
.sw-signed, .vbar-in { background: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.sw-signed, .vbar-in) { background: var(--accent-2); } }
:root[data-theme="dark"] :is(.sw-signed, .vbar-in) { background: var(--accent-2); }
.vchart { position: relative; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 180px auto; }
.vchart-grid { grid-column: 1 / 3; grid-row: 1; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vchart-grid div { height: 0; border-top: 1px solid var(--line); position: relative; }
.vchart-grid span { position: absolute; left: 0; top: -8px; font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--panel); padding-right: 4px; }
.vchart-bars { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(var(--n), 1fr); align-items: end; height: 100%; position: relative; }
.vcol { height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; cursor: default; outline: none; }
.vcol:hover, .vcol:focus-visible { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 6px 6px 0 0; }
.vbar { width: min(100%, 28px); border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; overflow: hidden; }
.vbar-in { width: 100%; border-top: 2px solid var(--panel); }
.vchart-x { grid-column: 2; display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 6px; }
.vchart-x span { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.vchart-x span.we { color: var(--text); }
@media (max-width: 640px) { .vchart-x span { font-size: 9px; } }
.vtip { position: absolute; top: 0; z-index: 2; min-width: 170px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; color: var(--text); pointer-events: none; }
.vtip b { display: block; margin-bottom: 2px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl tr.zero td { color: var(--muted); }
.pages-tbl .bar-cell { width: 40%; min-width: 80px; }
.page-bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
/* guest banner */
.guest-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 12px 16px; border-radius: 14px; background: var(--amber-soft); color: var(--text); font-size: 14px; }

.known-flash { animation: known-pop .15s ease-out; }
@keyframes known-pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mark-back { margin-top: 10px; text-align: center; }
.mark-back .btn { padding: 6px 12px; font-size: 14px; }

/* music: track page = player + steps on the side, lyrics with translation */
.music-form { grid-template-columns: 1fr auto; }
@media (min-width: 700px) { .music-form { grid-template-columns: 1fr auto; } }
.track { display: grid; gap: 16px; }
.track-side { display: grid; gap: 16px; }
.player-box { display: grid; gap: 6px; }
.player-box .yt-wrap { margin: 0; }
/* phones: the video stays on top while the lyrics scroll under it */
@media (max-width: 899px) {
  .track-side { display: contents; }
  .track-head { order: 1; }
  .player-box { order: 2; position: sticky; top: 0; z-index: 20; margin: 0 -16px; padding: 0 16px 6px;
    background: var(--bg); box-shadow: 0 8px 12px -10px rgb(0 0 0 / .25); }
  .player-box .yt-wrap { border-radius: 0 0 12px 12px; }
  .lyrics-panel { order: 3; }
  .track-stats { order: 4; }
  .size-btn { display: none; }
  .sync-tip { display: none; }
}
@media (min-width: 900px) {
  .track { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); align-items: start; }
  .track[data-size="m"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .track[data-size="l"] { grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr); }
  .track-side { position: sticky; top: 76px; }
}
.size-btn { margin-left: auto; }
.sync-tip { flex-basis: 100%; order: 9; font-size: 13px; }
.ly-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.yt-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin: 6px 0 10px; }
.yt-wrap iframe, .yt-wrap #yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-empty { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; margin-top: 8px; }
.yt-empty p { margin: 0; }
.yt-form { display: flex; gap: 8px; }
.yt-form input { flex: 1; min-width: 0; margin: 0; }
.yt-change summary { cursor: pointer; margin: 4px 0 8px; }
.sync-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn.sm { padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.track-steps { display: grid; gap: 8px; margin-top: 12px; }
.lyrics-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.about { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.lyrics { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 2px; }
.lyrics li { padding: 8px 12px; border-radius: 12px; cursor: pointer; transition: background .2s; scroll-margin: 120px; }
.lyrics li:hover { background: var(--panel-2); }
.lyrics li.on { background: var(--accent-soft); }
.lyrics li.on .ly-en { font-weight: 600; }
.lyrics li.open { background: var(--panel-2); }
.ly-en { font-size: 17px; }
.ly-ru { color: var(--muted); font-size: 15px; }
.lyrics.hide-tr .ly-ru { display: none; }
.lyrics.hide-tr li.open .ly-ru { display: block; }
.ly-note-mark { font-size: 13px; opacity: .7; }
.ly-more { margin-top: 8px; display: grid; gap: 8px; cursor: default; }
.ly-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); font-size: 15px; }
.ly-words { display: flex; flex-wrap: wrap; gap: 6px; }
.ly-word { display: inline-flex; gap: 6px; align-items: center; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }
.ly-word .muted { font-size: 13px; }
.ly-word button { border: 0; border-radius: 999px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; background: var(--accent-soft); color: var(--accent); }
.ly-word.learning { border-color: var(--accent); }
.ly-word.known { opacity: .6; }
.tag.good { display: inline-block; width: fit-content; padding: 1px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-weight: 600; }
.tr-offer { padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; margin: 8px 0; }
.tr-offer p { margin: 0 0 8px; }
.tr-offer-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
/* series library: home shelf, show page, episode still banner */
.lib-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.lib-head h1 { font-size: clamp(26px, 3.4vw, 32px); letter-spacing: -.03em; margin: 0; }
.show-search { display: flex; gap: 6px; flex: 1; max-width: 440px; min-width: min(100%, 280px); padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.show-search input { flex: 1; min-width: 0; margin: 0; border: 0; background: transparent; padding: 8px 12px; box-shadow: none; }
.show-search input:focus { box-shadow: none; }
.show-search .btn { border-radius: 999px; padding: 8px 18px; }
.continue { display: grid; border-radius: 22px; overflow: hidden; background: #0d0f14; color: #fff; margin-bottom: 8px; box-shadow: var(--shadow); text-decoration: none; }
@media (min-width: 720px) { .continue { grid-template-columns: 1.4fr 1fr; min-height: 250px; } }
.continue .still { position: relative; min-height: 200px; background: center / cover no-repeat; }
.continue .still.blank, .ep-hero.blank, .ep-still.blank { background-image: radial-gradient(ellipse 60% 70% at 25% 30%, #33415c, transparent 70%), radial-gradient(ellipse 50% 60% at 80% 70%, #2a2f3d, transparent 70%); background-color: #0d0f14; }
@media (min-width: 720px) { .continue .still::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, #0d0f14); } }
.subs-on-still { position: absolute; left: 12px; right: 12px; bottom: 16px; z-index: 1; display: grid; justify-items: center; gap: 3px; text-align: center; text-shadow: 0 1px 3px #000; }
.subs-on-still span { max-width: 100%; padding: 1px 10px; border-radius: 5px; background: rgb(0 0 0 / .55); }
.subs-on-still .en { font-weight: 600; font-size: 17px; color: #fff; }
.subs-on-still .ru { font-size: 14px; color: #ffe066; }
.subs-on-still mark { background: none; color: #ffe066; text-decoration: underline 2px; text-underline-offset: 3px; }
.continue .info { padding: 22px 26px 26px; display: grid; align-content: center; gap: 10px; }
.continue .kicker, .ep-hero .k { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: rgb(255 255 255 / .65); }
.continue h2 { font-size: 26px; margin: 0; letter-spacing: -.02em; color: #fff; }
.continue .meta { color: rgb(255 255 255 / .72); font-size: 15px; }
.continue .pbar { height: 6px; border-radius: 6px; background: rgb(255 255 255 / .15); overflow: hidden; }
.continue .pbar i { display: block; height: 100%; background: var(--accent-2); }
.continue .go { justify-self: start; margin-top: 4px; background: #fff; color: #0d0f14; font-weight: 700; padding: 11px 20px; border-radius: 12px; }
.continue:hover .go { background: #ffe066; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 16px; }
@media (min-width: 900px) { .shelf { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); } }
.poster { display: grid; gap: 6px; align-content: start; color: var(--text); text-decoration: none; }
.poster .img { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: var(--panel-2) center / cover no-repeat; box-shadow: 0 10px 24px -12px rgb(0 0 0 / .5); transition: transform .2s; }
.poster:hover .img { transform: translateY(-3px); }
.poster .img.blank { display: grid; place-items: center; padding: 12px; text-align: center; background: linear-gradient(160deg, #2a3142, #0d0f14); }
.poster .ph-name { color: #fff; font-weight: 700; font-size: 17px; line-height: 1.2; }
.poster .badge { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px; background: rgb(0 0 0 / .65); color: #fff; font-size: 12px; font-weight: 700; }
.poster .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgb(0 0 0 / .35); }
.poster .prog i { display: block; height: 100%; background: var(--accent-2); }
.poster b { font-size: 15px; line-height: 1.25; }
.poster > span { font-size: 13px; color: var(--muted); }
.poster.add .img { box-shadow: none; border: 2px dashed var(--line); background: transparent; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.poster.add:hover .img { border-color: var(--accent); color: var(--accent); }
.own-files { margin-top: 12px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.file-chip { padding: 7px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 14px; }
.file-chip:hover { border-color: var(--accent); }
details.upload > summary { cursor: pointer; font-weight: 600; list-style: none; }
details.upload > summary::-webkit-details-marker { display: none; }
details.upload[open] > summary { margin-bottom: 14px; }
.show-hero { position: relative; overflow: hidden; margin: -20px -16px 0; color: #fff; background: #0d0f14; }
@media (min-width: 1152px) { .show-hero { border-radius: 0 0 24px 24px; margin-left: 0; margin-right: 0; } }
.show-bg { position: absolute; inset: -40px; background: center 30% / cover no-repeat; filter: blur(28px) saturate(1.2) brightness(.45); transform: scale(1.1); }
.show-in { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: end; padding: 28px 20px; }
@media (min-width: 720px) { .show-in { grid-template-columns: 170px 1fr; gap: 28px; padding: 32px 28px; } }
.show-poster { aspect-ratio: 2 / 3; border-radius: 14px; background: center / cover no-repeat; box-shadow: 0 20px 40px -12px rgb(0 0 0 / .7); }
.show-poster.blank { background: linear-gradient(160deg, #2a3142, #11141b); }
.show-back { color: rgb(255 255 255 / .75); font-size: 14px; }
.show-hero h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: -.035em; margin: 6px 0 6px; color: #fff; }
.show-meta { color: rgb(255 255 255 / .75); font-size: 15px; }
.show-stats { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 14px; }
.show-stats b { display: block; font-size: 22px; }
.show-stats span { font-size: 13px; color: rgb(255 255 255 / .7); }
.show-error { margin-top: 16px; }
.season-pills { display: flex; gap: 8px; margin: 22px 0 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.season-pills::-webkit-scrollbar { display: none; }
.season-pills a { flex: none; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; font-size: 14px; }
.season-pills a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px 18px; margin: 22px 0 28px; }
.ep-card { display: grid; gap: 5px; align-content: start; margin: 0; }
.ep-still { position: relative; aspect-ratio: 16 / 9; width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: #0d0f14 center / cover no-repeat; box-shadow: 0 8px 20px -10px rgb(0 0 0 / .45); margin-bottom: 4px; transition: transform .2s; font: inherit; }
.ep-still:hover { transform: translateY(-2px); }
.ep-still .num { position: absolute; left: 10px; bottom: 9px; color: #fff; font-weight: 800; font-size: 13px; text-shadow: 0 1px 3px #000; }
.ep-still .tag { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.ep-still .tag.done { background: var(--good); color: #fff; }
.ep-still .tag.work { background: #ffe066; color: #1a1a1a; }
.ep-still .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(0 0 0 / .35); }
.ep-still .pbar i { display: block; height: 100%; background: var(--accent-2); }
.ep-card b { font-size: 15px; line-height: 1.3; }
.ep-card .linkbtn { justify-self: start; font-weight: 600; }
.show-upload .row { display: flex; gap: 8px; }
.tvmaze-credit { margin-top: 24px; }
.ep-hero { position: relative; min-height: 190px; aspect-ratio: 21 / 8; border-radius: 22px; overflow: hidden; margin-bottom: 14px; background: #0d0f14 center / cover no-repeat; box-shadow: var(--shadow); color: #fff; }
.ep-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .6), rgb(0 0 0 / .05) 45%, rgb(0 0 0 / .45)); }
.ep-hero-t { position: absolute; top: 16px; left: 20px; right: 20px; z-index: 1; }
.ep-hero h1 { color: #fff; font-size: clamp(22px, 3.4vw, 30px); margin: 2px 0 0; text-shadow: 0 1px 4px rgb(0 0 0 / .5); }

/* swipe cards (review, marking one by one): touch only; buttons and keys still work */
[data-swipe-card] { position: relative; }
[data-swipe-card]:not(.dragging) { transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
[data-swipe-card].flying { transition: transform .2s ease-in, opacity .2s ease-in; opacity: 0; }
@media (hover: none) { [data-swipe-card] { touch-action: none; -webkit-user-select: none; user-select: none; } }
.swipe-in { animation: swipe-in .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes swipe-in { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.swipe-stamp { position: absolute; top: 18px; z-index: 2; padding: 4px 12px; border: 3px solid currentColor; border-radius: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--muted); }
.swipe-stamp.right { left: 18px; transform: rotate(-12deg); }
.swipe-stamp.left { right: 18px; transform: rotate(12deg); }
.swipe-stamp.up, .swipe-stamp.down { left: 50%; transform: translateX(-50%) rotate(-5deg); }
.swipe-stamp.down { top: auto; bottom: 18px; }
.swipe-stamp.good, .swipe-hints .good i { color: var(--good); }
.swipe-stamp.bad, .swipe-hints .bad i { color: var(--bad); }
.swipe-stamp.amber, .swipe-hints .amber i { color: var(--amber); }
.swipe-stamp.accent, .swipe-hints .accent i { color: var(--accent); }
.swipe-hints { display: none; }
@media (hover: none) {
  .swipe-hints { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 4px 0 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); }
  .swipe-hints .hint { display: grid; justify-items: center; gap: 4px; }
  .swipe-hints i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-style: normal; font-size: 17px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
  .swipe-hints .good i { background: var(--good); border-color: var(--good); color: #fff; }
}

/* spot check of «Знаю» while marking */
.check-badge { padding: 3px 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.check-hint { margin: 4px 0 10px; }

/* quiz on wide screens: the site menu stays, card on the left, episode still + numbers on the right */
.quiz-meta, .quiz-bar, .quiz-side { display: none; }
@media (min-width: 900px) {
  body.focus.quiz-page .top { display: flex; }
  body.quiz-page .quiz-focusbar { display: none; }
  .quiz { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 24px; align-items: start; max-width: 1040px; margin: 10px auto 0; }
  .quiz .card { margin: 0; padding: 26px 30px; }
  .quiz-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; }
  .quiz-meta a { color: inherit; }
  .quiz-meta a:hover { color: var(--accent); }
  .quiz-bar { display: block; margin: 8px 0 16px; }
  .quiz .lemma { font-size: 48px; }
  .quiz-side { display: grid; gap: 14px; position: sticky; top: 84px; }
  .quiz-still { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0d0f14 center / cover no-repeat; box-shadow: var(--shadow); color: #fff; }
  .quiz-still.blank { background-image: radial-gradient(ellipse 60% 70% at 25% 30%, #33415c, transparent 70%); }
  .quiz-still::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgb(0 0 0 / .7)); }
  .quiz-still span { position: absolute; left: 14px; right: 14px; bottom: 11px; z-index: 1; font-size: 14px; line-height: 1.3; text-shadow: 0 1px 3px #000; }
  .quiz-stat { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); }
  a.quiz-stat:hover { border-color: var(--accent); }
  .quiz-stat b { font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
  .quiz-stat span { color: var(--muted); font-size: 14px; }
  .dots.big { gap: 6px; margin-top: 6px; }
  .dots.big i { width: 22px; height: 10px; border-radius: 5px; }
  .quiz-keys { margin: 0 4px; }
}
.cover { flex: none; width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--panel-2); box-shadow: 0 6px 16px -8px rgb(0 0 0 / .45); }
.cover.blank { display: grid; place-items: center; font-size: 26px; box-shadow: none; }
.cover.sm { width: 48px; height: 48px; border-radius: 10px; font-size: 20px; }
.track-title { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.track-title h1 { margin: 0; }
.track-card-head { display: flex; gap: 12px; align-items: center; }
.track-card-head .cover { width: 56px; height: 56px; }
.subs li:has(> .cover) { display: flex; align-items: center; gap: 12px; }
.subs li:has(> .cover) .subs-info { flex: 1; min-width: 0; }
main.wide:has(.track[data-size="l"]) { max-width: 1440px; }
.search-modes { display: flex; gap: 6px; margin-top: 10px; }
.search-modes a { padding: 4px 12px; border-radius: 999px; color: var(--muted); border: 1px solid var(--line); }
.search-modes a.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.album-row { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 8px; scroll-snap-type: x mandatory; }
.album-card { display: grid; gap: 4px; align-content: start; color: var(--text); scroll-snap-align: start; }
.album-card img, .album-card .cover { width: 148px; height: 148px; border-radius: 14px; object-fit: cover; box-shadow: 0 10px 22px -12px rgb(0 0 0 / .5); }
.album-card b { font-size: 14px; line-height: 1.25; }
.album-head { display: flex; gap: 18px; align-items: center; }
.album-head h1 { margin: 2px 0; }
.cover.big { width: 160px; height: 160px; border-radius: 16px; font-size: 48px; }
@media (max-width: 520px) { .album-head { flex-direction: column; align-items: flex-start; } }

/* level test (/calibrate) and its result */
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.level-lead { font-size: 17px; max-width: 620px; margin: 0 0 14px; }
.level-form { display: grid; gap: 14px; margin-top: 18px; }
.level-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.level-set legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 0; margin-bottom: 12px; }
.level-form.stepped .level-set:not(.on) { display: none; }
.level-progress { display: none; gap: 6px; }
.level-form.stepped .level-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.level-progress i { height: 6px; border-radius: 999px; background: var(--line); transition: background .25s; }
.level-progress i.done { background: var(--good); }
.level-progress i.on { background: var(--accent); }
.level-form.stepped .chips.pop { min-height: 132px; align-content: flex-start; }
.level-hint { margin: 0; }
.dock-actions { display: flex; gap: 6px; }
.level-big { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 8px; }
.level-big b { font-size: 56px; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.level-big span { font-size: 20px; color: var(--muted); }
.level-bars { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; gap: 8px; max-width: 520px; }
.level-bars li { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.level-bars .range { color: var(--muted); font-variant-numeric: tabular-nums; }
.level-bars .bar { height: 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.level-bars .bar i { display: block; height: 100%; border-radius: inherit; background: var(--good); }
.level-bars .fail .bar i { background: var(--muted); opacity: .45; }
.level-bars .score { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.level-bars .fail .score { color: var(--muted); }
.level-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* «Мой уровень» (/level) */
.lv { display: grid; gap: 16px; }
.lv > .panel { margin: 0; }
.lv-hero { display: grid; gap: 22px; }
@media (min-width: 900px) { .lv-hero { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.lv-hero h1 { font-size: 24px; }
.lv-side { display: grid; gap: 12px; }
.lv-goal, .lv-streak { padding: 14px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.lv-goal { display: grid; gap: 4px; }
.lv-goal b { font-size: 20px; }
.lv-bar { display: block; height: 10px; margin: 4px 0; border-radius: 999px; background: var(--line); overflow: hidden; }
.lv-bar.thin { height: 6px; margin: 6px 0 2px; }
.lv-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.cefr-rows { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.cefr-rows li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.cefr-rows .lv-bar { margin: 0; }
.cefr-rows li:not(.pass) .lv-bar i { background: var(--muted); opacity: .55; }
.cefr-num { font-size: 14px; white-space: nowrap; }
.cefr-chip { display: inline-block; min-width: 36px; padding: 2px 8px; border-radius: 8px; text-align: center; font-weight: 700;
             font-size: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.cefr-chip.on, h2 .cefr-chip { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 480px) { .cefr-rows li { grid-template-columns: 40px minmax(0, 1fr); } .cefr-num { grid-column: 2; } }
.lv-streak { display: flex; gap: 12px; align-items: center; }
.lv-streak > div { display: grid; gap: 2px; }
.lv-streak .flame { font-size: 30px; filter: grayscale(1); opacity: .45; }
.lv-streak.on .flame { filter: none; opacity: 1; }
.lv-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 900px) { .lv-tiles { grid-template-columns: repeat(6, 1fr); } }
.lv-tiles > * { display: grid; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.lv-tiles a:hover { border-color: var(--accent); }
.lv-tiles b { font-size: 24px; letter-spacing: -.02em; }
.lv-tiles span { font-size: 13px; color: var(--muted); }
.heat { display: grid; grid-auto-flow: column; grid-auto-columns: 15px; gap: 4px; margin-top: 10px; overflow-x: auto; }
.heat-week { display: grid; gap: 4px; }
.heat i, .heat-legend i { display: block; width: 15px; aspect-ratio: 1; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); }
.heat i.l1, .heat-legend i.l1 { background: color-mix(in srgb, var(--good) 25%, var(--panel)); border-color: transparent; }
.heat i.l2, .heat-legend i.l2 { background: color-mix(in srgb, var(--good) 50%, var(--panel)); border-color: transparent; }
.heat i.l3, .heat-legend i.l3 { background: color-mix(in srgb, var(--good) 75%, var(--panel)); border-color: transparent; }
.heat i.l4, .heat-legend i.l4 { background: var(--good); border-color: transparent; }
.heat i.future { visibility: hidden; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.heat-legend i { width: 12px; }
.badges { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 10px; }
.badge { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.badge-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.badge-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; font-size: 24px; background: var(--panel); border: 2px solid var(--line); }
.badge.t0 .badge-icon { filter: grayscale(1); opacity: .5; }
.badge.t1 .badge-icon { border-color: #c98a4b; }
.badge.t2 .badge-icon { border-color: #a7b1bd; }
.badge.t3 .badge-icon { border-color: #e2b33c; box-shadow: 0 0 0 3px color-mix(in srgb, #e2b33c 25%, transparent); }
.pips { display: flex; gap: 4px; }
.pips i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); }
.pips i.got:nth-child(1) { background: #c98a4b; }
.pips i.got:nth-child(2) { background: #a7b1bd; }
.pips i.got:nth-child(3) { background: #e2b33c; }
.lv-how summary { cursor: pointer; list-style: none; }
.lv-how summary::-webkit-details-marker { display: none; }
.lv-how summary h2 { display: inline; font-size: 17px; }
.lv-how summary::after { content: " ▾"; color: var(--muted); }

/* forced theme: native controls (selects, scrollbars) follow it too */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* a faint still of the episode in the card's top-right corner: decoration only (off in /settings) */
.card:has(> .still-deco) { position: relative; isolation: isolate; overflow: hidden; }
.still-deco { position: absolute; top: 0; right: 0; z-index: -1; width: min(42%, 260px); aspect-ratio: 16 / 9;
  background: center / cover no-repeat; opacity: .2; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 120% at 100% 0, #000 30%, transparent 72%);
  mask-image: radial-gradient(120% 120% at 100% 0, #000 30%, transparent 72%); }
.still-cap { position: absolute; right: 16px; bottom: 7px; max-width: 70%; font-size: 11px; line-height: 1.3; color: var(--muted); opacity: .7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .still-deco { opacity: .16; } }
:root[data-theme="dark"] .still-deco { opacity: .16; }
/* the wide quiz already shows the still in its side column */
@media (min-width: 900px) { .quiz :is(.still-deco, .still-cap) { display: none; } }

/* settings */
.settings { max-width: 760px; margin: 0 auto; }
.set-section h2 { margin: 6px 0 12px; }
.set-section h2:not(:first-child) { margin-top: 26px; }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.set-head form { margin: 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row > span:first-child { display: grid; gap: 2px; }
.set-label { font-weight: 600; }
.toggle-row { cursor: pointer; }
.set-row select { max-width: 60%; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; }
.set-row input[type=range] { width: min(240px, 50%); accent-color: var(--accent); }
.set-foot { min-height: 20px; text-align: right; }
.seg-radio label { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; }
.seg-radio label.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.set-switch { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.set-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .15s; }
.set-switch:checked { background: var(--accent); }
.set-switch:checked::after { transform: translateX(18px); }
.set-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.keys-group h3 { margin: 18px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.keys-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.keys-label { font-weight: 500; }
.keys-chips { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.keys-row.fixed { color: var(--muted); }
.key-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 40px; justify-content: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.key-chip:hover { border-color: var(--accent); }
.key-chip kbd { margin: 0; }
.key-chip.add { color: var(--muted); border-style: dashed; background: transparent; }
.key-chip.capturing { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-size: 13px; animation: key-wait 1s ease-in-out infinite; }
@keyframes key-wait { 50% { opacity: .6; } }
.key-x { color: var(--muted); padding: 0 2px; }
.key-x:hover { color: var(--bad); }
.keys-reset { font-size: 13px; white-space: nowrap; }
.keys-row .keys-note { white-space: nowrap; }
.nav-gear { display: inline-flex; align-items: center; }
@media (max-width: 560px) {
  .keys-row { grid-template-columns: minmax(0, 1fr) auto; }
  .keys-reset, .keys-row .keys-note { grid-column: 1 / -1; justify-self: end; }
  .set-row select { max-width: 55%; }
}

/* «ИИ-режим» toggle on home */
.aimode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.aimode-cost { margin-top: 8px; }
.switch { flex: none; width: 44px; height: 26px; padding: 3px; border: 0; border-radius: 13px;
  background: color-mix(in srgb, var(--muted) 40%, transparent); cursor: pointer; transition: background .15s; }
.switch span { display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on span { transform: translateX(18px); }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* quiz: «нет верного варианта» / «не учить это слово» — small, out of the way of the options */
.drill-extra { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.drill-extra .linkbtn { font-size: 13px; font-weight: 400; color: var(--muted); }
.drill-extra .linkbtn:hover { color: var(--accent); }
.drill-extra kbd { font-size: 11px; }
.row.end .drill-extra { margin: 0 auto 0 0; align-self: center; }
.own-tr { display: flex; gap: 8px; margin-top: 10px; }
.own-tr input { flex: 1; min-width: 0; }

/* track: a video picked automatically */
.yt-auto { margin: 0 0 6px; }
.yt-auto.unsure { background: color-mix(in srgb, #f5a623 14%, transparent); border-radius: 10px; padding: 8px 10px; }

/* track: «🎯 Подстроить текст» — tap when the named line is sung */
.calib { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.calib p { margin: 0 0 8px; }
.calib-line { font-size: 18px; font-weight: 600; }
.calib-btns { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.lyrics li.calib-target { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px; }

/* dictionary: practice buttons, where a translation comes from */
.dict-practice { display: flex; flex-wrap: wrap; gap: 8px; }
.dict-practice .btn[disabled] { opacity: .45; pointer-events: none; }
.tr-disclaimer { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.tr-disclaimer b { color: var(--text); font-weight: 600; }
.tag.src { opacity: .75; font-weight: 500; }
.tr-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.dict-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
