/* ESPwithme — design system */
:root {
  --brand: #1f6fd6;
  --brand-strong: #1559b3;
  --brand-soft: #e9f2ff;
  --brand-ink: #0d3a7a;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #0f1b2d;
  --muted: #5a6577;
  --faint: #8a94a6;
  --border: #e2e7ef;
  --ring: rgba(31, 111, 214, .35);
  --ok: #138a4c; --ok-soft: #e6f6ed;
  --warn: #b26b00; --warn-soft: #fff4e0;
  --bad: #c62f2f; --bad-soft: #fdecec;
  --t-blue: #1f6fd6;   --t-blue-bg: #e9f2ff;
  --t-violet: #6d4ae0; --t-violet-bg: #f0ebff;
  --t-red: #d43c3c;    --t-red-bg: #fdecec;
  --t-amber: #c27a00;  --t-amber-bg: #fff3dc;
  --t-green: #158a52;  --t-green-bg: #e5f6ec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
  --shadow-lg: 0 10px 40px rgba(15, 27, 45, .14);
  --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5ea3ff; --brand-strong: #86b9ff; --brand-soft: #14284a; --brand-ink: #cfe2ff;
    --bg: #0b111d; --surface: #121a29; --surface-2: #192335; --text: #e7ecf4; --muted: #9ba7bb; --faint: #6f7b90; --border: #243149;
    --ring: rgba(94, 163, 255, .4);
    --ok: #4cc98a; --ok-soft: #10301f; --warn: #f0b04c; --warn-soft: #33260c; --bad: #ff7a7a; --bad-soft: #3a1717;
    --t-blue: #6aa9ff; --t-blue-bg: #14284a; --t-violet: #a48cff; --t-violet-bg: #251c45; --t-red: #ff8080; --t-red-bg: #3a1a1a;
    --t-amber: #f2b553; --t-amber-bg: #33270f; --t-green: #56d494; --t-green-bg: #0f2f20;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #5ea3ff; --brand-strong: #86b9ff; --brand-soft: #14284a; --brand-ink: #cfe2ff;
  --bg: #0b111d; --surface: #121a29; --surface-2: #192335; --text: #e7ecf4; --muted: #9ba7bb; --faint: #6f7b90; --border: #243149;
  --ring: rgba(94, 163, 255, .4);
  --ok: #4cc98a; --ok-soft: #10301f; --warn: #f0b04c; --warn-soft: #33260c; --bad: #ff7a7a; --bad-soft: #3a1717;
  --t-blue: #6aa9ff; --t-blue-bg: #14284a; --t-violet: #a48cff; --t-violet-bg: #251c45; --t-red: #ff8080; --t-red-bg: #3a1a1a;
  --t-amber: #f2b553; --t-amber-bg: #33270f; --t-green: #56d494; --t-green-bg: #0f2f20;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6;
  color: var(--text); background: var(--bg);
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
body.wide .container { max-width: 1400px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); margin-top: -2px; }
.nav { display: none; gap: 2px; margin-left: 12px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-size: .93rem; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current] { color: var(--brand); background: var(--brand-soft); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: inline-grid; }
@media (min-width: 1060px) { .nav { display: flex; } .menu-btn { display: none; } }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }

.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(5, 12, 25, .45); }
.drawer .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--surface); padding: 16px; overflow-y: auto; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 4px;
}
.drawer .panel a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; color: var(--text); font-weight: 500; }
.drawer .panel a:hover, .drawer .panel a[aria-current] { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.drawer .panel .icon { color: var(--brand); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer;
  text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(31, 111, 214, .3); }
.btn-primary:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .btn-primary { color: #06152d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #06152d; } }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 14px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------------- page head */
.page-head { padding: 32px 0 20px; }
.page-head .eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.page-head p.lead { color: var(--muted); font-size: 1.05rem; max-width: 720px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: .875rem; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.section { padding: 8px 0 40px; }

/* ---------------------------------------------------------------- cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card h3 { margin-bottom: .35em; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s; position: relative;
}
a.tile:hover, button.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); text-decoration: none; }
.tile .tile-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.tile .tile-icon .icon { width: 24px; height: 24px; }
.tile h3 { margin: 4px 0 0; font-size: 1.05rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.tile .go { margin-top: auto; padding-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: .9rem; color: var(--brand); }
.tone-blue   { background: var(--t-blue-bg);   color: var(--t-blue); }
.tone-violet { background: var(--t-violet-bg); color: var(--t-violet); }
.tone-red    { background: var(--t-red-bg);    color: var(--t-red); }
.tone-amber  { background: var(--t-amber-bg);  color: var(--t-amber); }
.tone-green  { background: var(--t-green-bg);  color: var(--t-green); }

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
}
a.list-item:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); background: var(--brand-soft); text-decoration: none; }
.list-item .num { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); flex-shrink: 0; font-size: .95rem; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; }
.list-item .sub { color: var(--muted); font-size: .875rem; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 40px 0 24px; }
.hero-grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 64px 0 40px; } .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 48px; } }
.hero h1 { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.4rem); letter-spacing: -.02em; }
.hero h1 .accent { color: var(--brand); }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-card {
  position: relative; border-radius: 24px; padding: 28px; overflow: hidden;
  background: linear-gradient(145deg, var(--brand) 0%, #3f8cf0 55%, #6aa8ff 100%); color: #fff;
  box-shadow: 0 20px 50px rgba(31, 111, 214, .3);
}
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero-card .logo { width: 76px; height: 76px; border-radius: 18px; background: #fff; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.hero-card h2 { margin-top: 18px; font-size: 1.35rem; }
.hero-card p { color: rgba(255,255,255,.85); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px; text-align: center; }
.hero-stats b { display: block; font-size: 1.5rem; line-height: 1.1; }
.hero-stats span { font-size: .78rem; color: rgba(255,255,255,.85); }

.instructor { display: grid; gap: 24px; align-items: center; }
@media (min-width: 760px) { .instructor { grid-template-columns: 220px 1fr; } }
.instructor img { width: 100%; max-width: 220px; aspect-ratio: 4/5; object-fit: cover; border-radius: 20px; background: var(--surface-2); }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 14px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.check { display: flex; gap: 10px; align-items: center; font-size: .95rem; cursor: pointer; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } .form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.search { position: relative; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 42px; }

.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-wrap .card { padding: 28px; }

/* ---------------------------------------------------------------- alerts */
.flashes { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .95rem; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--brand-soft); color: var(--brand-ink); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.matrix td.q { text-align: center; padding: 6px 4px; min-width: 34px; font-weight: 600; font-size: .82rem; }
.matrix th.q { text-align: center; padding: 8px 4px; }
.matrix td.q.ok { background: var(--ok-soft); color: var(--ok); }
.matrix td.q.no { background: var(--bad-soft); color: var(--bad); }
.matrix td.q.skip { color: var(--faint); }
.matrix tr.stats td { background: var(--surface-2); font-weight: 600; font-size: .8rem; }
.matrix .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.matrix tr.stats .sticky-col { background: var(--surface-2); }

.score-pill { display: inline-block; min-width: 52px; text-align: center; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.score-pill.great { background: var(--ok-soft); color: var(--ok); }
.score-pill.good { background: var(--brand-soft); color: var(--brand); }
.score-pill.fair { background: var(--warn-soft); color: var(--warn); }
.score-pill.low { background: var(--bad-soft); color: var(--bad); }

.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .82rem; color: var(--muted); }

.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; scrollbar-width: none; }
.admin-nav a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; font-size: .92rem; }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-nav a[aria-current] { background: var(--brand-soft); color: var(--brand); }

details.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
details.panel > summary { padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; color: var(--muted); }
details.panel[open] > summary::after { content: "–"; }
details.panel > .inner { padding: 0 20px 20px; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; padding: 28px 0; font-size: .9rem; color: var(--muted); }
.site-footer .cols { display: grid; gap: 20px; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer a { color: var(--muted); }
.site-footer h4 { color: var(--text); font-size: .9rem; margin-bottom: .6em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer .contact { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal .scrim { position: absolute; inset: 0; background: rgba(5, 12, 25, .6); }
.modal .dialog { position: relative; width: min(920px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); }
.modal .dialog-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal .dialog-head h3 { margin: 0; flex: 1; font-size: 1rem; }
.modal .dialog-body { padding: 20px; }
.ratio-16x9 { position: relative; aspect-ratio: 16 / 9; background: #000; }
.ratio-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------------------------------------------------------- PDF viewer */
.viewer { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.viewer iframe { display: block; width: 100%; height: 78vh; min-height: 520px; border: 0; background: #fff; }
.viewer-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mobile-only { display: none; }
@media (max-width: 760px) { .viewer iframe { height: 60vh; min-height: 360px; } .mobile-only { display: block; } }

.video-card { padding: 0; overflow: hidden; cursor: pointer; text-align: left; font: inherit; }
.video-card .thumb { position: relative; aspect-ratio: 16 / 9; background: #0b1220; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .thumb .play { position: absolute; inset: 0; display: grid; place-items: center; }
.video-card .thumb .play span { width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--t-red); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: transform .15s; }
.video-card:hover .thumb .play span { transform: scale(1.08); }
.video-card .meta { padding: 14px 16px; font-weight: 600; }

/* ---------------------------------------------------------------- test taking */
body.focus .site-footer { display: none; }
.take { display: grid; gap: 20px; padding: 20px 0 40px; }
@media (min-width: 960px) { .take { grid-template-columns: 1fr 300px; align-items: start; } .take aside { position: sticky; top: 84px; } }
.take-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; flex: 1; min-width: 120px; }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s; }
.q-card { padding: 28px 22px; }
@media (min-width: 640px) { .q-card { padding: 36px; } }
.q-num { font-size: .82rem; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.q-text { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); font-weight: 500; line-height: 1.5; margin: 10px 0 24px; }
.q-text .blank { display: inline-block; min-width: 90px; padding: 0 8px; border-bottom: 3px solid var(--brand); color: var(--brand); font-weight: 700; text-align: center; }
.q-text .blank.empty { color: transparent; }
.options { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; min-height: 58px;
  border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.05rem; text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.opt:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.opt .key { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; flex-shrink: 0; color: var(--muted); }
.opt[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); }
.opt[aria-checked="true"] .key { background: var(--brand); color: #fff; }
.q-actions { display: flex; gap: 10px; margin-top: 24px; }
.q-actions .btn { flex: 1; }
@media (min-width: 640px) { .q-actions .btn { flex: 0 0 auto; } .q-actions .spacer { display: block; } }
.q-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.q-grid button {
  aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.q-grid button.answered { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.q-grid button.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.timer { display: inline-flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.timer.low { color: var(--bad); }
.saved-note { font-size: .8rem; color: var(--faint); }

/* result */
.result-hero { display: grid; gap: 20px; align-items: center; }
@media (min-width: 700px) { .result-hero { grid-template-columns: 180px 1fr; } }
.ring { --p: 0; --c: var(--brand); width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring > div { width: 136px; height: 136px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.ring b { font-size: 2.2rem; line-height: 1; display: block; }
.ring span { font-size: .82rem; color: var(--muted); }
.review-item { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.review-item.ok { border-left: 4px solid var(--ok); }
.review-item.no { border-left: 4px solid var(--bad); }
.review-item .ans { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: .92rem; }

/* ---------------------------------------------------------------- games */
.jeo-wrap { padding: 16px 0 40px; }
.teams { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.team { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.team input { width: 110px; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); padding: 2px 0; }
.team input:focus { outline: none; border-bottom: 2px solid var(--brand); }
.team b { min-width: 48px; text-align: right; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.board { display: grid; gap: 8px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
.board .cat { background: var(--brand-ink); color: #fff; border-radius: 12px; padding: 12px 8px; text-align: center; font-weight: 700; font-size: clamp(.72rem, .6rem + .5vw, 1rem); display: grid; place-items: center; min-height: 64px; }
:root[data-theme="dark"] .board .cat { background: #1d3a6a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .board .cat { background: #1d3a6a; } }
.board .cell {
  border: 0; border-radius: 12px; background: linear-gradient(160deg, var(--brand), #3d86ea); color: #ffd84d;
  font: inherit; font-weight: 800; font-size: clamp(1.1rem, .8rem + 1.6vw, 2.2rem); min-height: clamp(64px, 11vw, 110px); cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); transition: transform .1s, filter .1s;
}
.board .cell:hover { transform: translateY(-2px); filter: brightness(1.08); }
.board .cell.used { background: var(--surface-2); color: var(--faint); box-shadow: none; cursor: default; transform: none; }
.jq { font-size: clamp(1.1rem, 1rem + .8vw, 1.6rem); font-weight: 600; line-height: 1.45; }
.jq-img { margin: 16px auto; max-height: 50vh; width: auto; border-radius: 12px; }
.ja { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); font-size: 1.1rem; font-weight: 600; }
.award-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

.game-shell { max-width: 720px; margin: 0 auto; }
.game-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.game-score { display: flex; gap: 16px; }
.game-score div { text-align: center; }
.game-score b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.game-score span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.play { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 20px; }
.play .kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.play .prompt { font-size: clamp(1.15rem, 1rem + .9vw, 1.6rem); font-weight: 600; max-width: 560px; margin-bottom: 24px; line-height: 1.45; }
.play .big { font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); font-weight: 800; letter-spacing: .12em; margin-bottom: 10px; word-break: break-word; }
.choices { display: grid; gap: 10px; width: 100%; max-width: 560px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { padding: 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; min-height: 58px; }
.choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.choice.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.choice.hidden-hint { opacity: .25; pointer-events: none; text-decoration: line-through; }
.play .answer-row { display: flex; gap: 10px; width: 100%; max-width: 420px; }
.play .answer-row .input { text-align: center; font-weight: 600; font-size: 1.1rem; }
.feedback { font-size: 1.05rem; font-weight: 600; margin-top: 16px; min-height: 1.6em; }
.feedback.ok { color: var(--ok); }
.feedback.no { color: var(--bad); }
.usage { margin-top: 10px; color: var(--muted); font-style: italic; max-width: 520px; }

/* ---------------------------------------------------------------- writing */
.word-count { font-size: .85rem; color: var(--muted); }
.criteria { display: grid; gap: 14px; }
.criterion .top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: .95rem; }
.criterion .bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0; }
.criterion .bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.criterion p { margin: 0; color: var(--muted); font-size: .9rem; }
.essay-text { white-space: pre-wrap; line-height: 1.75; }
.prose { line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.2em; }
.prose ul { padding-left: 1.2em; }
.corr { display: grid; gap: 8px; }
.corr div { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.corr del { color: var(--bad); }
.corr ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.loading-dots::after { content: "…"; animation: dots 1.2s steps(4, end) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { 0% { width: 0; } 100% { width: 1.2em; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- tutor chat */
.chat-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px; border-radius: 999px; border: 0; background: var(--brand); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 8px 24px rgba(31, 111, 214, .4);
}
:root[data-theme="dark"] .chat-fab { color: #06152d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-fab { color: #06152d; } }
.chat-fab .icon { width: 22px; height: 22px; }
.chat-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 55; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 100px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
@media (max-width: 520px) { .chat-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-head .av { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.chat-head b { display: block; font-size: .95rem; }
.chat-head small { color: var(--muted); font-size: .78rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .msg.user { color: #06152d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.user { color: #06152d; } }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.err { align-self: center; background: var(--bad-soft); color: var(--bad); font-size: .85rem; }
.chat-suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.chat-suggest button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .82rem; cursor: pointer; }
.chat-suggest button:hover { border-color: var(--brand); color: var(--brand); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form .input { min-height: 44px; }

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--faint); }
.kbd { font-family: ui-monospace, monospace; font-size: .85em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .chat-fab, .chat-panel, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
@media (max-width: 520px) { .hide-sm { display: none; } .header-actions .btn-sm { padding: 6px 10px; } }
@media (max-width: 520px) {
  .brand small { display: none; }
  .brand img { width: 34px; height: 34px; }
  .site-header .bar { gap: 8px; }
  .header-actions { gap: 6px; }
  .header-actions .btn-sm { min-width: 40px; min-height: 40px; padding: 6px 10px; }
  .chat-fab { padding: 14px; right: 12px; bottom: 12px; }
  .chat-fab span { display: none; }
}
html, body { overflow-x: clip; }
[hidden] { display: none !important; }
.msg code { font-size: .88em; padding: 1px 5px; border-radius: 5px; background: rgba(127,127,127,.15); }

/* ---------------------------------------------------------------- speaking practice */
.cue-list { margin: 8px 0 0 18px; padding: 0; }
.cue-list li { margin: 4px 0; }
.speak-panel .stage { animation: fadein .2s; }
.rec-indicator { display: inline-flex; align-items: center; gap: 10px; color: var(--bad); font-weight: 600; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1s ease-in-out infinite; }
.level { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.level > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--brand)); border-radius: 999px; transition: width .08s linear; }
.pad-md { padding: 16px 18px; }
.timer.low b { color: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media print { .speak-panel, .no-print { display: none !important; } }

/* ---------------------------------------------------------------- mock exam & progress */
.mock-banner { background: linear-gradient(135deg, color-mix(in srgb, var(--brand-soft) 70%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.exam-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 16px 0 12px; }
.exam-progress { display: flex; gap: 6px; flex: 1; min-width: 160px; }
.exam-progress i { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); }
.exam-progress i.done { background: var(--brand); }
.exam-progress i.now { background: var(--brand); opacity: .45; animation: pulse 1.2s ease-in-out infinite; }
.examiner { display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; }
.examiner .av { width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; position: relative; }
.examiner .av .icon { width: 26px; height: 26px; }
.examiner .av.talking::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--brand); animation: pulse 1s ease-in-out infinite; }
.examiner .bubble { background: var(--surface-2); border-radius: 4px 18px 18px 18px; padding: 14px 18px; font-size: 1.08rem; line-height: 1.5; }
.examiner .bubble .q { font-weight: 600; }
.mock-card { border: 2px dashed color-mix(in srgb, var(--brand) 50%, var(--border)); border-radius: 14px; padding: 14px 18px; background: var(--surface); }
.heard { border-left: 3px solid var(--border); padding: 6px 12px; color: var(--muted); font-size: .92rem; }
.stage-ready .big { font-size: 1.1rem; }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--ok); flex-shrink: 0; margin-top: 2px; }
.prog-chart { width: 100%; height: auto; display: block; }
.prog-chart .grid { stroke: var(--border); stroke-width: 1; }
.prog-chart .lbl { fill: var(--muted); font-size: 11px; font-family: inherit; text-anchor: end; }
.prog-chart .lbl.end { text-anchor: end; }
.prog-chart text.lbl:not(.end):not(.target-lbl) { text-anchor: end; }
.prog-chart .target { stroke: var(--warn); stroke-dasharray: 6 5; stroke-width: 1.5; }
.prog-chart .target-lbl { fill: var(--warn); font-weight: 600; }
.prog-chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.prog-chart .line.speak { stroke: var(--brand); }
.prog-chart .line.write { stroke: var(--ok); }
.prog-chart .dot { stroke: var(--surface); stroke-width: 2; }
.prog-chart .dot.speak { fill: var(--brand); }
.prog-chart .dot.write { fill: var(--ok); }
.prog-chart .dot.mock { stroke: var(--brand); fill: var(--surface); stroke-width: 3; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; background: var(--brand); }
.legend .write::before { background: var(--ok); }
.legend .mock::before { background: var(--surface); border: 3px solid var(--brand); width: 8px; height: 8px; }
.legend .target::before { background: none; border-top: 2px dashed var(--warn); border-radius: 0; height: 0; width: 14px; vertical-align: 3px; }
.goal-box b.big { font-size: 2rem; line-height: 1; }
.gap { font-size: .85rem; font-weight: 600; }
.gap.up { color: var(--warn); }
.gap.ok { color: var(--ok); }
.plan-item { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.plan-item .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.plan-item h4 { margin: 0 0 2px; font-size: 1rem; }
.plan-item p { margin: 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 640px) { .plan-item { grid-template-columns: 42px 1fr; } .plan-item .btn { grid-column: 2; justify-self: start; } .examiner { grid-template-columns: 44px 1fr; } }
@media print { .exam-top, .speak-panel { display: none; } }
.turn-corr { margin: 6px 0 0 12px; display: grid; gap: 4px; font-size: .9rem; }
.turn-corr div { padding: 6px 10px; border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.turn-corr del { color: var(--bad); margin-right: 6px; }
.turn-corr ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.turn-corr .why { color: var(--muted); font-size: .82rem; margin-left: 6px; }
.speaking-now { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 10px; background: var(--brand-soft) !important; }
.listen-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- talk to the tutor */
.mode-grid label.tile { cursor: pointer; position: relative; }
.mode-tile input { position: absolute; opacity: 0; inset: 0; }
.mode-tile:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.talk-card { display: flex; flex-direction: column; min-height: 60vh; max-height: 80vh; }
.talk-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.talk-log.static { max-height: none; overflow: visible; padding: 0; }
.talk-row { display: flex; gap: 10px; align-items: flex-start; max-width: 90%; }
.talk-row.me { align-self: flex-end; flex-direction: row-reverse; }
.talk-row .msg { max-width: none; font-size: 1.02rem; }
.talk-av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; position: relative; }
.tutor-talking .talk-row.bot:last-of-type .talk-av::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--brand); animation: pulse 1s ease-in-out infinite; }
.corr-box { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.corr-box del { color: var(--bad); }
.corr-box ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.corr-box .why, .corr .why { color: var(--muted); font-size: .82rem; }
.help-box { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--text); font-size: .92rem; border-left: 3px solid var(--warn); }
.link-btn { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 4px 0; font: inherit; font-size: .82rem; }
.link-btn:hover { text-decoration: underline; }
.talk-controls { border-top: 1px solid var(--border); padding: 16px 18px; }
.mic-btn { display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 16px 28px; font: inherit; font-weight: 700; font-size: 1.05rem; color: #fff; background: var(--brand); cursor: pointer; box-shadow: 0 6px 20px rgba(31,111,214,.3); transition: transform .1s, background .2s; }
.mic-btn .icon { width: 24px; height: 24px; }
.mic-btn:hover { transform: translateY(-1px); }
.mic-btn.on { background: var(--bad); box-shadow: 0 0 0 8px var(--bad-soft); animation: pulse 1.2s ease-in-out infinite; }
.mic-btn:disabled { opacity: .6; cursor: wait; animation: none; }

/* ---------------------------------------------------------------- pronunciation & pictures */
.word-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 8px 12px; font: inherit; cursor: pointer; text-align: left; display: grid; gap: 2px; color: var(--text); }
.word-chip:hover { border-color: var(--brand); }
.word-chip b { font-size: 1rem; }
.word-chip span { color: var(--muted); font-size: .8rem; }
.word-chip small { color: var(--bad); font-size: .75rem; }
.word-chip.ok { border-color: var(--ok); background: var(--ok-soft); }
.word-chip.bad { border-color: var(--bad); background: var(--bad-soft); }

/* ---------------------------------------------------------------- avatar */
.avatar-wrap { width: 64px; height: 64px; flex-shrink: 0; }
.examiner .av.avatar-wrap { width: 64px; height: 64px; background: none; }
.avatar { width: 100%; height: 100%; display: block; }
.avatar .av-eyes { transform-origin: 60px 62px; animation: av-blink 4.5s infinite; }
.avatar .av-mouth { transform-origin: 60px 84px; transform: scaleY(.35); opacity: 0; }
.avatar .av-smile { opacity: 1; }
.tutor-talking .avatar .av-mouth, .talking .avatar .av-mouth, .av.talking .avatar .av-mouth { opacity: 1; animation: av-talk .22s ease-in-out infinite alternate; }
.tutor-talking .avatar .av-smile, .talking .avatar .av-smile, .av.talking .avatar .av-smile { opacity: 0; }
@keyframes av-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes av-talk { from { transform: scaleY(.3); } to { transform: scaleY(1.6); } }
.talk-head { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
@media (prefers-reduced-motion: reduce) { .avatar .av-eyes, .avatar .av-mouth { animation: none !important; } }
