/* Dạy Bi — kiểu "sổ tay + hình dán": viền mực dày, bóng cứng chọn lọc, Bi là điểm nhấn duy nhất */

:root {
  --ink: #221A4B;
  --ink-2: #4B4378;
  --page: #E9E4FF;
  --paper: #FFFDF6;
  --rule: #E6E0F7;
  --sun: #FFD23F;
  --sun-2: #FFEE9E;
  --coral: #FF5C8A;
  --coral-2: #FFD6E2;
  --mint: #34D3A0;
  --mint-2: #CFF5E7;
  --sky: #8FD0FF;

  --font-d: "Baloo 2", "Be Vietnam Pro", system-ui, sans-serif;
  --font-b: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-h: "Mali", "Be Vietnam Pro", cursive;

  --bd: 3px solid var(--ink);
  --r-s: 12px;
  --r-m: 20px;
  --r-l: 28px;
  --pop: 5px 5px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-b);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--page);
  background-image: radial-gradient(rgba(34, 26, 75, .13) 1.6px, transparent 1.6px);
  background-size: 24px 24px;
}
main { flex: 1; padding-bottom: 48px; }
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 800; line-height: 1.12; letter-spacing: -.005em; margin: 0; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.7rem); text-wrap: balance; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--sun); border: var(--bd); border-radius: var(--r-s); padding: 8px 14px; font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- Thanh trên ---------- */
.top { padding: 14px 0; }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (min-width: 720px) { .top-in { padding: 0 28px; } }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo { flex: none; }
.logo-text { font-family: var(--font-d); font-weight: 800; font-size: 1.6rem; letter-spacing: -.01em; white-space: nowrap; }
@media (max-width: 480px) {
  .top-in { gap: 6px; }
  .nav-link { padding: 6px 10px; font-size: .95rem; }
  .demo-full { display: none; }
  .logo-text { font-size: 1.45rem; }
}
.bi--logo { width: 44px; height: 44px; }
.top-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link { text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 3px solid transparent; }
.nav-link:hover { border-color: var(--ink); background: var(--paper); }
.nav-link.is-on { border-color: var(--ink); background: var(--sun); }
.demo-pill { font-size: .8rem; font-weight: 700; padding: 3px 10px; background: var(--sun-2); border: 2px dashed var(--ink); border-radius: 999px; }

/* ---------- Thành phần chung ---------- */
.card { background: var(--paper); border: var(--bd); border-radius: var(--r-m); padding: 20px; }
.lead { font-size: 1.15rem; max-width: 34em; color: var(--ink-2); }
.hint { font-size: .9rem; color: var(--ink-2); margin: 6px 0 0; }
.opt { font-weight: 400; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1.05rem/1.1 var(--font-d);
  padding: 13px 22px;
  color: var(--ink); background: var(--paper);
  border: var(--bd); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn--coral { background: var(--coral); }
.btn--mint { background: var(--mint); }
.btn--ghost { background: var(--paper); }
.btn--xl { font-size: 1.3rem; padding: 16px 30px; }
.btn--sm { font-size: .95rem; padding: 9px 14px; box-shadow: 0 4px 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 0 2px 0 var(--ink); }
.btn[aria-pressed="true"] { background: var(--sun); }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 2px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

input[type="text"], textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: #fff;
  border: var(--bd); border-radius: 14px;
  padding: 12px 14px;
}
textarea { resize: vertical; min-height: 116px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #8A83AE; }
input[type="text"]:focus-visible, textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font: 700 1.1rem/1.3 var(--font-d); margin-bottom: 8px; padding: 0; }

.alert { background: var(--coral-2); border: var(--bd); border-radius: var(--r-s); padding: 10px 14px; margin: 0 0 18px; font-weight: 600; }
.alert--ok { background: var(--mint-2); }

/* ---------- Bi (mascot) ---------- */
.bi { display: block; overflow: visible; }
.bi .v { display: none; }
.bi[data-mood="curious"] .v-curious,
.bi[data-mood="thinking"] .v-thinking,
.bi[data-mood="confused"] .v-confused,
.bi[data-mood="surprised"] .v-surprised,
.bi[data-mood="aha"] .v-aha,
.bi[data-mood="happy"] .v-happy { display: inline; }
.bi-sym { font-family: var(--font-d); font-weight: 800; font-size: 34px; }
.bi-eye { transform-box: fill-box; transform-origin: center; }
.bi-pupil { transition: transform .14s ease-out; }
.bi-body { transform-box: fill-box; transform-origin: 50% 100%; }
.bi-arm { transform-box: fill-box; transform-origin: 50% 8%; }

.bi--logo { width: 44px; height: 44px; }
.bi--sm { width: 52px; height: 52px; }
.bi--md { width: 92px; height: 92px; }
.bi--lg { width: 190px; height: 190px; }
.bi--xl { width: 150px; height: 150px; margin: 0 auto 8px; }
.bi--hero { width: clamp(210px, 32vw, 370px); height: auto; aspect-ratio: 1; }

@media (prefers-reduced-motion: no-preference) {
  .bi--hero, .bi--lg, .bi--xl, .bi--md { animation: bob 3.6s ease-in-out infinite; }
  .bi--sm .bi-eye, .bi--logo .bi-eye { animation: none; }
  .bi-eye { animation: blink 5.2s infinite; }
  .bi.is-pop .bi-body { animation: pop .55s cubic-bezier(.3, 1.6, .5, 1); }
  .bi[data-mood="aha"] .bi-arm-r, .bi[data-mood="happy"] .bi-arm-r { animation: wave .55s ease-in-out infinite alternate; }
  .bi[data-mood="thinking"] .bi-dots circle { animation: think 1.4s ease-in-out infinite; }
  .bi[data-mood="thinking"] .bi-dots circle:nth-child(2) { animation-delay: .2s; }
  .bi[data-mood="thinking"] .bi-dots circle:nth-child(3) { animation-delay: .4s; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes pop { 0% { transform: scale(1); } 30% { transform: scale(1.1, .9); } 60% { transform: scale(.96, 1.06); } 100% { transform: scale(1); } }
@keyframes wave { from { transform: rotate(8deg); } to { transform: rotate(-26deg); } }
@keyframes think { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------- Trang chủ ---------- */
.hero { display: grid; gap: 8px 40px; padding-top: 4px; padding-bottom: 28px; grid-template-columns: minmax(0, 1fr); }
.hero-bi { display: flex; flex-direction: column; align-items: center; order: -1; }
.hero-bubble {
  position: relative; background: #fff; border: var(--bd); border-radius: 22px;
  padding: 10px 18px; margin-bottom: 14px; max-width: 20em; text-align: center; text-wrap: balance;
  font: 600 1.02rem/1.4 var(--font-h);
}
.hero-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -11px; width: 18px; height: 18px;
  background: #fff; border-right: var(--bd); border-bottom: var(--bd);
  transform: translateX(-50%) rotate(45deg);
}
.hero-main h1 { max-width: 12em; margin-bottom: 14px; }
.start { position: relative; margin-top: 22px; padding: 26px 22px 24px; box-shadow: var(--pop); border-radius: var(--r-l); max-width: 560px; }
.start::before {
  content: ""; position: absolute; top: -15px; left: 50%; width: 112px; height: 28px; margin-left: -56px;
  background: repeating-linear-gradient(135deg, var(--coral-2) 0 9px, #fff 9px 18px);
  border: 2px solid var(--ink); border-radius: 4px; transform: rotate(-2.5deg); opacity: .95;
}
.start .btn { width: 100%; }
.demo-note { text-align: center; margin: 12px 0 0; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { font: 600 .9rem/1 var(--font-b); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.chip:hover { background: var(--sun-2); }

.grade-row { display: flex; flex-wrap: wrap; gap: 6px; }
.grade { position: relative; cursor: pointer; }
.grade input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.grade span {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: #fff; border: var(--bd); font: 800 1.15rem/1 var(--font-d);
  transition: transform .12s, background-color .12s;
}
.grade:hover span { background: var(--sun-2); }
.grade input:checked + span { background: var(--sun); box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px); }
.grade input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

.how { padding-top: 24px; padding-bottom: 8px; }
.how h2 { margin-bottom: 22px; }
.steps { list-style: none; display: grid; gap: 18px; counter-reset: s; grid-template-columns: minmax(0, 1fr); }
.step { counter-increment: s; position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: var(--bd); border-radius: var(--r-m); padding: 22px 20px 20px 20px; }
.step::before {
  content: counter(s); position: absolute; top: -18px; left: 18px;
  width: 42px; height: 42px; display: grid; place-items: center;
  font: 800 1.35rem/1 var(--font-d); border: var(--bd); border-radius: 50%;
}
.step--1::before { background: var(--sun); }
.step--2::before { background: var(--coral); }
.step--3::before { background: var(--mint); }
.step b { font: 800 1.25rem/1.2 var(--font-d); margin-top: 10px; }
.step span { color: var(--ink-2); }
.why { margin: 26px 0 0; max-width: 40em; font-family: var(--font-h); font-weight: 500; font-size: 1.05rem; color: var(--ink-2); }

@media (min-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: center; padding-top: 16px; padding-bottom: 44px; }
  .hero-bi { order: 0; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step:nth-child(2) { transform: rotate(.6deg); }
  .step:nth-child(1) { transform: rotate(-.5deg); }
}
@media (max-width: 919px) {
  .bi--hero { width: 190px; }
  .hero-bubble { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .page-home .hero-bi .bi { animation: drop .9s cubic-bezier(.3, 1.4, .5, 1) both, bob 3.6s ease-in-out .9s infinite; }
  .page-home .hero-bubble { animation: bubble .45s cubic-bezier(.3, 1.5, .5, 1) .6s both; }
}
@keyframes drop { from { transform: translateY(-70px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bubble { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Buổi dạy ---------- */
.teach { padding-top: 6px; }
.teach-head { margin-bottom: 18px; }
.topic { font-size: clamp(1.6rem, 3.6vw, 2.4rem); overflow-wrap: anywhere; }
.topic-label { display: inline-block; vertical-align: middle; font: 700 .85rem/1 var(--font-b); background: var(--coral-2); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; margin-right: 8px; }
.teach-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.tag { font-weight: 600; font-size: .9rem; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 12px; }
.pips { display: inline-flex; align-items: center; gap: 6px; }
.pip { width: 16px; height: 16px; border: 3px solid var(--ink); border-radius: 50%; background: #fff; transition: background-color .3s; }
.pip.is-on { background: var(--mint); }
.pips-text { margin-left: 6px; font-weight: 600; font-size: .95rem; }

.teach-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "card" "book" "notes"; align-items: start; }
.bi-card { grid-area: card; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px 16px; }
.notebook { grid-area: book; }
.bi-notes { grid-area: notes; }
.bi-card .bi--lg { width: 96px; height: 96px; animation: none; }
.bi-stage { border-radius: 50%; background: radial-gradient(circle at 50% 56%, #FFF1A8 0 60%, transparent 61%); padding: 2px; }

.meter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-weight: 700; }
.meter-num { font: 800 1.5rem/1 var(--font-d); }
.meter-track { height: 28px; background: #fff; border: var(--bd); border-radius: 999px; overflow: hidden; }
.meter-fill {
  height: 100%; width: 0; background-color: var(--coral);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .38) 0 8px, transparent 8px 16px);
  transition: width 1s cubic-bezier(.2, .8, .2, 1), background-color .4s;
}
.meter-fill.has-value { border-right: var(--bd); }
.meter[data-level="mid"] .meter-fill { background-color: var(--sun); }
.meter[data-level="high"] .meter-fill { background-color: var(--mint); }

.notebook { position: relative; padding: 18px 14px 18px 14px; box-shadow: var(--pop); border-radius: var(--r-l); }
.log {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 8px 6px 14px 6px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
  background-attachment: local;
  border-radius: 12px;
}
@media (prefers-reduced-motion: no-preference) { .log { scroll-behavior: smooth; } }
.log--static { max-height: none; overflow: visible; }

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .avatar { flex: none; }
.bubble { position: relative; max-width: min(100%, 36em); background: #fff; border: var(--bd); border-radius: 6px 20px 20px 20px; padding: 8px 14px 4px; }
.bubble p { margin: 0 0 .5em; overflow-wrap: anywhere; }
.who { display: block; font: 700 .85rem/1.2 var(--font-d); color: var(--ink-2); margin-bottom: 2px; }
.msg--me { justify-content: flex-end; }
.msg--me .bubble { background: var(--mint-2); border-radius: 20px 6px 20px 20px; transform: rotate(.35deg); max-width: min(88%, 34em); }
.msg--bi .bubble { transform: rotate(-.25deg); }
@media (prefers-reduced-motion: no-preference) {
  .msg.is-new { animation: msg-in .35s cubic-bezier(.3, 1.4, .5, 1); }
}
@keyframes msg-in { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.typing { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.dots { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: block; }
@media (prefers-reduced-motion: no-preference) {
  .dots i { animation: dot 1s ease-in-out infinite; }
  .dots i:nth-child(2) { animation-delay: .15s; }
  .dots i:nth-child(3) { animation-delay: .3s; }
}
@keyframes dot { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-5px); } }

.note-safe, .note-soft { margin: 14px 0 0; padding: 12px 14px; border: var(--bd); border-radius: var(--r-s); font-weight: 600; }
.note-safe { background: var(--coral-2); }
.note-soft { background: var(--sun-2); }

.composer { margin-top: 16px; }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.count { margin: 0; font-size: .9rem; color: var(--ink-2); }
.count.is-bad { color: #B3123F; font-weight: 700; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form-err { margin: 12px 0 0; padding: 10px 14px; background: var(--coral-2); border: var(--bd); border-radius: var(--r-s); font-weight: 600; }
.done { margin-top: 16px; text-align: center; padding: 18px; background: var(--mint-2); border: var(--bd); border-radius: var(--r-m); }
.done p { font: 700 1.2rem/1.3 var(--font-d); }
.done .btn { margin-top: 4px; }

.notes-title { margin-bottom: 12px; }
.notes-sec { margin-top: 16px; padding-top: 14px; border-top: 3px dashed var(--rule); }
.notes-sec:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.notes-sec h3 { margin-bottom: 8px; }
.notes-list { list-style: none; display: grid; gap: 7px; }
.notes-list li { position: relative; padding-left: 28px; font-family: var(--font-h); font-weight: 500; font-size: .98rem; line-height: 1.45; overflow-wrap: anywhere; }
.notes-list li::before { content: ""; position: absolute; left: 0; top: .15em; width: 20px; height: 20px; background-repeat: no-repeat; background-size: contain; }
.notes-sec--learned li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='%2334D3A0' stroke='%23221A4B' stroke-width='2'/%3E%3Cpath d='M6 10.3l2.7 2.7L14 7.5' fill='none' stroke='%23221A4B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.notes-sec--gaps li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='%23FFD23F' stroke='%23221A4B' stroke-width='2'/%3E%3Cpath d='M7.6 8a2.5 2.5 0 1 1 3.6 2.2c-.8.4-1.2.9-1.2 1.7M10 14.4v.2' fill='none' stroke='%23221A4B' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.notes-sec--doubts li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='%23FF5C8A' stroke='%23221A4B' stroke-width='2'/%3E%3Cpath d='M10 5.5v5.6M10 14.4v.2' fill='none' stroke='%23221A4B' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.notes-empty { margin: 0; font-size: .92rem; color: var(--ink-2); }
.notes-list:not(:empty) + .notes-empty { display: none; }

@media (min-width: 980px) {
  .teach-grid { grid-template-columns: minmax(0, 1fr) 330px; grid-template-areas: "book card" "book notes"; gap: 22px; }
  .bi-card { display: block; padding: 18px 20px 20px; text-align: left; }
  .bi-card .bi--lg { width: 100%; height: auto; aspect-ratio: 1; max-width: 210px; margin: 0 auto; animation: bob 3.6s ease-in-out infinite; }
  .bi-stage { margin-bottom: 14px; }
  .notebook { padding: 22px 22px 22px 54px; }
  .notebook::before {
    content: ""; position: absolute; left: 12px; top: 18px; bottom: 18px; width: 28px;
    background: radial-gradient(circle at 14px 14px, var(--page) 0 6px, var(--ink) 6px 8px, transparent 8.5px) 0 0 / 28px 64px repeat-y;
  }
  .log { padding-left: 14px; max-height: min(58vh, 560px); overflow-y: auto; }
  .log--static { max-height: none; overflow: visible; }
  .log::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--coral-2); }
}
@media (prefers-reduced-motion: reduce) { .bi-card .bi--lg { animation: none !important; } }
@media (max-width: 520px) {
  .composer-actions { width: 100%; }
  .composer-actions .btn { flex: 1 1 140px; }
  .composer-actions .btn--sm { flex-basis: 100%; }
  .bi-card { grid-template-columns: 84px minmax(0, 1fr); }
  .bi-card .bi--lg { width: 84px; height: 84px; }
}

/* ---------- Bảng điểm ---------- */
.report { padding-top: 6px; display: grid; gap: 22px; }
.report-top { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.score-card { text-align: center; box-shadow: var(--pop); border-radius: var(--r-l); padding: 26px 20px 24px; }
.ring { position: relative; width: 210px; height: 210px; margin: 0 auto 14px; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-edge { stroke: var(--ink); }
.ring-bg { stroke: #fff; }
.ring-fg { stroke: var(--coral); }
.score-card[data-level="mid"] .ring-fg { stroke: var(--sun); }
.score-card[data-level="high"] .ring-fg { stroke: var(--mint); }
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num b { font: 800 4.2rem/.9 var(--font-d); }
.ring-num span { font: 700 1.1rem/1 var(--font-d); color: var(--ink-2); }
.stamp { display: inline-block; margin: 0 0 10px; padding: 4px 16px; font: 800 1.4rem/1.2 var(--font-d); background: var(--sun); border: var(--bd); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
.score-blurb { margin: 0; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .ring-fg.is-anim { transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1); }
  .stamp.is-anim { animation: stamp .5s cubic-bezier(.3, 1.8, .5, 1) 1.1s both; }
}
@keyframes stamp { from { transform: rotate(-3deg) scale(2); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }

.report-meta { margin: 0 0 6px; color: var(--ink-2); font-weight: 600; }
.report-head h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); overflow-wrap: anywhere; }
.headline { font: 700 1.3rem/1.35 var(--font-d); margin: 10px 0 18px; }
.retell { display: flex; gap: 12px; align-items: flex-start; }
.retell .avatar { flex: none; }

.two { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.pane h2 { margin-bottom: 12px; }
.pane--good { background: var(--mint-2); }
.pane--next { background: var(--sun-2); }
.pane--check { background: #fff; }
.tick, .arrow { list-style: none; display: grid; gap: 10px; }
.tick li, .arrow li { position: relative; padding-left: 32px; }
.tick li::before, .arrow li::before { content: ""; position: absolute; left: 0; top: .18em; width: 22px; height: 22px; background-repeat: no-repeat; background-size: contain; }
.tick li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='%2334D3A0' stroke='%23221A4B' stroke-width='2'/%3E%3Cpath d='M6 10.3l2.7 2.7L14 7.5' fill='none' stroke='%23221A4B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.arrow li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8.5' fill='%23FFD23F' stroke='%23221A4B' stroke-width='2'/%3E%3Cpath d='M6 10h7M10 6.5l3.5 3.5-3.5 3.5' fill='none' stroke='%23221A4B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.checks { list-style: none; display: grid; gap: 14px; }
.checks li { display: grid; gap: 2px; padding-left: 14px; border-left: 5px solid var(--coral); }
.said { color: var(--ink-2); }
.right { font-weight: 700; }

.tip { position: relative; justify-self: start; max-width: 38em; padding: 22px 26px; background: #FFF4A8; border: var(--bd); border-radius: 6px; transform: rotate(-.7deg); margin-top: 6px; }
.tip::before {
  content: ""; position: absolute; top: -14px; left: 28px; width: 96px; height: 26px;
  background: repeating-linear-gradient(135deg, var(--coral-2) 0 9px, #fff 9px 18px);
  border: 2px solid var(--ink); border-radius: 4px; transform: rotate(-3deg);
}
.tip-text { margin: 0; font: 600 1.12rem/1.55 var(--font-h); }

.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.copied { font-weight: 700; background: var(--mint-2); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 12px; }
.transcript summary { cursor: pointer; font: 800 1.15rem/1.3 var(--font-d); }
.transcript .log { margin-top: 14px; }
.fine { font-size: .9rem; color: var(--ink-2); margin: 0; max-width: 46em; }
.del { margin: 0; font-size: .92rem; }

@media (min-width: 860px) {
  .report-top { grid-template-columns: 320px minmax(0, 1fr); align-items: center; gap: 40px; }
  .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Sổ tay (lịch sử) ---------- */
.history { display: grid; gap: 22px; padding-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat { background: var(--paper); border: var(--bd); border-radius: var(--r-m); padding: 14px 12px; text-align: center; }
.stat--a { background: var(--sun-2); }
.stat--b { background: var(--mint-2); }
.stat--c { background: var(--coral-2); }
.stat dt { font-size: .85rem; font-weight: 600; color: var(--ink-2); order: 2; }
.stat dd { margin: 0; font: 800 2.4rem/1.1 var(--font-d); order: 1; }
.stat { display: flex; flex-direction: column; }
.lesson-list { list-style: none; display: grid; gap: 12px; }
.lesson-row { display: flex; align-items: center; gap: 14px; text-decoration: none; padding: 14px 16px; transition: transform .12s, box-shadow .12s; }
.lesson-row:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); }
.lesson-info { display: grid; min-width: 0; }
.lesson-info b { font: 700 1.15rem/1.3 var(--font-d); overflow-wrap: anywhere; }
.lesson-info span { font-size: .9rem; color: var(--ink-2); }
.badge { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border: var(--bd); border-radius: 50%; font: 800 1.4rem/1 var(--font-d); background: #fff; }
.badge--low { background: var(--coral); }
.badge--mid { background: var(--sun); }
.badge--high { background: var(--mint); }
.empty { text-align: center; padding: 36px 20px; }
.empty h1, .empty h2 { margin-bottom: 8px; }
.empty p { color: var(--ink-2); }

/* ---------- Trang chữ ---------- */
.prose { padding-top: 6px; }
.prose h1 { margin-bottom: 14px; }
.prose h2 { margin: 30px 0 10px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; margin-bottom: 1em; }
.prose p, .prose li { max-width: 40em; }

/* ---------- Chân trang ---------- */
.foot { text-align: center; padding: 8px 16px 32px; font-size: .9rem; color: var(--ink-2); }
.foot p { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
