/* TypWiz - design system
   Two colours + neutrals: brand teal, accent amber. Flat surfaces, no gradients. */

:root {
  --bg: #ffffff;
  --surface: #f5f6f7;
  --surface-2: #eceef0;
  --border: #e1e4e8;
  --text: #16181d;
  --muted: #646b75;
  --faint: #a3a9b2;
  --brand: #0f766e;
  --brand-hover: #0b5f58;
  --brand-ink: #ffffff;
  --brand-soft: #e3f2f0;
  --accent: #c76a00;
  --error: #d92d20;
  --error-soft: #fde8e6;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Bengali", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --bangla: "Noto Sans Bengali", "Hind Siliguri", "Kalpurush", "SolaimanLipi", "Nirmala UI", var(--font);
  --wrap: 1140px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #121417;
  --surface: #1a1d21;
  --surface-2: #22262b;
  --border: #2c3036;
  --text: #e7e9ec;
  --muted: #959ba5;
  --faint: #5d636c;
  --brand: #2bb3a5;
  --brand-hover: #3cc6b8;
  --brand-ink: #0c1412;
  --brand-soft: #16302d;
  --accent: #f0a640;
  --error: #f26b61;
  --error-soft: #3a1f1d;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.55rem); margin-top: 1.6em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(14px, 3vw, 24px); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.logo b { color: var(--brand); font-weight: 800; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: var(--radius-sm); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a.active { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 10px; }
.free-badge { font-size: .78rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: var(--radius-sm); cursor: pointer; padding: 0; }
.icon-btn:hover { color: var(--text); background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="dark"] .theme-icon-light { display: none; }

@media (max-width: 920px) {
  .menu-btn { display: inline-grid; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,.08); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px 14px 14px; z-index: 49; }
  .nav.open { display: grid; }
  .nav a { padding: 10px 12px; border: 1px solid var(--border); background: var(--surface); text-align: center; }
  .nav a.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
  .site-header .wrap { gap: 12px; }
  .header-right { margin-left: auto; }
}
@media (max-width: 480px) {
  .nav.open { grid-template-columns: 1fr; }
  .nav a { text-align: left; }
}

/* ---------- Buttons & form controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1; padding: 11px 18px; border-radius: var(--radius-sm); border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border); }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: var(--error); filter: brightness(.92); border-color: var(--error); }
.btn svg { width: 16px; height: 16px; }

.seg { display: inline-flex; background: var(--surface); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; max-width: 100%; }
.seg button { font: inherit; font-size: .85rem; font-weight: 500; border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 4px; cursor: pointer; min-height: 32px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
[data-theme="dark"] .seg button.on { background: var(--surface-2); }

label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  font: inherit; font-size: .95rem; width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field { margin-bottom: 16px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Sections & cards ---------- */
main { min-height: 60vh; }
.section { padding: 48px 0; }
.section-tight { padding: 28px 0; }
.section + .section { border-top: 1px solid var(--border); }
.page-head { padding: 32px 0 8px; }
.page-head p { color: var(--muted); max-width: 680px; margin-bottom: 0; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.path-card { display: block; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: border-color .15s; }
.path-card:hover { border-color: var(--brand); text-decoration: none; }
.path-card .kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.path-card h3 { margin: 6px 0 6px; font-size: 1.15rem; }
.path-card p { color: var(--muted); margin: 0; font-size: .95rem; }

.trust { display: flex; gap: 10px 28px; flex-wrap: wrap; justify-content: center; font-weight: 700; font-size: 1.05rem; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.trust span::before { content: "✓"; color: var(--brand); margin-right: 8px; }

.prose { max-width: 760px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 3px solid var(--brand); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.prose pre { overflow-x: auto; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose pre code { background: none; border: 0; padding: 0; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

details.faq { border-bottom: 1px solid var(--border); padding: 14px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.2rem; line-height: 1; }
details.faq[open] summary::after { content: "−"; }
details.faq p { margin: 10px 0 0; color: var(--muted); }

.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: .92rem; }
.notice-error { background: var(--error-soft); border-color: transparent; color: var(--error); }
.notice-ok { background: var(--brand-soft); border-color: transparent; color: var(--brand); }

/* ---------- Ads (always outside typing area) ---------- */
.ad-slot { margin: 28px auto; text-align: center; min-height: 0; max-width: var(--wrap); padding: 0 clamp(14px, 3vw, 24px); }
.ad-slot:empty { display: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 36px 0 28px; font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 24px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ========== Typing test ========== */
.tw-test { position: relative; max-width: 960px; margin: 0 auto; }
.tw-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tw-toolbar .group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tw-stats { display: flex; gap: 28px; align-items: baseline; margin-bottom: 10px; min-height: 44px; }
.tw-stat { display: flex; flex-direction: column; line-height: 1.1; }
.tw-stat b { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.tw-stat span { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tw-stat.timer b { color: var(--text); }

.tw-box { position: relative; padding: 4px 0; cursor: text; }
.tw-input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; font-size: 16px; z-index: 2; cursor: text; caret-color: transparent; color: transparent; background: transparent; resize: none; }
.tw-words { --lh: 2.6rem; position: relative; height: calc(var(--lh) * 3); overflow: hidden; font-family: var(--mono); font-size: 1.6rem; line-height: var(--lh); color: var(--faint); user-select: none; }
.tw-lines { position: relative; display: flex; flex-wrap: wrap; transition: transform .12s ease-out; }
.tw-word { margin-right: .6em; position: relative; white-space: nowrap; }
.tw-word.err { text-decoration: underline; text-decoration-color: var(--error); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.tw-l { position: relative; }
.tw-l.ok { color: var(--text); }
.tw-l.bad { color: var(--error); }
.tw-l.extra { color: var(--error); opacity: .7; }
.tw-caret { position: absolute; width: 2px; height: 1.9rem; background: var(--brand); border-radius: 1px; top: 0; left: 0; transition: left .08s linear, top .08s linear; z-index: 1; }
.tw-box.idle .tw-caret { animation: tw-blink 1s step-end infinite; }
@keyframes tw-blink { 50% { opacity: 0; } }
.tw-focus-hint { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--font); font-size: 1rem; color: var(--muted); background: color-mix(in srgb, var(--bg) 70%, transparent); z-index: 3; pointer-events: none; padding: 0 16px; text-align: center; }
.tw-box.blurred .tw-focus-hint { display: grid; }
.tw-box.blurred .tw-words { filter: blur(3px); }

/* Word-granularity mode (Bangla and other complex scripts) */
.tw-words.lang-bn { font-family: var(--bangla); font-size: 1.65rem; --lh: 3.1rem; }
.tw-words.by-word .tw-word.cur { color: var(--text); background: var(--surface); border-radius: 4px; box-shadow: 0 0 0 4px var(--surface); }
.tw-words.by-word .tw-word.cur.bad { color: var(--error); background: var(--error-soft); box-shadow: 0 0 0 4px var(--error-soft); }
.tw-words.by-word .tw-word.done { color: var(--text); }
.tw-words.by-word .tw-word.done.wrong { color: var(--error); }
.tw-typed-echo { font-family: var(--bangla); font-size: 1.25rem; min-height: 2rem; color: var(--muted); margin-top: 6px; }

.tw-hint-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: .85rem; color: var(--muted); }
kbd { font-family: var(--mono); font-size: .78rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; background: var(--surface); color: var(--text); }

/* Result card */
.tw-result { display: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.tw-test.done .tw-result { display: block; }
.tw-test.done .tw-play { display: none; }
.tw-result-top { display: flex; gap: 36px; flex-wrap: wrap; align-items: flex-end; }
.tw-big { line-height: 1; }
.tw-big b { display: block; font-size: 3.6rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tw-big span { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tw-rank { margin-left: auto; text-align: right; }
.tw-rank b { font-size: 1.4rem; color: var(--brand); display: block; }
.tw-rank span { font-size: .85rem; color: var(--muted); }
.tw-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.tw-result-grid div { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.tw-result-grid b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tw-result-grid span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tw-chart { width: 100%; height: 90px; display: block; margin-bottom: 18px; }
.tw-chart path.line { fill: none; stroke: var(--brand); stroke-width: 2; }
.tw-chart path.raw { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 3 3; }
.tw-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .tw-result { padding: 18px; }
  .tw-result-top { gap: 20px; }
  .tw-big b { font-size: 2.8rem; }
}
@media (max-width: 640px) {
  .section { padding: 30px 0; }
  .section-tight { padding: 20px 0; }
  .page-head { padding: 22px 0 10px; }
  .hero-test { padding: 22px 0 18px; }
  .hero-test h1 { font-size: 1.15rem; margin-bottom: 14px; }
  .card { padding: 16px; }
  .tw-toolbar { gap: 8px; margin-bottom: 14px; }
  .tw-toolbar .group { width: 100%; justify-content: space-between; }
  .tw-stats { gap: 16px; }
  .tw-stat b { font-size: 1.45rem; }
  .tw-words { font-size: 1.25rem; --lh: 2.2rem; }
  .tw-words.lang-bn { font-size: 1.32rem; --lh: 2.55rem; }
  .tw-caret { height: 1.55rem; }
  .tw-hint-row { flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; }
  .tw-test .kb, .tw-test .kb-fingers { display: none; }
  .tw-result-grid { grid-template-columns: repeat(2, 1fr); margin: 16px 0; }
  .tw-rank { margin-left: 0; text-align: left; }
  .table th, .table td { padding: 8px 10px; font-size: .86rem; }
}
@media (max-width: 480px) {
  .tw-result-actions { flex-direction: column; }
  .tw-result-actions .btn { width: 100%; }
}

/* ========== On-screen keyboard ========== */
.kb { --u: 44px; display: flex; flex-direction: column; gap: 5px; align-items: center; margin: 26px auto 0; user-select: none; max-width: 100%; }
.kb-row { display: flex; gap: 5px; flex: none; }
.key { width: calc(var(--u) * var(--w, 1) + 5px * (var(--w, 1) - 1)); height: var(--u); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--bg); color: var(--muted); font-family: var(--mono); font-size: .8rem; display: flex; align-items: center; justify-content: center; position: relative; transition: background .06s, color .06s, border-color .06s; flex: none; }
.key small { font-size: .62rem; position: absolute; top: 3px; left: 6px; opacity: .8; }
.key.home::after { content: ""; position: absolute; bottom: 6px; width: 10px; height: 2px; border-radius: 1px; background: var(--faint); }
.key.next { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.key.down { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.key.bad { background: var(--error); color: #fff; border-color: var(--error); }
.key.tested { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.kb-fingers { font-size: .82rem; color: var(--muted); text-align: center; margin-top: 10px; min-height: 1.4em; }
@media (max-width: 760px) { .kb { --u: 30px; gap: 3px; } .kb-row { gap: 3px; } .key { font-size: .65rem; width: calc(var(--u) * var(--w, 1) + 3px * (var(--w, 1) - 1)); } .key small { display: none; } }
@media (max-width: 480px) { .kb { --u: 21px; gap: 2px; } .kb-row { gap: 2px; } .key { width: calc(var(--u) * var(--w, 1) + 2px * (var(--w, 1) - 1)); } }

/* ========== Homepage ========== */
.hero-test { padding: 36px 0 28px; }
.hero-test h1 { font-size: 1.35rem; font-weight: 700; margin-bottom: 18px; }
.hero-test h1 .muted { font-weight: 500; }

/* ========== Lessons ========== */
.lesson-stage { margin-top: 32px; }
.lesson-stage h2 { font-size: 1.1rem; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.lesson-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lesson-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; color: var(--text); }
.lesson-item:hover { border-color: var(--brand); text-decoration: none; }
.lesson-num { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; color: var(--muted); }
.lesson-item.done .lesson-num { background: var(--brand); color: var(--brand-ink); }
.lesson-item h3 { font-size: .98rem; margin: 0; }
.lesson-item p { margin: 0; font-size: .82rem; color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 1px; font-size: .85rem; }
.lesson-progress { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin: 6px 0 18px; }
.lesson-progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }

/* ========== Games ========== */
.game-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); }
.game-card:hover { border-color: var(--brand); text-decoration: none; }
.game-card .art { aspect-ratio: 16/9; background: var(--surface); display: grid; place-items: center; border-bottom: 1px solid var(--border); }
.game-card .art svg { width: 64%; height: auto; }
.game-card .body { padding: 16px 18px 18px; }
.game-card h3 { margin: 0 0 4px; }
.game-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.game-card .tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface); padding: 2px 8px; border-radius: 99px; margin-bottom: 8px; }
.game-card.soon { opacity: .6; pointer-events: none; }
.game-stage { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.coins svg { width: 17px; height: 17px; flex: none; }
a.coins:hover { text-decoration: none; opacity: .85; }

/* ========== Keyboard test page ========== */
.kt-wrap .kb { --u: 52px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; align-items: safe center; }
.kt-last { font-family: var(--mono); font-size: 1rem; color: var(--muted); text-align: center; min-height: 1.6em; margin-top: 18px; }
.kt-last b { color: var(--text); }
@media (max-width: 900px) { .kt-wrap .kb { --u: 36px; } }
@media (max-width: 640px) { .kt-wrap .kb { --u: 24px; } }
@media (max-width: 480px) { .kt-wrap .kb { --u: 19px; } .free-badge { display: none; } .footer-grid { grid-template-columns: 1fr; } }

/* ========== Utilities ========== */
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
@media (max-width: 600px) { .flex.between { flex-direction: column; align-items: stretch; gap: 10px; } }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
[hidden] { display: none !important; }

/* ========== Print (certificate & score card) ========== */
@media print {
  .site-header, .site-footer, .ad-slot, .page-head, .tw-toolbar, .btn, .seg, nav, .notice, .section { display: none !important; }
  main { padding: 0; min-height: 0; }
  .wrap { max-width: 100%; padding: 0; }
  .card { border: 0; padding: 0; background: transparent; }
  canvas { max-width: 100% !important; height: auto !important; }
}
