/* iOS-style design tokens (system colors, light + dark) */
:root {
  --loaded-style: 1;   /* core.js cssApplied: this file is in effect */
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-pressed: #d1d1d6;
  --label: #000000;
  --secondary: rgba(60, 60, 67, 0.6);
  --tertiary: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --fill: rgba(118, 118, 128, 0.12);
  --seg-thumb: #ffffff;
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --bar: rgba(249, 249, 249, 0.82);
  --sheet: #f2f2f7;
  --shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 50px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --cell: #1c1c1e;
    --cell-pressed: #3a3a3c;
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, 0.6);
    --tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.6);
    --fill: rgba(118, 118, 128, 0.24);
    --seg-thumb: #636366;
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --bar: rgba(22, 22, 22, 0.82);
    --sheet: #1c1c1e;
    --shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  }
  .sheet .group { --cell: #2c2c2e; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font: 17px/1.29 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  letter-spacing: -0.41px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ───────── Screens & navigation bar ───────── */
#screens { position: fixed; inset: 0; }
.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  display: none;
}
.screen.active { display: block; }
.screen.page.active { animation: fade .18s ease-out; }   /* tabs switch instantly, without a blink */
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }

.navbar {
  position: sticky; top: 0; z-index: 10;
  height: calc(44px + var(--safe-top));
  padding-top: var(--safe-top);
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  transition: background .2s, box-shadow .2s;
}
.navbar-title { font-weight: 600; opacity: 0; transition: opacity .2s; }
.screen.scrolled .navbar {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--separator);
}
.screen.scrolled .navbar-title { opacity: 1; }
.navbar-action { position: absolute; right: 16px; bottom: 8px; color: var(--blue); width: 28px; height: 28px; }
.navbar-action svg { width: 24px; height: 24px; stroke-width: 2.2; }
.navbar-action.spin svg { animation: spin .8s linear infinite; }

.content {
  padding: 0 16px calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
  max-width: 680px; margin: 0 auto;
}
.large-title {
  font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: 0.37px;
  margin: 0 4px 12px;
}

/* ───────── Grouped lists ───────── */
.group {
  background: var(--cell);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cell {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; width: 100%;
  padding: 11px 16px;
  text-align: left;
  background: var(--cell);
}
.cell + .cell::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  height: 0.5px; background: var(--separator);
}
button.cell:active, .cell.tappable:active { background: var(--cell-pressed); transition: none; }
.cell-icon { width: 22px; height: 22px; color: var(--secondary); flex: none; }
.section-header {
  margin: 22px 16px 7px;
  font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  text-transform: uppercase; color: var(--secondary);
}
.section-footer {
  margin: 0 16px 20px;
  font-size: 13px; line-height: 18px; letter-spacing: -0.08px;
  color: var(--secondary);
}
.section-footer:empty { display: none; }
.secondary { color: var(--secondary); }

.input-cell { padding-top: 6px; padding-bottom: 6px; }
.input-cell input, .field input {
  flex: 1; min-width: 0;
  font: inherit; letter-spacing: inherit; color: var(--label);
  background: none; border: 0; outline: none;
  padding: 6px 0;
}
.input-cell input::placeholder, .field input::placeholder { color: var(--tertiary); }
.clear-btn { width: 22px; height: 22px; color: var(--tertiary); flex: none; }
.clear-btn svg { width: 22px; height: 22px; }
.clear-btn circle { fill: var(--tertiary); stroke: none; }
.clear-btn path { stroke: var(--cell); stroke-width: 2.4; }

.field > span { width: 100px; flex: none; }
.field input { text-align: right; }
.token-actions { justify-content: flex-end; gap: 24px; font-size: 15px; }

.value-cell { justify-content: space-between; }
.value-cell .secondary { text-align: right; font-size: 15px; }
.link-cell { color: var(--blue); justify-content: center; }
.destructive { color: var(--red); }
.disclosure { justify-content: space-between; }
.chevron { width: 16px; height: 16px; color: var(--tertiary); stroke-width: 2.6; }

.text-button { color: var(--blue); }
.text-button:active { opacity: .4; }
.paste-button {
  display: flex; align-items: center; gap: 6px;
  margin: 6px 16px 0; font-size: 15px;
}
.paste-button svg { width: 18px; height: 18px; }

/* ───────── Segmented control ───────── */
.segmented {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--fill);
  border-radius: 9px; padding: 2px;
  height: 36px;
}
.segmented button {
  position: relative; z-index: 1;
  font-size: 14px; font-weight: 500; letter-spacing: -0.08px;
  border-radius: 7px;
}
.segmented button[aria-checked="true"] { font-weight: 600; }
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px;
  width: calc((100% - 4px) / 4);
  background: var(--seg-thumb);
  border-radius: 7px;
  box-shadow: var(--shadow);
  transition: transform .28s cubic-bezier(.3, .7, .4, 1);
}

/* ───────── Buttons ───────── */
.primary-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  margin: 8px 0 24px;
  background: var(--blue); color: #fff;
  font-weight: 600;
  border-radius: 14px;
  transition: transform .1s, opacity .1s;
}
.primary-button svg { width: 20px; height: 20px; stroke-width: 2.4; }
.primary-button:active { transform: scale(.98); opacity: .85; }
.primary-button:disabled { opacity: .4; }
.primary-button.green { background: var(--green); }
.secondary-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; margin-bottom: 10px;
  background: var(--fill); color: var(--blue);
  font-weight: 600; border-radius: 14px;
}
.secondary-button:active { opacity: .6; }
.secondary-button.destructive { color: var(--red); }
.secondary-button svg { width: 20px; height: 20px; stroke-width: 2.2; }

/* ───────── Job card ───────── */
.job-card {
  background: var(--cell);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}
.job-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--fill) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: var(--tertiary);
}
.job-thumb > svg { width: 48px; height: 48px; stroke-width: 1.4; }
.job-thumb .pill {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.job-info { padding: 14px 16px 16px; }
.job-title {
  font-weight: 600; margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.job-sub { font-size: 13px; color: var(--secondary); margin: 0; word-break: break-all; }
.job-status {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 0; font-size: 15px; font-weight: 500;
}
.job-status.failed { color: var(--red); align-items: flex-start; }
.job-status.ready { color: var(--green); }
.job-error { font-size: 13px; color: var(--secondary); margin: 6px 0 0; word-break: break-word; -webkit-user-select: text; user-select: text; }
.job-actions { padding: 0 16px 6px; }

.progress {
  height: 4px; border-radius: 2px; background: var(--fill);
  overflow: hidden; margin-top: 10px;
}
.progress > i {
  display: block; height: 100%; width: 0;
  background: var(--blue); border-radius: 2px;
  transition: width .4s ease;
}
.progress.indeterminate > i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

.steps { display: flex; gap: 4px; margin-top: 12px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--fill); }
.steps span.done { background: var(--blue); }
.steps span.now { background: var(--blue); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

.spinner {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  border: 2.2px solid var(--fill); border-top-color: var(--secondary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon { width: 20px; height: 20px; flex: none; stroke-width: 2.4; }

/* ───────── Library rows ───────── */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; min-height: 72px;
}
.row + .row::before { left: 100px; }
.row-thumb {
  width: 72px; height: 48px; flex: none; border-radius: 6px;
  background: var(--fill) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: var(--tertiary);
}
.row-thumb svg { width: 22px; height: 22px; }
.row-text { flex: 1; min-width: 0; }
.row-title {
  font-size: 15px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub { font-size: 13px; color: var(--secondary); margin-top: 2px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--secondary); }
.dot.ready { background: var(--green); }
.dot.failed { background: var(--red); }
.dot.running { background: var(--orange); animation: pulse .8s ease-in-out infinite alternate; }
.empty {
  padding: 48px 24px; text-align: center; color: var(--secondary);
}
.empty svg { width: 44px; height: 44px; stroke-width: 1.4; margin-bottom: 8px; }

/* ───────── Tab bar ───────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--separator);
}
.tab {
  position: relative;
  flex: 1; max-width: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #999999;
  font-size: 10px; font-weight: 500; letter-spacing: 0.1px;
}
.tab svg { width: 26px; height: 26px; stroke-width: 1.7; }
.tab.active { color: var(--blue); }
.tab.active svg { stroke-width: 2.1; }
.badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font: 600 12px/18px -apple-system, system-ui, sans-serif; font-style: normal; text-align: center;
}

/* ───────── Bottom sheet ───────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  max-height: calc(100% - var(--safe-top) - 12px);
  background: var(--sheet);
  border-radius: 12px 12px 0 0;
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.2, .9, .3, 1);
  display: flex; flex-direction: column;
  max-width: 680px; margin: 0 auto;
}
.sheet.open { transform: none; }
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--tertiary); margin: 6px auto 0; flex: none; }
.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; flex: none;
}
.sheet-title { font-weight: 600; font-size: 17px; }
.sheet-header .text-button { font-weight: 600; }
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(var(--safe-bottom) + 24px);
  -webkit-user-select: text; user-select: text;
}
.sheet-body ol { padding-left: 20px; margin: 0 0 16px; }
.sheet-body li { margin-bottom: 10px; font-size: 15px; line-height: 1.4; }
.sheet-body code, .kv code {
  font: 13px ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--fill); padding: 1px 5px; border-radius: 4px;
  word-break: break-all;
}
.kv { font-size: 14px; }
.kv .cell { display: block; }
.kv .k { color: var(--secondary); font-size: 12px; margin-bottom: 2px; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; z-index: 1100;   /* above sheets and the tour, so its ✕ can be tapped */
  top: calc(var(--safe-top) + 10px);
  transform: translate(-50%, calc(-100% - var(--safe-top) - 40px));
  opacity: 0;
  background: var(--cell); color: var(--label);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  padding: 12px 18px; border-radius: 22px;
  font-size: 15px; font-weight: 500;
  width: max-content; max-width: min(480px, calc(100% - 32px)); box-sizing: border-box;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.2), opacity .2s;
  pointer-events: none;
  display: flex; align-items: center; gap: 12px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-t { flex: 1 1 auto; min-width: 0; }
.toast { overflow: hidden; }
.toast-x { flex: none; border: 0; background: var(--fill); color: var(--label); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; padding: 0; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--blue); opacity: .7; transform-origin: left; animation: toast-left linear forwards; }
@keyframes toast-left { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ═════════ Study ═════════ */
body.in-page .tabbar { display: none; }

.review-card {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, #5e5ce6, #bf5af2);
  color: #fff; border-radius: 16px; padding: 16px 16px 16px 18px; margin-bottom: 8px;
}
.review-card:empty { display: none; }
.rc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-text b { font-size: 17px; }
.rc-text span { font-size: 13px; opacity: .85; }
.rc-btn {
  background: rgba(255, 255, 255, .95); color: #5e5ce6;
  font-weight: 700; font-size: 15px; padding: 9px 18px; border-radius: 20px; flex: none;
}
.rc-btn:disabled { opacity: .5; }
.rc-btn:active { opacity: .7; }

/* Pages (lesson player, review) */
.screen.page { padding-bottom: calc(var(--safe-bottom) + 24px); }
.page-bar {
  background: var(--bar) !important;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--separator);
  justify-content: space-between; padding-left: 4px; padding-right: 8px;
}
.page-bar .page-title {
  opacity: 1; position: absolute; left: 90px; right: 90px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; bottom: 11px;
}
.page-bar .navbar-action { position: static; }
.back-btn { display: flex; align-items: center; color: var(--blue); gap: 0; font-size: 17px; height: 44px; }
.back-btn svg { width: 28px; height: 28px; stroke-width: 2.4; }

.player {
  position: sticky; top: calc(44px + var(--safe-top)); z-index: 5;
  background: var(--bg);
  box-shadow: 0 0.5px 0 var(--separator);
}
.player video {
  display: block; width: 100%; max-height: 34vh; aspect-ratio: 16 / 9;
  background: #000; object-fit: contain;
}
.player-controls, .player-options {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px 0;
  overflow-x: auto; scrollbar-width: none;
}
.player-options { padding-bottom: 8px; }
.player-controls::-webkit-scrollbar, .player-options::-webkit-scrollbar { display: none; }
.player-controls > button:not(.chip) {
  width: 40px; height: 40px; flex: none; color: var(--label);
  display: flex; align-items: center; justify-content: center; border-radius: 20px;
}
.player-controls > button:not(.chip) svg { width: 22px; height: 22px; fill: currentColor; stroke-width: 1.5; }
.player-controls > button.big { width: 48px; height: 48px; background: var(--blue); color: #fff; }
.player-controls > button.big svg { width: 24px; height: 24px; }
.chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px;
  background: var(--fill); color: var(--label);
  font-size: 14px; font-weight: 600; letter-spacing: -0.1px; white-space: nowrap;
}
.chip.small { height: 28px; font-size: 13px; padding: 0 10px; }
.chip.on { background: var(--blue); color: #fff; }
.chip:active { opacity: .7; }

/* Transcript: Russian with literal meanings underneath, then English */
.transcript { padding: 6px 0 40px; max-width: 680px; margin: 0 auto; }
.sent {
  display: flex; align-items: flex-start; gap: 4px;
  padding: 12px 8px 12px 16px; margin: 0 8px; border-radius: 12px;
  transition: background .2s;
}
.sent:active { background: var(--fill); }
.sent.now { background: rgba(10, 132, 255, 0.12); }
.sent-main { flex: 1; min-width: 0; }
.il { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; }
.tok { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.tok b { font-size: 21px; font-weight: 500; letter-spacing: 0; color: var(--label); }
.tok i {
  font-style: normal; font-size: 12px; color: var(--secondary); margin-top: 3px;
  letter-spacing: 0; max-width: 11em;
}
.sent.now .tok b { color: var(--blue); }
.en { margin: 8px 0 0; font-size: 15px; color: var(--secondary); line-height: 1.35; font-style: italic; }
.hide-literal .tok i { display: none; }
.hide-english .en { display: none; }
.star { width: 36px; height: 36px; flex: none; color: var(--tertiary); display: flex; align-items: center; justify-content: center; }
.star svg { width: 24px; height: 24px; stroke-width: 1.8; }
.sent.starred .star { color: #ffcc00; }
.sent.starred .star svg { fill: #ffcc00; }

/* Review */
.review-player video { max-height: 30vh; }
.review-player video[hidden] { display: none; }
.review-body { padding: 16px 16px 32px; max-width: 680px; margin: 0 auto; }
.rv-hint { text-align: center; color: var(--secondary); font-size: 15px; margin: 4px 0 18px; }
.rv-front { min-height: 120px; display: flex; align-items: center; justify-content: center; text-align: center; margin-bottom: 12px; }
.rv-front .il { justify-content: center; }
.il.big .tok b { font-size: 26px; }
.en.big { font-size: 22px; font-style: normal; color: var(--label); margin: 0; }
.listen-icon { font-size: 64px; }
.rv-back { background: var(--cell); border-radius: 16px; padding: 18px 16px; margin-bottom: 12px; }
.rv-back .en { font-size: 17px; color: var(--label); }
.rv-src { margin: 12px 0 0; font-size: 12px; color: var(--secondary); }
.rv-tools { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; min-height: 32px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 0; border-radius: 14px; color: #fff;
}
.grade b { font-size: 16px; }
.grade span { font-size: 15px; opacity: .9; }
.grade.again { background: var(--red); }
.grade.hard { background: var(--orange); }
.grade.good { background: var(--green); }
.grade.easy { background: var(--blue); }
.grade:active { transform: scale(.97); }

/* "Use for Russian Study" on finished downloads */
.study-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; margin-bottom: 10px;
  background: linear-gradient(135deg, #5e5ce6, #bf5af2); color: #fff;
  font-weight: 600; border-radius: 14px;
}
.study-button:active { opacity: .8; }
.study-button.done { background: var(--fill); color: var(--label); }

/* Tappable words, word-by-word highlight, word card */
.tok[data-s="word"] { cursor: pointer; border-radius: 6px; padding: 1px 3px; margin: -1px -3px; transition: background .12s; }
.tok[data-s="word"]:active { background: var(--fill); }
.tok.say { background: rgba(255, 204, 0, .28); }
.tok.say b { color: var(--label) !important; }
.tok.saved b { text-decoration: underline dotted #ffcc00; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.tok.hl b { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
.sent-side { display: flex; flex-direction: column; align-items: center; flex: none; }
.replay { width: 36px; height: 36px; color: var(--blue); display: flex; align-items: center; justify-content: center; }
.replay svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.en { cursor: pointer; }

.word-card { text-align: center; padding-bottom: 8px; }
.wc-word { font-size: 40px; font-weight: 600; letter-spacing: 0; margin: 4px 0 2px; }
.wc-here { font-size: 19px; color: var(--secondary); margin-bottom: 14px; }
.wc-audio { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.wc-dict { text-align: left; }
.wc-base { font-size: 19px; font-weight: 600; }
.wc-dictline { font-size: 16px; margin: 0; color: var(--secondary); }
.wc-dictline b { color: var(--label); }
.wc-sentence { text-align: left; background: var(--cell); border-radius: 12px; padding: 12px 14px; margin: 12px 0 16px; }
.wc-sentence .k { font-size: 12px; color: var(--secondary); margin-bottom: 6px; }
.wc-sentence .tok b { font-size: 18px; }
.primary-button.saved-btn { background: #ffcc00; color: #000; }
.rv-back .wc-word, .rv-back .wc-here { text-align: center; }
.chip.off { opacity: .4; }

/* Word card syllables: stressed syllable coloured, current one lit while spoken */
.wc-word .syl { border-radius: 8px; padding: 0 2px; transition: background .12s, color .12s; }
.wc-word .syl.stress { color: var(--orange); }
.wc-word .syl.on { background: rgba(10, 132, 255, .25); color: var(--blue); }
.wc-word .sep { color: var(--tertiary); font-weight: 400; margin: 0 1px; }

/* Two-option segmented control (Study: Free / AI) */
.segmented.two { grid-template-columns: repeat(2, 1fr); margin-top: 10px; }
.segmented.two .seg-thumb { width: calc((100% - 4px) / 2); }

/* YouTube embedded player (test mode) */
.yt-box { width: 100%; aspect-ratio: 16 / 9; max-height: 34vh; background: #000; }
.yt-box iframe, .yt-box > div { display: block; width: 100%; height: 100%; border: 0; }
.player video[hidden] { display: none; }

/* Words the accuracy checks couldn't confirm */
.tok.unsure b { text-decoration: underline dotted var(--orange); text-underline-offset: 5px; text-decoration-thickness: 2px; }
.wc-warn {
  text-align: left; font-size: 14px; line-height: 1.4;
  background: rgba(255, 149, 0, .14); color: var(--label);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 14px;
}
.wc-warn span { color: var(--secondary); font-size: 13px; }

/* Scrub bar under the lesson video */
.scrub { display: flex; align-items: center; gap: 10px; padding: 8px 14px 0; font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.scrub span { min-width: 38px; }
.scrub span:last-child { text-align: right; }
.scrub input[type=range] { flex: 1; height: 28px; margin: 0; accent-color: var(--blue); background: transparent; }
.scrub[hidden] { display: none; }

/* Three-option segmented control (Study engine: Free / AI / Captions) */
.segmented.three { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.segmented.three .seg-thumb { width: calc((100% - 4px) / 3); }
.segmented.three button { font-size: 13px; }

/* Caption check result (Study → Captions test) */
.check-result { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 15px; line-height: 1.35; background: var(--fill); }
.check-result b { display: block; font-size: 16px; margin-bottom: 2px; }
.check-result .ct { display: block; font-size: 13px; color: var(--secondary); margin-top: 6px; }
.check-result.good b { color: var(--green); }
.check-result.warn b { color: var(--orange); }
.check-result.bad b { color: var(--red); }
.check-result.busy b { color: var(--secondary); }

/* Saved words & sentences */
.rc-btns { display: flex; gap: 8px; flex: none; }
.rc-btn.ghost { background: rgba(255, 255, 255, .22); color: #fff; }
.sv-list { margin-top: 12px; }
.sv-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.sv-main { flex: 1; min-width: 0; }
.sv-word { font-size: 20px; font-weight: 600; }
.sv-gloss { color: var(--secondary); font-size: 15px; margin-left: 6px; }
.sv-sub { color: var(--secondary); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-ru { font-size: 17px; }
.sv-due { flex: none; font-size: 12px; color: var(--secondary); }
.sv-due.now { color: var(--orange); font-weight: 600; }
.sv-empty { padding: 28px 16px; text-align: center; color: var(--secondary); }

.navbar-text-action { position: absolute; right: 16px; bottom: 10px; color: var(--blue); font-size: 17px; }
.sv-voice { display: contents; }
.chip.record-chip { background: var(--blue); color: #fff; }
