@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url('/fonts/be-vietnam-pro-vietnamese-400-normal.woff2') format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 400; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url('/fonts/be-vietnam-pro-vietnamese-600-normal.woff2') format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 600; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 800; font-display: swap; src: url('/fonts/be-vietnam-pro-vietnamese-800-normal.woff2') format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Be Vietnam Pro'; font-weight: 800; font-display: swap; src: url('/fonts/be-vietnam-pro-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --navy: #03045e; --blue: #0077b6; --frost: #90e0ef; --gold: #d4a017; --red: #c8102e;
  --paper: #f2f8fb; --card: #ffffff; --ink: #0a1f3d; --muted: #4a6079; --line: #bfd8e6;
  --ok: #0f7a4a; --ok-bg: #e3f6ec; --bad: #b3261e; --bad-bg: #fde8e6; --warn-bg: #fff4d6;
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); min-height: 100vh; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; font-weight: 800; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
.brand-strip { display: flex; justify-content: center; align-items: center; padding: 10px 16px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.brand-strip a { display: inline-flex; border-radius: 8px; padding: 2px 6px; }
.brand-strip img { display: block; height: 34px; width: auto; }
@media (min-width: 760px) { .brand-strip { padding: 12px 16px 10px; } .brand-strip img { height: 42px; } }
@media print { .brand-strip { display: none; } }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 5; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar .back { padding: 6px 10px; margin-left: -10px; border-radius: 999px; }
.topbar .title { font-weight: 800; flex: 1; font-size: 1rem; }
.topbar .passport-mini { font-size: .85rem; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; }

/* Nút */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border: 2px solid var(--navy); border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; cursor: pointer; text-decoration: none; transition: transform .12s; }
.btn:active { transform: translateY(1px); }
.btn.alt { background: #fff; color: var(--navy); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1d1500; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .92rem; }

/* Thẻ */
.card { background: var(--card); border: 2px solid var(--navy); border-radius: 10px; padding: 16px; margin: 0 0 16px; }
.card.soft { border-color: var(--line); border-width: 1px; }
.note { background: var(--warn-bg); border-left: 5px solid var(--gold); padding: 10px 14px; border-radius: 4px; font-size: .95rem; }
.muted { color: var(--muted); font-size: .92rem; }
.tag { display: inline-block; padding: 1px 10px; border: 1.5px solid var(--blue); color: var(--blue); border-radius: 999px; font-size: .8rem; font-weight: 600; }

/* Form */
label { display: block; font-weight: 600; margin: 0 0 4px; }
.field { margin: 0 0 14px; }
input[type=text], input[type=email], input[type=tel], select, textarea { width: 100%; min-height: 50px; padding: 10px 14px; background: #fff; border: 2px solid var(--line); border-radius: 8px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0,119,182,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 6px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.chip[aria-pressed=true] { border-color: var(--navy); background: var(--navy); color: #fff; }
.err { color: var(--bad); font-weight: 600; margin: 6px 0 0; }

/* Hộ chiếu */
.passport { position: relative; background: var(--navy); color: #fff; padding: 22px 18px 20px; border-radius: 10px 10px 0 0; overflow: hidden; }
.passport::before { content: ''; position: absolute; inset: 0; opacity: .16; background: repeating-radial-gradient(circle at 85% 20%, transparent 0 9px, var(--frost) 9px 10px), repeating-linear-gradient(115deg, transparent 0 14px, var(--frost) 14px 15px); }
.passport > * { position: relative; }
.passport h1 { font-size: 1.55rem; margin-bottom: .2em; }
.passport p { margin: 0; opacity: .9; font-size: .95rem; }
.stamps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; background: #fff; border: 2px solid var(--navy); border-top: 0; border-radius: 0 0 10px 10px; padding: 18px 14px; margin-bottom: 18px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; text-decoration: none; color: var(--ink); }
.stamp { position: relative; width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 3px dashed var(--line); color: var(--muted); font-weight: 800; font-size: .86rem; line-height: 1.2; padding: 10px; }
.stamp .sub { display: block; font-weight: 600; font-size: .7rem; margin-top: 2px; }
.stamp.done { border: 3px double var(--red); color: var(--red); transform: rotate(-9deg); background: radial-gradient(circle, rgba(200,16,46,.05), rgba(200,16,46,.0) 70%); }
.stamp.done::after { content: ''; position: absolute; inset: 6px; border: 1.5px solid var(--red); border-radius: 50%; }
.stamp.thud { animation: thud .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes thud { 0% { transform: scale(1.9) rotate(4deg); opacity: 0; } 70% { opacity: 1; } 100% { transform: scale(1) rotate(-9deg); } }
.slot .name { font-weight: 800; font-size: .98rem; }
.slot .desc { font-size: .83rem; color: var(--muted); line-height: 1.35; }
.progress-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bar { flex: 1; height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .5s; }
.finish { text-align: center; border-color: var(--red); }
.passport-kicker { font-size: .74rem !important; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--frost); margin-bottom: 6px !important; }
.slot { position: relative; }
.slot-no { position: absolute; top: -4px; left: 4px; font: 800 .72rem/1 'Courier New', ui-monospace, monospace; color: var(--muted); letter-spacing: .08em; }
.bar { position: relative; }
.gift-mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--gold); }
@media (min-width: 640px) { .hub .stamps { grid-template-columns: repeat(3, 1fr); } .wrap.hub { max-width: 720px; } }

/* Chat Dạy lại AI */
.bi-row { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; }
.bi-face { flex: 0 0 64px; width: 64px; height: 64px; }
.bubble { background: #fff; border: 2px solid var(--navy); border-radius: 4px 16px 16px 16px; padding: 10px 14px; }
.me-row { display: flex; justify-content: flex-end; margin: 0 0 14px; }
.me-row .bubble { background: var(--frost); border-radius: 16px 4px 16px 16px; }
.meter { display: flex; gap: 6px; margin: 0 0 6px; }
.meter i { flex: 1; height: 14px; border-radius: 4px; background: var(--line); transition: background .4s; }
.meter i.on { background: var(--gold); }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 56px; }
.mic { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--navy); background: #fff; font-size: 1.2rem; cursor: pointer; }
.mic[aria-pressed=true] { background: var(--red); color: #fff; border-color: var(--red); }
.topic-btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 14px 16px; margin: 0 0 10px; background: #fff; border: 2px solid var(--navy); border-radius: 10px; cursor: pointer; font-weight: 600; }
.score-big { font-size: 3.2rem; font-weight: 800; line-height: 1; color: var(--navy); }
.check li { list-style: none; padding-left: 28px; position: relative; margin: 0 0 6px; }
.check { padding: 0; margin: 0 0 12px; }
.check li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.check.miss li::before { content: '○'; color: var(--bad); }

/* Bắt lỗi AI */
.timer { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 0 0 14px; }
.timer > i { display: block; height: 100%; width: 100%; background: var(--blue); transition: width 1s linear, background .3s; }
.timer.low > i { background: var(--red); }
.sentences { display: flex; flex-direction: column; gap: 8px; }
.sent { text-align: left; width: 100%; padding: 12px 14px; background: #fff; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; line-height: 1.5; }
.sent[aria-pressed=true] { border-color: var(--blue); background: #e5f4fb; box-shadow: inset 5px 0 0 var(--blue); }
.sent.r-hit { border-color: var(--ok); background: var(--ok-bg); box-shadow: inset 5px 0 0 var(--ok); }
.sent.r-miss { border-color: var(--bad); background: var(--bad-bg); box-shadow: inset 5px 0 0 var(--bad); }
.sent.r-false { border-color: var(--line); background: #f0f3f5; color: var(--muted); text-decoration: line-through; }
.why { display: block; margin-top: 6px; font-size: .92rem; font-weight: 600; text-decoration: none; }

/* Giáo án */
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--blue); animation: spin 1s linear infinite; margin: 8px auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.plan h3 { margin-top: 1.2em; padding-bottom: 4px; border-bottom: 2px solid var(--navy); }
.plan ul, .plan ol { padding-left: 1.2em; margin: 0 0 .8em; }
.plan table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 1em; }
.plan th, .plan td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.plan th { background: var(--frost); }
.plan .ans { color: var(--ok); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.stars { display: flex; gap: 6px; }
.star { width: 48px; height: 48px; font-size: 1.6rem; border: 2px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; color: var(--line); }
.star[aria-pressed=true] { color: var(--gold); border-color: var(--gold); }

/* Chia sẻ lên tường */
.prefix { font-weight: 800; color: var(--navy); margin: 0 0 6px; font-size: 1.05rem; }
.cluster-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin: 0 0 10px; }
.cluster-bar .track { grid-column: 1 / -1; height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.cluster-bar .track i { display: block; height: 100%; background: var(--blue); }

@media print {
  body { background: #fff; font-size: 12pt; }
  .topbar, .no-print, .btn, .stars { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; }
  .plan h3 { break-after: avoid; }
  .plan table, .plan li { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
