:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #0d0d0d;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --line: #e7e7e7;
  --brand: #e10600;
  --brand-dark: #b30500;
  --brand-soft: #fdecec;
  --ok: #16a34a;
  --bad: #dc2626;
  --radius: 22px;
  --sidebar: 300px;
  --head: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; }
.content { padding: 36px 36px 60px; max-width: 1640px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  width: var(--sidebar); flex-shrink: 0;
  background: #ffffff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 24px 12px 16px;
  transition: width .2s ease;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 26px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--text); color: #fff;
  display: grid; place-items: center;
  font: 800 24px/1 var(--head);
}
.logo-text { font: 800 15px/1.05 var(--head); letter-spacing: .02em; }
.logo-text b { color: var(--brand); font-size: 19px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn:hover { background: #f0f0f0; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-radius: 16px;
  color: #4a4a4a; font-size: 16px;
}
.nav a:hover { background: #f3f3f3; color: var(--text); }
.nav a.active { background: var(--text); color: #fff; font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.nav-group { padding: 18px 18px 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }

.sidebar-bottom { display: flex; flex-direction: column; gap: 12px; padding: 12px 4px 0; }
.upgrade {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff;
  padding: 12px 14px; border-radius: 16px;
}
.upgrade:hover { background: var(--brand-dark); }
.upgrade svg { color: #fff; }
.upgrade span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.upgrade b { font-size: 15px; }
.upgrade small { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upgrade em { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .06em; background: rgba(255,255,255,.2); padding: 4px 8px; border-radius: 8px; }
.profile {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; flex-shrink: 0; }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.profile-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text small { color: var(--muted); font-size: 13px; }
.profile svg { width: 18px; height: 18px; color: var(--muted); }

/* Collapsed (desktop) */
.app.collapsed .sidebar { width: 88px; }
.app.collapsed .logo-text,
.app.collapsed .nav a span,
.app.collapsed .nav-group,
.app.collapsed .upgrade span,
.app.collapsed .upgrade em,
.app.collapsed .profile-text,
.app.collapsed .profile > svg { display: none; }
.app.collapsed .sidebar-top { flex-direction: column; gap: 14px; padding-inline: 0; }
.app.collapsed .nav a,
.app.collapsed .upgrade,
.app.collapsed .profile { justify-content: center; padding-inline: 0; }

.topbar { display: none; }
.scrim { display: none; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid #ececec; padding: 30px 32px; }
.eyebrow { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--text); color: #fff;
  border-radius: var(--radius);
  padding: 64px 64px; min-height: 230px;
}
.hero .eyebrow { color: var(--brand); font-weight: 600; font-size: 15px; }
.hero h1 { font: 800 clamp(30px, 4.2vw, 50px)/1.1 var(--head); margin: 10px 0 0; position: relative; z-index: 1; max-width: 70%; }
.hero-art { position: absolute; right: 0; top: 0; height: 100%; width: 42%; opacity: .8; }
.hero-art svg { width: 100%; height: 100%; stroke: var(--brand); stroke-width: 1.4; }

.grid-top { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 28vw, 500px); gap: 32px; margin-top: 32px; }

/* Question of the day */
.qotd-cols { display: grid; grid-template-columns: 1fr 1fr; margin-top: 22px; }
.qotd-col { display: flex; flex-direction: column; min-width: 0; }
.qotd-col + .qotd-col { border-left: 1px solid var(--line); padding-left: 26px; margin-left: 26px; }
.qotd-tag { font-size: 12px; font-weight: 600; color: var(--brand); background: var(--brand-soft); align-self: flex-start; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.qotd-text { flex: 1; font-size: 17px; line-height: 1.7; color: #4a4a4a; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.qotd-text strong { color: var(--text); font-weight: 500; display: block; margin-top: 12px; }
.qotd-text i { font-family: "Times New Roman", serif; font-size: 1.12em; }
.options { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-size: 15px;
}
.option:hover:not(:disabled) { border-color: var(--text); }
.option .letter { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #d0d0d0; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.option.picked { border-color: var(--text); background: #f3f3f3; }
.option.picked .letter { background: var(--text); border-color: var(--text); color: #fff; }
.option.right { border-color: var(--ok); background: #effaf3; }
.option.right .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.option.wrong { border-color: var(--bad); background: #fdf1f1; }
.option.wrong .letter { background: var(--bad); border-color: var(--bad); color: #fff; }
.option:disabled { cursor: default; }
.verdict { margin-top: 12px; font-size: 14px; line-height: 1.6; color: #4a4a4a; background: #f6f6f6; border-radius: 14px; padding: 12px 14px; }
.verdict b.ok { color: var(--ok); }
.verdict b.bad { color: var(--bad); }

.btn-outline {
  margin-top: 22px; width: 100%;
  background: #fff; border: 1px solid #dcdcdc; border-radius: 18px;
  padding: 18px; font-size: 17px; font-weight: 500;
}
.btn-outline:hover { background: #f6f6f6; }
.btn-outline:disabled { opacity: .5; cursor: default; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  padding: 16px 26px; font-size: 17px; font-weight: 600; white-space: nowrap;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary svg { width: 20px; height: 20px; }

/* Study time + calendar */
.stats { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.stats b { display: block; font: 700 42px/1.1 var(--head); }
.stats span { font-size: 14px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px 6px; margin-top: 30px; text-align: center; }
.cal .dow { font-size: 14px; color: var(--faint); padding-bottom: 6px; }
.cal .day {
  aspect-ratio: 1; max-width: 54px; width: 100%; margin: 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: #f2f2f2; font-size: 17px; color: #333;
}
.cal .day.other { background: #f8f8f8; color: #bdbdbd; }
.cal .day.studied { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.cal .day.today { background: var(--text); color: #fff; font-weight: 600; }

/* Placeholder pages */
.page-head h1 { font: 800 34px/1.2 var(--head); margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; }
.empty { margin-top: 28px; text-align: center; padding: 80px 24px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; color: var(--brand); margin-bottom: 12px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* English / Math cards */
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 32px; }
.subject-card { padding: 0; overflow: hidden; }
.subject-main { display: flex; align-items: center; gap: 18px; padding: 26px 30px; }
.subject-main:hover { background: #fafafa; }
.subject-main > svg { color: var(--faint); transition: transform .15s, color .15s; }
.subject-main:hover > svg { color: var(--brand); transform: translateX(4px); }
.subject-icon { width: 60px; height: 60px; border-radius: 18px; background: var(--text); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.subject-icon svg { width: 30px; height: 30px; }
.subject-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.subject-text b { font: 800 26px/1.2 var(--head); }
.subject-text small { font-size: 15px; color: var(--muted); }
.subject-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 30px 24px; }
.subject-links a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px 8px 12px; font-size: 15px; font-weight: 500; }
.subject-links a:hover { border-color: var(--text); }
.subject-links svg { width: 18px; height: 18px; color: var(--brand); }
.page-head .eyebrow { display: flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.page-head .eyebrow svg { width: 18px; height: 18px; }

/* Practice materials */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip { background: #fff; border: 1px solid #dcdcdc; border-radius: 999px; padding: 9px 18px; font-size: 15px; font-weight: 500; }
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.materials { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; margin-top: 20px; }
.material { display: flex; align-items: center; gap: 18px; padding: 20px 22px; transition: border-color .15s, box-shadow .15s; }
.material:hover { border-color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.material-icon { width: 56px; height: 64px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex-shrink: 0; }
.material-icon svg { width: 26px; height: 26px; }
.material-icon small { font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.material-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.material-body .qotd-tag { margin-bottom: 8px; }
.material-body b { font-size: 17px; line-height: 1.35; }
.material-body span:last-child:not(.qotd-tag) { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.material-open { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex-shrink: 0; }
.material-open svg { width: 20px; height: 20px; }
.material:hover .material-open { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Math Question Bank ---------- */
.qb-back { display: inline-block; color: var(--muted); font-size: 15px; margin-bottom: 14px; }
.qb-back:hover { color: var(--text); }
.qb-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-top: 28px; }
.qb-topic { display: flex; align-items: center; gap: 16px; padding: 20px 22px; transition: border-color .15s, box-shadow .15s; }
.qb-topic:hover, .qb-pack:hover { border-color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.qb-topic-num { width: 44px; height: 44px; border-radius: 12px; background: var(--text); color: #fff; display: grid; place-items: center; font: 700 17px var(--head); flex-shrink: 0; }
.qb-topic-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qb-topic-body b { font-size: 17px; line-height: 1.3; }
.qb-topic-body small { font-size: 14px; color: var(--muted); }
.qb-bar { display: block; height: 5px; border-radius: 99px; background: #eee; overflow: hidden; margin-top: 8px; }
.qb-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.qb-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-top: 20px; }
.qb-pack { display: flex; flex-direction: column; gap: 2px; padding: 20px 22px; transition: border-color .15s, box-shadow .15s; }
.qb-pack b { font: 700 20px var(--head); }
.qb-pack small { color: var(--muted); font-size: 14px; }
.qb-go { margin-top: 10px; font-size: 14px; font-weight: 600; }
.qb-pack.going .qb-go { color: var(--brand); }
.qb-pack.done .qb-bar i { background: var(--ok); }
.qb-pack.done .qb-go { color: var(--ok); }

/* Player: full screen, Desmos on the left, question on the right */
body.qb-open { overflow: hidden; }
.qb { position: fixed; inset: 0; z-index: 50; background: #fff; display: flex; flex-direction: column; }
.qb-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 2px dashed #d9d9d9; }
.qb-title { display: flex; flex-direction: column; min-width: 0; }
.qb-title b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-title span { font-size: 14px; color: var(--muted); }
.qb-clock { display: flex; flex-direction: column; align-items: center; font: 700 20px var(--head); }
.qb-clock span.hidden { visibility: hidden; }
.qb-clock button { background: none; border: 1px solid #ccc; border-radius: 99px; padding: 1px 12px; font-size: 12px; margin-top: 2px; }
.qb-tools { display: flex; justify-content: flex-end; gap: 8px; }
.qb-tool { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #d6d6d6; border-radius: 12px; padding: 8px 14px; font-size: 15px; font-weight: 500; }
.qb-tool svg { width: 20px; height: 20px; }
.qb-tool:hover { border-color: var(--text); }
.qb-tool.on { background: var(--text); border-color: var(--text); color: #fff; }
.qb-tool.on svg { color: var(--brand); }
.qb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.qb-calc { border-right: 4px solid #e4e4e4; min-height: 0; }
.qb-calc iframe { width: 100%; height: 100%; border: 0; display: block; }
.qb-main.nocalc { grid-template-columns: minmax(0, 1fr); }
.qb-main.nocalc .qb-calc { display: none; }
.qb-main.nocalc .qb-q { width: 100%; max-width: 820px; margin: 0 auto; }
.qb-q { overflow-y: auto; padding: 28px 40px 40px; min-height: 0; }
.qb-qhead { display: flex; align-items: center; gap: 14px; background: #f2f2f2; border-bottom: 2px dashed #cfcfcf; padding: 0 12px 0 0; margin-bottom: 22px; }
.qb-num { background: var(--text); color: #fff; font: 700 18px var(--head); min-width: 40px; height: 40px; display: grid; place-items: center; }
.qb-mark { display: flex; align-items: center; gap: 6px; background: none; border: 0; font-size: 15px; padding: 6px 4px; }
.qb-mark svg { width: 18px; height: 18px; }
.qb-mark.on { font-weight: 600; }
.qb-mark.on svg { fill: var(--brand); stroke: var(--brand); }
.qb-level { margin-left: auto; font-size: 13px; color: var(--muted); }
.qb-verdict-tag { margin-left: auto; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.qb-verdict-tag.ok { color: var(--ok); background: #effaf3; }
.qb-verdict-tag.bad { color: var(--bad); background: #fdf1f1; }
.qb-imgwrap { overflow-x: auto; }
.qb-imgwrap img { display: block; height: auto; }
.qb-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 24px; }
.qb-opt { height: 54px; background: #fff; border: 2px solid #d0d0d0; border-radius: 12px; font: 700 20px var(--head); }
.qb-opt:hover:not(:disabled) { border-color: var(--text); }
.qb-opt.sel { border-color: var(--text); background: var(--text); color: #fff; }
.qb-opt.right { border-color: var(--ok); background: #effaf3; color: var(--ok); }
.qb-opt.wrong { border-color: var(--bad); background: #fdf1f1; color: var(--bad); }
.qb-opt:disabled { cursor: default; }
.qb-spr { margin-top: 24px; display: flex; flex-direction: column; gap: 6px; }
.qb-spr input { width: 200px; font: 600 22px var(--head); padding: 10px 14px; border: 2px solid #c8c8c8; border-radius: 12px; }
.qb-spr input:focus { outline: none; border-color: var(--text); }
.qb-spr input.ok { border-color: var(--ok); color: var(--ok); background: #effaf3; }
.qb-spr input.bad { border-color: var(--bad); color: var(--bad); background: #fdf1f1; }
.qb-spr small { color: var(--muted); font-size: 13px; max-width: 420px; line-height: 1.5; }
.spr-preview { font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-height: 44px; }
.spr-preview b { color: var(--text); font: 600 20px var(--head); display: inline-flex; align-items: center; gap: 2px; }
.spr-frac { display: inline-flex; flex-direction: column; align-items: center; font-size: 15px; line-height: 1.15; }
.spr-frac span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 3px; }
.spr-bad { font: 400 14px var(--body, inherit); color: var(--bad); }

/* Math reference sheet: a panel over the exam screen */
.mt-ref { position: absolute; top: 72px; left: 16px; width: min(400px, calc(100% - 32px)); max-height: calc(100% - 160px); display: flex; flex-direction: column;
  background: #fff; border: 1px solid #cfcfcf; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 6; }
.mt-ref-head { cursor: move; touch-action: none; user-select: none; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.mt-ref-head b { font: 700 16px var(--head); }
.mt-ref-head button { background: none; border: 0; font-size: 16px; padding: 6px 8px; border-radius: 8px; }
.mt-ref-head button:hover { background: #f1f1f1; }
.mt-ref-body { overflow-y: auto; padding: 14px 16px 16px; }
.mt-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.mt-figs figure { margin: 0; text-align: center; }
.mt-figs svg { width: 100%; max-width: 110px; height: auto; fill: none; stroke: var(--text); stroke-width: 1.4; }
.mt-figs svg text { fill: var(--text); stroke: none; font: italic 13px "Times New Roman", Times, serif; }
.mt-figs svg text.ang { font: 10px system-ui, sans-serif; }
.mt-figs svg .dash { stroke-dasharray: 3 3; }
.mt-figs svg .dot { fill: var(--text); }
.mt-figs figcaption { font: 15px/1.5 "Times New Roman", Times, serif; }
.mt-ref ul { margin: 16px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.mt-ref li { margin-bottom: 6px; }
.qb-why { margin-top: 24px; background: #f7f7f7; border-left: 4px solid var(--bad); border-radius: 12px; padding: 16px 18px; }
.qb-why.ok { border-left-color: var(--ok); }
.qb-why b { display: block; margin-bottom: 12px; }
.qb-why.ok b { color: var(--ok); }
.qb-why.bad b { color: var(--bad); }
.qb-why img { mix-blend-mode: multiply; }
.qb-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 24px; border-top: 2px dashed #d9d9d9; }
.qb-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-navbtn { background: var(--text); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.qb-caret { color: var(--brand); }
.qb-move { display: flex; justify-content: flex-end; gap: 8px; }
.qb-btn { background: #fff; border: 1px solid #ccc; border-radius: 99px; padding: 11px 22px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.qb-btn:disabled { opacity: .4; cursor: default; }
.qb-next { background: var(--brand); border-color: var(--brand); color: #fff; }
.qb-next:hover:not(:disabled) { background: var(--brand-dark); }
.qb-pop { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); width: min(460px, calc(100% - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.18); }
.qb-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.qb-pop-head button { background: none; border: 0; font-size: 18px; }
.qb-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 12px 0; }
.qb-legend span { display: flex; align-items: center; gap: 5px; }
.qb-legend i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed #999; }
.qb-legend i.cur { border: 2px solid var(--text); }
.qb-legend i.ok { background: var(--ok); border-color: var(--ok); }
.qb-legend i.bad { background: var(--bad); border-color: var(--bad); }
.qb-legend i.mk { border: 2px solid var(--brand); border-style: solid; }
.qb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.qb-cell { height: 42px; background: #fff; border: 1.5px dashed #999; border-radius: 8px; font-weight: 600; }
.qb-cell.ok { background: var(--ok); border: 0; color: #fff; }
.qb-cell.bad { background: var(--bad); border: 0; color: #fff; }
.qb-cell.mk { box-shadow: inset 0 0 0 2px var(--brand); }
.qb-cell.cur { outline: 2px solid var(--text); outline-offset: 2px; }

/* Pack results */
.qb-result { margin-top: 24px; }
.qb-score b { display: block; font: 800 48px/1.1 var(--head); }
.qb-score span { color: var(--muted); }
.qb-result-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0; }
.qb-result-btns .btn-primary { padding: 12px 22px; font-size: 15px; }
.qb-rows { display: flex; flex-direction: column; gap: 6px; }
.qb-row { display: grid; grid-template-columns: 40px 1fr 1fr 30px; align-items: center; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.qb-row:hover { border-color: var(--text); }
.qb-row span:first-child { font-weight: 700; }
.qb-row span:last-child { font-weight: 700; text-align: right; }
.qb-row.ok span:last-child { color: var(--ok); }
.qb-row.bad span:last-child { color: var(--bad); }

/* ---------- Full-length practice tests ---------- */
.pt-h2 { font: 700 22px var(--head); margin: 32px 0 0; }
.pt-est { margin-top: 24px; }
.pt-est h2 { font: 800 30px/1.2 var(--head); margin: 8px 0 10px; }
.pt-conf { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 99px; }
.pt-conf.low { background: #fff4e5; color: #b25e00; }
.pt-conf.medium { background: #eef4ff; color: #2856c4; }
.pt-conf.high { background: #effaf3; color: var(--ok); }
.pt-est-parts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; font-size: 15px; color: var(--muted); }
.pt-est-parts b { color: var(--text); }
.pt-est p { margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.pt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.pt-selects { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pt-select { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pt-select select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid #dcdcdc; border-radius: 999px; padding: 9px 38px 9px 16px; font: 500 15px inherit; font-family: inherit; color: var(--text); cursor: pointer; }
.pt-select select:hover { border-color: var(--text); }
.pt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; margin-top: 16px; }
.pt-card { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.pt-card-head b { font: 800 22px var(--head); }
.pt-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-pill { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 99px; background: #f1f1f1; color: var(--text); }
.pt-pill.free { background: #effaf3; color: var(--ok); }
.pt-pill.going { background: var(--brand-soft); color: var(--brand-dark); }
.pt-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-stats div { background: #f7f7f7; border-radius: 14px; padding: 12px 14px; }
.pt-stats small { display: block; font-size: 13px; color: var(--muted); }
.pt-stats b { font: 800 24px var(--head); }
.pt-stats b small { display: inline; margin-left: 6px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--muted); }
.pt-card-btns { display: flex; gap: 10px; margin-top: auto; }
.pt-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 14px; padding: 12px 10px; white-space: nowrap; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.pt-btn svg { width: 18px; height: 18px; }
.pt-btn.main { background: var(--brand); color: #fff; border: 0; }
.pt-btn.main:hover { background: var(--brand-dark); }
.pt-btn.ghost { background: #fff; color: var(--text); border: 1.5px solid #dcdcdc; }
.pt-btn.ghost:hover { border-color: var(--text); }
.pt-score-est { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.pt-score .pt-score-est b { display: inline; margin: 0; font: inherit; font-weight: 700; color: var(--text); }
a.chip { display: inline-block; }

/* Setup modal */
.pt-modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.pt-modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 28px; padding: 28px 28px 26px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.pt-modal h2 { font: 700 26px/1.25 var(--head); margin: 6px 0 22px; }
.pt-bars { display: flex; gap: 8px; padding-right: 36px; }
.pt-bars i { flex: 1; height: 5px; border-radius: 99px; background: #e6e6e6; }
.pt-bars i.on { background: var(--brand); }
.pt-x { position: absolute; top: 18px; right: 18px; background: none; border: 0; padding: 4px; border-radius: 8px; display: grid; }
.pt-x:hover { background: #f2f2f2; }
.pt-step { margin-top: 18px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pt-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pt-choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #fff; border: 2px solid #e2e2e2; border-radius: 22px; padding: 20px; }
.pt-choice:hover { border-color: #bdbdbd; }
.pt-choice.on { border-color: var(--brand); background: var(--brand-soft); }
.pt-choice-icon { width: 48px; height: 48px; border-radius: 14px; background: #f1f1f1; display: grid; place-items: center; margin-bottom: 14px; }
.pt-choice.on .pt-choice-icon { background: var(--brand); color: #fff; }
.pt-choice b { font-size: 18px; }
.pt-choice.on b { color: var(--brand-dark); }
.pt-choice small { font-size: 14px; color: var(--muted); }
.pt-tick { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; }
.pt-tick svg { width: 18px; height: 18px; stroke-width: 2.4; }
.pt-foot { display: flex; gap: 12px; margin-top: 20px; }
.pt-continue { flex: 2; background: var(--brand); color: #fff; border: 0; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 600; }
.pt-continue:hover:not(:disabled) { background: var(--brand-dark); }
.pt-continue:disabled { opacity: .4; cursor: default; }
.pt-back { flex: 1; background: #fff; border: 1.5px solid #dcdcdc; border-radius: 16px; padding: 16px; font-size: 17px; font-weight: 500; }
.pt-back:hover { background: #f6f6f6; }
.pt-selbar { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 12px; font-size: 15px; color: var(--muted); }
.pt-link { background: none; border: 0; padding: 0; color: var(--brand); font-size: 15px; font-weight: 600; }
.pt-link.muted { color: var(--muted); font-weight: 500; }
.pt-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-mod { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: #fff; border: 2px solid #e2e2e2; border-radius: 20px; padding: 16px 18px; }
.pt-mod:hover { border-color: #bdbdbd; }
.pt-mod.on { border-color: var(--brand); background: var(--brand-soft); }
.pt-mod b { font-size: 18px; margin-top: 8px; }
.pt-mod small { font-size: 14px; color: var(--muted); }
.pt-radio { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cfcfcf; display: grid; place-items: center; color: #fff; }
.pt-mod.on .pt-radio { background: var(--brand); border-color: var(--brand); }
.pt-radio svg { width: 16px; height: 16px; stroke-width: 2.6; }
.pt-tag { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .04em; padding: 4px 10px; border-radius: 8px; }
.pt-tag.rw { background: #ececec; color: var(--text); }
.pt-tag.math { background: var(--brand-soft); color: var(--brand-dark); }

/* Exam screen (shares the .qb player layout) */
.pt-exam .qb-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pt-passage { overflow-y: auto; padding: 32px 40px; border-right: 4px solid #e4e4e4; font-size: 17px; line-height: 1.7; min-height: 0; }
.pt-passage p { margin: 0 0 14px; }
.pt-passage ul { margin: 0; padding-left: 22px; }
.pt-passage li { margin-bottom: 8px; }
.pt-table { border-collapse: collapse; margin: 6px 0 16px; font-size: 15px; }
.pt-table th, .pt-table td { border: 1px solid #cfcfcf; padding: 7px 14px; text-align: center; }
.pt-table th { background: #f3f3f3; font-weight: 600; }
.pt-passage .qb-fig { display: block; max-width: 100%; height: auto; margin: 0 auto 18px; }
.pt-passage .qb-poem { padding-left: 18px; }
.qb-rv-card { margin-top: 24px; max-width: 560px; }
.qb-rv-card .qb-topic-num { background: var(--brand); }
.qb-rv-card .qb-topic-num svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.qb-rv-empty { margin-top: 24px; }
.qb-rows + .qb-group { margin-top: 26px; }
.qb-group { font-size: 15px; margin: 22px 0 12px; color: var(--muted, #666); font-weight: 600; }
.pt-fig { display: block; max-width: min(100%, 420px); height: auto; margin: 4px auto 16px; }
.pt-eq { text-align: center; line-height: 1.9; }
.pt-q { font-size: 17px; line-height: 1.65; }
.pt-q p { margin: 0 0 12px; }
.pt-opts { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pt-opt { display: flex; align-items: center; gap: 14px; text-align: left; background: #fff; border: 1.5px solid #cfcfcf; border-radius: 12px; padding: 12px 16px; font-size: 16px; line-height: 1.5; }
.pt-opt:hover:not(:disabled) { border-color: var(--text); }
.pt-l { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #9a9a9a; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.pt-opt.sel { border: 2px solid var(--text); background: #f6f6f6; }
.pt-opt.sel .pt-l { background: var(--text); border-color: var(--text); color: #fff; }
.pt-opt.right { border: 2px solid var(--ok); background: #effaf3; }
.pt-opt.right .pt-l { background: var(--ok); border-color: var(--ok); color: #fff; }
.pt-opt.wrong { border: 2px solid var(--bad); background: #fdf1f1; }
.pt-opt.wrong .pt-l { background: var(--bad); border-color: var(--bad); color: #fff; }
.pt-opt:disabled { cursor: default; }
.pt-optrow { display: flex; align-items: center; gap: 10px; }
.pt-optrow .pt-opt { flex: 1; min-width: 0; }
.pt-cross { display: none; flex-shrink: 0; width: 52px; justify-content: center; background: none; border: 0; padding: 4px 0; font-size: 14px; font-weight: 600; text-decoration: underline; color: var(--text); }
.pt-cross .pt-l { position: relative; width: 26px; height: 26px; font-size: 12px; text-decoration: none; display: inline-grid; }
.pt-cross .pt-l::after { content: ""; position: absolute; left: -5px; right: -5px; top: 50%; border-top: 1.5px solid var(--text); }
.elim .pt-cross { display: flex; }
.pt-optrow.out .pt-opt { opacity: .45; }
.pt-optrow.out .pt-opt::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; border-top: 2px solid var(--text); }
.pt-opt { position: relative; }
.pt-elim { margin-left: 4px; position: relative; background: #fff; border: 1.5px solid #9a9a9a; border-radius: 6px; padding: 1px 6px; font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.pt-elim::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; border-top: 1.5px solid currentColor; transform: rotate(-12deg); }
.pt-elim:hover { border-color: var(--text); }
.pt-elim.on { background: var(--text); border-color: var(--text); color: #fff; }
.pt-hl { background: #ffe58a; color: inherit; border-radius: 2px; cursor: pointer; }
/* Results: each row opens its explanation in place */
.pt-rowd > summary { list-style: none; cursor: pointer; }
.pt-rowd > summary::-webkit-details-marker { display: none; }
.pt-rowd[open] > summary { border-color: var(--text); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.pt-exp { border: 1px solid var(--text); border-top: 0; border-radius: 0 0 12px 12px; padding: 18px 20px 20px; background: #fff; }
.pt-exp-passage { font-size: 16px; line-height: 1.65; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.pt-exp-passage p { margin: 0 0 10px; }
.pt-exp .pt-open { margin-top: 16px; }
.pt-review-all { margin-top: 16px; padding: 12px 22px; font-size: 15px; }
.pt-why { margin-top: 20px; background: #f7f7f7; border-left: 4px solid var(--bad); border-radius: 12px; padding: 14px 18px; font-size: 15px; line-height: 1.6; }
.pt-why.ok { border-left-color: var(--ok); }
.pt-verdict { font-weight: 700; margin-bottom: 6px; color: var(--bad); }
.pt-why.ok .pt-verdict { color: var(--ok); }
.qb-clock span.low { color: var(--bad); }
.qb-legend i.ans { background: var(--text); border: 0; }
.qb-cell.ans { background: var(--text); border: 0; color: #fff; }
.pt-review-link { display: block; margin: 16px auto 0; }
.qb-main.pt-check { display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; overflow-y: auto; padding: 32px 16px; background: #f6f6f6; }
.pt-check-card { width: min(620px, 100%); }
.pt-check-card h2 { font: 800 28px var(--head); margin: 0 0 8px; }
.pt-check-card p { color: var(--muted); line-height: 1.6; margin: 0; }
.pt-check-card .qb-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }

/* Between modules */
.pt-break { max-width: 640px; margin: 40px auto 0; text-align: center; padding: 44px 32px; }
.pt-break h1 { font: 800 30px/1.2 var(--head); margin: 10px 0 8px; }
.pt-break p { color: var(--muted); margin: 0 0 18px; }
.pt-next { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 24px; }
.pt-next b { font-size: 18px; }
.pt-next small { color: var(--muted); }

/* Results */
.pt-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; margin-top: 24px; }
.pt-score b { display: block; font: 800 44px/1.1 var(--head); margin: 12px 0 4px; }
.pt-score small { color: var(--muted); font-size: 15px; }
.pt-modres { margin-top: 16px; }
.pt-modres-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.pt-modres-head b { font-size: 17px; }
.pt-modres-head span { color: var(--muted); }
.qb-row.pt-row { grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1.2fr) 24px; }
.pt-row-type { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .grid-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.15);
  }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 20; }
  .collapse-btn { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 10;
    background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
    padding: 10px 12px; border-bottom: 1px solid var(--line);
  }
  .topbar-title { font: 800 16px var(--head); letter-spacing: .04em; }
  .content { padding: 16px 16px 40px; }
  .qb-top { grid-template-columns: 1fr auto; padding: 8px 12px; gap: 10px; }
  .qb-clock { display: none; }
  .qb-tool { padding: 8px 10px; }
  .qb-tool span { display: none; }
  .mt-ref { top: 64px; left: 8px; width: calc(100% - 16px); max-height: calc(100% - 140px); }
  .mt-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qb-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: 42vh minmax(0, 1fr); }
  .qb-main.nocalc { grid-template-rows: minmax(0, 1fr); }
  .qb-calc { border-right: 0; border-bottom: 4px solid #e4e4e4; }
  .qb-q { padding: 18px 16px 28px; }
  .qb-opts { gap: 8px; }
  .qb-bottom { grid-template-columns: auto 1fr; padding: 8px 12px; }
  .qb-who { display: none; }
  .qb-btn { padding: 10px 12px; font-size: 14px; }
  .qb-navbtn { padding: 10px 12px; font-size: 14px; }
  .qb-move { gap: 6px; }
  .qb-row { grid-template-columns: 28px 1fr 30px; }
  .qb-row span:nth-child(3) { grid-column: 2; }
  .pt-modal { padding: 22px 18px 18px; border-radius: 22px; }
  .pt-modal h2 { font-size: 22px; }
  .pt-choices, .pt-mods { gap: 10px; }
  .pt-choice { padding: 16px 14px; }
  .pt-choice b, .pt-mod b { font-size: 16px; }
  .pt-mod { padding: 14px; }
  .pt-exam .qb-top { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pt-exam .qb-clock { display: flex; font-size: 16px; }
  .pt-exam .qb-clock button { display: none; }
  .pt-exam .qb-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); overflow-y: auto; }
  .pt-exam .qb-main:not(.nocalc):has(.qb-calc) { grid-template-rows: 42vh minmax(0, 1fr); overflow-y: visible; }
  .pt-exam .qb-main.nocalc { grid-template-rows: minmax(0, 1fr); }
  .pt-passage { border-right: 0; border-bottom: 4px solid #e4e4e4; padding: 18px 16px; overflow: visible; font-size: 16px; }
  .pt-exam .pt-passage + .qb-q { overflow: visible; }
  .pt-q, .pt-opt { font-size: 15px; }
  .pt-exam .qb-mark { white-space: nowrap; }
  .pt-exam .qb-level { display: none; }
  .pt-elim { margin-left: auto; }
  .qb-row.pt-row { grid-template-columns: 28px minmax(0, 1fr) 24px; }
  .qb-row.pt-row .pt-row-type { display: none; }
  .qb-row.pt-row span:nth-child(3) { grid-column: auto; }
  .pt-break { margin-top: 0; padding: 32px 18px; }
  .pt-break h1 { font-size: 24px; }
  .hero { padding: 32px 24px; min-height: 0; }
  .hero h1 { max-width: none; }
  .hero-art { width: 55%; opacity: .3; }
  .card { padding: 22px 18px; }
  .grid-top { gap: 16px; margin-top: 16px; }
  .subjects { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  .subject-main { padding: 20px 18px; }
  .subject-text b { font-size: 22px; }
  .subject-links { padding: 0 18px 20px; }
  .qotd-cols { grid-template-columns: 1fr; }
  .qotd-text { max-height: none; overflow: visible; font-size: 16px; }
  .qotd-col + .qotd-col { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; margin: 24px 0 0; }
  .stats b { font-size: 34px; }
  .stats span { font-size: 12px; }
  .cal { gap: 6px 4px; }
  .cal .day { font-size: 14px; }
}

/* ---------- Profile menu ---------- */
.profile-wrap { position: relative; }
.profile-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 5;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}
.profile-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.profile-menu button:hover { background: #f3f3f3; }
.profile-menu #signOutBtn { color: var(--brand); }
.app.collapsed .profile-menu { right: auto; width: 180px; }

/* ---------- Sign-in screen ---------- */
.auth-screen { display: none; }
body.signed-out .app { display: none; }
body.signed-out .auth-screen { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.auth-brand {
  position: relative; overflow: hidden;
  background: var(--text); color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand::after {
  content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px;
  border: 2px solid var(--brand); border-radius: 50%; opacity: .5;
  box-shadow: 0 0 0 60px rgba(225,6,0,.06), 0 0 0 120px rgba(225,6,0,.04);
}
.auth-brand .logo-mark { background: var(--brand); }
.auth-brand .logo-text { color: #fff; }
.auth-pitch { position: relative; z-index: 1; }
.auth-pitch h1 { font: 800 clamp(34px, 4vw, 54px)/1.08 var(--head); margin: 0 0 18px; max-width: 520px; }
.auth-pitch h1 em { font-style: normal; color: var(--brand); }
.auth-pitch p { margin: 0; font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.7); max-width: 440px; }
.auth-points { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: rgba(255,255,255,.85); }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font: 800 30px/1.2 var(--head); margin: 0 0 8px; }
.auth-sub { margin: 0 0 28px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.auth-card label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.auth-card input, .auth-card select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  border: 1px solid #d6d6d6; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; background: #fff;
}
.auth-card input:focus, .auth-card select:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.auth-card .auth-code { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 600; }
.auth-card .btn-primary { width: 100%; justify-content: center; border-radius: 14px; padding: 16px; }
.auth-card .btn-primary:disabled { opacity: .6; cursor: default; }
.auth-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: #fff; border: 1px solid #d6d6d6; border-radius: 14px; padding: 15px; font-size: 16px; font-weight: 600;
}
.auth-google:hover { background: #f6f6f6; }
.auth-google svg { width: 20px; height: 20px; }
.auth-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--faint); font-size: 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-err { color: var(--brand); font-size: 14px; margin: -6px 0 14px; }
.auth-test { background: var(--brand-soft); color: var(--brand-dark); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 18px 0; }
.auth-foot { margin: 22px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--text); font-weight: 600; }
.auth-back { background: none; border: 0; padding: 0; margin-bottom: 24px; color: var(--muted); font-size: 15px; }
.auth-back:hover { color: var(--text); }

@media (max-width: 900px) {
  body.signed-out .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { padding: 24px 20px 28px; gap: 20px; }
  .auth-brand::after { width: 220px; height: 220px; right: -90px; bottom: -90px; }
  .auth-pitch h1 { font-size: 30px; margin-bottom: 10px; }
  .auth-pitch p { font-size: 15px; }
  .auth-points { display: none; }
  .auth-panel { place-items: start center; padding: 28px 16px 40px; }
  .auth-card h2 { font-size: 24px; }
}
