
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(/fonts/inter-vn.2848e9c1.woff2) format('woff2');}
  :root { --hl: #ffe169; --hlbg: #fff3a6; --ink: #1d2433; --muted: #6b7384; --line: #e7e9ef; --accent: #3b6ef5; --kw: #d97706; --bg: #f6f7fb; --card: #fff; --dot: #eceef3; --violet: #7c3aed; --green: #2b8a3e; }
  body.dark { --hl: #6b5d1a; --hlbg: #3a3413; --ink: #e6e9f0; --muted: #94a0b3; --line: #2c374a; --accent: #5b86f7; --kw: #e8a13c; --bg: #0f1420; --card: #1b2231; --dot: #2c374a; --violet: #a78bfa; --green: #4ea866; }
  .dark-btn { position: fixed; top: 10px; left: 10px; z-index: 50; width: 38px; height: 38px; border-radius: 50%;
              border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
              font-size: 1rem; line-height: 1; box-shadow: 0 2px 6px rgba(20,30,60,.14); }
  * { box-sizing: border-box; }
  body { margin: 0; font-family: 'Inter', -apple-system, "Segoe UI", Roboto, system-ui, sans-serif; letter-spacing: -.022em;
         color: var(--ink); background: var(--bg); line-height: 1.7; }
  header.top { padding: 20px 24px; text-align: left; background: var(--card); border-bottom: 1px solid var(--line); }
  header.top h1 { margin: 0 0 6px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
  header.top .hdr-row { color: var(--muted); font-size: .95rem; line-height: 1.5; }
  header.top .hdr-row b { color: var(--ink); font-weight: 700; }
  main { max-width: 760px; margin: 0 auto; padding: 18px 16px 80px; }
  /* technique card (e.g. It depends → 4 axes) — left-aligned, colored NAMES only, bullets, no emoji */
  .tech-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
               margin: 0 0 10px; box-shadow: 0 1px 3px rgba(20,30,60,.04); text-align: left; }
  .tech-head { font-size: 1rem; font-weight: 800; }
  .tech-head b { color: var(--violet); }
  .tech-sample { font-size: .88rem; color: var(--muted); margin: 2px 0 10px; }
  .tech-sample i { color: var(--ink); font-style: italic; }
  .axis { display: flex; align-items: baseline; gap: 7px; margin: 4px 0; font-size: .88rem; flex-wrap: wrap; }
  .axis .bul { color: var(--muted); }
  .axis .axis-name { font-weight: 800; white-space: nowrap; }
  .axis .split { flex: 1; min-width: 200px; }
  .axis .split b { font-weight: 700; }
  .axis .sep { color: var(--muted); margin: 0 8px; }
  .a-obj     .axis-name { color: var(--accent); }
  .a-time    .axis-name { color: var(--green); }
  .a-place   .axis-name { color: var(--kw); }
  .a-purpose .axis-name { color: var(--violet); }
  /* ladder (SCALE) — thang cấp độ, thụt bậc dần */
  .rung { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; font-size: .88rem; }
  .rung .nm { font-weight: 800; white-space: nowrap; min-width: 88px; }
  .rung .arw { color: var(--muted); }
  .rung.l1 { padding-left: 0; }    .rung.l1 .nm { color: var(--accent); }
  .rung.l2 { padding-left: 14px; } .rung.l2 .nm { color: var(--green); }
  .rung.l3 { padding-left: 28px; } .rung.l3 .nm { color: var(--kw); }
  .rung.l4 { padding-left: 42px; } .rung.l4 .nm { color: var(--violet); }
  /* beats (BDA) — reuse .axis row; color the name only */
  .beat .axis-name { min-width: 118px; }
  .beat.b1 .axis-name { color: var(--accent); }
  .beat.b2 .axis-name { color: var(--kw); }
  .beat.b3 .axis-name { color: var(--green); }
  /* sensory (5 giác quan) — reuse .axis row */
  .sense .axis-name { min-width: 72px; }
  .sense.s1 .axis-name { color: var(--accent); }
  .sense.s2 .axis-name { color: var(--kw); }
  .sense.s3 .axis-name { color: var(--green); }
  .sense.s4 .axis-name { color: var(--violet); }
  .sense.s5 .axis-name { color: var(--accent); }
  /* paraphrase — 3 câu mẫu → áp dụng */
  .pstep { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; font-size: .88rem; flex-wrap: wrap; }
  .pstep .pq { color: var(--muted); } .pstep .pq i { font-style: italic; }
  .pstep .arw { color: var(--muted); }
  .pstep .bd { flex: 1; min-width: 180px; } .pstep .bd b { font-weight: 700; color: var(--accent); }
  .qblock { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
            padding: 4px 18px 12px; margin: 16px 0; box-shadow: 0 1px 3px rgba(20,30,60,.04); }
  .q-prompt { display: flex; align-items: center; justify-content: space-between; gap: 12px;
              font-size: 1.02rem; font-weight: 700; margin: 0 0 10px; padding: 4px 0 6px 78px;
              position: sticky; top: 0; z-index: 5; background: var(--card); border-bottom: 1px solid var(--line); }
  .q-prompt .qtext { flex: 1; }
  .q-prompt .qn { color: var(--accent); }
  /* record button (beside the question): idle ● Ghi âm → recording/paused ■ + pause btn */
  .rec-wrap { flex: none; display: inline-flex; align-items: center; gap: 6px; }
  .rec { display: inline-flex; align-items: center; gap: 6px; background: #17181c; color: #fff; border: none;
         border-radius: 8px; padding: 5px 11px; cursor: pointer; font-size: .8rem; font-weight: 600; }
  .rec .dot { width: 11px; height: 11px; border-radius: 50%; background: #e5352b; transition: .15s; }
  .rec-wrap.st-rec .dot, .rec-wrap.st-pause .dot { border-radius: 2px; }
  .pause-btn { display: none; width: 30px; height: 30px; border-radius: 7px; border: 1.5px solid var(--line);
               background: var(--card); color: var(--ink); cursor: pointer; font-size: .72rem; align-items: center; justify-content: center; }
  .rec-wrap.st-rec .pause-btn, .rec-wrap.st-pause .pause-btn { display: inline-flex; }
  .q-audio-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
  .vlabel { font-size: .82rem; color: var(--muted); font-weight: 600; }
  .answer-lab { margin: 6px 0 2px; color: var(--accent); }
  .story-text { font-size: .9rem; line-height: 1.5; margin: 4px 0 12px; }
  .sent-row { display: flex; align-items: flex-start; gap: 9px; padding: 2px 0; }
  /* play button = solid soft dot + SVG arrow (variant B), small; stays in a fixed left column */
  .sent-play { flex: none; margin-top: 4px; width: 17px; height: 17px; border-radius: 50%; padding: 0;
               border: none; background: var(--dot); color: var(--ink); cursor: pointer;
               display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
  .sent-play svg { display: block; }
  .sent-play:hover { background: var(--accent); color: #fff; }
  .sent-play.playing { background: var(--accent); color: #fff; }
  .sent-play:disabled { opacity: .3; cursor: default; }
  .sent-text { flex: 1; }
  /* main/support level tag: only the TEXT indents; the play button stays column-aligned */
  .sent-row.support .sent-text { margin-left: 24px; border-left: 2px solid var(--line); padding-left: 10px; }
  .word { transition: background .08s, color .08s; border-radius: 4px; padding: 0 1px; cursor: default; }
  .word.active { background: var(--hlbg); box-shadow: 0 0 0 2px var(--hl); }
  .vocab { font-weight: 600; }
  .has-gloss { position: relative; cursor: help; }
  .vocab.has-gloss { border-bottom: none; }
  /* word-gloss tier: underline only, NOT bold (meaning-help words) */
  .wgloss { font-weight: 400; border-bottom: 1px dotted #8a8f99; }
  .has-gloss::after {
    content: attr(data-gloss); position: absolute; left: 0; top: calc(100% + 4px); z-index: 20;
    background: #22293a; color: #fff; font-weight: 400; font-size: .8rem; line-height: 1.35;
    padding: 5px 9px; border-radius: 7px; width: max-content; max-width: 240px;
    opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 4px 12px rgba(20,30,60,.18); }
  .has-gloss:hover::after, .has-gloss.show::after { opacity: 1; }
  /* control bar — indented (rail 64 + gap 14 = 78) so the player button lines up with the per-sentence plays */
  .controls { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin: 0 0 12px 78px; }
  .player { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 160px; min-width: 0; }
  .p-play { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; border: none;
            cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
  .p-bar { flex: 1 1 auto; min-width: 50px; max-width: 220px; height: 5px; border-radius: 3px; background: var(--line); position: relative; cursor: pointer; }
  .p-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 3px; background: var(--accent); width: 0; }
  .field { font-size: .74rem; color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
  .sel { font-size: .82rem; padding: 3px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card);
         color: var(--ink); font-weight: 600; cursor: pointer; }
  audio { height: 32px; vertical-align: middle; max-width: 100%; }
  .controls audio { max-width: 210px; }
  .speed-group { display: inline-flex; gap: 4px; }
  .speed-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 3px 9px;
               font-size: .82rem; cursor: pointer; color: var(--muted); }
  .speed-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .voice-group { display: inline-flex; gap: 7px; flex-wrap: wrap; }
  .voice-btn { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 15px;
               font-size: .85rem; cursor: pointer; font-weight: 700; color: var(--muted); }
  .voice-btn.male   { color: #2b8a3e; }                              /* nam — xanh lá */
  .voice-btn.female { color: #d6336c; }                              /* nữ — hồng */
  .voice-btn.male.active   { border-color: #2b8a3e; border-width: 2px; }   /* outline only, no fill */
  .voice-btn.female.active { border-color: #d6336c; border-width: 2px; }
  .rec-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 11px;
             font-size: .85rem; cursor: pointer; }
  .dl-btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 5px 13px;
            font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
            display: inline-flex; align-items: center; gap: 5px; }
  .dl-btn:hover { border-color: var(--accent); color: var(--accent); }
  .rec-btn.recording { background: #fde8e8; border-color: #e57373; color: #c62828; }
  .rec-status { font-size: .8rem; color: var(--muted); }
  .rec-playback { height: 30px; }
  .dl-btn { border-color: var(--accent); color: var(--accent); font-weight: 700; }
  .dl-btn:hover { background: var(--accent); color: #fff; }
  .global-rec { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center;
                gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
  .global-rec-label { font-size: .9rem; font-weight: 700; color: var(--ink); margin-right: 2px; }
  .global-rec .rec-hint { flex-basis: 100%; font-size: .78rem; color: var(--muted); margin-top: -2px; }
  .hdr-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 760px; margin: 0 auto; padding: 0 16px; }
  .hdr-left { text-align: left; min-width: 0; }
  .brand-full { display: flex; align-items: center; gap: 9px; flex: none; }
  .brand-mark { position: relative; width: 40px; height: 40px; flex: none; }
  .brand-mark .mq { position: absolute; width: calc(50% - 2px); height: calc(50% - 2px); }
  .brand-mark .mq.tl { top:0; left:0; background:#2a4a8a; border-radius:4px 0 0 0; }
  .brand-mark .mq.tr { top:0; right:0; background:#009040; border-radius:0 4px 0 0; }
  .brand-mark .mq.bl { bottom:0; left:0; background:#7c3aed; border-radius:0 0 0 4px; }
  .brand-mark .mq.br { bottom:0; right:0; background:#f07800; border-radius:0 0 4px 0; }
  .brand-mark .mq7 { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font:900 27px/1 Arial,sans-serif; color:#fff; z-index:2; text-shadow:0 2px 6px rgba(0,0,0,.4); }
  .brand-text { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; height: 40px; padding: 2px 0; }
  .brand-eyebrow { font-size: .6rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); line-height: 1; }
  .brand-name { font-weight: 900; font-size: 1.3rem; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
  .brand-name .gold { color: #f07800; }
  footer { text-align: center; color: var(--muted); padding: 16px 10px; }
  .foot-dots { font-size: 0; margin-bottom: 8px; }
  .foot-dots span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin: 0 3px; }
  .foot-name { font-size: .74rem; font-weight: 500; color: var(--ink); letter-spacing: .02em; }
  .foot-name .gold { color: #f07800; font-weight: 700; }
  .foot-tag { font-size: .64rem; color: var(--muted); margin-top: 2px; letter-spacing: .02em; }
  .qmark-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }
  .qmark-cap { font-size: .62rem; font-weight: 700; line-height: 1; color: var(--violet); letter-spacing: .01em; }
  /* click-a-word to hear just that word */
  .word[data-start] { cursor: pointer; }
  /* filter rail: LEFT vertical column — [Keywords label] / [vertical toggle] / [Connectors label] / [vertical toggle] */
  .answer-wrap { display: flex; gap: 14px; align-items: flex-start; }
  .answer-wrap .story-text { flex: 1; min-width: 0; }
  .iso-col { flex: none; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 2px; }
  .qmark { width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #fff; border: none; cursor: pointer;
           font-weight: 800; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center;
           box-shadow: 0 1px 3px rgba(124,58,237,.4); }
  .qmark:hover { filter: brightness(1.08); }
  .iso-switch { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
  .iso-switch .lbl { font-size: .7rem; font-weight: 700; white-space: nowrap; line-height: 1.1; }
  .iso-switch.kw   .lbl { color: var(--kw); }
  .iso-switch.conn .lbl { color: var(--accent); }
  .switch { position: relative; width: 24px; height: 46px; flex: none; }               /* vertical toggle */
  .switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
  .switch .slider { position: absolute; inset: 0; background: #cfd3dc; border-radius: 24px; transition: background .2s; }
  .switch .slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 2px; top: 2px;
                            background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
  .iso-switch.kw   input:checked + .slider { background: var(--kw); }
  .iso-switch.conn input:checked + .slider { background: var(--accent); }
  .switch input:checked + .slider::before { transform: translateY(22px); }             /* knob slides DOWN */
  /* filter on → dim + soft-blur the rest, reveal only the chosen category crisply */
  .story-text.filter .word { opacity: .1; filter: blur(1.5px); transition: opacity .2s, filter .2s; }
  .story-text.filter.f-kw   .vocab .word     { opacity: 1; filter: none; }
  .story-text.filter.f-kw   .word[data-if]   { opacity: 1; filter: none; }   /* IF-words = keywords */
  .story-text.filter.f-conn .word[data-conn] { opacity: 1; filter: none; }
  .story-text.f-kw   .vocab { color: var(--kw); }
  .story-text.f-kw   .word[data-if] { color: var(--kw); font-weight: 600; }
  .story-text.f-conn .word[data-conn] { border-bottom: 2px solid var(--accent); border-radius: 3px; cursor: help; }
