/* ============ Roastly — dark ember design system ============ */
:root {
  --bg: #0A0908;
  --bg-2: #0F0D0B;
  --surface: #14110F;
  --surface-2: #1B1714;
  --line: color-mix(in srgb, var(--text) 8%, transparent);
  --line-2: color-mix(in srgb, var(--text) 16%, transparent);
  --text: #F5EFE7;
  --muted: #A89E93;
  --dim: #6F665D;
  --ember: #FF5A1F;
  --ember-2: #FF8A3D;
  --amber: #FFC46B;
  --ok: #7BE38F;
  --bad: #FF6A5C;
  --ac: var(--ember);               /* current trainer accent */
  --on-ac: #160A04;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Inter Tight', 'Onest', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --body: 'Onest', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* film grain */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main { position: relative; z-index: 2; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--ember); color: var(--on-ac); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ic { width: 20px; height: 20px; flex: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.05em; }
.logo-mark { width: 26px; height: 26px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ember) 50%, transparent)); }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.trainer-chip { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; font-size: 14px; transition: border-color .2s; min-height: 44px; }
.trainer-chip:hover { border-color: var(--ac); }
.trainer-chip .mini { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--ac) 35%, transparent), transparent 70%), var(--bg); display: grid; place-items: center; overflow: hidden; }
.trainer-chip .mini svg { width: 46px; margin-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .25s;
}
.btn:hover { border-color: color-mix(in srgb, var(--text) 32%, transparent); background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--ember);
  border-color: transparent; color: var(--on-ac);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { background: color-mix(in srgb, var(--ember) 85%, #fff); border-color: transparent; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
section, section.wrap { padding-top: clamp(56px, 7vw, 96px); padding-bottom: clamp(56px, 7vw, 96px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow .live { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 12px var(--ember); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 540px; margin: 0; }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(32px, 4.4vw, 58px); letter-spacing: -0.05em; }
.sec-head .eyebrow { grid-column: 1 / -1; margin-bottom: -12px; }

/* ---------- Hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; min-height: min(860px, calc(100vh - 72px)); padding: 32px 0 56px; }
.hero h1 { font-size: clamp(44px, 6.6vw, 92px); margin: 24px 0 24px; font-weight: 600; letter-spacing: -0.055em; }
.hero h1 .burn { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.02em; padding-right: .06em; background: linear-gradient(100deg, var(--amber) 0%, var(--ember-2) 45%, var(--ember) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }
.hero-meta { display: flex; gap: 28px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.hero-meta b { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.hero-meta span { font-size: 13px; color: var(--muted); }

.stage { position: relative; aspect-ratio: 1 / 1.02; display: grid; place-items: center; }
.stage::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--ac) 30%, transparent), transparent 62%); filter: blur(30px); }
.stage .ring { position: absolute; border-radius: 50%; border: 1px solid var(--line); }
.stage .ring.r1 { inset: 10%; }
.stage .ring.r2 { inset: 0; border-style: dashed; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage .av { position: relative; width: 100%; transform: scale(1.18) translateY(-2%); }

.demo-card {
  position: absolute; z-index: 3; width: min(320px, 78%);
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px 16px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8);
  font-size: 14px; transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.demo-card.you { left: -14%; top: 14%; width: min(240px, 60%); }
.demo-card.ai { right: -12%; bottom: -9%; width: min(290px, 70%); }
.demo-card .who { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.demo-card .who i { width: 6px; height: 6px; border-radius: 50%; background: var(--ac); }
.demo-card .txt { font-weight: 500; }
.demo-card.ai .txt { font-weight: 600; }
.demo-card .fixline { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-family: var(--mono); font-size: 12.5px; }
.demo-card .fixline s { color: var(--bad); text-decoration-thickness: 2px; }
.demo-card .fixline b { color: var(--ok); font-weight: 500; }
.demo-card.hide { opacity: 0; transform: translateY(8px); }

/* ---------- Ticker ---------- */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; padding: 18px 0; background: var(--bg-2); }
.ticker div { display: inline-block; animation: scroll 50s linear infinite; }
.ticker span { font-family: var(--serif); font-style: italic; font-size: 20px; font-weight: 500; color: var(--dim); margin: 0 18px; }
.ticker span b { color: var(--ember); font-weight: 500; margin-right: 18px; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Trainers ---------- */
.trainers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tcard {
  --ac: var(--ember);
  position: relative; text-align: left; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .3s, transform .35s var(--ease), box-shadow .35s;
  display: flex; flex-direction: column;
}
.tcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--ac) 40%, transparent); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9); }
.tcard.selected { border-color: var(--ac); }
.tcard .art { position: relative; aspect-ratio: 1 / .92; display: grid; place-items: center; background: radial-gradient(circle at 50% 75%, color-mix(in srgb, var(--ac) 22%, transparent), transparent 65%); }
.tcard .art .av { width: 78%; }
.tcard .sel { position: absolute; top: 14px; right: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--ac); color: var(--on-ac); font-weight: 600; opacity: 0; }
.tcard.selected .sel { opacity: 1; }
.tcard .body { padding: 4px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tcard h3 { font-size: 24px; font-weight: 600; }
.tcard .tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ac); }
.tcard p { margin: 0; font-size: 14.5px; color: var(--muted); }
.tcard q { display: block; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; quotes: none; color: var(--text); }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.step { padding: 32px 28px 36px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.step:last-child { border-right: 0; }
.step .ic-box { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ember-2); }
.step h3 { font-size: 22px; font-weight: 600; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Evolution ---------- */
.evo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: end; }
.evo-item { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 16px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); position: relative; }
.evo-item .av { width: var(--s); }
.evo-item b { font-family: var(--display); font-weight: 600; font-size: 18px; }
.evo-item span { font-size: 13px; color: var(--muted); }
.evo-item.locked .av { filter: grayscale(1) brightness(.45); }
.evo-item .lock { position: absolute; top: 14px; right: 14px; color: var(--dim); }

/* ---------- Pricing ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 28px; display: flex; flex-direction: column; gap: 18px; }
.plan.hot { background: linear-gradient(180deg, color-mix(in srgb, var(--ember) 7%, transparent), var(--surface) 45%); border-color: color-mix(in srgb, var(--ember) 45%, transparent); }
.plan .badge { position: absolute; top: -12px; left: 28px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--ember); color: var(--on-ac); font-weight: 600; }
.plan h3 { font-size: 18px; font-weight: 600; }
.plan .price { font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.plan .price small { font-family: var(--body); font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; font-size: 15px; color: var(--muted); }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li .ic { width: 18px; height: 18px; color: var(--ember-2); margin-top: 3px; }

.cta-final { text-align: center; padding: clamp(56px, 8vw, 96px) 24px; border: 1px solid var(--line); border-radius: 36px; background: radial-gradient(ellipse at 50% 130%, color-mix(in srgb, var(--ember) 16%, transparent), transparent 60%), var(--surface); }
.cta-final h2 { font-size: clamp(34px, 5vw, 64px); max-width: 820px; margin: 0 auto 18px; }
.cta-final .lead { margin: 0 auto 32px; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--dim); font-size: 13.5px; position: relative; z-index: 2; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Call ---------- */
.call { display: grid; grid-template-columns: 1fr 380px; gap: 16px; padding: 20px 0 32px; min-height: calc(100vh - 72px); }
.call-stage {
  position: relative; border: 1px solid var(--line); border-radius: 32px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 24px 28px; min-height: 600px;
  background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--ac) 20%, transparent), transparent 60%), var(--bg-2);
  transition: background .5s;
}
.call-stage.angry { background: radial-gradient(ellipse at 50% 90%, rgba(255, 50, 20, .38), transparent 62%), #120806; }
.call-stage.happy { background: radial-gradient(ellipse at 50% 90%, color-mix(in srgb, var(--ac) 32%, transparent), transparent 62%), var(--bg-2); }
.call-top { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; z-index: 2; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.rec { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: pulse 1s infinite; }
.call-avatar { position: relative; width: min(360px, 72%); z-index: 1; transition: transform .12s linear; }
.call-avatar .av { width: 100%; }
.call-name { font-family: var(--display); font-weight: 600; font-size: 28px; margin-top: 6px; letter-spacing: -0.04em; }
.call-status { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; min-height: 1.5em; text-align: center; }
.call-say { max-width: 640px; text-align: center; font-size: clamp(18px, 2vw, 22px); font-weight: 500; margin-top: 18px; min-height: 2.8em; line-height: 1.4; text-wrap: balance; }
.call-say.shout { font-weight: 600; color: #FFD9C9; }
.call-task { margin-top: 10px; display: none; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--ac) 60%, transparent); font-size: 14.5px; }
.call-task.show { display: inline-flex; }
.call-task .mono { color: var(--ac); }
.call-interim { margin-top: 12px; color: var(--muted); font-style: italic; min-height: 1.5em; text-align: center; }
.call-controls { display: flex; gap: 14px; margin-top: 26px; align-items: center; }
.round { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); display: grid; place-items: center; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.round:hover { border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.round:active { transform: scale(.94); }
.round.big { width: 76px; height: 76px; }
.round.go { background: var(--text); border-color: transparent; color: var(--bg); }
.round.go:hover { background: #fff; }
.round.end { background: var(--bad); border-color: transparent; color: #2a0603; box-shadow: 0 10px 40px -8px color-mix(in srgb, var(--bad) 60%, transparent); }
.round.off { background: var(--text); color: var(--bg); }
.round[disabled] { opacity: .35; pointer-events: none; }
.round .ic { width: 24px; height: 24px; }
.round.big .ic { width: 30px; height: 30px; }
.talk {
  display: inline-flex; align-items: center; gap: 12px; height: 76px; padding: 0 30px 0 26px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ac) 60%, transparent);
  background: color-mix(in srgb, var(--ac) 18%, var(--surface-2)); color: var(--text);
  font-weight: 600; font-size: 16px; user-select: none; -webkit-user-select: none; touch-action: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.talk .ic { width: 26px; height: 26px; color: var(--ac); }
.talk:hover { background: color-mix(in srgb, var(--ac) 26%, var(--surface-2)); }
.talk.on { transform: scale(1.06); background: var(--ac); color: var(--on-ac); box-shadow: 0 0 0 10px color-mix(in srgb, var(--ac) 18%, transparent), 0 0 60px color-mix(in srgb, var(--ac) 60%, transparent); }
.talk.on .ic { color: var(--on-ac); }
.talk[hidden], .round[hidden] { display: none; }
.call-hint { margin-top: 14px; font-size: 13.5px; color: var(--dim); text-align: center; max-width: 440px; min-height: 1.4em; }
.call-stage.listening .call-interim { color: var(--text); font-style: normal; font-size: 18px; }
.wave { display: flex; align-items: center; gap: 3px; height: 28px; margin-top: 18px; }
.wave i { width: 3px; height: 2px; border-radius: 2px; background: var(--ac); opacity: .55; transition: height .08s; }
.call-stage:not(.on-call) .wave { opacity: 0; }

.call-side { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; font-family: var(--body); }
.field { margin-top: 14px; }
.field > span { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 36px; padding: 0 6px; font-weight: 500; font-size: 13.5px; color: var(--muted); transition: background .2s, color .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.seg.heat button.on { background: color-mix(in srgb, var(--ac) 22%, var(--surface-2)); }
.log-panel { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 240px; max-height: 50vh; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.msg { padding: 10px 14px; border-radius: 16px; font-size: 14.5px; max-width: 90%; line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: color-mix(in srgb, var(--ac) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--ac) 25%, transparent); border-bottom-left-radius: 6px; }
.msg.ai.angry { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.fix { align-self: stretch; border-radius: 14px; border: 1px dashed var(--line-2); padding: 10px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.fix .row { display: flex; gap: 8px; align-items: baseline; font-family: var(--mono); font-size: 13px; }
.fix .row .ic { width: 14px; height: 14px; align-self: center; }
.fix s { color: var(--bad); }
.fix b { color: var(--ok); font-weight: 500; }
.fix .rule { color: var(--muted); }
.empty { color: var(--dim); font-size: 14px; text-align: center; margin: auto; max-width: 240px; }
.typebox { display: flex; gap: 8px; }
.typebox input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--line-2); border-radius: 999px; padding: 0 16px; font: inherit; font-size: 14.5px; background: var(--bg); color: var(--text); }
.typebox input::placeholder { color: var(--dim); }
.typebox input:focus { outline: none; border-color: var(--ac); }
.typebox button { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--ac); color: var(--on-ac); display: grid; place-items: center; }
.engine { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--dim); display: flex; gap: 12px; flex-wrap: wrap; }
.engine b { color: var(--muted); font-weight: 500; }

/* ---------- Tests ---------- */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.level { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 26px 24px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; min-height: 200px; transition: border-color .3s, transform .35s var(--ease); }
.level:hover { transform: translateY(-3px); border-color: var(--line-2); }
.level .lv { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; letter-spacing: -0.05em; margin-bottom: auto; background: linear-gradient(180deg, var(--text), var(--dim)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.level b { font-weight: 600; font-size: 17px; margin-top: 18px; }
.level span { color: var(--muted); font-size: 14px; }
.level .heat { position: absolute; top: 26px; right: 26px; display: flex; gap: 4px; }
.level .heat i { width: 6px; height: 18px; border-radius: 3px; background: var(--line-2); }
.level .heat i.on { background: var(--ember); box-shadow: 0 0 10px color-mix(in srgb, var(--ember) 60%, transparent); }
.level .best { font-family: var(--mono); font-size: 12px; color: var(--ok); margin-top: 8px; }

.quiz { max-width: 780px; margin: 0 auto; padding: 40px 0 180px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.quiz-top a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; min-height: 44px; }
.quiz-top a:hover { color: var(--text); }
.progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 28px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--ember)); transition: width .5s var(--ease); box-shadow: 0 0 12px var(--ember); }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: 32px; padding: clamp(24px, 4vw, 44px); }
.qcard .qnum { margin-bottom: 14px; }
.qcard .qtext { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3.2vw, 36px); margin: 0 0 30px; line-height: 1.15; letter-spacing: -0.035em; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { text-align: left; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg-2); padding: 16px 18px; font-weight: 500; font-size: 16.5px; min-height: 60px; display: flex; gap: 14px; align-items: center; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.opt:hover:not([disabled]) { border-color: color-mix(in srgb, var(--text) 35%, transparent); background: var(--surface-2); }
.opt:active:not([disabled]) { transform: scale(.985); }
.opt .k { width: 28px; height: 28px; flex: none; border: 1px solid var(--line-2); border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.opt.right .k { background: var(--ok); color: #062010; border-color: transparent; }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); animation: shake .4s; }
.opt.wrong .k { background: var(--bad); color: #2a0603; border-color: transparent; }
.opt[disabled] { cursor: default; }
.opt[disabled]:not(.right):not(.wrong) { opacity: .5; }
.explain { margin-top: 18px; padding: 14px 16px 14px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.explain .ex { display: flex; gap: 10px; align-items: center; }
.explain .ic.ok { color: var(--ok); }
.explain .ic.no { color: var(--bad); }
.result { text-align: center; }
.result .av { width: 220px; margin: 0 auto; display: block; }
.result .score { font-family: var(--display); font-weight: 700; font-size: clamp(72px, 12vw, 128px); line-height: 1; letter-spacing: -0.06em; }
.result .score small { font-size: .4em; color: var(--dim); }

/* ---------- Ember creature animation ---------- */
.av { overflow: visible; }
.av .mouth, .av .e-happy-eye { display: none; }
.av.mood-neutral:not(.talking) .m-neutral,
.av.mood-neutral.talking .m-talk,
.av.mood-happy .m-happy,
.av.mood-angry .m-angry { display: inline; }
.av.mood-happy .e-eye { display: none; }
.av.mood-happy .e-happy-eye { display: inline; }
.av * { transform-box: fill-box; }
.av .mouth, .av .e-brow, .av .e-lid, .av .fl, .av .sp, .av .e-pupil { transform-origin: center; }
.av .fl { transform-origin: 50% 100%; animation: flick 1.6s ease-in-out infinite alternate; }
.av .fl2 { animation-duration: 1.2s; animation-delay: -.4s; }
.av .fl3 { animation-duration: 1.9s; animation-delay: -.9s; }
.av .e-body { transform-origin: 50% 100%; transform-box: fill-box; animation: breathe 3.4s ease-in-out infinite; }
.av .e-aura { animation: aura 3.4s ease-in-out infinite; transform-origin: center; }
.av .e-cracks { animation: veins 2.4s ease-in-out infinite; }
.av .e-core { animation: veins 3s ease-in-out infinite; }
.av .e-brow { transition: transform .25s var(--ease); }
.av .e-lid { transform: translateY(-14px); transition: transform .25s var(--ease); }
.av .sp { opacity: 0; }
.av .sp { animation: spark 2.6s ease-out infinite; }
.av .s2 { animation-delay: .5s; } .av .s3 { animation-delay: 1s; } .av .s4 { animation-delay: 1.4s; } .av .s5 { animation-delay: 1.9s; } .av .s6 { animation-delay: 2.2s; }
.av .e-pupil { transition: transform .25s; }
/* angry */
.av.mood-angry .e-brow { transform: translateY(9px) scaleX(.92); }
.av.mood-angry .e-lid { transform: translateY(2px); }
.av.mood-angry .e-pupil { transform: scaleX(.5); }
.av.mood-angry .fl { animation-duration: .35s; transform: scaleY(1.25); }
.av.mood-angry .e-body { animation: rage .14s linear infinite; }
.av.mood-angry .e-aura { animation: aura-hot .5s ease-in-out infinite alternate; }
.av.mood-angry .e-cracks { animation: veins .3s ease-in-out infinite; stroke-width: 3.6; }
.av.mood-angry .sp { animation-duration: .9s; }
.av.mood-angry { filter: saturate(1.3) brightness(1.08); }
/* happy */
.av.mood-happy .e-body { animation: hop .55s ease-in-out infinite alternate; }
.av.mood-happy .e-brow { transform: translateY(-8px); }
.av.mood-happy .fl { animation-duration: .8s; }
/* talking */
.av.talking .mouth { animation: talk .14s ease-in-out infinite alternate; }

@keyframes flick { 0% { transform: scaleY(.88) skewX(-4deg); opacity: .85; } 50% { transform: scaleY(1.06) skewX(3deg); } 100% { transform: scaleY(.96) skewX(-2deg); opacity: 1; } }
@keyframes breathe { 50% { transform: scale(1.025, .985); } }
@keyframes aura { 50% { opacity: .7; transform: scale(.96); } }
@keyframes aura-hot { from { opacity: .9; transform: scale(1.02); } to { opacity: 1; transform: scale(1.12); } }
@keyframes veins { 50% { opacity: .55; } }
@keyframes spark { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46px) translateX(6px); } }
@keyframes rage { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-2.5px, 1px) rotate(-1deg); } 75% { transform: translate(2.5px, -1px) rotate(1deg); } }
@keyframes hop { from { transform: translateY(0) scale(1.02, .98); } to { transform: translateY(-8px) scale(.98, 1.02); } }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1.15); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- Crawling buddy ---------- */
#buddy-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.buddy { position: absolute; left: 0; top: 0; width: 96px; pointer-events: auto; cursor: grab; will-change: transform; touch-action: none; }
.buddy:active { cursor: grabbing; }
.buddy .buddy-av { position: relative; }
.buddy .buddy-av .av { width: 96px; display: block; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .6)); }
.buddy .legs { display: flex; justify-content: center; gap: 20px; margin-top: -14px; }
.buddy .legs i { width: 6px; height: 16px; background: #1c1411; border: 1px solid rgba(0, 0, 0, .6); border-radius: 3px; transform-origin: top center; position: relative; }
.buddy .legs i::after { content: ''; position: absolute; bottom: -3px; left: -5px; width: 14px; height: 6px; border-radius: 4px; background: #1c1411; }
.buddy.walking .legs i:first-child { animation: leg .22s infinite alternate; }
.buddy.walking .legs i:last-child { animation: leg .22s infinite alternate-reverse; }
.buddy.walking .buddy-av { animation: waddle .22s infinite alternate; }
.buddy.flip .buddy-av { transform: scaleX(-1); }
.buddy.flip.walking .buddy-av { animation: waddleF .22s infinite alternate; }
.buddy.jump .buddy-av { animation: jump .5s 2; }
@keyframes leg { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes waddle { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-3px); } }
@keyframes waddleF { from { transform: scaleX(-1) rotate(-4deg); } to { transform: scaleX(-1) rotate(4deg) translateY(-3px); } }
@keyframes jump { 50% { transform: translateY(-36px); } }
.buddy-bubble { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; transform-origin: bottom center; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px 12px; font-weight: 600; font-size: 13.5px; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .8); transition: transform .25s var(--ease), opacity .2s; width: max-content; max-width: 240px; text-align: center; pointer-events: none; }
.buddy-bubble.show { transform: translateX(-50%) scale(1); opacity: 1; }
.buddy-bubble.angry { border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: #2a0f0a; color: #FFD9C9; }
.buddy-bubble.happy { border-color: color-mix(in srgb, var(--ac) 60%, transparent); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(8px); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 32px; padding: 28px; max-width: 1100px; width: 100%; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; }
.modal-head h2 { font-size: clamp(24px, 3vw, 34px); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .trainers { grid-template-columns: repeat(2, 1fr); }
  .call { grid-template-columns: 1fr; }
  .log { max-height: 44vh; }
  .pricing, .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .evo { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .stage { max-width: 440px; width: 100%; margin: 0 auto; }
  .sec-head { grid-template-columns: 1fr; gap: 16px; }
  .levels { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .opts { grid-template-columns: 1fr; }
  .trainers, .levels { grid-template-columns: 1fr; }
  .trainer-chip .lbl { display: none; }
  .trainer-chip { padding: 4px; }
  .demo-card.you { left: 0; }
  .demo-card.ai { right: 0; }
  .buddy, .buddy .buddy-av .av { width: 72px; }
  .call-stage { min-height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Editorial accents ---------- */
.serif { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.02em; color: var(--muted); }
.eyebrow { letter-spacing: .14em; }
.trainer-chip, .btn { letter-spacing: -0.01em; }
.tcard .sel { background: transparent; color: var(--ac); border: 1px solid currentColor; }
.level .lv { font-weight: 600; letter-spacing: -0.06em; }
.result .score { font-weight: 600; }
.evo-item { background: transparent; }

[hidden] { display: none !important; }

/* 18+ mode */
.seg.heat button.adult.on { background: #5a0f0a; color: #FFD9C9; box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 60%, transparent) inset; }
.adult-box { max-width: 520px; }
.adult-box h2 { font-size: 26px; margin-bottom: 14px; }
.adult-box p { color: var(--muted); }

/* ---------- Ember buddy v2: teleports, perches, peeks ---------- */
.buddy2 { position: absolute; left: 0; top: 0; width: 92px; pointer-events: auto; cursor: pointer; z-index: 2; }
.buddy2.b-hidden { visibility: hidden; }
.buddy2 .b-bob { animation: bFloat 3.2s ease-in-out infinite; }
.buddy2 .b-scale { transform-origin: 50% 85%; }
.buddy2 .b-body { transform-origin: 50% 90%; transition: transform .35s var(--ease); }
.buddy2 .b-body .av { width: 100%; display: block; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.buddy2.b-out .b-scale { animation: bOut .24s ease-in forwards; }
.buddy2.b-in .b-scale { animation: bIn .42s cubic-bezier(.3, 1.7, .5, 1) both; }
.buddy2.b-hop .b-bob { animation: bHop .45s ease-out 2; }
.buddy2.b-shake .b-bob { animation: bShake .12s linear 6; }
.buddy2.b-thinking .b-body { transform: rotate(-10deg) !important; }
@keyframes bFloat { 50% { transform: translateY(-5px); } }
@keyframes bOut { to { transform: scale(.15) rotate(25deg); opacity: 0; filter: brightness(2.2) saturate(1.6); } }
@keyframes bIn { from { transform: scale(.15) rotate(-25deg); opacity: 0; filter: brightness(2.4); } 60% { opacity: 1; } to { transform: scale(1) rotate(0); opacity: 1; filter: none; } }
@keyframes bHop { 40% { transform: translateY(-26px) scale(1.04, .96); } 70% { transform: translateY(0) scale(1.06, .92); } }
@keyframes bShake { 25% { transform: translateX(-4px) rotate(-3deg); } 75% { transform: translateX(4px) rotate(3deg); } }

.buddy2 .b-fx { position: absolute; inset: 0; pointer-events: none; }
.buddy2 .b-fx i { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--hot, #FFE7A3); box-shadow: 0 0 10px 2px var(--ac); animation: bSpark .65s ease-out forwards; transform: scale(var(--s)); }
@keyframes bSpark { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

.buddy2 .b-bubble { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%) scale(.6); transform-origin: bottom center; opacity: 0; pointer-events: none; width: max-content; max-width: 230px; text-align: center; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 13.5px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); transition: transform .25s var(--ease), opacity .2s; z-index: 3; }
.buddy2.b-bubble-below .b-bubble { bottom: auto; top: calc(100% + 2px); transform-origin: top center; }
.buddy2 .b-bubble.show { opacity: 1; transform: translateX(-50%) scale(1); }
.buddy2 .b-bubble.angry { background: #2a0f0a; border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: #FFD9C9; }
.buddy2 .b-bubble.happy { border-color: color-mix(in srgb, var(--ac) 60%, transparent); }
.buddy2 .b-bubble.think { background: var(--bg-2); color: var(--muted); font-style: italic; border-style: dashed; border-radius: 20px; }
@media (max-width: 560px) { .buddy2 { width: 70px; } }
@media (prefers-reduced-motion: reduce) { .buddy2 .b-bob { animation: none; } }
.buddy2 .b-bubble { transform: translateX(calc(-50% + var(--bx, 0px))) scale(.6); }
.buddy2 .b-bubble.show { transform: translateX(calc(-50% + var(--bx, 0px))) scale(1); }
@media (max-width: 560px) { .buddy2 .b-bubble { max-width: 190px; font-size: 12.5px; padding: 7px 10px; } }

/* ---------- plans: pricing toggle, paywall, locks ---------- */
.pricing-wrap { display: flex; flex-direction: column; gap: 22px; }
.period-toggle { align-self: center; display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.period-toggle button { border: 0; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; min-height: 38px; padding: 0 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; transition: background .2s, color .2s; }
.period-toggle button:hover { color: var(--text); }
.period-toggle button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }
.period-toggle .save { font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--ember) 16%, transparent); color: var(--ember-2); }
.plan .price-sub { font-size: 13.5px; color: var(--muted); margin-top: -10px; min-height: 1.4em; }
.plan.current { border-color: var(--line-2); }
.plan-current { pointer-events: none; opacity: .75; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.plan-current .ic { width: 16px; height: 16px; }
.pay-note { text-align: center; margin: 0; color: var(--muted); }
.paywall { max-width: 1040px; }
.paywall .modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.paywall h2 { font-size: clamp(22px, 2.6vw, 30px); margin-top: 6px; }
.paywall .round { width: 44px; height: 44px; flex: none; }
.paywall .plan { padding: 26px 22px; }
.tcard.locked .art .av { filter: saturate(.55) brightness(.75); }
.plan-lock { position: absolute; top: 14px; left: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: rgba(10, 8, 7, .7); border: 1px solid var(--line-2); color: var(--text); backdrop-filter: blur(6px); }
.plan-lock .ic { width: 12px; height: 12px; }
.seg button.lockd { opacity: .6; }
.pay-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ember-2); }
.pay-icon .ic { width: 34px; height: 34px; }
.pay-icon.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.pay-icon.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
@media (max-width: 900px) { .paywall .pricing { grid-template-columns: 1fr; } }

/* ---------- Google sign-in ---------- */
#accountSlot { display: flex; }
.acct-in { background: transparent; }
.acct-chip { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); padding: 3px; display: grid; place-items: center; transition: border-color .2s; }
.acct-chip:hover { border-color: var(--ac); }
.acct-chip img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.acct-chip span { font-weight: 600; font-family: var(--display); }
.auth-box { max-width: 440px; text-align: center; position: relative; }
.auth-box h2 { font-size: 26px; margin: 12px 0 8px; }
.auth-box p { color: var(--muted); margin: 0 0 12px; }
.auth-x { position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; }
.auth-mark { width: 56px; height: 56px; margin: 4px auto 0; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 16%, transparent); color: var(--ac); }
.auth-mark svg { width: 26px; height: 26px; }
.auth-perks { list-style: none; padding: 0; margin: 14px auto 20px; display: grid; gap: 8px; text-align: left; width: fit-content; }
.auth-perks li { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 15px; }
.auth-perks svg { width: 18px; height: 18px; color: var(--ok); flex: none; }
.auth-btn { display: flex; justify-content: center; min-height: 44px; margin: 8px 0; }
.auth-err { color: var(--bad) !important; }
.auth-back { margin-top: 8px; }
.acct-big img { width: 72px; height: 72px; border-radius: 50%; margin-top: 4px; }
.soft-login { margin-top: 18px; }
.lesson-done .soft-login { border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; max-width: 420px; margin: 22px auto 0; }
.lesson-done .soft-login p { color: var(--muted); margin: 0 0 12px; font-size: 15px; }
.soft-login #softBtn, .side-login #sideLogin { display: flex; justify-content: center; }
.side-login p { color: var(--muted); font-size: 14px; }
.side-login .linkish { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--dim); cursor: pointer; text-decoration: underline; }
@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .top-right { gap: 6px; }
  .acct-in, #topCall { padding: 0 12px; }
  .acct-chip { width: 40px; height: 40px; }
}
@media (max-width: 400px) { .logo > span:not(.logo-cat) { display: none; } }
/* custom "Войти через Google": dark ember pill with a slowly turning glowing rim */
@property --ga { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.g-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.g-btn {
  --ga: 0deg;
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 320px; min-height: 60px; padding: 8px 8px 8px 8px; border-radius: 999px;
  color: var(--text); cursor: pointer; text-align: left; isolation: isolate;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, var(--surface-2), var(--bg-2)) padding-box,
    conic-gradient(from var(--ga), var(--line-2) 0deg, var(--ac) 70deg, var(--amber) 110deg, var(--line-2) 170deg, var(--line-2) 360deg) border-box;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent), 0 14px 40px -22px color-mix(in srgb, var(--ac) 70%, transparent);
  animation: g-rim 6s linear infinite;
  transition: transform .25s var(--ease), box-shadow .3s;
}
@keyframes g-rim { to { --ga: 360deg; } }
.g-btn::after { /* soft ember light that wakes up on hover */
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--ac) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .3s;
}
.g-btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 8%, transparent), 0 18px 50px -18px color-mix(in srgb, var(--ac) 85%, transparent); }
.g-btn:hover::after { opacity: 1; }
.g-btn:active { transform: scale(.98); }
.g-btn:focus-visible { outline: 2px solid var(--ac); outline-offset: 4px; }
.g-logo { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 4px 14px rgba(0, 0, 0, .4); }
.g-logo svg { width: 22px; height: 22px; }
.g-text { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.g-txt { font: 600 16px/1.1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.g-sub { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.g-go { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ac); color: var(--on-ac); transition: transform .3s var(--ease), box-shadow .3s; box-shadow: 0 0 18px -4px var(--ac); }
.g-go svg { width: 18px; height: 18px; }
.g-btn:hover .g-go { transform: translateX(3px); box-shadow: 0 0 26px -2px var(--ac); }
.g-btn.busy { cursor: progress; animation-duration: 1.2s; }
.g-btn.busy .g-go svg { display: none; }
.g-btn.busy .g-go::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--on-ac) 30%, transparent); border-top-color: var(--on-ac); animation: gspin .8s linear infinite; }
.g-btn.busy .g-sub { color: var(--ac); }
@keyframes gspin { to { transform: rotate(360deg); } }
.g-err { margin: 0; font-size: 13px; color: var(--bad); text-align: center; max-width: 320px; }
.side-login .g-btn { min-height: 54px; gap: 10px; }
.side-login .g-logo, .side-login .g-go { width: 38px; height: 38px; }
.side-login .g-txt { font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .g-btn { animation: none; } }

/* ============ extras: toasts, sparks, goal ring, rank, phrase, profile ============ */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; cursor: pointer; display: flex; gap: 14px; align-items: center; max-width: 360px;
  padding: 12px 18px 12px 12px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, var(--ac) 10%, transparent);
  transform: translateY(20px) scale(.96); opacity: 0; transition: transform .45s var(--ease), opacity .35s;
}
.toast.in { transform: none; opacity: 1; }
.toast b { display: block; font-family: var(--display); font-size: 15px; letter-spacing: -0.01em; }
.toast span { font-size: 13.5px; color: var(--muted); }
.toast-ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 18%, transparent); color: var(--ac); }
.toast-ic svg { width: 22px; height: 22px; }
.toast-ach .toast-ic, .toast-rank .toast-ic { background: linear-gradient(135deg, var(--amber), var(--ac)); color: var(--on-ac); box-shadow: 0 0 22px -4px var(--ac); }
.toast-goal .toast-ic { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.toast-rank { border-color: color-mix(in srgb, var(--ac) 50%, transparent); }

.ember-layer { position: fixed; inset: 0; pointer-events: none; z-index: 130; overflow: hidden; }
.ember-layer i { position: absolute; border-radius: 50%; animation: spark cubic-bezier(.15, .7, .3, 1) forwards; opacity: 0; }
@keyframes spark {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 160px)) rotate(var(--r)) scale(.2); opacity: 0; }
}

.goal-ring .gr-track { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.goal-ring .gr-fill { fill: none; stroke: var(--ac); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.goal-ring.full .gr-fill { stroke: var(--ok); filter: drop-shadow(0 0 4px var(--ok)); }
.cstat.goal { text-decoration: none; gap: 4px; padding: 0 10px 0 6px; }

.rank-card { display: block; text-decoration: none; color: inherit; transition: border-color .2s; }
.rank-card:hover { border-color: color-mix(in srgb, var(--ac) 45%, transparent); }
.rk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rk-xp { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.rk-name { display: block; font-family: var(--display); font-size: 24px; letter-spacing: -0.03em; margin-bottom: 10px; background: linear-gradient(90deg, var(--amber), var(--ac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phrase-card { position: relative; overflow: hidden; }
.phrase-card::before { content: "\201C"; position: absolute; right: 10px; bottom: -50px; font: italic 140px/1 var(--serif); color: color-mix(in srgb, var(--ac) 12%, transparent); pointer-events: none; }
.phrase-play { width: 36px; height: 36px; }
.phrase-play svg { width: 16px; height: 16px; }
.ph-en { display: block; font-family: var(--display); font-size: 19px; letter-spacing: -0.02em; line-height: 1.2; }
.ph-ru { display: block; color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.phrase-card q { display: block; font: italic 500 14.5px/1.4 var(--serif); color: var(--ac); quotes: none; }

/* profile */
.profile > section { padding: 0; }
.profile { padding-top: 32px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 22px; }
.pf-head { display: flex; align-items: center; gap: 24px; padding: 24px; background: radial-gradient(80% 140% at 0% 0%, color-mix(in srgb, var(--ac) 14%, transparent), transparent 60%), var(--surface); }
.pf-av { width: 104px; height: 104px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--ac) 35%, transparent), transparent 70%), var(--bg); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px color-mix(in srgb, var(--ac) 60%, transparent), 0 0 40px -6px var(--ac); }
.pf-av img { width: 100%; height: 100%; object-fit: cover; }
.pf-av svg { width: 130px; margin-top: 14px; }
.pf-who { flex: 1; min-width: 0; }
.pf-who h1 { font-size: clamp(28px, 4vw, 42px); margin: 4px 0 10px; }
.pf-ranks { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pf-ranks span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); }
.pf-ranks .past { color: var(--muted); border-color: var(--line-2); }
.pf-ranks .now { color: var(--on-ac); background: linear-gradient(90deg, var(--amber), var(--ac)); border-color: transparent; box-shadow: 0 0 16px -4px var(--ac); }
.pf-rank .bar { height: 8px; max-width: 520px; }
.pf-head > .btn { align-self: flex-start; }
.pf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.pf-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.pf-tile b { font-family: var(--display); font-size: 30px; letter-spacing: -0.04em; line-height: 1.1; margin-top: 8px; }
.pf-tile span:not(.pf-ic) { color: var(--muted); font-size: 14px; }
.pf-tile small { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.pf-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--ac) 14%, transparent); color: var(--ac); }
.pf-ic svg { width: 18px; height: 18px; }
.pf-grid { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 12px; }
.pf-grid > * { min-width: 0; }
.pf-goal-top { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.pf-goal-top h3 { margin: 0; }
.pf-goal-top .small { margin-top: 4px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: border-color .2s, background .2s; }
.chip b { color: var(--text); font-size: 14px; }
.chip span { font-size: 11.5px; }
.chip:hover { border-color: var(--line-2); }
.chip.on { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, var(--bg-2)); box-shadow: 0 0 20px -8px var(--ac); }
.heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.heat-months { display: grid; grid-template-columns: repeat(var(--w), 16px); gap: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--dim); height: 16px; }
.heat-months span { white-space: nowrap; }
.heat { display: flex; gap: 4px; }
.heat-col { display: grid; grid-template-rows: repeat(7, 16px); gap: 4px; }
.heat i, .heat-legend i { width: 16px; height: 16px; border-radius: 4px; background: var(--surface-2); display: block; }
.heat i.fut { background: transparent; }
.heat .l1, .heat-legend .l1 { background: color-mix(in srgb, var(--ac) 25%, var(--surface-2)); }
.heat .l2, .heat-legend .l2 { background: color-mix(in srgb, var(--ac) 50%, var(--surface-2)); }
.heat .l3, .heat-legend .l3 { background: color-mix(in srgb, var(--ac) 78%, var(--surface-2)); }
.heat .l4, .heat-legend .l4 { background: var(--amber); box-shadow: 0 0 8px -1px var(--amber); }
.heat i.today { outline: 1.5px solid var(--text); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px !important; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; }
.heat-legend span { margin: 0 4px; }
.pf-sec { margin-bottom: 14px; }
.pf-sec h2 { font-size: clamp(24px, 3vw, 34px); }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ach { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--dim); }
.ach b { color: var(--muted); font-family: var(--display); font-size: 15.5px; letter-spacing: -0.01em; margin-top: 10px; }
.ach span { font-size: 13px; }
.ach small { font-family: var(--mono); font-size: 11px; margin-top: 4px; }
.ach-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.ach-ic svg { width: 20px; height: 20px; }
.ach-bar { height: 5px; border-radius: 9px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: var(--dim); border-radius: 9px; }
.ach.got { cursor: pointer; color: var(--muted); border-color: color-mix(in srgb, var(--ac) 30%, transparent); background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--ac) 12%, transparent), transparent 70%), var(--surface); transition: transform .2s var(--ease); }
.ach.got:hover { transform: translateY(-2px); }
.ach.got b { color: var(--text); }
.ach.got .ach-ic { background: linear-gradient(135deg, var(--amber), var(--ac)); color: var(--on-ac); box-shadow: 0 0 22px -6px var(--ac); }
.pf-settings h3 { margin-bottom: 6px; }
.pf-toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.pf-settings h3 + .pf-toggle { border-top: 0; }
.pf-toggle b { display: block; font-weight: 600; font-size: 15px; }
.pf-toggle .small { margin: 2px 0 0; }
.switch { width: 52px; height: 30px; flex: none; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); position: relative; cursor: pointer; transition: background .25s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.switch[aria-checked="true"] { background: var(--ac); border-color: transparent; }
.switch[aria-checked="true"] i { transform: translateX(22px); background: var(--on-ac); }
@media (max-width: 1024px) { .pf-stats { grid-template-columns: repeat(3, 1fr); } .pf-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pf-head { flex-direction: column; text-align: center; }
  .pf-ranks { justify-content: center; }
  .pf-rank .bar { margin: 0 auto; }
  .pf-head > .btn { align-self: center; }
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
  #toasts { left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: none; }
}

/* ============ mock exams ============ */
.exams-sec { padding-top: 0; }
.exam-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.exam-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--r); text-decoration: none; color: var(--text); overflow: hidden;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--ex) 16%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--line); transition: transform .25s var(--ease), border-color .25s, box-shadow .3s;
}
.exam-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ex) 55%, transparent); box-shadow: 0 20px 50px -26px var(--ex); }
.exam-card b { font-family: var(--display); font-size: 20px; letter-spacing: -0.03em; }
.ex-desc { color: var(--muted); font-size: 14px; line-height: 1.45; flex: 1; }
.ex-meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.ex-meta svg { width: 14px; height: 14px; color: var(--ex); }
.ex-badge { align-self: flex-start; font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: .08em; padding: 5px 10px; border-radius: 8px; color: #120c08; background: var(--ex); box-shadow: 0 0 20px -6px var(--ex); }
.ex-badge.big { font-size: 15px; padding: 7px 14px; align-self: center; }
.exam-card .best { font-family: var(--mono); font-size: 11.5px; color: var(--ex); }
@media (max-width: 1024px) { .exam-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .exam-cards { grid-template-columns: 1fr; } }

.exam-intro { max-width: 720px; margin: 0 auto; padding: 32px 0 80px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.exam-intro .pt-exit { align-self: flex-start; }
.exam-intro h1 { font-size: clamp(30px, 5vw, 52px); margin: 0; }
.ex-sections { list-style: none; padding: 0; margin: 6px 0; width: 100%; display: grid; gap: 8px; text-align: left; }
.ex-sections li { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ex-sections li > .mono:first-child { color: var(--ex); font-size: 13px; }
.ex-sections li div { flex: 1; display: flex; flex-direction: column; }
.ex-sections li b { font-family: var(--display); letter-spacing: -0.01em; }
.ex-sections li span { color: var(--muted); font-size: 13.5px; }
.ex-sections li > .mono:last-child { color: var(--dim); font-size: 12px; }

.exam-run .progress i { background: linear-gradient(90deg, var(--ex), color-mix(in srgb, var(--ex) 60%, #fff)); }
.ex-timer { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; min-width: 70px; text-align: center; }
.ex-timer.low { color: var(--bad); border-color: var(--bad); animation: pulse 1s infinite; }
.pt-exit.linkish { background: none; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; }
.pt-meta { display: flex; justify-content: space-between; align-items: center; }
.ex-card .opt.sel, .ws.on, .err-seg.sel { border-color: var(--ex); background: color-mix(in srgb, var(--ex) 14%, var(--surface)); box-shadow: 0 0 0 1px var(--ex); }
.opts.tfng { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .opts.tfng { grid-template-columns: 1fr; } }

.ws-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ws { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 16px var(--body); cursor: pointer; transition: transform .15s, background .2s; }
.ws:hover { transform: translateY(-1px); }

.ctest { font-size: 18px; line-height: 2.3; margin: 10px 0 0; }
.ct-w { white-space: nowrap; }
.ct-in { font: 600 17px var(--mono); color: var(--ex); background: var(--surface-2); border: 0; border-bottom: 2px solid var(--ex); border-radius: 6px 6px 0 0; padding: 2px 4px; margin: 0 1px; outline: none; }
.ct-in:focus { background: color-mix(in srgb, var(--ex) 14%, var(--surface-2)); }

.ex-type { width: 100%; margin-top: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 17px/1.5 var(--body); resize: vertical; outline: none; }
.ex-type:focus { border-color: var(--ex); }

.ex-form { margin-top: 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 6px 18px 12px; }
.ex-form-h { padding: 10px 0; color: var(--ex); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px dashed var(--line-2); }
.ex-form label { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ex-form label span { color: var(--muted); font-size: 14px; }
.ex-form input { font: 600 16px var(--body); color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line-2); padding: 6px 2px; outline: none; }
.ex-form input:focus { border-color: var(--ex); }
@media (max-width: 560px) { .ex-form label { grid-template-columns: 1fr; gap: 2px; } }

.ord-line { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; margin: 14px 0; border-radius: 16px; border: 1px dashed var(--line-2); background: var(--bg-2); }
.ord-end { font-size: 20px; color: var(--muted); }
.ord-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.ord-tok { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 16px var(--body); cursor: pointer; }
.ord-tok.on { border-color: var(--ex); background: color-mix(in srgb, var(--ex) 14%, var(--surface)); }
.ord-tok[disabled] { opacity: .25; cursor: default; }

.err-sent { font-size: 20px; line-height: 2.2; margin-top: 12px; }
.err-seg { font: inherit; color: var(--text); background: none; border: 0; border-bottom: 2px solid var(--line-2); border-radius: 6px 6px 0 0; padding: 0 4px; cursor: pointer; }
.err-seg:hover { border-color: var(--ex); }

.exam-result { max-width: 860px; margin: 0 auto; padding: 32px 0 80px; display: flex; flex-direction: column; gap: 16px; }
.er-head { display: flex; gap: 24px; align-items: center; padding: 26px; background: radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--ex) 16%, transparent), transparent 60%), var(--surface); }
.er-av { width: 130px; flex: none; }
.er-av svg { width: 100%; }
.er-score { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 2px; }
.er-score b { font-family: var(--display); font-size: clamp(56px, 9vw, 88px); letter-spacing: -0.05em; line-height: 1; color: var(--ex); text-shadow: 0 0 40px color-mix(in srgb, var(--ex) 50%, transparent); }
.er-score span { font-family: var(--mono); color: var(--dim); font-size: 13px; }
.er-head .lead { margin: 4px 0; }
.er-review h3 { margin-bottom: 8px; }
.er-review ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.er-review li { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.er-review li:first-child { border-top: 0; }
.er-review li span { color: var(--muted); }
.er-review li small { color: var(--dim); font-size: 13px; }
.er-review s { color: var(--bad); }
@media (max-width: 560px) { .er-head { flex-direction: column; text-align: center; } .er-head .ex-badge { align-self: center; } .er-score { justify-content: center; } }

/* ============ full mock exams ============ */
.xm { max-width: 860px; margin: 0 auto; padding: 22px 16px 80px; }
.xm.wide { max-width: 1240px; }
.xm-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.xm-quit { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 6px 0; }
.xm-quit svg { width: 18px; height: 18px; }
.xm-where { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.xm-where b { font-family: var(--display); letter-spacing: -0.01em; }
.xm-where span:not(.ex-badge) { color: var(--muted); font-size: 14px; }
.xm-timer { padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 15px; min-width: 76px; text-align: center; }
.xm-timer.low { color: var(--bad); border-color: var(--bad); animation: pulse 1s infinite; }
.xm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 30px); }
.xm-title { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 14px; }
.xm-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.xm-note { color: var(--muted); font-size: 14px; }
.xm-ctx { color: var(--muted); font-style: italic; margin: 0 0 12px; }
.xm-rules { color: var(--muted); line-height: 1.7; }
.xm-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 60px 20px; }
.xm-loading p { font-family: var(--display); font-size: 20px; margin: 0; }
.xm-spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--ex, var(--ac)); animation: gspin .8s linear infinite; }

.xl-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--ex) 10%, var(--bg-2)); border: 1px solid color-mix(in srgb, var(--ex) 30%, transparent); margin-bottom: 14px; }
.xl-on { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: pulse 1.2s infinite; flex: none; }

/* question groups */
.qg { margin: 18px 0 26px; }
.qg h4 { font-family: var(--display); font-size: 16px; margin: 0 0 4px; }
.qg-ins { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.qg-title { font-family: var(--display); font-weight: 600; padding: 10px 14px; border-radius: 12px 12px 0 0; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0; }
.qg-title + .qg-q, .qg-title + .qg-opts { border-top-left-radius: 0; }
.qg-opts { display: grid; gap: 4px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 14.5px; }
.qg-opts b { display: inline-block; min-width: 28px; color: var(--ex); }
.qg-q { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qg-q p { margin: 0 0 8px; }
.qg-q.qg-gapq { align-items: baseline; line-height: 2; }
.qn { flex: none; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 8px; display: inline-grid; place-items: center; font: 600 13px var(--mono); background: var(--surface-2); color: var(--muted); }
.qg-in { font: 600 15px var(--body); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 10px; width: 170px; margin: 0 4px; outline: none; }
.qg-in:focus { border-color: var(--ex); }
.qg-choices { display: grid; gap: 6px; }
.qg-choices.row { grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px; }
.qg-choices label { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-size: 15px; }
.qg-choices label:has(input:checked) { border-color: var(--ex); background: color-mix(in srgb, var(--ex) 12%, var(--bg-2)); }
.qg-choices input { accent-color: var(--ex); margin-top: 3px; }
.qg-choices b { color: var(--ex); }
.qg-match { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: space-between; flex-wrap: wrap; }
.qg-match p { margin: 0; }
.qg-match select, .ir select { font: 600 15px var(--body); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 10px; }

/* reading split view */
.xr-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.xr-tabs button { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font: 600 15px var(--display); cursor: pointer; }
.xr-tabs button small { font: 500 11px var(--mono); color: var(--dim); }
.xr-tabs button.on { color: var(--text); border-color: var(--ex); box-shadow: 0 0 0 1px var(--ex); }
.xr { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
.xr-text { max-height: 72vh; overflow: auto; padding: 4px 18px 4px 4px; font-size: 16px; line-height: 1.7; position: sticky; top: 84px; }
.xr-text h3 { font-size: 20px; margin: 0 0 12px; }
.xr-lab { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--ex) 20%, transparent); color: var(--ex); font: 700 13px var(--mono); margin-right: 4px; }
.xr-q { max-height: 72vh; overflow: auto; padding-right: 6px; }
.xr-q .qg:first-child { margin-top: 0; }
@media (max-width: 900px) { .xr { grid-template-columns: 1fr; } .xr-text, .xr-q { max-height: none; position: static; } }

.daily { padding: 16px 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-2); }
.daily-k { display: inline-block; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ex); margin-bottom: 6px; }
.daily b { display: block; margin-bottom: 6px; }
.daily p { margin: 0; line-height: 1.6; }

/* writing */
.xw { display: grid; gap: 16px; }
.xw.two { grid-template-columns: 1fr 1.1fr; align-items: start; }
@media (max-width: 900px) { .xw.two { grid-template-columns: 1fr; } }
.xw-prompt { padding: 16px 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-2); line-height: 1.6; }
.xw-prompt p { margin: 0 0 10px; }
.xw-time { color: var(--dim); font-size: 13px; }
.xw-box textarea { width: 100%; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 16px/1.6 var(--body); resize: vertical; outline: none; }
.xw-box textarea:focus { border-color: var(--ex); }
.xw-meta { display: flex; justify-content: space-between; font: 500 12.5px var(--mono); color: var(--dim); margin-top: 6px; }
.xw-meta #xwc.ok, .xw-meta span.ok { color: var(--ok); }
.post { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-top: 10px; }
.post.prof { border-color: color-mix(in srgb, var(--ex) 40%, transparent); }
.post b { font-size: 14px; }
.post p { margin: 4px 0 0; font-size: 15px; }
.det-photo { width: 100%; max-width: 520px; border-radius: 16px; display: block; margin: 0 auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--bg-2); }

/* charts */
.w1-chart { margin: 14px 0 0; }
.w1-chart figcaption { font-weight: 600; margin-bottom: 8px; }
.w1-chart figcaption span { color: var(--muted); font-weight: 400; }
.w1-svg { width: 100%; height: auto; }
.w1-svg text { fill: var(--muted); font: 15px var(--body); }
.w1-svg .pie-l { fill: #120c08; font-weight: 700; }
.w1-svg .grid { stroke: var(--line); }
.w1-svg .axis { stroke: var(--line-2); }
.w1-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.w1-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.w1-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.w1-table th, .w1-table td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: left; }
.w1-table thead th { background: var(--surface-2); }

/* speaking */
.xs-prompt { padding: 16px 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line-2); margin-bottom: 18px; line-height: 1.6; }
.xs-prompt p { margin: 0 0 6px; }
.ra { font-size: 20px; font-family: var(--display); letter-spacing: -0.01em; }
.xs-stage { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--bg-2); }
.xs-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--dim); flex: none; }
.xs-dot.listen { background: var(--ex); box-shadow: 0 0 14px var(--ex); animation: pulse 1.2s infinite; }
.xs-dot.prep { background: var(--amber); }
.xs-dot.rec { background: var(--bad); box-shadow: 0 0 16px var(--bad); animation: pulse 1s infinite; }
.xs-phase { font-family: var(--display); font-size: 18px; flex: 1; }
.xs-meter { width: 120px; height: 8px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.xs-meter i { display: block; height: 100%; width: 0; background: var(--ex); transition: width .08s; }
.xs-nomic { color: var(--bad); font-size: 14px; }
.cue { padding: 18px 20px; border-radius: 16px; border: 1px dashed var(--line-2); background: var(--bg-2); }
.cue b { font-family: var(--display); font-size: 18px; }
.cue p { margin: 10px 0 4px; color: var(--muted); }
.cue-notes { width: 100%; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 15px var(--body); }

/* DET interactive reading */
.ir { font-size: 16.5px; line-height: 2; }
.ir.small { font-size: 14px; line-height: 1.6; color: var(--muted); }
.ir.hl { user-select: text; cursor: text; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); }
.ir.hl::selection, .ir.hl *::selection { background: color-mix(in srgb, var(--ex) 45%, transparent); }
.hl-out { color: var(--ex); font-weight: 600; }
.ctest.big { font-size: 20px; }
.ord-who { margin-right: 6px; color: var(--ex); }

/* report */
.er-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.er-sec { display: flex; flex-direction: column; gap: 2px; padding: 16px; }
.er-sec span { color: var(--muted); font-size: 14px; }
.er-sec b { font-family: var(--display); font-size: 32px; letter-spacing: -0.03em; color: var(--ex); }
.er-sec small { color: var(--dim); font-size: 12px; font-family: var(--mono); }
.er-fb h3 { margin-bottom: 6px; }
.fb-item { padding: 14px 0; border-top: 1px solid var(--line); }
.fb-item:first-of-type { border-top: 0; }
.fb-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fb-s { font: 600 13px var(--mono); color: var(--ex); }
.fb-crit { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0; font-size: 13px; color: var(--muted); }
.fb-item p { margin: 6px 0 0; color: var(--text); font-size: 15px; line-height: 1.55; }
.fb-item details { margin-top: 6px; }
.fb-item summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ex-sections li .btn { flex: none; }
@media (max-width: 560px) { .ex-sections li { flex-wrap: wrap; } .ex-sections li .btn { width: 100%; } .qg-choices.row { grid-template-columns: 1fr; } }
