* { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: "Lato", "Be Vietnam Pro", "Noto Sans JP", "Segoe UI", Arial, sans-serif; background: #edf5fc; color: #1f2430; }
  #exam-room, #onde-room { font-family: "Be Vietnam Pro", "Noto Sans JP", "Segoe UI", Arial, sans-serif; }
  header.hero { position: relative; color: #fff; overflow: hidden; background: #2f7fc4; }
  .hero-bg { position: absolute; inset: 0; }
  .hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; animation: heroFade 21s ease-in-out infinite; will-change: opacity, transform; }
  .hero-slide.d2 { animation-delay: 7s; }
  .hero-slide.d3 { animation-delay: 14s; }
  @keyframes heroFade { 0% { opacity: 0; transform: scale(1.03); } 5% { opacity: 1; } 33% { opacity: 1; } 38% { opacity: 0; transform: scale(1.08); } 100% { opacity: 0; transform: scale(1.08); } }
  .hero-shade { position: absolute; inset: 0; background: linear-gradient(100deg, rgba(15,62,102,.88) 0%, rgba(22,84,138,.68) 48%, rgba(47,127,196,.32) 80%, rgba(47,127,196,.20) 100%); }
  .hero-inner { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 34px 24px 26px; }
  @media (prefers-reduced-motion: reduce) { .hero-slide { animation: none; } .hero-slide.s1 { opacity: 1; } }
  .hero-badge { display: inline-block; background: rgba(255,255,255,.96); color: #14507e; border: 1px solid rgba(255,255,255,.96); padding: 5px 14px; border-radius: 999px; font-size: 12.5px; letter-spacing: 1.5px; font-weight: 700; box-shadow: 0 2px 10px rgba(10,50,85,.25); }
  header.hero h1 { font-size: 37px; font-weight: 900; margin-top: 14px; line-height: 1.22; text-shadow: 0 2px 14px rgba(10,50,85,.35); }
  header.hero h1 .hl { color: #ffe9a8; }
  .hero-sub { margin-top: 10px; font-size: 15.5px; color: #eaf4fd; max-width: 660px; line-height: 1.55; text-shadow: 0 1px 8px rgba(10,50,85,.3); }
  .hero-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 2px; }
  .hero-stats span { background: rgba(255,255,255,.24); border: 1px solid rgba(255,255,255,.42); backdrop-filter: blur(3px); padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
  #auth-area { margin-top: 14px; }
  .lvl-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
  .lvl { border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.10); color: #fff; border-radius: 12px; padding: 8px 16px; font-size: 16px; font-weight: 800; cursor: pointer; text-align: left; font-family: inherit; }
  .lvl span { display: block; font-size: 11px; font-weight: 500; opacity: .85; margin-top: 1px; }
  .lvl.on { background: #ffffff; border-color: #ffffff; color: #14507e; opacity: 1; }
  .lvl.soon { opacity: .6; }
  #auth-area .cta-big { background: #ffffff; color: #14507e; font-size: 16.5px; font-weight: 800; padding: 13px 26px; border-radius: 999px; box-shadow: 0 6px 18px rgba(21,80,126,.35); }
  #auth-area .cta-big:hover { background: #eaf4fd; }
  #auth-area .cta-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.65); font-size: 15px; font-weight: 700; padding: 12px 22px; border-radius: 999px; }
  .auth-note { margin-top: 10px; font-size: 13px; color: #dcefff; max-width: 660px; line-height: 1.5; }
  .progress-wrap { margin-top: 10px; background: rgba(255,255,255,.25); border-radius: 999px; height: 12px; overflow: hidden; max-width: 560px; }
  .progress-bar { height: 100%; background: #ffffff; width: 0%; transition: width .4s; }
  .progress-text { font-size: 12.5px; margin-top: 5px; }
  nav { display: flex; gap: 8px; padding: 14px 24px 0; flex-wrap: wrap; justify-content: center; }
  nav button { border: none; background: #e4e9f4; color: #23406e; padding: 9px 18px; border-radius: 999px; font-size: 15px; cursor: pointer; font-weight: 600; }
  nav button.active { background: #2f7fc4; color: #fff; }
  main { padding: 18px 24px 40px; max-width: 1080px; margin: 0 auto; }
  .card { background: #fff; border-radius: 14px; box-shadow: 0 1px 5px rgba(20,30,60,.08); padding: 18px; margin-bottom: 16px; }
  .lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
  .lesson-chip { border: 1.5px solid #d5ddef; background: #fff; border-radius: 10px; padding: 9px 6px; cursor: pointer; text-align: center; font-size: 13.5px; font-weight: 600; color: #23406e; }
  .lesson-chip small { display: block; font-weight: 400; color: #7a8499; font-size: 11.5px; margin-top: 2px; }
  .lesson-chip.done { border-color: #43a047; background: #e8f5e9; }
  .lesson-chip.current { border-color: #2f7fc4; background: #e2f1fd; }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: 12.5px; color: #7a8499; padding: 8px 10px; border-bottom: 2px solid #eef1f7; }
  td { padding: 10px; border-bottom: 1px solid #eef1f7; vertical-align: middle; }
  tr.known td { background: #f1f8f1; }
  .word { font-size: 21px; font-weight: 700; }
  .reading { font-size: 14px; color: #5b6578; }
  .hanviet { font-size: 12.5px; color: #8a6d1a; letter-spacing: .3px; }
  .nghia { font-size: 15.5px; }
  .icon-btn { border: none; background: #eef3fc; border-radius: 50%; width: 34px; height: 34px; font-size: 16px; cursor: pointer; }
  .icon-btn:hover { background: #d9e6fa; }
  .st-btn { border: 1.5px solid #d5ddef; background: #fff; border-radius: 8px; width: 32px; height: 32px; font-size: 15px; cursor: pointer; color: #98a0b3; }
  .st-btn.ok.active { background: #43a047; border-color: #43a047; color: #fff; }
  .st-btn.no.active { background: #e53935; border-color: #e53935; color: #fff; }
  .btn { border: none; border-radius: 10px; padding: 10px 20px; font-size: 15px; font-weight: 600; cursor: pointer; }
  .btn-primary { background: #2f7fc4; color: #fff; }
  .btn-ok { background: #43a047; color: #fff; }
  .btn-no { background: #e53935; color: #fff; }
  .btn-ghost { background: #e4e9f4; color: #23406e; }
  .btn:disabled { opacity: .45; cursor: default; }
  .row-flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .spacer { flex: 1; }
  h2 { font-size: 19px; margin-bottom: 6px; }
  h3 { font-size: 16px; margin: 14px 0 8px; color: #23406e; }
  .muted { color: #7a8499; font-size: 13.5px; }
  .flashcard { background: linear-gradient(160deg, #ffffff, #eef3fc); border: 2px solid #d5ddef; border-radius: 18px; min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; padding: 26px; text-align: center; user-select: none; }
  .flashcard .fw { font-size: 46px; font-weight: 800; }
  .flashcard .fr { font-size: 22px; color: #5b6578; margin-top: 6px; }
  .flashcard .fn { font-size: 26px; font-weight: 700; color: #23406e; margin-top: 8px; }
  .flashcard .fh { font-size: 15px; color: #8a6d1a; margin-top: 4px; }
  .flashcard .hint { font-size: 13px; color: #98a0b3; margin-top: 14px; }
  .quiz-opt { display: block; width: 100%; text-align: left; margin: 8px 0; padding: 13px 16px; border: 1.5px solid #d5ddef; border-radius: 10px; background: #fff; font-size: 16px; cursor: pointer; }
  .quiz-opt:hover { border-color: #2f7fc4; }
  .quiz-opt.right { background: #e8f5e9; border-color: #43a047; }
  .quiz-opt.wrong { background: #fdecea; border-color: #e53935; }
  input[type="text"], select { padding: 10px 14px; border: 1.5px solid #d5ddef; border-radius: 10px; font-size: 15.5px; width: 100%; }
  select { width: auto; }
  .ex-item { padding: 8px 0; border-bottom: 1px dashed #e3e8f2; }
  .ex-jp { font-size: 16.5px; }
  .ex-word { font-size: 20px; font-weight: 800; line-height: 1.25; }
  .ex-reading { font-size: 14px; color: #4a6fa5; margin: 1px 0 5px; }
  .ex-jp-reading { font-size: 14px; color: #8494ab; margin-top: 2px; }
  .ex-vi { font-size: 14.5px; color: #5b6578; }
  /* --- Ngữ pháp --- */
  .g-point { border: 1px solid #e3e8f2; border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: #fbfcff; }
  .g-point.learned { border-color: #9fd3ae; background: #f4fbf5; }
  .g-pattern { font-size: 19px; font-weight: 800; color: #14507e; line-height: 1.35; }
  .g-meaning { font-size: 15px; font-weight: 700; color: #b3541e; margin-top: 2px; }
  .g-expl { font-size: 14.5px; color: #3c465c; white-space: pre-line; margin-top: 8px; line-height: 1.55; }
  .g-examples { margin-top: 10px; border-top: 1px dashed #e3e8f2; padding-top: 4px; }
  .g-mark { display: inline-flex; align-items: center; gap: 6px; }
  .g-mark > span { font-size: 12.5px; color: #7a8499; font-weight: 600; }
  .chip { display: inline-block; background: #e2f1fd; color: #14507e; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 700; }
  .kcard { display: flex; gap: 16px; }
  .k-big { font-size: 62px; font-weight: 800; color: #14507e; line-height: 1.15; min-width: 82px; text-align: center; }
  .k-hanviet { font-size: 19px; font-weight: 800; color: #b3541e; }
  .k-meaning { font-size: 15px; font-weight: 600; color: #23406e; }
  .k-readings { font-size: 13.5px; color: #5b6578; margin-top: 4px; line-height: 1.65; }
  .k-readings b { color: #14507e; }
  .k-words { margin-top: 10px; border-top: 1px dashed #e3e8f2; padding-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; }
  .kmode-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
  .kmode-row button { border: none; background: #e4e9f4; color: #23406e; padding: 9px 18px; border-radius: 999px; font-size: 15px; cursor: pointer; font-weight: 600; }
  .kmode-row button.active { background: #2f7fc4; color: #fff; }
  .kflash { perspective: 1200px; height: 380px; cursor: pointer; margin-top: 10px; }
  .kflash-inner { position: relative; width: 100%; height: 100%; transition: transform .55s; transform-style: preserve-3d; }
  .kflash-inner.flipped { transform: rotateY(180deg); }
  .kface { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 18px; padding: 22px; box-sizing: border-box; }
  .kfront { background: linear-gradient(160deg, #2f7fc4, #14507e); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
  .kfront .kf-kanji { font-size: 128px; font-weight: 800; line-height: 1.1; font-family: "Noto Sans JP", sans-serif; }
  .kfront .kf-sub { margin-top: 6px; font-size: 16px; opacity: .9; }
  .kfront .kf-hint { margin-top: 14px; font-size: 13px; opacity: .75; }
  .kback { background: #fff; border: 2px solid #d5ddef; transform: rotateY(180deg); overflow-y: auto; }
  .kflash-ctrl { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
  .kf-check { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font-size: 14px; color: #5b6578; cursor: pointer; }
  .k-word { font-size: 14.5px; }
  .k-word b { font-size: 16px; color: #1c2440; }
  .k-word .r { color: #5b6578; font-size: 13.5px; }
  .k-word .v { color: #3c465c; display: block; font-size: 13.5px; }
  .g-sr-item { padding: 8px 2px; border-bottom: 1px dashed #e3e8f2; cursor: pointer; }
  .g-sr-item:hover { background: #f4f6fb; }
  .stats { display: flex; gap: 18px; flex-wrap: wrap; }
  .stat b { font-size: 22px; display: block; }
  .stat span { font-size: 12.5px; color: #7a8499; }
  footer { text-align: center; color: #98a0b3; font-size: 12.5px; padding: 0 20px 26px; }
  @media (max-width: 640px) { .word { font-size: 18px; } .flashcard .fw { font-size: 36px; } td, th { padding: 8px 6px; } }

  #auth-area .chip { display:inline-block; background:rgba(255,255,255,.18); border-radius:999px; padding:6px 14px; font-size:13.5px; }
  #panel-hoc.rank-only #hoc-lvls, #panel-hoc.rank-only #hoc-skills, #panel-hoc.rank-only #vocab-books, #panel-hoc.rank-only #vocab-book-note, #panel-hoc.rank-only #hoc-app nav { display:none !important; }
  #panel-hoc.rank-only .panel-wrap:has(> #hoc-lvls), #panel-hoc.rank-only .panel-wrap:has(> #hoc-skills), #panel-hoc.rank-only .panel-wrap:has(> #vocab-books) { display:none !important; }
  #auth-area button { border:none; border-radius:999px; padding:7px 16px; font-size:13.5px; font-weight:600; cursor:pointer; background:#ffffff; color:#14507e; }
  #auth-area button.ghost { background:rgba(255,255,255,.25); color:#fff; }
  #profile-modal { position:fixed; inset:0; background:rgba(15,25,50,.55); z-index:50; display:flex; align-items:center; justify-content:center; padding:14px; }
  .pf-card { background:#fff; border-radius:18px; max-width:640px; width:100%; max-height:92vh; overflow:auto; padding:22px; box-shadow:0 18px 50px rgba(10,40,80,.35); }
  .pf-grid { display:grid; grid-template-columns:200px 1fr; gap:20px; }
  @media (max-width:560px) { .pf-grid { grid-template-columns:1fr; } }
  .pf-left { text-align:center; }
  .pf-ava { width:96px; height:96px; border-radius:50%; margin:0 auto; display:flex; align-items:center; justify-content:center; font-size:52px; background:linear-gradient(180deg,#eef6fd,#d7ebfc); border:3px solid #55a5e6; cursor:pointer; }
  .pf-name { font-size:19px; font-weight:800; color:#173d63; margin-top:10px; }
  .pf-rank { display:inline-block; margin-top:6px; padding:5px 14px; border-radius:999px; background:#2f7fc4; color:#fff; font-weight:800; font-size:14.5px; }
  .pf-xpbar { height:10px; background:#e4eef8; border-radius:99px; overflow:hidden; margin-top:12px; }
  .pf-xpfill { height:100%; background:linear-gradient(90deg,#55a5e6,#2f7fc4); border-radius:99px; }
  .pf-next { font-size:13px; color:#5a6b84; margin-top:6px; }
  .pf-ach h3 { margin:0 0 10px; color:#173d63; font-size:16.5px; }
  .pf-ach table { width:100%; border-collapse:collapse; }
  .pf-ach td { padding:8px 6px; border-bottom:1px solid #eef2f8; font-size:14.5px; }
  .pf-ach td:last-child { text-align:right; font-weight:800; color:#1c5d99; }
  .ava-grid { display:grid; grid-template-columns:repeat(8,1fr); gap:8px; margin-top:10px; }
  .ava-opt { font-size:26px; padding:7px 0; border-radius:12px; border:2px solid #e4eef8; background:#fff; cursor:pointer; }
  .ava-opt.on { border-color:#2f7fc4; background:#eef6fd; }
  @media (max-width:560px) { .ava-grid { grid-template-columns:repeat(4,1fr); } }
  .pf-tier { margin-top:14px; }
  .pf-tier h4 { margin:0 0 6px; color:#173d63; font-size:15px; }
  .pf-rung { display:flex; justify-content:space-between; padding:6px 10px; border-bottom:1px solid #eef2f8; font-size:14px; color:#51637c; border-radius:8px; }
  .pf-rung.done { color:#7d8ea6; }
  .pf-rung.on { background:#eef6fd; color:#1c5d99; font-weight:800; }
  #auth-modal { position:fixed; inset:0; background:rgba(15,25,50,.55); z-index:50; display:flex; align-items:center; justify-content:center; }
  .modal-box { background:#fff; border-radius:16px; padding:24px; width:min(420px, 92vw); box-shadow:0 10px 40px rgba(0,0,0,.3); }
  .modal-box label { display:block; font-size:13.5px; color:#5b6578; margin-top:12px; }
  .modal-box input { margin-top:5px; }
  .modal-box input[type="password"] { padding:10px 14px; border:1.5px solid #d5ddef; border-radius:10px; font-size:15.5px; width:100%; }
  tr.me td { background:#fff8e1; font-weight:700; }
  .medal { font-size:18px; }

  button, input, select, textarea { font-family: inherit; }
  .topbar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; background: rgba(255,255,255,.97); box-shadow: 0 1px 8px rgba(20,30,60,.14); }
  .tb-logo { border: none; background: none; cursor: pointer; padding: 2px; display: flex; align-items: center; gap: 10px; text-align: left; font-family: inherit; }
  .logo-mark { width: 38px; height: 38px; flex: 0 0 auto; filter: drop-shadow(0 2px 5px rgba(47,127,196,.35)); }
  .logo-text { font-size: 17.5px; font-weight: 900; color: #14507e; letter-spacing: .2px; line-height: 1.1; white-space: nowrap; }
  .logo-text small { display: block; font-size: 10.5px; font-weight: 600; color: #7a97ad; letter-spacing: .6px; margin-top: 2px; text-transform: uppercase; }
  .tb-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .tb-btn { border: 1.5px solid #d5ddef; background: #fff; color: #23406e; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 700; cursor: pointer; }
  .tb-btn:hover { border-color: #2f7fc4; color: #14507e; }
  .tb-btn.home { background: #2f7fc4; border-color: #2f7fc4; color: #fff; }
  @media (max-width: 560px) { .logo-text { font-size: 15px; } .logo-text small { display: none; } .logo-mark { width: 32px; height: 32px; } .tb-btn { padding: 6px 10px; font-size: 13px; } }
  .langbar { display:flex; gap:10px; justify-content:center; padding:18px 24px 0; flex-wrap:wrap; }
  .lang-btn { font-family:inherit; font-size:16px; font-weight:700; padding:11px 30px; border-radius:999px; border:2px solid #2f7fc4; background:#fff; color:#14507e; cursor:pointer; }
  .lang-btn.active { background:#2f7fc4; color:#fff; box-shadow:0 6px 16px rgba(47,127,196,.35); }
  .subbar { display:flex; gap:8px; justify-content:center; padding:14px 24px 0; flex-wrap:wrap; }
  .sub-btn { font-family:inherit; border:none; background:#e4e9f4; color:#23406e; padding:10px 22px; border-radius:999px; font-size:15px; cursor:pointer; font-weight:700; }
  .sub-btn.active { background:#2f7fc4; color:#fff; }
  .hub { max-width: 1080px; margin: 0 auto; padding: 36px 16px 6px; text-align: center; }
  .hub-title { font-size: 27px; font-weight: 800; color: #173d63; }
  .hub-sub { color: #5a6b84; margin: 8px 0 24px; font-size: 15px; }
  .hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .hub-card { font-family: inherit; cursor: pointer; border: 2px solid #cfe4f7; background: linear-gradient(180deg, #ffffff, #eef6fd); border-radius: 20px; padding: 32px 20px 28px; display: flex; flex-direction: column; align-items: center; gap: 9px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
  .hub-card:hover { transform: translateY(-3px); border-color: #55a5e6; box-shadow: 0 12px 28px rgba(47,127,196,.18); }
  .hub-ico { font-size: 47px; line-height: 1; }
  .hub-name { font-size: 25px; font-weight: 900; color: #1c5d99; }
  .hub-desc { font-size: 14.5px; color: #51637c; line-height: 1.5; }
  @media (max-width: 768px) { .hub { padding-top: 26px; } .hub-grid { grid-template-columns: 1fr; } .hub-card { padding: 22px 16px; } .hub-ico { font-size: 38px; } .hub-name { font-size: 22px; } .hub-title { font-size: 23px; } }
  .panel-wrap { max-width:1080px; margin:0 auto; padding:18px 24px 0; }
  .lvl-row2 { display:flex; gap:8px; flex-wrap:wrap; }
  .skill-row { display:flex; gap:8px; flex-wrap:wrap; }
  .skill-btn { border:2px solid #7fb8e8; background:#eef6fd; color:#14507e; border-radius:999px; padding:9px 18px; font-size:15px; font-weight:700; cursor:pointer; }
  .skill-btn.on { background:#2f7fc4; border-color:#2f7fc4; color:#fff; }
  .lvl2 { font-family:inherit; border:1.5px solid #d5ddef; background:#fff; border-radius:10px; padding:8px 18px; font-weight:800; font-size:15px; color:#23406e; cursor:pointer; }
  .lvl2 small { display:block; font-weight:500; font-size:10.5px; color:#7a8499; margin-top:1px; }
  .lvl2.on { background:#d9ecfc; border-color:#2f7fc4; color:#14507e; }
  .lvl2.on small { color:#3d739e; }
  .book-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .book-chip { border: 1.5px solid #c9dff2; background: #fff; border-radius: 12px; padding: 8px 14px; font-size: 15px; font-weight: 700; color: #14507e; cursor: pointer; text-align: left; font-family: inherit; }
  .book-chip small { display: block; font-size: 12px; font-weight: 500; color: #8494ab; margin-top: 1px; }
  .book-chip.on { border-color: #2f7fc4; background: #e8f3fd; box-shadow: 0 1px 4px rgba(47,127,196,.18); }
  .soon-box { margin-top:14px; background:#eef6fd; border:1.5px dashed #7fb8e8; border-radius:12px; padding:16px 18px; font-size:15px; line-height:1.65; }

  .exam-passage { background: #f6f8fd; border: 1px solid #dfe6f5; border-radius: 10px; padding: 12px 14px; font-size: 15px; line-height: 1.9; margin: 10px 0; white-space: pre-wrap; }
  .q-block { border-top: 1px solid #edf0f7; padding: 14px 0 6px; }
  .q-text { font-size: 15.5px; line-height: 1.85; font-weight: 600; color: #1c2b4a; white-space: pre-wrap; }
  .q-text u { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
  .q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  @media (max-width: 640px) { .q-opts { grid-template-columns: 1fr; } }
  .q-opt { text-align: left; border: 1.5px solid #d5ddef; background: #fff; border-radius: 10px; padding: 9px 12px; font-size: 14.5px; cursor: pointer; line-height: 1.6; color: #26355a; }
  .q-opt:hover { border-color: #7aa2e8; }
  .q-opt.sel { border-color: #2f6df6; background: #eaf1fe; font-weight: 600; }
  .q-opt.ok { border-color: #43a047; background: #e8f5e9; font-weight: 600; }
  .q-opt.bad { border-color: #e53935; background: #fdecea; font-weight: 600; }
  .q-opt:disabled { cursor: default; opacity: .92; }

  .sys-row { display:flex; gap:8px; margin-top:12px; }
  .sys-btn { border:1.5px solid #d5ddef; background:#fff; border-radius:999px; padding:8px 18px; font-size:15px; font-weight:700; cursor:pointer; color:#26355a; }
  .sys-btn.on { background:#2f7fc4; color:#fff; border-color:#2f7fc4; }
  .q-img { max-width:100%; border:1px solid #dfe6f5; border-radius:10px; margin:8px 0; display:block; }
  .q-hint { font-size:12.5px; color:#5b7a94; margin-top:5px; }
  .q-input { width:100%; box-sizing:border-box; padding:10px 12px; border:1.5px solid #d5ddef; border-radius:10px; font-size:15.5px; color:#26355a; background:#fff; }
  .q-input:focus { border-color:#2f6df6; outline:none; }
  .q-input.ok { border-color:#43a047; background:#e8f5e9; }
  .q-input.bad { border-color:#e53935; background:#fdecea; }
  .fill2-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:8px; }
  @media (max-width:640px){ .fill2-row { grid-template-columns:1fr; } }
  .jt-status { background:#f6f8fd; border:1px solid #dfe6f5; border-radius:10px; padding:12px 14px; margin-top:12px; font-size:14.5px; line-height:1.7; }
  .tg-btn { display:inline-flex; align-items:center; gap:9px; background:#229ED9; color:#fff; font-weight:700; font-size:15px; padding:10px 18px; border-radius:999px; text-decoration:none; box-shadow:0 3px 10px rgba(34,158,217,.35); }
  .tg-btn:hover { background:#1b8ac2; }
  .tg-btn svg { flex:0 0 auto; }
  .exam-audio { background:#fff8e6; border:1px solid #f0d48a; border-radius:10px; padding:12px 14px; margin:10px 0; }
  .exam-audio audio { width:100%; margin-top:8px; }
  .jt-transcript { background:#f6f8fd; border:1px dashed #b9c8ea; border-radius:10px; padding:10px 14px; margin-top:8px; font-size:14.5px; line-height:1.9; white-space:pre-wrap; }
  .exam-bar { position: sticky; top: 0; z-index: 5; background: #2f7fc4; color: #fff; border-radius: 10px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .exam-clock-wrap { text-align: center; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 6px 16px 7px; min-width: 128px; }
  .exam-clock-label { font-size: 10.5px; letter-spacing: 1.4px; font-weight: 700; opacity: .9; }
  .exam-clock { font-size: 27px; font-weight: 800; letter-spacing: 1.5px; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .exam-clock-total { font-size: 11.5px; opacity: .85; }
  .exam-clock.low { color: #ff9d97; animation: clockPulse 1s ease-in-out infinite; }
  @keyframes clockPulse { 50% { opacity: .5; } }
  .exam-sec-title { font-size: 17px; font-weight: 800; color: #23406e; margin: 16px 0 4px; }
  .exam-instr { color: #5a6a8c; font-size: 13.5px; margin-bottom: 6px; line-height: 1.7; }
  .exam-score-box { background: #eef4ff; border: 1.5px solid #bcd2fb; border-radius: 12px; padding: 16px; text-align: center; margin: 14px 0; }
  .exam-score-big { font-size: 34px; font-weight: 900; color: #23406e; }
  .exam-nav-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

  .menubar { display: flex; gap: 12px; justify-content: center; align-items: flex-end; padding: 16px 24px 0; flex-wrap: wrap; }
  .menu-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: #3d739e; letter-spacing: .3px; }
  .menu-field select { font-family: inherit; font-size: 15.5px; font-weight: 700; color: #14507e; background-color: #fff; border: 2px solid #2f7fc4; border-radius: 999px; padding: 10px 38px 10px 16px; cursor: pointer; width: auto; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232f7fc4' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; box-shadow: 0 2px 8px rgba(47,127,196,.15); }
  .menu-field select:focus { outline: none; border-color: #14507e; }


  /* ===== Responsive: iPad + Mobile (2026-11-11) ===== */
  html, body { overflow-x: hidden; }
  img, video, audio { max-width: 100%; }
  .tb-nav { min-width: 0; }
  @media (max-width: 1024px) {
    main { padding: 16px 18px 36px; }
    .panel-wrap { padding: 16px 18px 0; }
    .lesson-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  }
  @media (max-width: 768px) {
    main { padding: 12px 10px 30px; }
    .panel-wrap { padding: 12px 10px 0; }
    .card { padding: 13px 12px; border-radius: 12px; }
    .hero-inner { padding: 20px 14px 18px; }
    header.hero h1 { font-size: 23px !important; }
    .hero-sub { font-size: 13.5px; margin-top: 7px; }
    #auth-area .cta-big { font-size: 15px; padding: 12px 18px; }
    #auth-area .cta-ghost { font-size: 14px; padding: 11px 16px; }
    .topbar { flex-wrap: wrap; padding: 8px 10px; row-gap: 6px; }
    .tb-nav { justify-content: flex-start; }
    .menubar { padding: 12px 10px 0; gap: 8px; }
    .menu-field { flex: 1 1 0; }
    .menu-field select { width: 100%; font-size: 16px; }
    .lang-btn { padding: 9px 16px; font-size: 14.5px; flex: 1 1 auto; }
    .subbar { padding: 10px 10px 0; gap: 6px; }
    .sub-btn { padding: 9px 14px; font-size: 14px; flex: 1 1 auto; }
    .lvl-row2 { gap: 6px; }
    .lvl2 { flex: 1 1 42%; padding: 8px 10px; font-size: 14px; }
    .skill-row { gap: 6px; }
    .skill-btn { flex: 1 1 auto; padding: 9px 10px; font-size: 14px; }
    .book-row { gap: 6px; }
    .book-chip { flex: 1 1 46%; font-size: 14px; padding: 8px 10px; }
    .lesson-grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; }
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    th, td { padding: 8px 7px; }
    .word { font-size: 18px; }
    input[type="text"], input[type="password"], select, textarea { font-size: 16px; }
    .flashcard { min-height: 200px; padding: 18px 14px; }
    .flashcard .fw { font-size: 34px; }
    .flashcard .fr { font-size: 19px; }
    .flashcard .fn { font-size: 22px; }
    .kcard { flex-direction: column; gap: 6px; }
    .k-big { font-size: 50px; text-align: left; min-width: 0; }
    .k-words { grid-template-columns: 1fr; }
    .kflash { height: 340px; }
    .kfront .kf-kanji { font-size: 92px; }
    .g-pattern { font-size: 17px; }
    .exam-bar { padding: 8px 10px; }
    .exam-clock { font-size: 22px; }
    .exam-clock-wrap { min-width: 108px; padding: 5px 10px 6px; }
    .exam-score-big { font-size: 28px; }
    .stats { gap: 12px; }
    h2 { font-size: 17px; }
    .sys-btn { padding: 8px 12px; font-size: 14px; }
    .btn { padding: 10px 14px; }
  }
  @media (max-width: 420px) {
    .lvl2 { flex: 1 1 44%; }
    .book-chip { flex: 1 1 100%; }
    .tb-btn { padding: 6px 9px; font-size: 12.5px; }
    .lesson-chip { font-size: 12.5px; padding: 8px 4px; }
  }
  /* ===== Mobile first-screen (2026-11-12): gon hero, 3 muc chinh thay ngay ===== */
  @media (max-width: 768px) {
    .hero-shade { background: linear-gradient(180deg, rgba(15,62,102,.93) 0%, rgba(22,84,138,.80) 55%, rgba(47,127,196,.55) 100%); }
    .hero-inner { padding: 16px 14px 14px; }
    .hero-badge { font-size: 11px; letter-spacing: 1px; padding: 5px 11px; }
    header.hero h1 { margin-top: 10px; line-height: 1.25; }
    .hero-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.5; margin-top: 7px; }
    .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 11px 0 0; }
    .hero-stats span { background: rgba(255,255,255,.94); color: #14507e; border: none; text-align: center; padding: 6px 6px; font-size: 12.5px; }
    #auth-area { margin-top: 11px; }
    #auth-area .chip { font-size: 12.5px; padding: 5px 11px; }
    #auth-area button { padding: 6px 13px; font-size: 12.5px; }
    .progress-wrap { margin-top: 9px; }
    .progress-text { font-size: 12px; margin-top: 4px; }
    .hub { padding-top: 16px; }
    .hub-title { font-size: 20px; }
    .hub-sub { display: none; }
    .hub-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
    .hub-card { padding: 15px 4px 12px; border-radius: 14px; gap: 5px; }
    .hub-ico { font-size: 29px; }
    .hub-name { font-size: 15.5px; }
    .hub-desc { display: none; }
  }

  /* --- V5: màn hình tải dữ liệu --- */
  #loading { position: fixed; inset: 0; background: rgba(244,246,251,.92); z-index: 200; display: flex; align-items: center; justify-content: center; }
  .load-box { background: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(20,30,60,.15); padding: 26px 34px; font-size: 17px; font-weight: 700; color: #2b3a8f; text-align: center; }
  .load-box .spin { font-size: 30px; display: block; margin-bottom: 8px; animation: spinPulse 1.2s ease-in-out infinite; }
  @keyframes spinPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25); } }
  #load-error { max-width: 720px; margin: 26px auto; }
