  :root {
    color-scheme:light;
    --bg:#f7f3ed; --surface:#fffdfa; --surface2:#f3ece4; --ink:#27201d; --mute:#64574e; --line:#e9ded3;
    --brand:#b13a25; --brand-ink:#fff; --brand-soft:#f9e3d8;
    --hero-tint:#fff4eb; --hero-line:#ead2c1;
    --teal:#17664e; --teal-ink:#fff; --teal-soft:#dcf1e5;
    --gold:#946117; --gold-soft:#fbefd6; --indigo:#4c53a6; --indigo-soft:#e9ecff;
    --red:#a53038; --red-ink:#fff; --redbg:#fbe9eb; --redline:#a5303877;
    --shadow:0 1px 2px #33231b09, 0 6px 18px #33231b08;
    --shadow-lg:0 18px 42px -18px #33231b55;
    --r:20px; --r-sm:12px;
    --font:system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  [data-theme="dark"] {
    color-scheme:dark;
    --bg:#1b1512; --surface:#241c18; --surface2:#302520; --ink:#f8eee8; --mute:#cfbaaf; --line:#4b3a32;
    --brand:#ffad8c; --brand-ink:#341711; --brand-soft:#462c23;
    --hero-tint:#302019; --hero-line:#573b30;
    --teal:#8bd9af; --teal-ink:#10291e; --teal-soft:#214137;
    --gold:#f3c678; --gold-soft:#44351c; --indigo:#bac2ff; --indigo-soft:#2b3460;
    --red:#ffabb0; --red-ink:#361719; --redbg:#45282e; --redline:#ffabb077;
    --shadow:0 1px 2px #0004, 0 6px 18px #0002;
    --shadow-lg:0 18px 42px -18px #000a;
  }
  * { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  html { scroll-behavior:smooth; }
  html { max-width:100%; overflow-x:hidden; }
  body { max-width:100%; overflow-x:clip; }
  body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.6 var(--font); -webkit-font-smoothing:antialiased; }
  .ic { width:1.15em; height:1.15em; flex:none; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; vertical-align:-.2em; }
  .ic.fill { fill:currentColor; stroke:none; }
  :focus-visible { outline:2px solid var(--brand); outline-offset:2px; border-radius:8px; }

  /* top bar */
  header.top { position:sticky; top:0; z-index:20; background:color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter:saturate(1.4) blur(14px); -webkit-backdrop-filter:saturate(1.4) blur(14px); border-bottom:1px solid var(--line); padding-top:env(safe-area-inset-top); }
  .topin { max-width:1120px; margin:0 auto; padding:12px 22px; display:flex; align-items:center; gap:12px; }
  .brand { display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-.035em; line-height:1.15; cursor:pointer; border:0; background:none; padding:0; color:var(--ink); font-size:18px; text-decoration:none; flex:none; }
  .logo { display:block; width:40px; height:40px; border-radius:10px; flex:none; }
  .brand small { display:block; font-weight:500; font-size:11px; color:var(--mute); letter-spacing:.06em; text-transform:uppercase; line-height:1.1; transition:color .15s; }
  .brand:hover small { color:var(--brand); }
  .topnav { display:flex; gap:4px; margin-left:clamp(4px, 2vw, 32px); }
  .topnav button { display:flex; gap:7px; align-items:center; padding:10px 11px; border-radius:10px; border:0; background:none; color:var(--mute); font:inherit; font-size:14px; font-weight:500; cursor:pointer; transition:.15s; }
  .topnav button:hover { background:var(--surface2); color:var(--ink); }
  .topnav button.on { background:var(--brand-soft); color:var(--brand); font-weight:700; }
  .chips { margin-left:auto; display:flex; gap:8px; align-items:center; }
  .hchip { white-space:nowrap; display:flex; align-items:center; gap:6px; background:var(--surface); border:1px solid var(--line); border-radius:99px; padding:5px 11px; font-size:13px; font-weight:600; box-shadow:var(--shadow); cursor:default; }
  .hchip .ic { color:var(--brand); }
  .hchip.xp .ic { color:var(--gold); }
  .iconbtn { width:40px; height:40px; display:grid; place-items:center; border-radius:50%; border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; padding:0; }
  .iconbtn:hover { border-color:var(--brand); }

  main { max-width:1120px; margin:0 auto; padding:28px 22px 110px; animation:rise .35s ease both; }
  @keyframes rise { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
  @media (prefers-reduced-motion:reduce) { * { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }

  /* bottom tab bar (mobile) */
  .tabbar { display:none; position:fixed; left:0; right:0; bottom:0; z-index:30; background:color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border-top:1px solid var(--line); padding:6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; border:0; background:none; color:var(--mute); font:inherit; font-size:11px; font-weight:600; padding:6px 0; border-radius:12px; cursor:pointer; position:relative; }
  .tabbar button .ic { width:22px; height:22px; }
  .tabbar button.on { color:var(--brand); background:var(--brand-soft); }
  @media (max-width:480px) { .brand span:last-child { display:none; } .hchip .lv { display:none; } .chips { gap:6px; } .hchip { padding:5px 9px; } }
  @media (max-width:985px) {
    .topnav { display:none; } .tabbar { display:flex; }
    .brand small { display:none; }
    main { padding:16px 14px 120px; }
    .topin { padding:9px 14px; }
    .iconbtn { width:44px; height:44px; }
    .tabbar button { min-height:48px; }
  }

  @media (max-width:430px) {
    #setBtn { display:none; }
    .topin { gap:8px; }
  }

  /* buttons */
  button { font:inherit; }
  .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 18px; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface); color:var(--ink); font-weight:650; font-size:14px; cursor:pointer; transition:transform .1s, border-color .15s, background .15s, box-shadow .15s; min-height:44px; }
  .btn:hover { border-color:color-mix(in srgb, var(--ink) 40%, var(--line)); }
  .btn:active { transform:scale(.97); }
  .btn.primary { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); box-shadow:0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
  .btn.primary:hover { filter:brightness(1.07); }
  .btn.good { background:var(--teal); border-color:var(--teal); color:var(--teal-ink); }
  .btn.ghost { background:transparent; }
  .btn.sm { padding:6px 13px; font-size:13px; min-height:34px; }
  .btn:disabled { opacity:.45; cursor:default; transform:none; }
  .btn.rec-on { background:var(--red); border-color:var(--red); color:var(--red-ink); animation:pulse 1.2s infinite; }
  @keyframes pulse { 0%,100% { box-shadow:0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 50% { box-shadow:0 0 0 9px transparent; } }
  .round { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; padding:0; flex:none; transition:.12s; }
  .round:hover { border-color:var(--brand); color:var(--brand); }
  .round.on { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); }
  .round.big { width:60px; height:60px; background:var(--brand); border-color:var(--brand); color:var(--brand-ink); box-shadow:0 10px 24px -8px color-mix(in srgb, var(--brand) 80%, transparent); }
  .round.big .ic { width:26px; height:26px; }
  .round.sm { width:34px; height:34px; }

  /* surfaces */
  .card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:clamp(18px, 2.4vw, 26px); margin-bottom:16px; box-shadow:var(--shadow); }
  .card h2 { font-size:1.19rem; margin:0 0 12px; letter-spacing:-.025em; line-height:1.3; }
  h1.page { font-size:clamp(1.9rem, 4vw, 2.8rem); letter-spacing:-.055em; margin:4px 0 4px; line-height:1.2; }
  .lead { color:var(--mute); margin:0 0 20px; }
  .row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
  .row > * { min-width:0; }
  .grow { flex:1; }
  .muted { color:var(--mute); } .small { font-size:13px; color:var(--mute); }
  .eyebrow { font-size:11px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--mute); }
  .pill { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:600; padding:2px 10px; border-radius:99px; background:var(--surface2); color:var(--mute); white-space:nowrap; }
  .pill.B1 { background:var(--teal-soft); color:var(--teal); } .pill.B2 { background:var(--gold-soft); color:var(--gold); }
  [data-theme="dark"] .pill.B2 { color:var(--gold); }
  .pill.Bp { background:var(--brand-soft); color:var(--brand); } .pill.C1 { background:var(--indigo-soft); color:var(--indigo); }
  .pill.studio { background:var(--teal-soft); color:var(--teal); }

  /* Daily lesson and study goal */
  .hero { position:relative; isolation:isolate; overflow:hidden; border-radius:24px;
    padding:clamp(22px,3.4vw,38px); margin-bottom:18px; color:#fff8f4;
    background:radial-gradient(115% 150% at 2% 0%, #c44731 0%, #a93321 42%, #83281d 100%);
    box-shadow:var(--shadow-lg); }
  .hero h1 { font-size:clamp(1.7rem,3.25vw,2.65rem); margin:0 0 12px; letter-spacing:-.042em; line-height:1.14; overflow-wrap:anywhere; }
  .hero p { margin:0 0 17px; color:#fff8f4; max-width:41rem; }
  .hero p strong { font-weight:650; }
  .hero-wave { position:absolute; z-index:-1; bottom:-1px; right:0; width:60%; height:75%; fill:#fff; opacity:.15; pointer-events:none; }
  .hero-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; }
  .hero .btn { background:#fffaf5; border-color:#fffaf5; color:#913220; text-align:left; border-radius:99px; }
  .hero .btn:hover { background:#f9e7dc; border-color:#f9e7dc; }
  .hero .btn:focus-visible { outline-color:#fffaf5; }
  .goal { display:flex; align-items:center; gap:11px; padding:10px 15px 10px 10px;
    border:1px solid #ffffff35; border-radius:15px; background:#42170f68; color:#fff8f4; }
  .goal-ring { display:block; line-height:0; flex:none; }
  .goal b { display:block; font-size:1.28rem; line-height:1.1; font-variant-numeric:tabular-nums; }
  .goal div span { display:block; margin-top:3px; font-size:13px; }
  .today-overview { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:16px; }
  .today-overview .card { margin-bottom:0; }
  .today-overview .card + .card { margin:0; }
  .today-forecast { display:flex; flex-direction:column; }
  .today-forecast p { margin:0; }
  .today-forecast .bars { margin-top:auto; min-height:96px; }
  .today-stats { margin-block:16px; }
  @media (max-width:650px) {
    .hero-footer { gap:12px; }
    .hero-wave { width:100%; height:54%; }
    .goal { padding:8px 11px 8px 8px; }
    .today-overview { grid-template-columns:1fr; }
  }

  .chiprow { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:0 0 16px; }
  .chip { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:38px; padding:0 15px; border-radius:99px; border:1px solid var(--line); background:var(--surface); color:var(--ink); font-size:14px; font-weight:600; cursor:pointer; line-height:1; }
  .chip .ic { vertical-align:0; }
  .chiprow select { -webkit-appearance:none; appearance:none; height:38px; padding:0 32px 0 15px; font-size:14px; font-weight:600; cursor:pointer;
    background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236f6a61' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
  .chiprow .seg { height:38px; align-items:center; }
  .chip.on { background:var(--ink); color:var(--bg); border-color:var(--ink); }

  /* lesson grid (Full-Bleed Story Card) */
  .grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(290px, 1fr)); gap:16px; margin-bottom:14px; align-items:stretch; }
  .lcard { position:relative; background:var(--surface); border:1px solid var(--line); border-radius:22px; overflow:hidden; box-shadow:var(--shadow); cursor:pointer; transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s; display:flex; flex-direction:column; text-align:left; padding:0; color:inherit; }
  .lcard:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); border-color:color-mix(in srgb, var(--brand) 45%, var(--line)); }
  .lcover { position:relative; height:196px; overflow:hidden; background:#29211d; display:flex; flex-direction:column; justify-content:space-between; padding:13px 15px; color:#fff; flex:1; }
  .lcover-img { position:absolute; inset:0; background-size:cover; background-position:center; transition:transform .4s ease; }
  .lcover-art.art-0 { background:radial-gradient(circle at 86% 24%, rgba(255,214,153,.42), transparent 52%), linear-gradient(135deg, #c2552d 0%, #6d2e1b 100%); }
  .lcover-art.art-1 { background:radial-gradient(circle at 86% 24%, rgba(167,227,208,.36), transparent 52%), linear-gradient(135deg, #1d6b5c 0%, #153c36 100%); }
  .lcover-art.art-2 { background:radial-gradient(circle at 86% 24%, rgba(255,220,148,.38), transparent 52%), linear-gradient(135deg, #b87a12 0%, #5c3a0f 100%); }
  .lcover-art.art-3 { background:radial-gradient(circle at 86% 24%, rgba(255,196,168,.36), transparent 52%), linear-gradient(135deg, #9d4329 0%, #3d211b 100%); }
  .lcover-sticker {
    position:absolute; right:16px; top:38px; width:74px; height:74px; border-radius:20px; object-fit:cover;
    background:#fbf8f3; border:2px solid rgba(255,255,255,.78); box-shadow:0 8px 20px rgba(0,0,0,.22);
    transform:rotate(7deg); opacity:.94; pointer-events:none;
  }
  .lcard:hover .lcover-img { transform:scale(1.06); }
  .lcover::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg, rgba(20,16,12,.26) 0%, rgba(20,16,12,.14) 35%, rgba(20,16,12,.84) 100%); pointer-events:none; }
  .lcover-top, .lcover-bot { position:relative; z-index:1; }
  .lcover-top { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .lcover .pill { background:rgba(255,255,255,.22); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); color:#fff; border:1px solid rgba(255,255,255,.28); }
  .lcover .pill.B1 { background:rgba(26,107,92,.78); }
  .lcover .pill.B2 { background:rgba(184,122,18,.82); }
  .lcover .pill.Bp { background:rgba(145,52,33,.94); }
  .lcover .pill.C1 { background:rgba(74,79,163,.82); }
  .round.pri { background:var(--brand); border-color:var(--brand); color:var(--brand-ink); box-shadow:0 4px 12px -4px color-mix(in srgb, var(--brand) 65%, transparent); }
  .round.pri:hover { filter:brightness(1.08); color:var(--brand-ink); }
  .lcover .heart { position:static; margin-left:auto; width:32px; height:32px; background:rgba(255,255,255,.22); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); color:#fff; border:1px solid rgba(255,255,255,.25); }
  .lcover .heart.on { color:#ff8a80; background:rgba(255,255,255,.92); }
  .lcover-bot h3 { margin:0 0 4px; font-size:18px; font-weight:700; letter-spacing:-.015em; line-height:1.25; text-shadow:0 1px 8px rgba(0,0,0,.45); }
  .lcover-bot .summary { margin:0; font-size:13px; color:rgba(255,255,255,.9); line-height:1.4; -webkit-line-clamp:2; }
  .lband { height:4px; background:var(--teal); } .lband.B2 { background:var(--gold); } .lband.Bp { background:var(--brand); } .lband.C1 { background:var(--indigo); }
  .ltags { padding:10px 15px 4px; background:var(--surface); }
  .ltags .tags { margin-top:0; }
  .lfoot { display:flex; align-items:center; gap:10px; padding:8px 15px 13px; background:var(--surface); }
  .steps { display:flex; gap:5px; }
  .lactions { flex:none; }
  .step { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--surface2); color:var(--mute); font-size:11px; font-weight:700; }
  .step.done { background:var(--teal); color:var(--teal-ink); } .step .ic { width:14px; height:14px; stroke-width:2.2; }
  .lactions { margin-left:auto; display:flex; gap:6px; }

  /* lesson header + stepper tabs */
  .lhead { display:flex; align-items:center; gap:12px; margin-bottom:14px; flex-wrap:wrap; }
  .lhead h1 { font-size:24px; margin:0; letter-spacing:-.02em; line-height:1.2; flex:1; min-width:180px; }
  .stepper { display:flex; gap:6px; overflow-x:auto; padding:2px 2px 10px; margin-bottom:6px; scrollbar-width:none; }
  .stepper::-webkit-scrollbar { display:none; }
  .stepper button { display:flex; align-items:center; gap:8px; padding:8px 16px 8px 8px; border-radius:99px; border:1px solid var(--line); background:var(--surface); color:var(--mute); font-weight:600; font-size:14px; cursor:pointer; white-space:nowrap; }
  .stepper button .n { width:24px; height:24px; border-radius:50%; background:var(--surface2); display:grid; place-items:center; font-size:12px; color:var(--mute); }
  .stepper button.done .n { background:var(--teal); color:var(--teal-ink); } .stepper button .n .ic { width:12px; height:12px; stroke-width:3; }
  .stepper button.on { background:var(--ink); color:var(--bg); border-color:var(--ink); }
  .stepper button.on .n { background:var(--brand); color:var(--brand-ink); }

  /* segmented control */
  .seg { display:inline-flex; background:var(--surface2); border-radius:99px; padding:3px; gap:2px; }
  .seg button { border:0; background:none; color:var(--mute); font-weight:600; font-size:13px; padding:6px 13px; border-radius:99px; cursor:pointer; min-height:32px; }
  .seg button.on { background:var(--surface); color:var(--ink); box-shadow:0 1px 3px rgba(0,0,0,.15); }
  .toggle { display:inline-flex; align-items:center; gap:8px; font-size:14px; color:var(--mute); cursor:pointer; user-select:none; }
  .toggle input { accent-color:var(--brand); width:18px; height:18px; }

  .progressbar { height:7px; border-radius:99px; background:var(--surface2); overflow:hidden; margin-top:14px; cursor:pointer; }
  .progressbar i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--brand),var(--gold)); transition:width .3s; border-radius:99px; }

  /* inline sentence scrubber */
  .aplayer { display:flex; align-items:center; gap:10px; margin-top:12px; padding:10px 14px; border-radius:14px; background:var(--surface2); border:1px solid var(--line); }
  .aplayer .scrub { -webkit-appearance:none; appearance:none; flex:1; height:6px; border-radius:99px; cursor:pointer; min-width:80px; outline:none;
    background:linear-gradient(90deg, var(--brand) var(--pct, 0%), color-mix(in srgb, var(--ink) 14%, transparent) var(--pct, 0%)); }
  .aplayer .scrub::-webkit-slider-thumb { -webkit-appearance:none; appearance:none; width:16px; height:16px; border-radius:50%; background:var(--brand); border:2.5px solid var(--surface); box-shadow:0 1px 5px rgba(0,0,0,.28); cursor:grab; transition:transform .12s; }
  .aplayer .scrub::-webkit-slider-thumb:hover { transform:scale(1.18); }
  .aplayer .scrub::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:var(--brand); border:2.5px solid var(--surface); box-shadow:0 1px 5px rgba(0,0,0,.28); cursor:grab; }
  .aplayer .atime { font-size:12px; font-variant-numeric:tabular-nums; color:var(--mute); white-space:nowrap; min-width:74px; text-align:right; }
  .aplayer .alabel { font-size:12px; font-weight:600; color:var(--ink); white-space:nowrap; }
  @media (max-width:520px) { .aplayer { flex-wrap:wrap; gap:8px; } .aplayer .alabel { width:100%; } }

  /* transcript lines */
  .line { display:flex; gap:12px; align-items:flex-start; padding:14px 8px; border-bottom:1px solid var(--line); border-radius:12px; transition:background .2s; }
  .line:last-child { border-bottom:0; }
  .line.active { background:var(--brand-soft); }
  .av { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:13px; color:#fff; flex:none; background:var(--teal); }
  .av.B { background:var(--brand); }
  .lbox { flex:1; min-width:0; }
  .who { font-size:12px; font-weight:600; color:var(--mute); }
  .vi { font-size:19px; line-height:1.5; }
  .en { color:var(--mute); font-size:14px; margin-top:2px; }
  .lo [data-vi] { filter:blur(9px); user-select:none; } .lo .line.active [data-vi] { filter:none; }
  .loop-on { background:var(--teal) !important; border-color:var(--teal) !important; color:var(--teal-ink) !important; }
  mark.v { color:var(--red); background:var(--redbg); border-radius:4px; padding:0 3px; cursor:pointer; text-decoration:underline wavy var(--redline) 1px; text-underline-offset:4px; font-weight:500; }
  #pop { position:fixed; left:50%; bottom:calc(92px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(520px, 92vw); z-index:50; background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:var(--shadow-lg); display:none; animation:rise .2s ease both; }

  /* quiz */
  .opt { display:flex; align-items:center; gap:12px; width:100%; text-align:left; margin:8px 0 0; padding:13px 16px; border-radius:14px; border:1.5px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer; font-size:15px; transition:.12s; }
  .opt:hover { border-color:var(--brand); background:var(--brand-soft); }
  .opt .k { width:26px; height:26px; border-radius:8px; background:var(--surface2); display:grid; place-items:center; font-weight:700; font-size:12px; color:var(--mute); flex:none; }
  .opt.right { background:var(--teal-soft); border-color:var(--teal); } .opt.right .k { background:var(--teal); color:var(--teal-ink); }
  .opt.wrong { background:var(--redbg); border-color:var(--red); } .opt.wrong .k { background:var(--red); color:var(--red-ink); }
  .why { margin-top:12px; padding:12px 14px; border-radius:12px; background:var(--surface2); font-size:14px; color:var(--mute); }
  .big { font-size:19px; font-weight:600; line-height:1.4; }
  textarea, input.txt { width:100%; font:inherit; padding:12px 14px; border-radius:14px; border:1.5px solid var(--line); background:var(--surface); color:var(--ink); }
  textarea { min-height:130px; resize:vertical; }
  textarea:focus, input.txt:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
  select { font:inherit; padding:8px 12px; border-radius:99px; border:1px solid var(--line); background:var(--surface); color:var(--ink); }

  /* shadow */
  .shadowline { text-align:center; padding:24px 10px 8px; }
  .shadowline .vi { font-size:26px; line-height:1.4; font-weight:500; letter-spacing:-.01em; }
  .shadowline .en { font-size:15px; margin-top:8px; }
  .phases { display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:18px 0; }
  .rate { display:flex; align-items:center; gap:10px; justify-content:space-between; padding:9px 0; border-top:1px solid var(--line); }
  .dots { display:flex; gap:6px; flex-wrap:wrap; }
  .dot { width:34px; height:34px; border-radius:50%; border:1.5px solid var(--line); background:var(--surface); font-size:13px; font-weight:700; cursor:pointer; color:var(--mute); }
  .dot.done { background:var(--teal); border-color:var(--teal); color:var(--teal-ink); } .dot.cur { border-color:var(--brand); color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
  .dot.done.cur { color:#fff; }
  .rec { color:var(--brand); font-size:13px; min-height:20px; text-align:center; font-weight:500; }
  .kbd { font:600 11px var(--font); border:1px solid var(--line); border-bottom-width:2px; border-radius:6px; padding:1px 6px; background:var(--surface); color:var(--mute); }

  /* stats */
  .statgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:14px; }
  .stat { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:16px 18px; box-shadow:var(--shadow); }
  .stat b { font-size:30px; display:block; letter-spacing:-.02em; line-height:1.15; } .stat span { font-size:13px; color:var(--mute); }
  .bars { display:flex; align-items:flex-end; gap:10px; height:120px; padding-top:8px; }
  .bcol { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:6px; }
  .bcol i { width:100%; max-width:42px; border-radius:8px 8px 3px 3px; background:var(--surface2); min-height:5px; display:block; }
  .bcol i.has { background:var(--brand); }
  .bcol span { font-size:11px; color:var(--mute); }
  .badges { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
  .badge { border:1px solid var(--line); border-radius:16px; padding:16px 12px; text-align:center; background:var(--surface); }
  .badge .medal { width:52px; height:52px; border-radius:50%; margin:0 auto 8px; display:grid; place-items:center; background:var(--brand); color:var(--brand-ink); box-shadow:var(--shadow); }
  .badge.locked { opacity:.55; } .badge.locked .medal { background:var(--surface2); color:var(--mute); box-shadow:none; }
  .badge b { display:block; font-size:14px; } .badge span { font-size:12px; color:var(--mute); }
  table.mini { width:100%; border-collapse:collapse; font-size:14px; }
  table.mini th { text-align:left; font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--mute); padding:6px 8px; border-bottom:1px solid var(--line); }
  table.mini td { padding:10px 8px; border-bottom:1px solid var(--line); }
  .tone-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:12px; margin-bottom:14px; }
  .tone-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:18px; box-shadow:var(--shadow); }
  ul.tips { padding-left:20px; margin:0; } ul.tips li { margin-bottom:8px; }
  .twocol { display:grid; grid-template-columns:1fr; gap:14px; } @media (min-width:900px) { .twocol { grid-template-columns:1.6fr 1fr; } }
  .errnote { color:var(--red); font-size:13px; }
  .histitem { display:flex; gap:10px; align-items:center; margin:8px 0; }
  .empty { text-align:center; padding:36px 16px; } .empty .emo { width:64px; height:64px; margin:0 auto 12px; border-radius:50%; background:var(--teal-soft); color:var(--teal); display:grid; place-items:center; }

  /* toast */
  #toasts { position:fixed; top:calc(70px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:80; display:flex; flex-direction:column; gap:8px; align-items:center; pointer-events:none; }
  .toast { background:var(--ink); color:var(--bg); padding:9px 18px; border-radius:99px; font-size:14px; font-weight:600; box-shadow:var(--shadow-lg); animation:toast 2.6s ease both; display:flex; gap:8px; align-items:center; }
  .toast .ic { color:var(--gold); }
  @keyframes toast { 0% { opacity:0; transform:translateY(-10px) scale(.95); } 10%,82% { opacity:1; transform:none; } 100% { opacity:0; transform:translateY(-8px); } }
  .hint { text-align:center; color:var(--mute); font-size:12px; margin-top:10px; }

  /* glossary words + popover */
  .w { border-radius:5px; cursor:help; transition:background .12s; }
  .w:hover, .w.on { background:color-mix(in srgb, var(--indigo) 16%, transparent); }
  .w:focus-visible { background:color-mix(in srgb, var(--indigo) 16%, transparent); outline:2px solid var(--brand); outline-offset:1px; }
  .lo .line:not(.active) .w { pointer-events:none; }
  .opentitle { all:unset; cursor:pointer; color:inherit; font:inherit; display:block; } .opentitle:focus-visible { outline:2px solid var(--brand); border-radius:6px; }
  .tscroll { overflow-x:auto; }
  .w.v { color:var(--red); font-weight:500; text-decoration:underline wavy var(--redline) 1px; text-underline-offset:4px; }
  .w.v:hover, .w.v.on { background:var(--redbg); }
  #wp { position:fixed; z-index:60; display:none; width:min(300px, calc(100vw - 20px)); background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow-lg); padding:10px 12px; font-size:13px; line-height:1.4; animation:rise .12s ease both; }
  #wp .wp-h { display:flex; align-items:center; gap:6px; margin-bottom:4px; }
  #wp .wp-h b { font-size:16px; letter-spacing:-.01em; }
  #wp .wpb { min-width:26px; height:24px; padding:0 7px; border-radius:99px; border:1px solid var(--line); background:var(--surface2); color:var(--ink); font-size:11px; font-weight:700; cursor:pointer; display:inline-flex; align-items:center; gap:3px; }
  #wp .wpb:hover { border-color:var(--brand); color:var(--brand); }
  #wp .wpb.pref { background:var(--ink); color:var(--bg); border-color:var(--ink); }
  #wp .wpb .ic { width:11px; height:11px; }
  #wp .wp-m { font-size:14px; } #wp .wp-m .en { color:var(--ink); font-weight:600; margin:0; font-size:14px; display:inline; }
  #wp .wp-m .ru { color:var(--teal); font-weight:600; }
  #wp .wp-s, #wp .wp-n { color:var(--mute); font-size:12px; margin-top:3px; }
  #wp .wp-x { margin-top:6px; padding-top:6px; border-top:1px dashed var(--line); font-size:12.5px; }
  #wp .wp-x i { font-style:normal; display:block; } #wp .wp-x span { color:var(--mute); }
  #wp .wp-f { margin-top:6px; font-size:11px; color:var(--mute); }
  #wp .wp-save { margin-left:2px; }
  .wp-hint { font-size:12px; color:var(--mute); }
  /* tags + cards */
  .tags { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
  .tag { font-size:11px; font-weight:600; padding:1px 8px; border-radius:99px; border:1px solid var(--line); color:var(--mute); background:transparent; cursor:pointer; }
  .tag:hover, .tag.on { border-color:var(--ink); color:var(--ink); }
  .tag.on { background:var(--ink); color:var(--bg); }
  .summary { font-size:14px; color:var(--mute); margin:6px 0 0; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
  .reg { font-size:11px; }
  .reg.formal { background:var(--indigo-soft); color:var(--indigo); } .reg.casual { background:var(--teal-soft); color:var(--teal); }
  .reg.slangy { background:var(--brand-soft); color:var(--brand); } .reg.neutral { background:var(--surface2); color:var(--mute); }
  .heart { position:absolute; right:10px; top:14px; width:32px; height:32px; border-radius:50%; border:0; background:transparent; color:var(--mute); cursor:pointer; display:grid; place-items:center; padding:0; }
  .heart:hover { color:var(--brand); } .heart.on { color:var(--brand); } .heart.on .ic { fill:currentColor; }
  .search { position:relative; margin-bottom:12px; }
  .search input { width:100%; padding:12px 16px 12px 42px; border-radius:99px; border:1.5px solid var(--line); background:var(--surface); color:var(--ink); font:inherit; }
  .search input:focus { outline:none; border-color:var(--brand); box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
  .search .ic { position:absolute; left:15px; top:50%; transform:translateY(-50%); color:var(--mute); }
  .tagrow { display:flex; gap:6px; overflow-x:auto; padding-bottom:6px; margin-bottom:14px; scrollbar-width:none; }
  .tagrow::-webkit-scrollbar { display:none; } .tagrow .tag { white-space:nowrap; flex:none; padding:4px 11px; font-size:12px; }
  .star { color:var(--mute); } .star.on { color:var(--gold); } .star.on .ic { fill:currentColor; }
  .heat { display:grid; grid-auto-flow:column; grid-template-rows:repeat(7,14px); gap:4px; overflow-x:auto; padding-bottom:4px; }
  .heat i { width:14px; height:14px; border-radius:4px; background:var(--surface2); display:block; }
  .heat i.l1 { background:color-mix(in srgb, var(--brand) 25%, var(--surface2)); } .heat i.l2 { background:color-mix(in srgb, var(--brand) 50%, var(--surface2)); }
  .heat i.l3 { background:color-mix(in srgb, var(--brand) 78%, var(--surface2)); } .heat i.l4 { background:var(--brand); }
  .roomy .line { padding:18px 8px; } .roomy .vi { line-height:1.85; }
  .setrow { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); flex-wrap:wrap; }
  .setrow:last-child { border-bottom:0; } .setrow b { display:block; } .setrow .small { max-width:380px; }
  #help, #onboard { position:fixed; inset:0; z-index:90; background:#0009; backdrop-filter:blur(6px); display:none; place-items:center; padding:20px; } #help.on, #onboard.on { display:grid; }
  #help .box, #onboard .box { background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:26px; max-width:460px; width:100%; box-shadow:var(--shadow-lg); animation:rise .2s ease both; }
  #onboard .onboard-row { margin:14px 0; }
  #onboard .onboard-row label { display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--ink); }
  #help table { width:100%; border-collapse:collapse; } #help td { padding:7px 4px; border-bottom:1px solid var(--line); font-size:14px; } #help td:first-child { width:110px; }
  .confetti { position:fixed; top:-12px; width:9px; height:14px; z-index:100; border-radius:2px; animation:fall 1.8s ease-in forwards; pointer-events:none; }
  @keyframes fall { to { transform:translateY(105vh) rotate(720deg); opacity:.9; } }
  .skip { position:absolute; left:-999px; top:8px; background:var(--ink); color:var(--bg); padding:8px 14px; border-radius:8px; z-index:200; } .skip:focus { left:8px; }

  a.btn { text-decoration:none; }

  /* learning tree + week dots */
  .weekdots { display:flex; gap:6px; align-items:center; margin-top:12px; position:relative; }
  .wd { display:flex; flex-direction:column; align-items:center; gap:3px; font-size:10px; font-weight:700; opacity:.8; }
  .wd i { width:10px; height:10px; border-radius:50%; background:#ffffff38; display:block; }
  .wd.on i { background:#fff; box-shadow:0 0 8px #ffffff99; }
  .tree { display:flex; flex-direction:column; gap:18px; margin-bottom:16px; }
  .tier { background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:18px; box-shadow:var(--shadow); }
  .tier-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
  .tier-head h2 { margin:0; font-size:17px; }
  .tnodes { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; position:relative; }
  .tnode { position:relative; display:flex; align-items:center; gap:11px; padding:12px 14px; border-radius:15px; border:1.5px solid var(--line); background:var(--surface); color:var(--ink); text-align:left; cursor:pointer; transition:.15s; overflow:hidden; isolation:isolate; }
  .tnode:hover { transform:translateY(-2px); border-color:var(--brand); box-shadow:var(--shadow); }
  .tnode.done { border-color:color-mix(in srgb, var(--teal) 55%, var(--line)); }
  .tnode.next { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
  .tnode .tbg { position:absolute; inset:0; background-size:cover; background-position:center; filter:blur(2px); opacity:.26; z-index:-2; }
  .tnode .tscrim { position:absolute; inset:0; background:linear-gradient(90deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface) 62%, transparent)); z-index:-1; }
  .tnode .tbadge { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-size:12px; font-weight:700; flex:none; background:var(--surface2); color:var(--mute); }
  .tnode.done .tbadge { background:var(--teal); color:var(--teal-ink); }
  .tnode.next .tbadge { background:var(--brand); color:var(--brand-ink); }
  .tnode b { display:block; font-size:14px; line-height:1.25; }
  .tnode span { font-size:12px; color:var(--mute); }

/* ---------- sign-in page ---------- */
.loginpage { min-height:100dvh; display:grid; place-items:center; background:radial-gradient(ellipse at 50% 0%,var(--brand-soft),transparent 65%),var(--bg); }
.loginwrap { width:100%; max-width:460px; margin:0 auto; padding:calc(28px + env(safe-area-inset-top)) 18px 40px; animation:rise .35s ease both; }
.logintop { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:22px; }
.loginbrand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px; color:var(--ink); text-decoration:none; margin-bottom:22px; }
.logintop .loginbrand { margin-bottom:0; }
.loginback { display:inline-flex; align-items:center; min-height:36px; padding:6px 12px; border-radius:999px; border:1px solid var(--line); background:var(--surface); color:var(--mute); font-size:13px; font-weight:600; text-decoration:none; white-space:nowrap; }
.loginback:hover { border-color:var(--brand); color:var(--brand); }
.loginbrand small { display:block; font-size:11px; font-weight:500; letter-spacing:.06em; text-transform:uppercase; color:var(--mute); line-height:1.1; }
.logincard h1 { font-size:clamp(1.7rem, 5vw, 2.15rem); letter-spacing:-.02em; margin:0 0 6px; line-height:1.25; }
.loginbtns { display:grid; gap:10px; margin:18px 0 6px; }
.lbtn { display:flex; align-items:center; justify-content:center; gap:12px; min-height:52px; padding:12px 18px; border-radius:14px; font-weight:600; font-size:16px; text-decoration:none; border:1.5px solid var(--line); transition:transform .1s, box-shadow .15s; }
.lbtn:active { transform:scale(.98); }
.lbtn.google { background:#fff; color:#1f1f1f; } .lbtn.google:hover { box-shadow:0 4px 14px -6px #0004; }
.lbtn.telegram { background:#146d97; border-color:#146d97; color:#fff; } .lbtn.telegram:hover { background:#115b7f; }
.lbtn.zalo { background:#0068ff; border-color:#0068ff; color:#fff; } .lbtn.zalo:hover { background:#0057d6; }
.loginerr { background:var(--redbg); color:var(--red); border:1px solid var(--redline); border-radius:12px; padding:10px 14px; font-size:14px; margin:12px 0 0; }
.loginnote { margin:14px 0 0; }
.loginskip { margin:16px 0 0; text-align:center; } .loginskip a { color:var(--brand); font-weight:600; }
.loginfoot { text-align:center; margin-top:16px; } .loginfoot a { color:inherit; }
.acct-ids { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

/* ---------- avatars ---------- */
.avatar { width:var(--s,40px); height:var(--s,40px); border-radius:50%; overflow:hidden; display:inline-grid; place-items:center; background:var(--surface2); flex:none; line-height:0; }
.avatar svg, .avatar img { width:100%; height:100%; display:block; object-fit:cover; }
.avatar .ic { width:52%; height:52%; color:var(--mute); }
.iconbtn.has-av { padding:0; overflow:hidden; }
.hero-h { display:flex; align-items:center; gap:12px; } .hero-av .avatar { box-shadow:0 0 0 3px var(--brand-soft); }
.av-head { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:14px; } .av-actions { display:flex; flex-wrap:wrap; gap:8px; }
.avgrid { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; }
.avopt { aspect-ratio:1; border-radius:50%; border:3px solid transparent; padding:0; background:none; cursor:pointer; transition:transform .12s, border-color .12s, box-shadow .12s; }
.avopt:hover { transform:scale(1.06); } .avopt .avatar { width:100%; height:100%; }
.avopt.on { border-color:var(--brand); box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
#avdlg { position:fixed; inset:0; z-index:95; background:#0009; backdrop-filter:blur(6px); display:none; place-items:center; padding:20px; } #avdlg.on { display:grid; }
#avdlg .box { background:var(--surface); border:1px solid var(--line); border-radius:22px; padding:24px; max-width:360px; width:100%; box-shadow:var(--shadow-lg); animation:rise .2s ease both; }
.crop-stage { width:260px; height:260px; margin:0 auto; border-radius:50%; overflow:hidden; box-shadow:0 0 0 4px var(--surface2), 0 8px 24px -8px #0005; touch-action:none; cursor:grab; background:#fff; } .crop-stage:active { cursor:grabbing; }
.crop-stage canvas { display:block; width:260px; height:260px; }
.crop-zoom { display:flex; align-items:center; gap:10px; margin:14px auto 0; max-width:260px; } .crop-zoom input { flex:1; accent-color:var(--brand); }
#onboard .box { max-height:92vh; overflow:auto; }
.linkbtn{background:none;border:0;padding:0;margin-left:6px;font:inherit;color:var(--mute);text-decoration:underline;cursor:pointer}
.linkbtn:hover{color:var(--red,#b3261e)}
.ordiv { display:flex; align-items:center; gap:12px; margin:14px 0 10px; color:var(--mute); font-size:13px; }
.ordiv::before, .ordiv::after { content:""; flex:1; height:1px; background:var(--line); }
.emailrow { display:flex; gap:8px; flex-wrap:wrap; }
.emailin { flex:1 1 200px; min-width:0; min-height:48px; padding:10px 14px; border-radius:12px; border:1.5px solid var(--line); background:var(--surface); color:inherit; font:inherit; font-size:16px; }
.emailin:focus { outline:2px solid var(--brand); outline-offset:1px; }
.emailcode { letter-spacing:.25em; font-variant-numeric:tabular-nums; text-align:center; font-weight:600; }
.emailgo { min-height:48px; }
.emailmsg { margin:8px 0 0; min-height:1.2em; } .emailmsg.bad { color:var(--red); }
.emailhint { margin:0 0 10px; } .emaillinks { margin:8px 0 0; }
.acctmail { margin-top:12px; }
/* ---------- Today (phase 1 step 4) ---------- */
.todo { display:grid; gap:8px; }
.todo button { display:flex; align-items:center; gap:10px; text-align:left; padding:12px 14px; border-radius:14px; border:1.5px solid var(--line); background:var(--surface,#fff); color:inherit; font:inherit; cursor:pointer; min-height:48px; }
.todo button.done { background:var(--surface2); color:var(--mute); }
.todo button .ic { color:var(--brand); } .todo button.done span { text-decoration:line-through; }
.todo button:hover { border-color:var(--brand); }
.bcol em { font-style:normal; font-size:12px; color:var(--mute); min-height:14px; }
.bcol i.goal { background:var(--teal); }
.ladder { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; list-style:none; margin:0; padding:0; }
.ladder li { display:grid; }
@media (max-width:420px) { .ladder { grid-template-columns:1fr 1fr; } }
.rung { display:grid; gap:2px; text-align:left; padding:12px; border-radius:14px; border:1.5px solid var(--line); background:var(--surface,#fff); color:inherit; font:inherit; cursor:pointer; position:relative; min-height:44px; }
.rung .rn { font-size:12px; font-weight:700; color:var(--brand); }
.rung.soon { cursor:default; border-style:dashed; background:transparent; }
.rung.soon .rn { color:var(--mute); }
.rung .here { font-weight:700; }
.rung.cur { border-color:var(--brand); box-shadow:0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.rung .rbar { display:block; height:5px; border-radius:3px; background:var(--surface2,#eee); overflow:hidden; margin-top:6px; }
.rung .rbar i { display:block; height:100%; background:var(--brand); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.legend { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.legend .sw { display:inline-block; width:12px; height:12px; border-radius:3px; background:var(--brand); margin-left:6px; }
.legend .sw.goal { background:var(--teal); margin-left:0; }

/* Tone identification: calm, keyboard-first listening; history is session-only. */
.tone-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:16px 0; }
.tone-choices .btn { min-height:48px; white-space:normal; }
:is(#toneStartAB,#toneStartABX,#toneStartOdd,#toneStartDictation) { margin-block:6px; min-height:44px; }
:is(#toneStartAB,#toneStartABX,#toneStartOdd,#toneStartDictation)[hidden] { display:none; }
.tone-choices .btn { flex-direction:column; gap:3px; }
.tone-choices .tone-expected, .tone-verdict--correct { background:var(--teal-soft); color:var(--teal); border-color:var(--teal); }
.tone-choices .tone-incorrect, .tone-verdict--incorrect { background:var(--redbg); color:var(--red); border-color:var(--red); }
.tone-choices .btn:is(.tone-expected,.tone-incorrect):disabled { opacity:1; }
.tone-answer-marker { font-size:.8rem; }
.tone-verdict { border:2px solid var(--line); border-radius:var(--r-sm); padding:12px 16px; margin:16px 0; }
.tone-verdict-title { font-size:1.25rem; }
.tone-verdict p { color:var(--ink); margin:4px 0 0; }
.tone-table-wrap { overflow-x:auto; max-width:100%; }
.tone-matrix { border-collapse:collapse; width:100%; margin:16px 0; font-size:14px; }
.tone-matrix caption { text-align:left; margin-bottom:10px; }
.tone-matrix th,.tone-matrix td { padding:10px 8px; text-align:center; border:1px solid var(--line); }
.tone-exercise details { margin:18px 0; }
.tone-exercise summary { cursor:pointer; min-height:44px; padding:10px 0; }
@media(max-width:460px) { .tone-choices { grid-template-columns:repeat(2,minmax(0,1fr)); } }

#toneNext[hidden],#toneReveal[hidden],#toneIntro[hidden],#toneReference[hidden] { display:none; }
.tone-exercise .btn { min-height:44px; }

/* Pitch drawings share a midline and pitch range so the shapes can be compared. */
.tone-example { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px 10px; max-width:100%; color:var(--ink); vertical-align:middle; }
.tone-example-word { font-size:1.25rem; line-height:1.2; }
.tone-card .tone-example-word { font-size:2rem; }
.tone-card .tone-example { display:flex; margin-bottom:12px; }
.tone-example-label { display:grid; line-height:1.25; font-weight:650; }
.tone-shape { color:var(--mute); font-size:.83rem; font-weight:400; }
.tone-contour { flex:none; color:var(--teal); }
.tone-contour-guide { fill:none; stroke:var(--mute); stroke-width:1; stroke-dasharray:2 3; opacity:.6; }
.tone-contour-line { fill:none; stroke:currentColor; stroke-width:2.8; stroke-linecap:round; stroke-linejoin:round; }
.tone-revealed { display:flex; flex-wrap:wrap; gap:10px 20px; margin-top:8px; }
.tone-pair-example { display:inline-flex; gap:8px; align-items:center; max-width:100%; }
.tone-pair-example > span:first-child { font-weight:700; }

/* Tone cues stay readable while waiting for the first playback. */
.tone-choices .tone-option { border-radius:var(--r-sm); padding:8px; gap:4px; }
.tone-choices .tone-option:disabled { opacity:1; }
.tone-choices .tone-option:disabled:not(.tone-expected,.tone-incorrect) { background:var(--surface2); }
.tone-option .tone-shape { margin-top:3px; }

.tone-dictation { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; margin:16px 0; max-width:460px; }
.tone-dictation label { grid-column:1/-1; font-weight:600; }
.tone-dictation input:not([type=checkbox]) { min-height:44px; width:100%; }
.tone-dictation-tolerance { display:flex; align-items:center; gap:8px; min-height:44px; }

.tone-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:6px; margin:10px 0 16px; }
.tone-day { display:grid; text-align:center; gap:6px; font-size:.8rem; }
.tone-day meter { width:100%; height:14px; accent-color:var(--teal); }
.practice-options { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.practice-options .btn,.lesson-practice > .btn { min-height:44px; }
.practice-order { display:block; padding:12px; min-height:46px; background:var(--surface2); border-radius:var(--r-sm); }
.pitch-comparison { margin:12px 0; max-width:520px; }
.pitch-comparison svg { display:block; width:100%; background:var(--surface2); border-radius:var(--r-sm); }
.pitch-comparison path { fill:none; stroke-width:2; }
.pitch-axis { stroke:var(--line); }
.pitch-model { stroke:var(--teal); }
.pitch-model-key { color:var(--teal); }
.pitch-take { stroke:var(--red); stroke-dasharray:5 3; }
.pitch-take-key { color:var(--red); }
.pitch-comparison figcaption { margin-top:8px; font-size:.9rem; }
/* ---------- Tones: beginner path (owner feedback 2026-11-26) ---------- */
.tone-path { list-style:none; margin:12px 0 0; padding:0; display:grid; gap:8px; }
.tone-path li { display:flex; align-items:center; gap:12px; padding:12px; border:1.5px solid var(--line); border-radius:14px; }
.tone-path li.next { border-color:var(--brand); }
.tone-path li.done .tone-step-n { background:var(--teal); color:var(--teal-ink); border-color:var(--teal); }
.tone-step-n { flex:none; width:32px; height:32px; border-radius:50%; display:grid; place-items:center; font-weight:700; border:1.5px solid var(--line); }
.tone-step-text { flex:1; display:grid; gap:2px; min-width:0; }
.tone-more { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:10px; margin:10px 0 14px; }
.tone-more-item { display:grid; gap:6px; align-content:start; padding:12px; border:1.5px solid var(--line); border-radius:14px; }
.tone-more-item .btn { justify-self:start; }
.tone-family { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin:12px 0; }
.tone-word { display:grid; gap:6px; justify-items:start; text-align:left; padding:12px; border:1.5px solid var(--line); border-radius:14px; background:var(--surface); color:inherit; font:inherit; cursor:pointer; min-height:44px; }
.tone-word:hover { border-color:var(--brand); }
.tone-word-vi { font-size:1.8rem; font-weight:700; line-height:1; }
.tone-plain { font-weight:700; }
.tone-target { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:10px 12px; border-radius:12px; background:var(--surface2); }
.tone-tip { font-weight:600; }
#toneReference summary { cursor:pointer; min-height:44px; padding:10px 0; }
@media (max-width:460px) { .tone-path li { flex-wrap:wrap; } .tone-path li .btn { width:100%; } }
/* ---------- Lesson practice, one task at a time (owner feedback 2026-11-26) ---------- */
.practice-progress { height:6px; border-radius:99px; background:var(--surface2); overflow:hidden; margin-bottom:12px; }
.practice-progress i { display:block; height:100%; background:var(--brand); transition:width .3s; }
.practice-how { color:var(--mute); margin:4px 0 10px; }
.practice-prompt { font-size:1.25rem; font-weight:600; line-height:1.4; }
.practice-options { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; margin:14px 0; }
.practice-options.practice-chunks { grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); }
.practice-option { min-height:52px; white-space:normal; justify-content:center; }
.practice-option.tone-expected { background:var(--teal-soft); color:var(--teal); border-color:var(--teal); opacity:1; }
.practice-option.tone-incorrect { background:var(--redbg); color:var(--red); border-color:var(--red); opacity:1; }
.practice-order { display:block; min-height:48px; padding:12px; border:1.5px dashed var(--line); border-radius:12px; font-size:1.15rem; margin-top:10px; }
.practice-row { display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.practice-next { margin-top:14px; }
.practice-missed { padding-left:18px; } .practice-missed li { margin:8px 0; } .practice-missed .small { display:block; }
.lesson-practice [hidden], .practice-intro[hidden], .tone-more-item[hidden], #toneSession [hidden] { display:none !important; }

.linkbtn { color:var(--mute); }
/* level check (views/place.js) */
.place-q h2 { margin-top:4px; }
.place-word { color:var(--red); }
.place-opts { display:grid; gap:8px; margin-top:12px; }
.place-opt { justify-content:flex-start; text-align:left; white-space:normal; min-height:44px; }
.card.place-result h2.place-level { font-size:32px; line-height:1.15; margin:2px 0 8px; }
.place-bars { display:grid; gap:8px; margin:14px 0; }
.place-bar { display:grid; grid-template-columns:90px 1fr auto; align-items:center; gap:10px; }
.place-bar > i { display:block; height:8px; border-radius:8px; background:var(--line); overflow:hidden; }
.place-bar > i > i { display:block; height:100%; background:var(--teal); }
.place-note { padding:10px 12px; border-radius:12px; background:var(--surface2); }
.place-cta { margin:6px 0 10px; }
.place-result [hidden], .place-q [hidden] { display:none !important; }
.place-q [aria-disabled="true"] { opacity:.6; cursor:default; }
/* beginner levels (pre-A1, A1) and lesson tips */
.pill.A1 { background:var(--teal-soft); color:var(--teal); }
.lcover .pill.A1 { background:rgba(26,107,92,.78); color:#fff; }
.lesson-tip { padding:12px 16px; }
.lesson-tip p { margin:4px 0; }

/* Review: one phrase at a time, with an optional listening or recall mode. */
.review-count { margin-bottom:16px; }
.review-card { padding:clamp(14px, 2.2vw, 24px); }
.review-card [hidden] { display:none; }
.review-card-top { display:flex; justify-content:space-between; align-items:start; flex-wrap:wrap; gap:10px 16px; margin-bottom:16px; }
.review-position { margin:0 0 6px; font-size:.875rem; color:var(--mute); font-weight:700; }
.review-progress { display:block; width:min(9rem, 36vw); height:6px; accent-color:var(--brand); }
.review-options { color:var(--mute); font-size:.875rem; text-align:right; }
.review-options summary { cursor:pointer; padding:9px 0; }
.review-options label { display:block; margin:4px 0; }
.review-options select { max-width:100%; border-radius:var(--r-sm); }
.review-question {
  padding:clamp(20px, 4.6vw, 48px); border-radius:16px; overflow-wrap:anywhere;
  color:var(--ink); background:var(--hero-tint); border:1px solid var(--hero-line);
}
.review-question p { margin:0 0 8px; color:var(--mute); }
.review-question h2 { font-size:clamp(1.85rem, 4.5vw, 3.4rem); letter-spacing:-.05em; margin:0; }
.review-question .btn { margin-top:18px; color:var(--brand); border-color:var(--hero-line); }
.review-question .btn:hover { background:var(--brand-soft); border-color:var(--brand); }
.review-reveal:has(button:not([hidden])) { margin-top:16px; }
.review-answer { margin-top:16px; padding:clamp(16px, 2vw, 24px); border:1px solid var(--line); border-radius:16px; background:var(--surface2); }
.review-answer h3 { font-size:clamp(1.3rem, 3vw, 2rem); line-height:1.2; letter-spacing:-.027em; margin:0 0 8px; overflow-wrap:anywhere; }
.review-answer p { margin:0 0 8px; }
.review-context { padding-left:12px; margin:12px 0; border-left:2px solid var(--brand); }
.review-source { color:var(--mute); font-size:.875rem; }
.review-actions { margin-top:12px; }
.review-finish { background:linear-gradient(120deg,var(--surface),var(--brand-soft)); padding:clamp(20px, 4vw, 44px); }
.review-finish p { margin:0 0 20px; color:var(--mute); }
.review-emblem { display:grid; place-items:center; width:44px; height:44px; background:var(--brand-soft); color:var(--brand); border-radius:12px; margin-bottom:16px; }
@media (max-width:480px) {
  .review-actions { gap:8px; }
  .review-actions .btn { flex:1 1 auto; }
}

/* ---------- Grammar (Option A in Lessons + Option B in transcript) & Vietnamese stickers ---------- */
.ltabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin:0 0 18px; }
.ltab {
  display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:8px 16px;
  border:0; border-bottom:2px solid transparent; background:none; color:var(--mute);
  font:inherit; font-weight:600; cursor:pointer; margin-bottom:-1px; border-radius:10px 10px 0 0;
}
.ltab:hover { color:var(--ink); }
.ltab.on { color:var(--brand); border-bottom-color:var(--brand); }
.ltab .pill { font-size:.75rem; padding:2px 7px; }

.gram-hero {
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  padding:clamp(18px, 3vw, 28px); margin-bottom:18px; border-radius:20px;
  background:linear-gradient(125deg, var(--hero-tint), var(--brand-soft));
  border:1px solid var(--hero-line);
}
.gram-hero-copy h1 { margin:0 0 6px; font-size:clamp(1.6rem, 3.2vw, 2.2rem); letter-spacing:-.03em; }
.gram-hero-copy p { margin:0 0 12px; color:var(--mute); }
.gram-hero-stats { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.gram-filters { display:flex; align-items:center; flex-wrap:wrap; gap:6px; }
.gram-filters .chip { height:32px; padding:0 12px; font-size:13px; }
.gram-hero-art { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.gram-sticker {
  border-radius:16px; object-fit:cover; background:#fbf8f3;
  border:1.5px solid var(--hero-line); box-shadow:0 6px 16px rgba(130, 58, 28, .10);
  transition:transform .2s ease;
}
.gram-sticker.s1 { transform:rotate(-5deg); }
.gram-sticker.s2 { transform:rotate(4deg) translateY(4px); }
.gram-sticker.s3 { transform:rotate(-3deg); }
.gram-hero:hover .gram-sticker.s1 { transform:rotate(-2deg) translateY(-2px); }
.gram-hero:hover .gram-sticker.s2 { transform:rotate(2deg); }

.gram-layout { display:grid; grid-template-columns:280px minmax(0, 1fr); gap:18px; align-items:start; }
.gram-nav h2 { margin:0 0 10px; font-size:1rem; }
.gram-list { display:grid; gap:8px; }
.gram-item {
  display:flex; align-items:center; gap:10px; width:100%; min-height:54px; padding:8px 10px;
  border:1px solid var(--line); border-radius:14px; background:var(--surface); color:inherit;
  font:inherit; text-align:left; cursor:pointer; transition:border-color .15s, background .15s;
}
.gram-item:hover { border-color:var(--brand); }
.gram-item.on { background:var(--brand-soft); border-color:var(--brand); }
.gram-item-img { border-radius:10px; object-fit:cover; flex-shrink:0; border:1px solid var(--line); }
.gram-item-txt { display:grid; gap:2px; min-width:0; flex:1; }
.gram-item-txt b { font-size:.93rem; line-height:1.25; }
.gram-item-txt span { font-size:.8rem; color:var(--mute); }
.gram-item-arr { color:var(--brand); font-weight:700; flex-shrink:0; }

.gram-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.gram-card-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.gram-done-pill { background:var(--teal-soft); color:var(--teal); }
.gram-card-sticker { border-radius:14px; object-fit:cover; border:1px solid var(--line); flex-shrink:0; }
.gram-card-title { margin:0 0 8px; font-size:clamp(1.3rem, 2.5vw, 1.7rem); letter-spacing:-.02em; }
.gram-rule { margin:0 0 6px; line-height:1.5; }
.gram-sub { display:block; color:var(--mute); font-size:.88rem; margin-top:3px; }
.gram-formula {
  display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px;
  padding:8px 12px; margin:10px 0 12px; border-radius:12px; background:var(--surface2); border:1px solid var(--line);
}
.gram-slot { font-weight:600; }
.gram-slot.hi { padding:3px 9px; border-radius:8px; background:var(--brand-soft); color:var(--brand); font-weight:700; }
.gram-south { padding:10px 12px; margin:0 0 12px; border-radius:12px; background:var(--teal-soft); color:var(--ink); font-size:.92rem; line-height:1.45; }
.gram-examples { display:grid; gap:10px; margin:10px 0; }
.gram-ex { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:12px; background:var(--surface2); }
.gram-ex-vi { font-weight:700; font-size:1.05rem; }
.gram-ex-tr { color:var(--mute); font-size:.9rem; margin-top:2px; }
.gram-ex-note { font-size:.85rem; color:var(--mute); margin-top:4px; }
.gram-sep { border:0; border-top:1px solid var(--line); margin:16px 0; }
.gram-sec-label { font-weight:700; margin-bottom:4px; }
.gram-prompt { margin:0 0 8px; }
.gram-blank { font-size:1.2rem; font-weight:700; margin:6px 0 12px; }
.gram-gap { display:inline-block; min-width:54px; padding:0 8px; text-align:center; border-bottom:2px solid var(--brand); color:var(--brand); }
.gram-opts { display:flex; flex-wrap:wrap; gap:8px; }
.gram-opt { min-height:44px; min-width:84px; }
.gram-opt.on { background:var(--teal-soft); border-color:var(--teal); color:var(--teal); }
.gram-opt.bad { background:var(--redbg); border-color:var(--red); color:var(--red); }
.gram-fb { margin:10px 0 0; font-size:.93rem; font-weight:600; }
.gram-fb.ok { color:var(--teal); }
.gram-fb.err { color:var(--red); }
.gram-write { margin-top:14px; }
.gram-write summary { cursor:pointer; font-weight:600; color:var(--brand); min-height:44px; display:inline-flex; align-items:center; }
.gram-write-body { padding-top:8px; }
.gram-ta { width:100%; resize:vertical; }
.gram-model { margin-top:10px; padding:10px 12px; border-radius:12px; background:var(--surface2); border:1px solid var(--line); }
.gram-model-vi { font-weight:700; font-size:1.05rem; margin-bottom:4px; }
.gram-foot { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:16px; padding-top:12px; border-top:1px solid var(--line); }

.line-gram-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.line-gram {
  display:inline-flex; align-items:center; gap:6px; padding:4px 10px; min-height:32px;
  border-radius:99px; border:1px solid var(--hero-line); background:var(--brand-soft);
  color:var(--brand); font:inherit; font-size:.82rem; font-weight:600; cursor:pointer;
}
.line-gram:hover, .line-gram.on { background:var(--brand); color:#fff; border-color:var(--brand); }
.line.gram-focus { background:var(--brand-soft); border-radius:12px; }
.lesson-side { display:grid; gap:16px; align-content:start; }
.gram-inline-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }

@media (max-width:780px) {
  .gram-layout { grid-template-columns:1fr; }
  .gram-hero-art { display:none; }
}

.today-hero { position:relative; overflow:hidden; }
.today-sticker {
  position:absolute; top:18px; right:20px; z-index:1;
  width:72px; height:72px; border-radius:20px; object-fit:cover; background:#fbf8f3;
  border:2.5px solid rgba(255,255,255,.88); box-shadow:0 8px 22px rgba(92, 34, 12, .22);
  transform:rotate(5deg); pointer-events:none;
}
.today-hero .hero-h { padding-right:86px; }
.page-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:6px; }
.page-head .page { margin-bottom:2px; }
.page-head .lead { margin-bottom:0; }
.page-stickers { display:flex; align-items:center; gap:8px; flex-shrink:0; }
@media (max-width:520px) {
  .today-sticker { width:54px; height:54px; top:14px; right:14px; border-radius:15px; }
  .today-hero .hero-h { padding-right:64px; }
  .page-stickers img { width:44px; height:44px; border-radius:12px; }
}

.vn-gutters { display:none; }

/* ---------- 2026 Modern Library Toolbar & Filter Drawer (views/home.js) ---------- */
.lib-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 16px; margin:0 0 14px; }
.lib-title { display:flex; align-items:baseline; gap:10px; }
.lib-title .page { margin:0; }
.lib-count { color:var(--mute); font-weight:600; }
.lib-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:1 1 340px; justify-content:flex-end; }
.lib-search {
  display:flex; align-items:center; gap:8px; flex:1 1 220px; max-width:340px; min-height:40px;
  padding:0 12px; border-radius:99px; border:1px solid var(--line); background:var(--surface);
  transition:border-color .15s, box-shadow .15s;
}
.lib-search:focus-within { border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft); }
.lib-search input { flex:1; min-width:0; border:0; background:none; color:inherit; font:inherit; font-size:14px; outline:none; padding:8px 0; }
.lib-search input::placeholder { color:var(--mute); }
.kbd-hint {
  display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px;
  border-radius:6px; border:1px solid var(--line); background:var(--surface2); color:var(--mute);
  font:inherit; font-size:12px; font-weight:700;
}
.lib-clear { border:0; background:none; color:var(--mute); font-size:18px; line-height:1; cursor:pointer; padding:2px 4px; }
.lib-clear:hover { color:var(--ink); }
.lib-filters { margin-bottom:14px; }
.filter-drawer {
  display:grid; gap:12px; padding:14px 16px; margin:0 0 16px;
  border-radius:16px; border:1px solid var(--line); background:var(--surface);
}
.filter-drawer[hidden] { display:none; }
.filter-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.filter-drawer .tagrow { margin:0; }
@media (max-width:680px) {
  .lib-tools { justify-content:stretch; }
  .lib-search { max-width:none; }
}

/* ---------- 2026 Modern Tones Page (views/tones.js) ---------- */
.page-head-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.page-head-row .page { margin:0 0 4px; }
.page-head-row .lead { margin:0; }
.tone-strip-card { padding:12px 14px; margin-bottom:16px; }
.tone-strip { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:8px; }
.tone-strip-item {
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:4px;
  padding:10px 8px; border-radius:12px; background:var(--surface2); border:1px solid transparent;
  color:inherit; font:inherit; cursor:pointer; transition:border-color .15s, background .15s, transform .15s;
}
.tone-strip-item:hover { border-color:var(--brand); background:var(--brand-soft); transform:translateY(-2px); }
.tone-strip-item.playing { border-color:var(--brand); background:var(--brand-soft); }
.tone-strip-play { font-size:.82rem; font-weight:700; color:var(--brand); }
.tone-strip-status { margin:8px 0 0; text-align:center; }

/* ---------- Polish: Review, Progress & Lesson Player ---------- */
.review-card { border-radius:20px; box-shadow:var(--shadow); }
.review-question { border-radius:18px; }
.review-source-row { display:flex; align-items:center; gap:10px; margin:8px 0 4px; }
.review-source-row .review-source { margin:0; }
.review-thumb { width:48px; height:34px; border-radius:8px; object-fit:cover; border:1px solid var(--line); flex-shrink:0; }
.review-ans-body { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.review-ans-copy { min-width:0; flex:1; }
.review-word-img {
  width:240px; height:165px; object-fit:cover; border-radius:14px; flex-shrink:0;
  border:1px solid var(--line); box-shadow:var(--shadow);
}
.review-modes {
  display:inline-flex; align-items:center; gap:2px; padding:3px;
  border-radius:99px; border:1px solid var(--line); background:var(--surface2);
}
.review-mode-btn {
  min-height:34px; padding:0 13px; border:0; border-radius:99px; background:none;
  color:var(--mute); font:inherit; font-size:13px; font-weight:600; cursor:pointer;
  transition:background .15s, color .15s, box-shadow .15s;
}
.review-mode-btn:hover { color:var(--ink); }
.review-mode-btn.on { background:var(--surface); color:var(--brand); box-shadow:0 1px 4px rgba(0,0,0,.08); }
@media (max-width:640px) {
  .review-ans-body { flex-direction:column; }
  .review-word-img { width:100%; height:180px; }
}
.bars { gap:10px; }
.bcol i { transition:height .25s ease; }
.bcol i.goal { background:var(--teal); }
.aplayer { border-radius:18px; border:1px solid var(--line); box-shadow:var(--shadow); }
.wp-img { width:100%; height:130px; object-fit:cover; border-radius:10px; margin:8px 0; border:1px solid var(--line); display:block; }
.vocab-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.vocab-row:last-child { border-bottom:0; }
details.lesson-tip summary { cursor:pointer; }
details.lesson-tip p { margin:8px 0 0; }
.tone-more { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px; }
.tone-more-cafe { background:linear-gradient(135deg, var(--surface), var(--brand-soft)); border-color:var(--hero-line); }
@media (max-width:860px) { .tone-more { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width:620px) {
  .tone-strip { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .tone-more { grid-template-columns:1fr; }
}
@media (min-width:1320px) {
  .vn-gutters { display:block; position:fixed; inset:0; pointer-events:none; z-index:0; }
  main#view { position:relative; z-index:1; }
  .vn-side {
    position:fixed; width:clamp(68px, calc((100vw - 1120px) / 2 - 28px), 92px); height:auto; aspect-ratio:1/1;
    border-radius:22px; object-fit:cover; background:#fbf8f3; pointer-events:auto; cursor:default;
    border:2px solid var(--hero-line); box-shadow:0 10px 24px rgba(130, 58, 28, .11);
    opacity:.92; transition:transform .22s cubic-bezier(.34,1.56,.64,1), opacity .2s ease, box-shadow .2s ease;
  }
  .vn-side:hover { transform:scale(1.09) rotate(0deg) translateY(-3px); opacity:1; box-shadow:0 14px 28px rgba(130, 58, 28, .18); }
  @media (prefers-reduced-motion:reduce) { .vn-side { transition:none; } .vn-side:hover { transform:none; } }
  [data-theme="dark"] .vn-side { opacity:.78; border-color:var(--line); box-shadow:0 10px 24px rgba(0, 0, 0, .35); }
  .vn-side.l1, .vn-side.l2, .vn-side.l3, .vn-side.l4 { left:max(16px, calc((100vw - 1120px) / 4 - 44px)); }
  .vn-side.r1, .vn-side.r2, .vn-side.r3, .vn-side.r4 { right:max(16px, calc((100vw - 1120px) / 4 - 44px)); }
  .vn-side.l1 { top:112px; transform:rotate(-7deg); }
  .vn-side.l2 { top:292px; transform:rotate(6deg); }
  .vn-side.l3 { top:472px; transform:rotate(-5deg); }
  .vn-side.l4 { top:652px; transform:rotate(5deg); }
  .vn-side.r1 { top:132px; transform:rotate(7deg); }
  .vn-side.r2 { top:312px; transform:rotate(-6deg); }
  .vn-side.r3 { top:492px; transform:rotate(5deg); }
  .vn-side.r4 { top:672px; transform:rotate(-6deg); }
}
@media (min-width:1320px) and (max-height:780px) {
  .vn-side.l4, .vn-side.r4 { display:none; }
}

/* ---------- BaoSpeak English additions (IPA, stress, Sounds & Rhythm Lab, Vietnamese contrast) ---------- */
.en-ipa { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--mute); margin-right: 8px; }
.stress-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--indigo-soft); color: var(--indigo); vertical-align: middle; }
.vi-note { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--gold-soft); color: var(--ink); font-size: 13px; line-height: 1.45; }
.vi-note b { color: var(--gold); }
.wp-ipa { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--brand); margin: 2px 0 6px; font-weight: 600; }
.pillar-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
@media (max-width: 720px) { .pillar-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pillar-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s, background .15s, transform .12s; }
.pillar-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.pillar-btn.on { border-color: var(--brand); background: var(--brand-soft); }
.pillar-btn b { font-size: 14px; line-height: 1.3; }
.pillar-btn span { font-size: 12px; color: var(--mute); font-family: ui-monospace, Menlo, monospace; }
.path-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.path-step { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); display: flex; flex-direction: column; gap: 6px; text-align: left; }
.path-step.cur { border-color: var(--brand); background: var(--hero-tint); }
.path-step .eyebrow { margin: 0; }
.stress-svg { width: 100%; max-width: 240px; height: 52px; display: block; margin: 6px 0; }
.sound-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.sound-box { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); }
.sound-box .big { font-size: 20px; font-weight: 700; }
.cue-box { margin-top: 4px; padding: 5px 10px; border-radius: 10px; background: var(--hero-tint); border: 1px solid var(--hero-line); font-size: 13.5px; line-height: 1.45; }
.wp-cue { margin: 6px 0; padding: 6px 8px; border-radius: 10px; background: var(--surface2); font-size: 13px; }
.can-do-card { background: var(--hero-tint); border-color: var(--hero-line); }
.transfer-card { border-left: 4px solid var(--brand); }
.ok { color: var(--teal); }

/* ---------- 2026 Beginner-First Calm UI & Custom Controls ---------- */
.pselect { position:relative; display:inline-block; min-width:170px; max-width:100%; }
.pselect-btn {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px;
  min-height:44px; padding:8px 14px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface); color:var(--ink); font:inherit; font-size:14px; font-weight:600; cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.pselect-btn:hover { border-color:var(--brand); }
.pselect-lbl { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pselect-menu {
  position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:40; max-height:280px; overflow:auto;
  padding:6px; border-radius:16px; border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow-lg);
}
.pselect-menu[hidden] { display:none; }
.pselect-opt {
  width:100%; display:flex; align-items:center; justify-content:space-between; gap:8px;
  min-height:40px; padding:8px 12px; border:0; border-radius:10px; background:transparent;
  color:var(--ink); font:inherit; font-size:14px; text-align:left; cursor:pointer;
}
.pselect-opt:hover, .pselect-opt:focus-visible { background:var(--surface2); }
.pselect-opt.on { background:var(--brand-soft); color:var(--brand); font-weight:700; }

.sound-tip-banner { padding:14px 16px; border-radius:16px; background:var(--hero-tint); border:1px solid var(--hero-line); }
.sound-pairs-clean { grid-template-columns:1fr; }
.sound-split { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.sound-half { padding:12px 14px; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
@media (max-width:680px) { .sound-split { grid-template-columns:1fr; } }
.pillar-btn .pillar-sub { font-family:var(--font); font-size:12px; color:var(--mute); line-height:1.35; }

.next-spotlight { background:var(--hero-tint); border-color:var(--hero-line); }
.lbody { padding:12px 15px 4px; }
.lbody .summary { margin:0; font-size:13.5px; color:var(--mute); line-height:1.45; }
.lcover { height:172px; }

details.path-drawer summary.path-drawer-sum {
  display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer; list-style:none;
}
details.path-drawer summary.path-drawer-sum::-webkit-details-marker { display:none; }
details.path-drawer[open] .path-drawer-sum .pill { background:var(--brand-soft); color:var(--brand); }

.gram-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:6px; }
.gram-card-sticker { width:60px; height:60px; border-radius:16px; object-fit:cover; background:#fbf8f3; border:1px solid var(--line); box-shadow:var(--shadow); flex:none; }
.gram-mob-pick { display:none; margin-bottom:14px; align-items:center; gap:10px; flex-wrap:wrap; }
@media (max-width:780px) {
  .gram-nav { display:none; }
  .gram-mob-pick { display:flex; }
}
@media (prefers-reduced-motion:no-preference) {
  .card, .lcard, .btn, .pill { transition:transform .18s cubic-bezier(.22, 1, .36, 1), border-color .18s ease, box-shadow .18s ease; }
  .lcard:hover { transform:translateY(-2px); }
}

/* Achievements 2026: emoji medals, tiers, compact grid; locked = grey medal, readable text */
.badges { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.badge { padding: 12px 8px; }
.badge .medal.emoji { font-size: 26px; background: var(--surface2); color: inherit; }
.badge.tier-bronze .medal.emoji { box-shadow: 0 0 0 3px #CD7F32 inset; }
.badge.tier-silver .medal.emoji { box-shadow: 0 0 0 3px #A8A9AD inset; }
.badge.tier-gold .medal.emoji { box-shadow: 0 0 0 3px #D4A72C inset; }
.badge.locked { opacity: 1; } .badge.locked .medal.emoji { filter: grayscale(1); opacity: .45; box-shadow: none; }
.badge.locked b, .badge.locked span { color: var(--mute); }
