@layer hsk-reset, hsk-base, hsk-components, hsk-modules, hsk-overrides;

/* Shared design tokens. New components use semantic tokens below.
   Legacy palette entries preserve existing feature-specific shades during migration. */
:root{
  /* Sentence editor exact brand shades and elevation; centralized design tokens. */
  --sentence-editor-green:#10a37f;
  --sentence-editor-green-soft:rgba(16,163,127,.12);
  --sentence-editor-fix:#ef4444;
  --sentence-editor-fix-soft:rgba(239,68,68,.12);
  --sentence-editor-style:#3b82f6;
  --sentence-editor-style-soft:rgba(59,130,246,.12);
  --shadow-sentence-editor-submit:0 2px 6px rgba(16,163,127,.25);
  --shadow-sentence-editor-submit-hover:0 4px 12px rgba(16,163,127,.35);
  --shadow-sentence-editor-card:0 1px 3px rgba(0,0,0,.04);
  --shadow-sentence-editor-card-hover:0 4px 12px rgba(0,0,0,.07);
  --qa-thinking-active-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 24%,var(--palette-clear));
  --qa-effort-accent:#3b82f6;
  --qa-effort-thumb-border:#2563eb;
  --qa-effort-thumb-shadow:0 1px 4px rgba(0,0,0,.35);
  --shadow-sidebar-brand-hover:0 0 0 3px var(--accent-light);
  --shadow-topbar-nav-hover:0 1px 3px rgba(24,24,48,.06);
  --shadow-home-hero:0 3px 10px rgb(38 24 88 / 8%);
--wb-exact-0:transparent;
--wb-exact-1:inherit;
--wb-exact-2:rgba(158,146,255,.16);
--wb-exact-3:50%;
--wb-exact-4:0 0 0 3px var(--wb-exact-2);
--wb-exact-5:#fff;
--wb-exact-6:#7c6bff;
--wb-exact-7:#5b4be8;
--wb-exact-8:rgba(91,75,232,.95);
--wb-exact-9:50%;
--wb-exact-10:0 12px 26px -12px var(--wb-exact-8);
--wb-exact-11:rgba(237,237,247,.10);
--wb-exact-12:50%;
--wb-exact-13:8px;
--wb-exact-14:8px;
--wb-exact-15:6px;
--wb-exact-16:0 3px 3px 0;
--wb-exact-17:transparent;
--wb-exact-18:10px;
--wb-exact-19:1.5px;
--wb-exact-20:20px;
--wb-exact-21:transparent;
--wb-exact-22:rgba(237,237,247,.16);
--wb-exact-23:transparent;

/* WorkBuddy music presentation palette; independent of app theme. */

  --mb-rd-canvas:#0f0f18; --mb-rd-canvas-2:#13131f;
  --mb-rd-surface:#181826; --mb-rd-surface-soft:#1d1d2e;
  --mb-rd-ink:#ededf7; --mb-rd-ink-2:#c9c9de; --mb-rd-muted:#9c9cb8; --mb-rd-faint:#7a7a96;
  --mb-rd-line:#2a2a3f; --mb-rd-line-soft:#232338;
  --mb-rd-brand:#5b4be8; --mb-rd-brand-2:#7c6bff; --mb-rd-brand-deep:#3b2fb0;
  --mb-rd-brand-soft:#241f45; --mb-rd-brand-tint:#1c1930;
  --mb-palette-dark-violet:#9e92ff;
  --mb-rd-hero-grad:linear-gradient(158deg,#2a2350 0%,#241f45 38%,#1c1930 70%,#13131f 100%);
  --mb-rd-hero-glow:radial-gradient(120% 90% at 12% 0%,rgba(124,107,255,.26) 0%,rgba(124,107,255,0) 62%);
  --mb-rd-on-hero:#ffffff; --mb-rd-on-hero-2:rgba(237,237,247,.80); --mb-rd-on-hero-3:rgba(237,237,247,.62);
  --mb-rd-glass:rgba(19,19,31,.74); --mb-rd-glass-solid:#13131f; --mb-rd-glass-line:rgba(237,237,247,.09);
  --mb-rd-track:rgba(237,237,247,.16);
  --mb-rd-track-fill:linear-gradient(90deg,#5b4be8 0%,#7c6bff 55%,#9e92ff 100%);
  --mb-rd-playing:#9e92ff; --mb-rd-playing-bg:rgba(124,107,255,.10); --mb-rd-playing-line:rgba(124,107,255,.34);
  --mb-rd-skeleton:#232338; --mb-rd-skeleton-sheen:rgba(237,237,247,.07);
  --mb-rd-scrim:rgba(15,15,24,.86);
  --mb-rd-shadow-hero:0 18px 44px -22px rgba(59,47,176,.55),0 2px 6px rgba(0,0,0,.34);
  --mb-rd-shadow-lg:0 28px 64px -32px rgba(0,0,0,.8);
  --mb-rd-ring:0 0 0 3px rgba(124,107,255,.25);
  --mb-radius-8px:8px; --mb-radius-btn:12px; --mb-radius-card:24px; --mb-radius-pill:999px;
  --mb-radius-cover:16px; --mb-radius-row:14px;
  --mb-sp-1:4px;--mb-sp-2:8px;--mb-sp-3:12px;--mb-sp-4:16px;--mb-sp-5:20px;--mb-sp-6:24px;--mb-sp-7:28px;--mb-sp-8:32px;
  --mb-gutter:20px;
  --mb-font-ui:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI","Helvetica Neue","PingFang SC","Hiragino Sans GB","Noto Sans",Arial,sans-serif;
  --mb-safe-top:0px; --mb-safe-bottom:0px;
  --mb-h-header:56px; --mb-h-pills:44px; --mb-h-mini:64px;

  --mb-row-pad:clamp(8px,.8vw,12px);
  --mb-row-h:calc(44px + var(--mb-row-pad) * 2);

  --mb-h-sticky:106px;
  --mb-ease-out:cubic-bezier(.22,.61,.36,1);
  --mb-ease-in-out:cubic-bezier(.4,0,.2,1);
  --mb-ease-spring:cubic-bezier(.22,1,.36,1);
  --mb-dur-fast:120ms; --mb-dur-base:200ms; --mb-dur-slow:320ms; --mb-dur-morph:420ms; --mb-stagger:36ms;

  --mb-rd-sheet-bg:var(--mb-rd-surface);
  --mb-rd-danger:#dd6b76;
  --mb-rd-danger-soft:rgba(221,107,118,.10);
  --mb-dur-view:220ms;
  --mb-sheet-pad:12px;

  color-scheme:light;
  --shell:520px;--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px);
  --palette-clear:transparent;
  --palette-mobile-streak-soft:rgba(245,158,11,0.16);
  --palette-mobile-streak-border:rgba(245,158,11,0.34);
  --palette-mobile-streak-text:#fde68a;
  --palette-mobile-vocab-heading:#a5b4fc;
  --palette-mobile-hero-surface:#4338ca;
  --palette-mobile-hero-button-soft:rgba(20,16,66,0.34);
  --palette-mobile-hero-button-border:rgba(255,255,255,0.34);
  --palette-mobile-hero-button-ink:#2e2584;
  --palette-mobile-wrong-soft:rgba(244,63,94,0.16);
  --palette-mobile-wrong-border:rgba(244,63,94,0.34);
  --palette-mobile-wrong-ink:#fda4af;
  --palette-mobile-correct-soft:rgba(16,185,129,0.16);
  --palette-mobile-correct-border:rgba(16,185,129,0.34);
  --palette-mobile-correct-ink:#6ee7b7;
  --palette-mobile-status-soft:rgba(34,197,94,0.16);
  --palette-mobile-status-border:rgba(34,197,94,0.34);
  --palette-mobile-status-ink:#86efac;
  --legacy-hex-dae3ff:#dae3ff;
  --legacy-hex-f7f9ff:#f7f9ff;
  --legacy-hex-1547b0:#1547b0;
  --legacy-rgb-1:rgba(255,255,255,0.8);
  --legacy-hex-3498db:#3498db;
  --palette-white:#ffffff;
  --legacy-hex-2980b9:#2980b9;
  --legacy-hex-16a085:#16a085;
  --legacy-hex-27ae60:#27ae60;
  --legacy-hex-229954:#229954;
  --legacy-hex-f39c12:#f39c12;
  --legacy-hex-e67e22:#e67e22;
  --legacy-hex-e74c3c:#e74c3c;
  --legacy-hex-c0392b:#c0392b;
  --legacy-hex-8e44ad:#8e44ad;
  --legacy-hex-732d91:#732d91;
  --legacy-hex-34495e:#34495e;
  --legacy-hex-2c3e50:#2c3e50;
  --legacy-hex-7f8c8d:#7f8c8d;
  --legacy-hex-606d6e:#606d6e;
  --legacy-hex-1e4edb:#1e4edb;
  --legacy-hex-111111:#111111;
  --palette-violet:#5b4be8;
  --press-active-bg:#6957e7;
  --legacy-hex-bdc3c7:#bdc3c7;
  --legacy-hex-333333:#333333;
  --legacy-hex-2b63c0:#2b63c0;
  --legacy-hex-222222:#222222;
  --legacy-hex-555555:#555555;
  --legacy-hex-cad6ef:#cad6ef;
  --legacy-rgb-2:rgba(255,255,255,.95);
  --legacy-hex-52627b:#52627b;
  --legacy-hex-bac8df:#bac8df;
  --legacy-hex-213250:#213250;
  --legacy-hex-f5b942:#f5b942;
  --legacy-hex-e6f5ed:#e6f5ed;
  --legacy-hex-146637:#146637;
  --legacy-hex-b9dfcb:#b9dfcb;
  --legacy-hex-fdecec:#fdecec;
  --legacy-hex-a72b30:#a72b30;
  --legacy-hex-f0babc:#f0babc;
  --legacy-hex-14864a:#14864a;
  --legacy-hex-0c5a30:#0c5a30;
  --legacy-hex-c9343b:#c9343b;
  --legacy-hex-8c2026:#8c2026;
  --legacy-hex-d8e1f0:#d8e1f0;
  --legacy-hex-f8faff:#f8faff;
  --legacy-hex-5a6b86:#5a6b86;
  --legacy-hex-143d91:#143d91;
  --legacy-hex-eef3fc:#eef3fc;
  --legacy-hex-243858:#243858;
  --legacy-hex-dce5f5:#dce5f5;
  --legacy-hex-e2f6e8:#e2f6e8;
  --legacy-hex-fde8e8:#fde8e8;
  --legacy-hex-d83b40:#d83b40;
  --legacy-hex-f1f5fd:#f1f5fd;
  --legacy-hex-d8e3f5:#d8e3f5;
  --legacy-hex-d7e3f7:#d7e3f7;
  --legacy-hex-f5f8ff:#f5f8ff;
  --legacy-hex-ac6c13:#ac6c13;
  --legacy-hex-475569:#475569;
  --legacy-hex-e2e8f0:#e2e8f0;
  --legacy-hex-c7d7f5:#c7d7f5;
  --legacy-hex-eff4ff:#eff4ff;
  --legacy-hex-18345d:#18345d;
  --legacy-hex-cad8f1:#cad8f1;
  --legacy-hex-526785:#526785;
  --legacy-hex-64748b:#64748b;
  --legacy-hex-d7e3ee:#d7e3ee;
  --legacy-hex-f8fafc:#f8fafc;
  --legacy-hex-162b42:#162b42;
  --legacy-hex-285b91:#285b91;
  --legacy-hex-b6d4ef:#b6d4ef;
  --legacy-hex-eff6ff:#eff6ff;
  --legacy-hex-173b60:#173b60;
  --legacy-hex-dce8ff:#dce8ff;
  --legacy-hex-173b75:#173b75;
  --legacy-hex-466fd1:#466fd1;
  --legacy-hex-d9e1f2:#d9e1f2;
  --legacy-hex-bcd0ff:#bcd0ff;
  --legacy-hex-dbe6ff:#dbe6ff;
  --legacy-hex-e6edff:#e6edff;
  --legacy-hex-3b5a8f:#3b5a8f;
  --legacy-hex-6b7c97:#6b7c97;
  --legacy-hex-f2f6ff:#f2f6ff;
  --legacy-hex-fafbfe:#fafbfe;
  --legacy-hex-f4f7ff:#f4f7ff;
  --legacy-hex-ffffff26:#ffffff26;
  --legacy-hex-ffffff38:#ffffff38;
  --legacy-hex-e08a0b:#e08a0b;
  --legacy-hex-4b6076:#4b6076;
  --legacy-hex-6d7b7c:#6d7b7c;
  --legacy-hex-0a1a4a73:#0a1a4a73;
  --legacy-hex-8a5a00:#8a5a00;
  --legacy-hex-fff4d6:#fff4d6;
  --legacy-hex-e4ecfa:#e4ecfa;
  --legacy-hex-12307a:#12307a;
  --legacy-hex-e78119:#e78119;
  --legacy-hex-ffbc5020:#ffbc5020;
  --legacy-hex-fff4df:#fff4df;
  --legacy-hex-f7faff:#f7faff;
  --legacy-hex-b7c8ee:#b7c8ee;
  --legacy-hex-edf3ff:#edf3ff;
  --legacy-hex-526b8f:#526b8f;
  --legacy-hex-eef3fb:#eef3fb;
  --legacy-hex-e4edff:#e4edff;
  --legacy-hex-f3f6fc:#f3f6fc;
  --legacy-rgb-3:rgba(255,255,255,.8);
  --legacy-hex-2563eb:#2563eb;
  --legacy-hex-2563eb15:#2563eb15;
  --legacy-hex-e8f0ff:#e8f0ff;
  --legacy-hex-f4f7fc:#f4f7fc;
  --legacy-hex-fee2e2:#fee2e2;
  --legacy-hex-991b1b:#991b1b;
  --legacy-hex-dcfce7:#dcfce7;
  --legacy-hex-166534:#166534;
  --legacy-hex-ecfdf3:#ecfdf3;
  --legacy-hex-86d4a5:#86d4a5;
  --legacy-hex-d1fae5:#d1fae5;
  --legacy-hex-16965a:#16965a;
  --legacy-hex-12753d:#12753d;
  --legacy-hex-e5eaf1:#e5eaf1;
  --legacy-hex-cde1d5:#cde1d5;
  --legacy-hex-f2faf5:#f2faf5;
  --legacy-hex-e8eef9:#e8eef9;
  --legacy-hex-d9e1ef:#d9e1ef;
  --legacy-hex-eaf1ff:#eaf1ff;
  --legacy-hex-153477:#153477;
  --legacy-hex-e3a630:#e3a630;
  --legacy-hex-6a501a:#6a501a;
  --legacy-hex-14532d:#14532d;
  --legacy-hex-405c93:#405c93;
  --legacy-hex-406fde:#406fde;
  --legacy-hex-dbe3ef:#dbe3ef;
  --legacy-hex-dfe3ed:#dfe3ed;
  --legacy-hex-1b2333:#1b2333;
  --legacy-hex-364156:#364156;
  --palette-violet-deep:#3b2fb0;
  --legacy-hex-ded8f5:#ded8f5;
  --palette-line:#e7e6f1;
  --legacy-hex-25253b:#25253b;
  --legacy-hex-18152d66:#18152d66;
  --palette-line-strong:#d8d6e8;
  --palette-dark-ink:#eeeef6;
  --legacy-hex-526783:#526783;
  --legacy-hex-2459a6:#2459a6;
  --legacy-hex-5683c5:#5683c5;
  --legacy-hex-244b83:#244b83;
  --legacy-hex-17315b:#17315b;
  --legacy-hex-173d91:#173d91;
  --legacy-hex-ccd7ed:#ccd7ed;
  --legacy-hex-193256:#193256;
  --legacy-hex-edf2fc:#edf2fc;
  --legacy-hex-e6f5ef:#e6f5ef;
  --legacy-hex-536580:#536580;
  --legacy-hex-dde5f3:#dde5f3;
  --legacy-hex-bdcce4:#bdcce4;
  --legacy-hex-fffffff2:#fffffff2;
  --legacy-hex-cad8ef:#cad8ef;
  --legacy-hex-bac9e3:#bac9e3;
  --legacy-hex-dbe3f1:#dbe3f1;
  --legacy-hex-e7eefc:#e7eefc;
  --legacy-hex-c5d5f1:#c5d5f1;
  --legacy-hex-e8eef8:#e8eef8;
  --legacy-hex-aba1ff:#aba1ff;
  --legacy-hex-a0a3b1:#a0a3b1;
  --legacy-hex-707389:#707389;
  --legacy-hex-f8f7fd:#f8f7fd;
  --legacy-hex-8a8ca0:#8a8ca0;
  --legacy-hex-f8f8fc:#f8f8fc;
  --legacy-hex-f2f2f7:#f2f2f7;
  --legacy-hex-7a7d90:#7a7d90;
  --legacy-hex-a7a9b5:#a7a9b5;
  --legacy-rgb-4:rgba(247,248,251,.92);
  --legacy-rgb-5:rgba(230,233,240,.8);
  --legacy-hex-a0a1af:#a0a1af;
  --legacy-hex-74778e:#74778e;
  --legacy-hex-c5bbff:#c5bbff;
  --legacy-hex-565a70:#565a70;
  --legacy-hex-c3bcf7:#c3bcf7;
  --legacy-hex-dcd6fb:#dcd6fb;
  --legacy-hex-eae6ff:#eae6ff;
  --legacy-hex-5848cb:#5848cb;
  --legacy-hex-9598a7:#9598a7;
  --legacy-hex-78bda0:#78bda0;
  --legacy-hex-68608e:#68608e;
  --legacy-hex-86899d:#86899d;
  --legacy-hex-9186b8:#9186b8;
  --legacy-hex-8b8ea0:#8b8ea0;
  --legacy-hex-e9e8ee:#e9e8ee;
  --legacy-hex-9698a5:#9698a5;
  --legacy-hex-5445c1:#5445c1;
  --legacy-hex-ffffff2a:#ffffff2a;
  --legacy-hex-ffffff1f:#ffffff1f;
  --legacy-hex-e5dfff:#e5dfff;
  --legacy-hex-bcb1ff:#bcb1ff;
  --legacy-hex-ddd7ff:#ddd7ff;
  --legacy-hex-5040be:#5040be;
  --legacy-hex-efecff:#efecff;
  --legacy-hex-d9d1ff4d:#d9d1ff4d;
  --legacy-hex-ffffff3a:#ffffff3a;
  --legacy-hex-ddd7ff9c:#ddd7ff9c;
  --legacy-hex-c9c1f9:#c9c1f9;
  --legacy-hex-eeeaff:#eeeaff;
  --legacy-hex-705de2:#705de2;
  --legacy-hex-fff0e9:#fff0e9;
  --legacy-hex-cf8066:#cf8066;
  --legacy-hex-e9f7f2:#e9f7f2;
  --legacy-hex-48a68a:#48a68a;
  --legacy-hex-edf4ff:#edf4ff;
  --legacy-hex-6695d5:#6695d5;
  --legacy-hex-9a9dad:#9a9dad;
  --legacy-hex-b6b8c5:#b6b8c5;
  --legacy-hex-b9afea:#b9afea;
  --legacy-hex-999cac:#999cac;
  --legacy-hex-d5d3e1:#d5d3e1;
  --legacy-hex-e9e6ff:#e9e6ff;
  --legacy-hex-796ae3:#796ae3;
  --legacy-hex-9a98aa:#9a98aa;
  --legacy-hex-8e91a2:#8e91a2;
  --legacy-hex-adadbf:#adadbf;
  --legacy-hex-f0eff6:#f0eff6;
  --legacy-hex-a599f3:#a599f3;
  --legacy-hex-a0a1ad:#a0a1ad;
  --legacy-hex-a8a9b5:#a8a9b5;
  --legacy-hex-f3f3f8:#f3f3f8;
  --legacy-hex-e9e6fa:#e9e6fa;
  --palette-violet-soft:#efedff;
  --legacy-hex-5b4ace:#5b4ace;
  --legacy-hex-9d95c7:#9d95c7;
  --legacy-hex-cfc7ff:#cfc7ff;
  --legacy-hex-f2efff:#f2efff;
  --legacy-hex-e8e3ff:#e8e3ff;
  --legacy-hex-e8e2ff:#e8e2ff;
  --legacy-hex-8271dd:#8271dd;
  --legacy-hex-aaa6bd:#aaa6bd;
  --legacy-hex-888a9f:#888a9f;
  --legacy-hex-878a9c:#878a9c;
  --legacy-hex-9395a5:#9395a5;
  --legacy-hex-dedeea:#dedeea;
  --legacy-hex-bdb3fc:#bdb3fc;
  --legacy-hex-eeeef4:#eeeef4;
  --legacy-hex-f8f8fb:#f8f8fb;
  --legacy-hex-6a6d81:#6a6d81;
  --legacy-hex-efedff:#efedff;
  --legacy-hex-f5dcde:#f5dcde;
  --legacy-hex-fff8f8:#fff8f8;
  --legacy-hex-74788d:#74788d;
  --legacy-hex-e2e4eb:#e2e4eb;
  --legacy-hex-a99af1:#a99af1;
  --legacy-hex-b5b8c6:#b5b8c6;
  --legacy-hex-77798d:#77798d;
  --legacy-hex-9193a5:#9193a5;
  --legacy-hex-a3a5b5:#a3a5b5;
  --legacy-hex-d5caff:#d5caff;
  --legacy-hex-999aa9:#999aa9;
  --legacy-hex-e9e7fa:#e9e7fa;
  --legacy-hex-f4f1ff:#f4f1ff;
  --legacy-hex-faf9ff:#faf9ff;
  --legacy-hex-a1a3b2:#a1a3b2;
  --legacy-hex-e8e3fe:#e8e3fe;
  --legacy-hex-f1eeff:#f1eeff;
  --legacy-hex-7466ca:#7466ca;
  --legacy-hex-9388d6:#9388d6;
  --legacy-hex-29273e:#29273e;
  --legacy-hex-3f415a:#3f415a;
  --legacy-hex-aaa6c0:#aaa6c0;
  --legacy-hex-b9b5c9:#b9b5c9;
  --legacy-hex-d9eee3:#d9eee3;
  --legacy-hex-ecf8f1:#ecf8f1;
  --legacy-hex-2c8b63:#2c8b63;
  --legacy-hex-f4dfe0:#f4dfe0;
  --legacy-hex-fff1f2:#fff1f2;
  --legacy-hex-c36b72:#c36b72;
  --legacy-hex-999bac:#999bac;
  --legacy-hex-8e82db:#8e82db;
  --legacy-hex-9295a7:#9295a7;
  --legacy-hex-eee9ff:#eee9ff;
  --legacy-hex-efecfc:#efecfc;
  --legacy-hex-fbfaff:#fbfaff;
  --legacy-hex-5e6180:#5e6180;
  --legacy-hex-3e3b73:#3e3b73;
  --legacy-hex-9892b8:#9892b8;
  --legacy-hex-74768d:#74768d;
  --legacy-hex-fbfbfe:#fbfbfe;
  --legacy-hex-eeeef5:#eeeef5;
  --legacy-hex-36334c:#36334c;
  --legacy-hex-a1a3b1:#a1a3b1;
  --legacy-hex-787a90:#787a90;
  --legacy-hex-fbfbfd:#fbfbfd;
  --legacy-hex-d8d1ff:#d8d1ff;
  --legacy-hex-39364f:#39364f;
  --legacy-hex-9092a3:#9092a3;
  --legacy-hex-fcfcfe:#fcfcfe;
  --legacy-hex-aaaaaa:#aaaaaa;
  --legacy-hex-cfc9e7:#cfc9e7;
  --legacy-hex-eff0f5:#eff0f5;
  --legacy-hex-e5e2f4:#e5e2f4;
  --legacy-hex-f6f4ff:#f6f4ff;
  --legacy-hex-9292a5:#9292a5;
  --legacy-hex-e6e7ef:#e6e7ef;
  --legacy-hex-4f5068:#4f5068;
  --legacy-hex-b9aaff:#b9aaff;
  --legacy-hex-bee1c9:#bee1c9;
  --legacy-hex-eefaef:#eefaef;
  --legacy-hex-2d815a:#2d815a;
  --legacy-hex-f0cccc:#f0cccc;
  --legacy-hex-ae4957:#ae4957;
  --legacy-hex-55576f:#55576f;
  --legacy-hex-f8f7fc:#f8f7fc;
  --legacy-hex-eeedf8:#eeedf8;
  --legacy-hex-999ba9:#999ba9;
  --legacy-hex-f6f6fa:#f6f6fa;
  --legacy-hex-eeedf3:#eeedf3;
  --legacy-hex-84869a:#84869a;
  --legacy-hex-eae8f4:#eae8f4;
  --legacy-hex-999ba8:#999ba8;
  --legacy-hex-777b91:#777b91;
  --legacy-hex-eae9f3:#eae9f3;
  --legacy-hex-9495a5:#9495a5;
  --legacy-hex-7b7d8e:#7b7d8e;
  --legacy-hex-ebe7fc:#ebe7fc;
  --legacy-hex-585a73:#585a73;
  --legacy-hex-a7a8b5:#a7a8b5;
  --legacy-hex-fcfbff:#fcfbff;
  --legacy-hex-d0c8fb:#d0c8fb;
  --legacy-hex-7969d6:#7969d6;
  --legacy-hex-989ba8:#989ba8;
  --legacy-hex-f0f0f5:#f0f0f5;
  --legacy-hex-36334f:#36334f;
  --legacy-hex-9a9bad:#9a9bad;
  --legacy-hex-9698a6:#9698a6;
  --legacy-hex-e6e0ff:#e6e0ff;
  --legacy-hex-8f8baf:#8f8baf;
  --legacy-hex-14152e78:#14152e78;
  --legacy-hex-f7f6ff:#f7f6ff;
  --legacy-hex-9792b5:#9792b5;
  --legacy-hex-8684a4:#8684a4;
  --legacy-hex-a0a1ae:#a0a1ae;
  --legacy-hex-e7e6ee:#e7e6ee;
  --legacy-hex-7b7d90:#7b7d90;
  --legacy-hex-eeebff:#eeebff;
  --legacy-hex-6654d2:#6654d2;
  --legacy-hex-c8bfff:#c8bfff;
  --legacy-hex-75778b:#75778b;
  --legacy-hex-f7f5ff:#f7f5ff;
  --legacy-hex-faf9fe:#faf9fe;
  --legacy-hex-77788d:#77788d;
  --legacy-hex-2c2b42:#2c2b42;
  --legacy-hex-6d637f:#6d637f;
  --legacy-rgb-6:rgba(255,255,255,.97);
  --legacy-hex-9da0ad:#9da0ad;
  --legacy-hex-ffffff1c:#ffffff1c;
  --legacy-hex-ddd7ffb0:#ddd7ffb0;
  --legacy-hex-eef0f6:#eef0f6;
  --legacy-hex-80839a:#80839a;
  --legacy-hex-a7a9ba:#a7a9ba;
  --legacy-hex-b3b5c3:#b3b5c3;
  --legacy-hex-e3a2a8:#e3a2a8;
  --legacy-hex-a0a3b5:#a0a3b5;
  --legacy-hex-b0b2c0:#b0b2c0;
  --legacy-hex-a2454f:#a2454f;
  --legacy-hex-fff6f6:#fff6f6;
  --legacy-hex-efc9cc:#efc9cc;
  --legacy-hex-eef8f2:#eef8f2;
  --legacy-hex-f0edf8:#f0edf8;
  --legacy-hex-f5f5fa:#f5f5fa;
  --legacy-hex-a3a5b4:#a3a5b4;
  --legacy-hex-ece8ff:#ece8ff;
  --legacy-hex-d5d5e0:#d5d5e0;
  --legacy-hex-ffffff70:#ffffff70;
  --legacy-rgb-7:rgba(255,255,255,.5);
  --legacy-rgb-8:rgba(195,196,212,.55);
  --legacy-rgb-9:rgba(255,255,255,.65);
  --legacy-rgb-10:rgba(166,165,187,.7);
  --legacy-hex-f0ecff:#f0ecff;
  --legacy-hex-216540:#216540;
  --legacy-hex-ffffffed:#ffffffed;
  --palette-sub:#6b6b88;
  --palette-ink-strong:#14142b;
  --palette-ink:#3a3a57;
  --legacy-hex-d8dae5:#d8dae5;
  --palette-muted:#6b6b88;
  --legacy-hex-e8f6ef:#e8f6ef;
  --legacy-hex-145b37:#145b37;
  --legacy-hex-b5d8c4:#b5d8c4;
  --legacy-hex-fff0f0:#fff0f0;
  --legacy-hex-9a3038:#9a3038;
  --legacy-hex-ecc2c6:#ecc2c6;
  --legacy-hex-b3a6ee:#b3a6ee;
  --legacy-rgb-11:rgba(255,255,255,.16);
  --legacy-hex-ded8fa:#ded8fa;
  --palette-dark-paper:#14151f;
  --palette-dark-surface:#20222f;
  --palette-dark-line:#373a4d;
  --legacy-rgb-12:rgba(20,21,31,.95);
  --legacy-hex-f6f5fc:#f6f5fc;
  --palette-dark-muted:#b9bdce;
  --legacy-hex-2a293e:#2a293e;
  --legacy-hex-44405c:#44405c;
  --legacy-hex-393247:#393247;
  --legacy-hex-191b27:#191b27;
  --palette-dark-line-strong:#44485e;
  --legacy-hex-b0b4c6:#b0b4c6;
  --palette-dark-violet-soft:#302a4e;
  --legacy-hex-c9c0ff:#c9c0ff;
  --legacy-hex-363050:#363050;
  --legacy-hex-5141b8:#5141b8;
  --legacy-hex-f4f3fb:#f4f3fb;
  --legacy-hex-203c32:#203c32;
  --legacy-hex-a2ecc3:#a2ecc3;
  --legacy-hex-446d59:#446d59;
  --legacy-hex-442a33:#442a33;
  --legacy-hex-ffc0c7:#ffc0c7;
  --legacy-hex-795160:#795160;
  --legacy-hex-292c3b:#292c3b;
  --legacy-hex-ded9f1:#ded9f1;
  --legacy-hex-121326b3:#121326b3;
  --legacy-hex-d9d8e7:#d9d8e7;
  --legacy-hex-5542ca:#5542ca;
  --legacy-hex-c1b7ff:#c1b7ff;
  --palette-paper:#f4f4fa;
  --legacy-hex-27845b:#27845b;
  --legacy-hex-cb5760:#cb5760;
  --legacy-rgb-13:rgba(33,32,74,.045);
  --legacy-hex-1d4bb8:#1d4bb8;
  --palette-dark-violet:#bcb2ff;
  --legacy-hex-92deb3:#92deb3;
  --legacy-hex-ffabb3:#ffabb3;
  --legacy-hex-00000033:#00000033;
  --legacy-hex-303241:#303241;
  --legacy-rgb-14:rgba(0,0,0,0.15);
  --legacy-rgb-15:rgba(0,0,0,0.2);
  --legacy-rgb-16:rgba(0,0,0,0.1);
  --legacy-hex-1547b014:#1547b014;
  --legacy-hex-12307a40:#12307a40;
  --legacy-hex-12307a14:#12307a14;
  --legacy-hex-12307a26:#12307a26;
  --legacy-hex-0a1a4a40:#0a1a4a40;
  --legacy-hex-00000022:#00000022;
  --legacy-hex-12307a35:#12307a35;
  --legacy-hex-5746b91b:#5746b91b;
  --legacy-hex-29275105:#29275105;
  --legacy-hex-4935a10b:#4935a10b;
  --legacy-hex-39365504:#39365504;
  --legacy-hex-ebe8ff:#ebe8ff;
  --legacy-hex-44358e0b:#44358e0b;
  --legacy-hex-11132d38:#11132d38;
  --legacy-hex-15142630:#15142630;
  --legacy-hex-25253b14:#25253b14;
  --legacy-hex-6957e71f:#6957e71f;
  --legacy-hex-6957e733:#6957e733;
  --legacy-hex-25253b22:#25253b22;
  /* Theme roles and interaction states. */
  --accent:#5b4be8;
  --accent-ink:#5b4be8;
  --progress-track:#ecebf5;
  --progress-fill:#5b4be8;
  --accent-dark:#3b2fb0;
  --accent-light:#efedff;
  --ink:#3a3a57;
  --ink-strong:#14142b;
  --muted:#6b6b88;
  --sub:#6b6b88;
  --paper:#f4f4fa;
  --line:#e7e6f1;
  --line-dark:#d8d6e8;
  --surface:#ffffff;
  --green:#0e9f6e;
  --red:#e23d5c;
  --shadow:0 1px 2px rgba(20,20,43,.04), 0 14px 34px -18px rgba(20,20,43,.22);
  --shadow-home-cta:0 4px 0 var(--accent-dark);
  --shadow-home-cta-pressed:0 1px 0 var(--accent-dark);
  --navy:var(--palette-violet-deep);
  --blue:var(--accent);
  --ink-2:var(--legacy-hex-1d4bb8);
  --button-bg:#ffffff;
  --button-text:#292949;
  --button-border:#e2e0ef;
  --button-active-bg:#5b4be8;
  --button-active-text:#ffffff;
  --button-disabled-bg:#efeff6;
  --button-disabled-text:#656580;
  --focus-ring:#5b4be8;
  --mobile-backdrop:rgba(24,21,45,.45);
  --mobile-dark-line:rgba(255,255,255,.12);
  --mobile-dark-accent:#9d8fff;
  --mobile-review-ink:var(--legacy-hex-ac6c13);
  --radius-10px:10px;
  --radius-20px:20px;
  --radius-16px:16px;
  --radius-btn:12px;
  --radius-8px:8px;
  --radius-18px:18px;
  --radius-14px:14px;
  --radius-28px:28px;
  --radius-13px:13px;
  --radius-none:0;
  --radius-15px:15px;
  --radius-card:24px;
  --radius-pill:999px;
  --radius-2px:2px;
  --radius-6px:6px;
  --radius-5px:5px;
  --radius-4px:4px;
  --radius-dialog:22px;
  --radius-22px-22px-0-0:22px 22px 0 0;
  --radius-round:50%;
  --radius-100px:100px;
  --radius-11px:11px;
  --radius-17px:17px;
  --radius-19px:19px;
  --radius-5px-5px-0-0:5px 5px 0 0;
  /* Existing shadow recipes retain their original visual weight. */
  --shadow-style-1:0 6px 14px var(--legacy-rgb-14);
  --shadow-style-2:0 10px 18px var(--legacy-rgb-15);
  --shadow-style-3:0 4px 12px var(--legacy-rgb-16);
  --shadow-style-4:0 6px 24px var(--legacy-hex-1547b014);
  --shadow-style-5:inset 0 0 0 1px var(--legacy-hex-466fd1);
  --shadow-mobile-layout-6:0 20px 60px var(--legacy-hex-12307a40);
  --shadow-mobile-layout-7:0 0 0 2px var(--palette-white),0 0 0 4px var(--ink);
  --shadow-mobile-layout-8:0 -4px 18px var(--legacy-hex-12307a14);
  --shadow-mobile-layout-9:0 10px 28px var(--legacy-hex-12307a26);
  --shadow-mobile-layout-10:0 4px 14px var(--legacy-hex-12307a14);
  --shadow-mobile-layout-11:0 -6px 0 var(--ink),0 6px 0 var(--ink);
  --shadow-mobile-layout-12:8px 0 32px var(--legacy-hex-0a1a4a40);
  --shadow-mobile-layout-13:0 -6px 0 var(--palette-white),0 6px 0 var(--palette-white);
  --shadow-notebook-14:0 24px 80px var(--legacy-hex-00000033);
  --shadow-speech-15:0 4px 18px var(--legacy-hex-00000022);
  --shadow-lesson-chat-16:0 5px 20px var(--legacy-hex-12307a40);
  --shadow-lesson-chat-17:0 8px 35px var(--legacy-hex-12307a40);
  --shadow-lesson-chat-18:0 8px 28px var(--legacy-hex-12307a35);
  --shadow-studio-layout-19:0 15px 38px var(--legacy-hex-5746b91b);
  --shadow-studio-layout-20:0 4px 17px var(--legacy-hex-29275105);
  --shadow-studio-layout-21:0 12px 25px var(--legacy-hex-4935a10b);
  --shadow-studio-layout-22:0 5px 20px var(--legacy-hex-39365504);
  --shadow-studio-layout-23:0 0 0 3px var(--legacy-hex-ebe8ff);
  --shadow-studio-layout-24:0 16px 60px var(--legacy-hex-44358e0b);
  --shadow-studio-layout-25:inset 0 0 0 2px currentColor;
  --shadow-studio-layout-26:0 24px 80px var(--legacy-hex-11132d38);
  --shadow-studio-layout-27:0 14px 35px var(--legacy-hex-15142630);
  --shadow-studio-layout-28:0 2px 8px var(--legacy-hex-25253b14);
  --shadow-studio-layout-29:0 0 0 4px var(--legacy-hex-6957e71f);
  --shadow-studio-layout-30:0 10px 24px var(--legacy-hex-6957e733);
  --shadow-studio-layout-31:0 12px 40px var(--legacy-hex-25253b22);
  --rd-brand:#5b4be8;
  --rd-brand-2:#7c6bff;
  --rd-brand-deep:#3b2fb0;
  --rd-brand-soft:#efedff;
  --rd-brand-tint:#f6f5ff;
  --rd-amber:#e8890c;
  --rd-amber-soft:#fff4e2;
  --rd-jade:#0e9f6e;
  --rd-jade-soft:#e7f8f1;
  --rd-rose:#e23d5c;
  --rd-rose-soft:#fdedf0;
  --rd-sky:#0c8ce9;
  --rd-sky-soft:#e8f4fe;
  --rd-canvas:#f4f4fa;
  --rd-canvas-2:#fafafe;
  --rd-surface:#ffffff;
  --rd-surface-soft:#fbfbfe;
  --rd-ink:#14142b;
  --rd-ink-2:#3a3a57;
  --rd-muted:#6b6b88;
  --rd-faint:#707088;
  --rd-line:#e7e6f1;
  --rd-line-soft:#f0eff7;
  --rd-r-xs:10px;
  --rd-r-sm:12px;
  --rd-r-md:16px;
  --rd-r-lg:20px;
  --rd-r-xl:26px;
  --rd-shadow-xs:0 1px 2px rgba(20,20,43,.05);
  --rd-shadow-sm:0 1px 2px rgba(20,20,43,.04), 0 6px 16px -12px rgba(20,20,43,.20);
  --rd-shadow-md:0 1px 2px rgba(20,20,43,.04), 0 14px 34px -18px rgba(20,20,43,.22);
  --rd-shadow-lg:0 28px 64px -32px rgba(20,20,43,.35);
  --rd-ring:0 0 0 3px rgba(91,75,232,.16);
  --rd-ease:cubic-bezier(.32,.72,0,1);
  --rd-ease-out:cubic-bezier(.22,.61,.36,1);
  --rd-dur:.2s;
  --rd-static-color-001:#EDEAFF;
  --rd-static-color-002:rgba(237,234,255,0);
  --rd-static-color-003:#E8F4FF;
  --rd-static-color-004:rgba(232,244,255,0);
  --rd-static-color-005:#1B1735;
  --rd-static-color-006:rgba(27,23,53,0);
  --rd-static-color-007:#10202E;
  --rd-static-color-008:rgba(16,32,46,0);
  --rd-static-color-009:rgba(91,75,232,.18);
  --rd-static-color-010:transparent;
  --rd-static-color-011:rgba(255,255,255,.72);
  --rd-static-color-012:rgba(20,20,43,.06);
  --rd-static-color-013:rgba(255,255,255,.6);
  --shadow-rd-001:1px 0 0 var(--rd-static-color-013) inset;
  --rd-static-color-014:rgba(19,19,31,.78);
  --rd-static-color-015:rgba(255,255,255,.06);
  --radius-rd-001:13px;
  --rd-static-color-016:#6D5BF0;
  --rd-static-color-017:#4A38D6;
  --rd-static-color-018:#3B2FB0;
  --rd-static-color-019:rgba(75,58,214,.85);
  --rd-static-color-020:rgba(255,255,255,.28);
  --shadow-rd-002:0 8px 18px -8px var(--rd-static-color-019), inset 0 1px 0 var(--rd-static-color-020);
  --rd-static-color-021:#fff;
  --radius-rd-002:12px;
  --rd-static-color-022:rgba(91,75,232,.07);
  --rd-static-color-023:#6553F0;
  --rd-static-color-024:#4F3FDC;
  --rd-static-color-025:rgba(75,58,214,.9);
  --rd-static-color-026:rgba(255,255,255,.22);
  --shadow-rd-003:0 8px 18px -10px var(--rd-static-color-025), inset 0 1px 0 var(--rd-static-color-026);
  --radius-rd-003:10px;
  --rd-static-color-027:rgba(20,20,43,.045);
  --rd-static-color-028:rgba(250,250,254,.72);
  --rd-static-color-029:rgba(20,20,43,.055);
  --rd-static-color-030:rgba(15,15,24,.72);
  --radius-rd-004:11px;
  --rd-static-color-031:rgba(255,255,255,.9);
  --rd-static-color-032:rgba(91,75,232,.35);
  --rd-static-color-033:rgba(91,75,232,.16);
  --radius-rd-005:50%;
  --rd-static-color-034:#8E7BFF;
  --rd-static-color-035:#5B4BE8;
  --rd-static-color-036:rgba(91,75,232,.9);
  --shadow-rd-004:0 6px 14px -8px var(--rd-static-color-036);
  --rd-static-color-037:rgba(232,137,12,.22);
  --rd-static-color-038:#925700;
  --radius-rd-006:99px;
  --rd-static-color-039:#7C6BFF;
  --rd-static-color-040:#6755F2;
  --rd-static-color-041:#4E3DDB;
  --rd-static-color-042:rgba(59,47,176,.55);
  --rd-static-color-043:#7362FF;
  --rd-static-color-044:#5646E6;
  --rd-static-color-045:rgba(75,58,214,.95);
  --rd-static-color-046:rgba(255,255,255,.25);
  --shadow-rd-005:0 12px 24px -12px var(--rd-static-color-045), inset 0 1px 0 var(--rd-static-color-046);
  --rd-static-color-047:#EFEFF6;
  --rd-static-color-048:#A5A5C0;
  --rd-static-color-049:#E4E3EF;
  --rd-static-color-050:#22222F;
  --rd-static-color-051:#6E6E8A;
  --rd-static-color-052:#2E2E46;
  --rd-static-color-053:rgba(91,75,232,.4);
  --rd-static-color-054:#8E82F5;
  --radius-rd-007:5px;
  --rd-static-color-055:rgba(91,75,232,.055);
  --rd-static-color-056:rgba(255,255,255,.05);
  --rd-static-color-057:#FBFAFF;
  --rd-static-color-058:#F7F6FF;
  --rd-static-color-059:#E9E6FB;
  --rd-static-color-060:#191727;
  --rd-static-color-061:#161426;
  --rd-static-color-062:#2A2745;
  --rd-static-color-063:rgba(91,75,232,.28);
  --shadow-rd-006:0 8px 18px -10px var(--rd-static-color-025);
  --rd-static-color-064:rgba(255,255,255,0);
  --rd-static-color-065:#5F4DEE;
  --rd-static-color-066:#4A38D2;
  --rd-static-color-067:#33268F;
  --rd-static-color-068:rgba(63,48,180,.75);
  --rd-static-color-069:rgba(255,255,255,.18);
  --shadow-rd-007:0 28px 56px -30px var(--rd-static-color-068), inset 0 1px 0 var(--rd-static-color-069);
  --rd-static-color-070:rgba(255,255,255,.14);
  --rd-static-color-071:rgba(255,255,255,.09);
  --rd-static-color-072:rgba(0,0,0,.08);
  --rd-static-color-073:rgba(255,255,255,.82);
  --rd-static-color-074:#3F30C4;
  --rd-static-color-075:rgba(0,0,0,.6);
  --shadow-rd-008:0 12px 24px -14px var(--rd-static-color-075);
  --rd-static-color-076:rgba(0,0,0,.55);
  --shadow-rd-009:0 16px 28px -14px var(--rd-static-color-076);
  --radius-rd-008:28px;
  --rd-static-color-077:rgba(255,255,255,.19);
  --rd-static-color-078:rgba(255,255,255,.3);
  --shadow-rd-010:inset 0 1px 0 var(--rd-static-color-078), 0 20px 40px -22px var(--rd-static-color-076);
  --rd-static-color-079:rgba(0,0,0,.18);
  --rd-static-color-080:rgba(0,0,0,.9);
  --rd-static-color-081:rgba(255,255,255,.12);
  --shadow-rd-011:0 28px 56px -30px var(--rd-static-color-080), inset 0 1px 0 var(--rd-static-color-081);
  --rd-static-color-082:rgba(91,75,232,.32);
  --rd-static-color-083:#EDEBFF;
  --rd-static-color-084:#FFEFE4;
  --rd-static-color-085:#D97316;
  --rd-static-color-086:#E4F8F0;
  --rd-static-color-087:#0E9F6E;
  --rd-static-color-088:#E6F2FE;
  --rd-static-color-089:#0C8CE9;
  --rd-static-color-090:#241F45;
  --rd-static-color-091:#A79BFF;
  --rd-static-color-092:#3A2718;
  --rd-static-color-093:#FFB067;
  --rd-static-color-094:#122E26;
  --rd-static-color-095:#5BD3A5;
  --rd-static-color-096:#12283A;
  --rd-static-color-097:#6FC0FF;
  --radius-rd-009:7px;
  --rd-static-color-098:rgba(91,75,232,.3);
  --radius-rd-010:9px;
  --rd-static-color-099:rgba(91,75,232,.09);
  --rd-static-color-100:rgba(91,75,232,0);
  --rd-static-color-101:#F6F4FF;
  --rd-static-color-102:#EFECFF;
  --rd-static-color-103:rgba(75,58,214,.7);
  --shadow-rd-012:0 14px 26px -18px var(--rd-static-color-103);
  --rd-static-color-104:#2E2390;
  --rd-static-color-105:#6A5FC0;
  --rd-static-color-106:rgba(255,255,255,.75);
  --rd-static-color-107:#221E3D;
  --rd-static-color-108:#1B1832;
  --rd-static-color-109:#322C58;
  --rd-static-color-110:#C6BEFF;
  --rd-static-color-111:#DDD8FF;
  --rd-static-color-112:#9A90D8;
  --radius-rd-011:8px;
  --rd-static-color-113:#F7F5FF;
  --rd-static-color-114:#F2EFFF;
  --rd-static-color-115:rgba(91,75,232,.14);
  --rd-static-color-116:rgba(91,75,232,.2);
  --rd-static-color-117:#FFFFFF;
  --rd-static-color-118:#1E1C33;
  --rd-static-color-119:#181826;
  --rd-static-color-120:#E7F8F1;
  --rd-static-color-121:#0B7A55;
  --rd-static-color-122:#BEEBD9;
  --rd-static-color-123:#FDEDF0;
  --rd-static-color-124:#B32843;
  --rd-static-color-125:#F7CFD8;
  --rd-static-color-126:#D5F2E6;
  --rd-static-color-127:#FBE0E6;
  --rd-static-color-128:#12302A;
  --rd-static-color-129:#1E4A40;
  --rd-static-color-130:#331A22;
  --rd-static-color-131:#FF9BAB;
  --rd-static-color-132:#4E2630;
  --rd-static-color-133:rgba(91,75,232,.45);
  --rd-static-color-134:rgba(255,255,255,.7);
  --shadow-rd-013:0 6px 14px -8px var(--rd-static-color-025);
  --rd-static-color-135:rgba(14,159,110,.18);
  --rd-static-color-136:#925700;
  --rd-static-color-137:#F6DFC0;
  --rd-static-color-138:#FFF4E2;
  --rd-static-color-139:#4A3D9C;
  --rd-static-color-140:#CFD9F8;
  --rd-static-color-141:#EDF1FE;
  --rd-static-color-142:#E23D5C;
  --radius-rd-012:0;
  --rd-static-color-143:rgba(63,48,180,.85);
  --shadow-rd-014:0 22px 44px -26px var(--rd-static-color-143), inset 0 1px 0 var(--rd-static-color-069);
  --rd-static-color-144:rgba(255,255,255,.26);
  --rd-static-color-145:rgba(255,255,255,.8);
  --rd-static-color-146:rgba(255,255,255,.78);
  --rd-static-color-147:rgba(255,255,255,.24);
  --rd-static-color-148:rgba(0,0,0,.7);
  --shadow-rd-015:0 12px 24px -16px var(--rd-static-color-148);
  --rd-static-color-149:rgba(255,255,255,.16);
  --rd-static-color-150:rgba(255,255,255,.86);
  --rd-static-color-151:rgba(20,20,43,.07);
  --rd-static-color-152:rgba(20,20,43,.35);
  --shadow-rd-016:0 -10px 30px -18px var(--rd-static-color-152);
  --rd-static-color-153:rgba(17,17,27,.9);
  --rd-static-color-154:rgba(255,255,255,.07);
  --rd-static-color-155:rgba(255,255,255,.92);
  --rd-static-color-156:rgba(20,20,43,.4);
  --shadow-rd-017:0 -12px 30px -20px var(--rd-static-color-156);
  --rd-static-color-157:rgba(17,17,27,.92);
  --rd-static-color-158:rgba(250,250,254,.9);
  --rd-static-color-159:rgba(15,15,24,.9);
  --rd-static-color-160:#F1EEFF;
  --rd-static-color-161:rgba(91,75,232,.24);
  --rd-static-color-162:rgba(91,75,232,.06);
  --rd-static-color-163:rgba(91,75,232,.20);
  --rd-static-color-164:rgba(20,20,43,.18);
  --rd-static-color-165:rgba(20,20,43,.16);
  --rd-static-color-166:rgba(20,20,43,.14);
  --radius-rd-013:14px;
  --shadow-rd-018:0 12px 24px -12px var(--rd-static-color-045);
  --radius-rd-014:22px;
  --shadow-rd-019:0 1px 0 var(--rd-static-color-013) inset;
  --rd-static-color-167:rgba(16,16,26,.92);
  --radius-rd-015:16px;
  --rd-static-color-168:rgba(91,75,232,.38);
  --rd-static-color-169:rgba(75,58,214,.55);
  --shadow-rd-020:0 16px 32px -20px var(--rd-static-color-169);
  --radius-rd-016:0 0 14px 14px;
  --rd-static-color-170:rgba(63,48,180,.9);
  --shadow-rd-021:0 34px 70px -28px var(--rd-static-color-170),  inset 0 1px 0 var(--rd-static-color-144);
  --rd-static-color-171:#251B72;
  --mu-bg:#0c0a14;
  --mu-surface:#17141f;
  --mu-surface-2:#1e1a29;
  --mu-hover:#272232;
  --mu-line:rgba(255,255,255,.08);
  --mu-line-2:rgba(255,255,255,.05);
  --mu-text:#ffffff;
  --mu-text-2:#b6b0c6;
  --mu-text-3:#8a8499;
  --mu-accent:#6C5CE7;
  --mu-accent-2:#8B7BFF;
  --rd-music-color-001:#241a4d;
  --rd-music-color-002:rgba(36,26,77,0);
  --rd-music-color-003:#0e0b1a;
  --rd-music-color-004:#0b0912;
  --rd-music-color-005:#08070d;
  --rd-music-color-006:rgba(12,10,20,.86);
  --rd-music-color-007:rgba(12,10,20,0);
  --radius-rd-music-001:50%;
  --rd-music-color-008:rgba(255,255,255,.08);
  --rd-music-color-009:#fff;
  --rd-music-color-010:rgba(255,255,255,.16);
  --rd-music-color-011:transparent;
  --radius-rd-music-002:99px;
  --radius-rd-music-003:16px;
  --rd-music-color-012:rgba(0,0,0,.9);
  --rd-music-color-013:rgba(255,255,255,.06);
  --shadow-rd-music-001:0 24px 48px -20px var(--rd-music-color-012), 0 0 0 1px var(--rd-music-color-013);
  --rd-music-color-014:#2a2350;
  --rd-music-color-015:#1a1533;
  --radius-rd-music-004:999px;
  --rd-music-color-016:rgba(108,92,231,.9);
  --shadow-rd-music-002:0 12px 28px -14px var(--rd-music-color-016);
  --rd-music-color-017:rgba(108,92,231,1);
  --shadow-rd-music-003:0 16px 34px -14px var(--rd-music-color-017);
  --rd-music-color-018:#e9e6f5;
  --rd-music-color-019:rgba(255,255,255,.13);
  --rd-music-color-020:#111;
  --radius-rd-music-005:10px;
  --rd-music-color-021:rgba(255,255,255,.07);
  --radius-rd-music-006:7px;
  --rd-music-color-022:#221d33;
  --shadow-rd-music-004:0 6px 14px -8px var(--rd-music-color-012);
  --rd-music-color-023:rgba(255,255,255,.14);
  --rd-music-color-024:rgba(255,255,255,.12);
  --radius-rd-music-007:12px;
  --rd-music-color-025:rgba(255,255,255,.02);
  --rd-music-color-026:#1b1726;
  --rd-music-color-027:#131019;
  --rd-music-color-028:rgba(255,255,255,.09);
  --radius-rd-music-008:20px 20px 0 0;
  --rd-music-color-029:rgba(0,0,0,.7);
  --shadow-rd-music-005:0 -24px 60px var(--rd-music-color-029);
  --rd-music-color-030:rgba(27,23,38,0);
  --rd-music-color-031:rgba(255,255,255,.28);
  --rd-music-color-032:rgba(255,255,255,.45);
  --radius-rd-music-009:9px;
  --shadow-rd-music-006:0 8px 18px -10px var(--rd-music-color-012);
  --radius-rd-music-010:8px;
  --rd-music-color-033:#f2effa;
  --rd-music-color-034:rgba(255,255,255,.05);
  --radius-rd-music-011:11px;
  --rd-music-color-035:rgba(255,255,255,.22);
  --rd-music-color-036:rgba(255,255,255,.1);
  --rd-music-color-037:rgba(139,123,255,.22);
  --shadow-rd-music-007:0 0 0 3px var(--rd-music-color-037);
  --rd-music-color-038:rgba(255,255,255,.38);
  --rd-music-color-039:rgba(255,255,255,.04);
  --rd-music-color-040:#eee;
  --rd-music-color-041:rgba(12,10,20,.78);
  --rd-music-color-042:rgba(108,92,231,.95);
  --shadow-rd-music-008:0 12px 28px -14px var(--rd-music-color-042);
  --rd-music-color-043:#9C8DFF;
  --rd-music-color-044:#7566F0;
  --rd-music-color-045:rgba(255,255,255,.2);
  --rd-music-color-046:rgba(255,255,255,.18);

  /* Scoped AI-QA palette: only used in the AI Q&A route. */
  --qa-bg:var(--paper);--qa-surface:var(--surface);--qa-sidebar:var(--surface);
  --qa-line:var(--line);--qa-text:var(--ink);--qa-muted:var(--muted);
  --qa-sidebar-line:var(--line);--qa-hover:var(--accent-light);--qa-hover-soft:var(--paper);--qa-hover-strong:var(--line-dark);
  --qa-bright:var(--surface);--qa-subtle:var(--muted);--qa-muted-text:var(--sub);--qa-scroll:var(--line-dark);
  --qa-message-label:var(--sub);--qa-input-border:var(--line-dark);--qa-placeholder:var(--muted);--qa-send-ink:var(--surface);
  --qa-shadow-menu:var(--shadow);--qa-shadow-composer:var(--shadow);
  --qa-radius-compact:8px;--qa-radius-message:18px;--qa-radius-flat:0;
}
html[data-theme="dark"]{
  color-scheme:dark;
  --paper:#0f0f18;
  --surface:#181826;
  --ink:#c9c9de;
  --ink-strong:#ededf7;
  --sub:#9c9cb8;
  --muted:#9c9cb8;
  --line:#2a2a3f;
  --line-dark:#3a3a55;
  --accent-dark:var(--accent-ink);
  --accent-ink:#9e92ff;
  --progress-track:#2a2a3f;
  --progress-fill:#7c6bff;
  --accent-light:#241f45;
  --green:#5bd3a5;
  --red:#ff8a9b;
  --shadow:0 12px 40px var(--legacy-hex-00000033);
  --button-bg:#1d1d2e;
  --button-text:#c9c9de;
  --button-border:#2e2e46;
  --button-disabled-bg:#22222f;
  --button-disabled-text:#aaaac4;
  --rd-canvas:#0f0f18;
  --rd-canvas-2:#13131f;
  --rd-surface:#181826;
  --rd-surface-soft:#1d1d2e;
  --rd-ink:#ededf7;
  --rd-ink-2:#c9c9de;
  --rd-muted:#9c9cb8;
  --rd-faint:#7a7a96;
  --rd-line:#2a2a3f;
  --rd-line-soft:#232338;
  --rd-brand-soft:#241f45;
  --rd-brand-tint:#1c1930;
  --rd-shadow-xs:0 1px 2px rgba(0,0,0,.35);
  --rd-shadow-sm:0 1px 2px rgba(0,0,0,.3), 0 6px 16px -12px rgba(0,0,0,.6);
  --rd-shadow-md:0 1px 2px rgba(0,0,0,.3), 0 14px 34px -18px rgba(0,0,0,.7);
  --rd-shadow-lg:0 28px 64px -32px rgba(0,0,0,.8);
  --rd-ring:0 0 0 3px rgba(124,107,255,.25);
  --palette-violet:var(--press-active-bg);
  --palette-violet-deep:#5b4be8;
  --palette-violet-soft:#241f45;
  --palette-dark-paper:#0f0f18;
  --palette-dark-surface:#181826;
  --palette-dark-ink:#c9c9de;
  --palette-dark-muted:#9c9cb8;
  --palette-dark-line:#2a2a3f;
  --palette-dark-line-strong:#3a3a55;
  --palette-dark-violet:#9e92ff;
  --palette-dark-violet-soft:#241f45;
  --accent:#7c6bff;
  --button-active-bg:var(--press-active-bg);
  --button-active-text:var(--palette-white);

  /* AI Q&A dark mode: ChatGPT-inspired neutral shades, isolated from other routes. */
  --qa-bg:#212121;--qa-surface:#2f2f2f;--qa-sidebar:#171717;--qa-line:#3f3f3f;--qa-text:#ececec;--qa-muted:#a7a7a7;
  --qa-sidebar-line:#292929;--qa-hover:#2a2a2a;--qa-hover-soft:#242424;--qa-hover-strong:#444444;
  --qa-bright:#ffffff;--qa-subtle:#888888;--qa-muted-text:#aaaaaa;--qa-scroll:#555555;
  --qa-message-label:#b7b7b7;--qa-input-border:#4b4b4b;--qa-placeholder:#9b9b9b;--qa-send-ink:#222222;
  --qa-shadow-menu:0 8px 28px #0008;--qa-shadow-composer:0 3px 16px #0006;
}


    * {
      box-sizing: border-box;
    }
    body {
      font-family: "Poppins", "Segoe UI", sans-serif;
      background: linear-gradient(160deg, var(--legacy-hex-dae3ff) 0%, var(--legacy-hex-f7f9ff) 100%);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding-top: 40px;
      min-height: 100vh;
      margin: 0;
    }

    h1 {
      color: var(--legacy-hex-1547b0);
      font-weight: 600;
      margin-bottom: 20px;
      letter-spacing: 0.5px;
      text-align: center;
    }

    /* Filter Buttons */
    .filter-buttons {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 10px;
      margin-bottom: 20px;
      padding: 10px;
      background: var(--legacy-rgb-1);
      border-radius:var(--radius-10px);
      max-width: 90%;
    }
    .filter-btn {
      padding: 8px 16px;
      border: none;
      border-radius:var(--radius-20px);
      background: var(--legacy-hex-3498db);
      color: var(--palette-white);
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s;
      font-weight: 500;
    }
    .filter-btn:hover { background: var(--legacy-hex-2980b9); transform: scale(1.05); }
    .filter-btn.active { background: var(--legacy-hex-16a085); }
    /* Màu riêng cho từng HSK */
    .filter-btn.hsk1 { background: var(--legacy-hex-27ae60); }
    .filter-btn.hsk1.active { background: var(--legacy-hex-229954); }
    .filter-btn.hsk2 { background: var(--legacy-hex-f39c12); }
    .filter-btn.hsk2.active { background: var(--legacy-hex-e67e22); }
    .filter-btn.hsk3 { background: var(--legacy-hex-e74c3c); }
    .filter-btn.hsk3.active { background: var(--legacy-hex-c0392b); }
    .filter-btn.hsk4 { background: var(--legacy-hex-8e44ad); }
    .filter-btn.hsk4.active { background: var(--legacy-hex-732d91); }
    .filter-btn.hsk5 { background: var(--legacy-hex-34495e); }
    .filter-btn.hsk5.active { background: var(--legacy-hex-2c3e50); }
    .filter-btn.hsk6 { background: var(--legacy-hex-7f8c8d); }
    .filter-btn.hsk6.active { background: var(--legacy-hex-606d6e); }


    /* Flashcard */
    .card {
      width: 320px;
      height: 240px;
      perspective: 1000px;
      cursor: pointer;
      margin-bottom: 25px;
    }

    .inner {
      position: relative;
      width: 100%;
      height: 100%;
      text-align: center;
      transform-style: preserve-3d;
      transition: transform 0.6s ease-in-out;
    }
    .flipped .inner {
      transform: rotateY(180deg);
    }

    .front,
    .back {
      position: absolute;
      width: 100%;
      height: 100%;
      border-radius:var(--radius-16px);
      backface-visibility: hidden;
      -webkit-backface-visibility: hidden;
      box-shadow:var(--shadow-style-1);
      background: var(--palette-white);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: box-shadow 0.3s;
      padding: 10px;
    }

    .front:hover,
    .back:hover {
      box-shadow:var(--shadow-style-2);
    }

    .back {
      background: var(--legacy-hex-1e4edb);
      color: var(--palette-white);
      transform: rotateY(180deg);
    }

    .han {
      font-size: 56px;
      color: var(--legacy-hex-111111);
      user-select: none;
      margin-bottom: 5px;
    }

    .pin {
      font-size: 22px;
      margin-top: 8px;
    }
    .mean {
      font-size: 18px;
      margin-top: 8px;
    }
    .hv {
      font-size: 15px;
      margin-top: 5px;
      opacity: 0.9;
    }

    /* HSK Tag */
    .hsk-tag {
      position: absolute;
      top: 10px;
      right: 10px;
      padding: 4px 8px;
      border-radius:var(--radius-btn);
      font-size: 12px;
      font-weight: bold;
      color: var(--palette-white);
    }
    .hsk1-tag { background: var(--legacy-hex-27ae60); }
    .hsk2-tag { background: var(--legacy-hex-f39c12); }
    .hsk3-tag { background: var(--legacy-hex-e74c3c); }
    .hsk4-tag { background: var(--legacy-hex-8e44ad); }
    .hsk5-tag { background: var(--legacy-hex-34495e); }
    .hsk6-tag { background: var(--legacy-hex-7f8c8d); }

    /* Buttons */
    .buttons {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-bottom: 12px;
    }
    button:where(:not([data-ui-owned]):not(.ui-btn)) {
      padding: 8px 14px;
      border: none;
      border-radius:var(--radius-8px);
      background: var(--button-bg, var(--palette-white));
      color: var(--palette-white);
      font-size: 15px;
      cursor: pointer;
      transition: all 0.25s;
    }
    button:where(:not([data-ui-owned]):not(.ui-btn)):hover {
      background: var(--button-active-bg, var(--palette-violet));
      transform: translateY(-1px);
    }
    button:where(:not([data-ui-owned]):not(.ui-btn)):disabled {
        background-color: var(--legacy-hex-bdc3c7);
        cursor: not-allowed;
    }

    #progress {
      margin-top: 8px;
      color: var(--legacy-hex-333333);
      font-weight: 500;
    }

    /* Example box */
    .example {
      width: 320px;
      background: var(--palette-white);
      border: 1px solid var(--legacy-hex-cad6ef);
      border-radius:var(--radius-10px);
      box-shadow:var(--shadow-style-3);
      padding: 12px 16px;
      color: var(--legacy-hex-333333);
      font-size: 15px;
      line-height: 1.5em;
      display: none;
      transition: opacity 0.3s ease;
      margin-top: 10px;
    }
    .example.show {
      display: block;
      opacity: 1;
    }
    .cn {
      color: var(--legacy-hex-222222);
      font-weight: 500;
    }
    .vi {
      color: var(--legacy-hex-555555);
      margin-top: 4px;
    }

    body { padding: 24px 12px 36px; }
    h1 { font-size: clamp(22px,4vw,30px); }
    [hidden] { display: none !important; }
    .app-tabs { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:0 0 18px; }
    .app-tabs button { background:var(--palette-white); color:var(--legacy-hex-1547b0); border:1px solid var(--legacy-hex-cad6ef); }
    .app-tabs button.active { background:var(--legacy-hex-1547b0); color:var(--palette-white); }
    .workspace { width:min(760px,100%); }
    #learnPanel { display:flex; align-items:center; flex-direction:column; }
    .panel-box { background:var(--legacy-rgb-2); padding:22px; border-radius:var(--radius-18px); box-shadow:var(--shadow-style-4); }
    .panel-box h2 { margin:0 0 12px; color:var(--legacy-hex-1547b0); font-size:22px; }
    .hint { font-size:14px; color:var(--legacy-hex-52627b); line-height:1.6; }
    .field-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:12px 0; max-width:100%; }
    input, select { padding:10px 12px; border:1px solid var(--legacy-hex-bac8df); border-radius:var(--radius-8px); font:inherit; max-width:100%; background:var(--palette-white); color:var(--legacy-hex-213250); }
    #searchInput { flex:1; min-width:180px; }
    button:focus-visible,input:focus-visible,select:focus-visible,.card:focus-visible { outline:3px solid var(--legacy-hex-f5b942); outline-offset:3px; }
    .jump-control { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
    #jumpInput { width:200px; }
    #jumpStatus, #learningStats { margin:8px 0; font-size:14px; color:var(--legacy-hex-52627b); text-align:center; }
    .card { position:relative; width:min(340px,100%); height:280px; -webkit-tap-highlight-color:var(--palette-clear); }
    .front,.back { padding:42px 18px 78px; }
    .han,.result-open { font-family:'Microsoft YaHei','PingFang SC','Noto Sans CJK SC',sans-serif; }
    .han { font-size:clamp(28px,8vw,52px); overflow-wrap:anywhere; }
    .mean { max-height:80px; overflow:auto; }
    .mastery-tools { position:absolute; bottom:14px; left:14px; right:14px; display:flex; gap:10px; z-index:2; }
    .mastery-btn { flex:1; min-width:0; min-height:48px; padding:10px 6px; border:2px solid var(--palette-clear); border-radius:var(--radius-10px); font-size:14px; font-weight:600; line-height:1.25; touch-action:manipulation; }
    .mastery-btn.known { background:var(--legacy-hex-e6f5ed); color:var(--legacy-hex-146637); border-color:var(--legacy-hex-b9dfcb); }
    .mastery-btn.unknown { background:var(--legacy-hex-fdecec); color:var(--legacy-hex-a72b30); border-color:var(--legacy-hex-f0babc); }
    .mastery-btn.known[aria-pressed="true"] { background:var(--legacy-hex-14864a); color:var(--palette-white); border-color:var(--legacy-hex-0c5a30); }
    .mastery-btn.unknown[aria-pressed="true"] { background:var(--legacy-hex-c9343b); color:var(--palette-white); border-color:var(--legacy-hex-8c2026); }
    .mastery-btn:hover { filter:brightness(.97); }
    .mastery-btn:active { transform:scale(.98); }
    .status-label { position:absolute; top:16px; left:14px; font-size:12px; }
    .result-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
    .result-card { position:relative; padding:40px 16px 82px; border:1px solid var(--legacy-hex-d8e1f0); border-radius:var(--radius-14px); background:var(--legacy-hex-f8faff); }
    .result-open { background:none; color:var(--legacy-hex-111111); font-size:30px; padding:0; text-align:left; overflow-wrap:anywhere; }
    .result-open:hover { background:none; color:var(--legacy-hex-1547b0); }
    .result-card p { margin:7px 0; line-height:1.5; }
    .result-card small { color:var(--legacy-hex-5a6b86); }
    #searchMore { margin-top:16px; }
    .quiz-prompt { font-size:30px; font-weight:600; color:var(--legacy-hex-143d91); margin:22px 0; line-height:1.4; overflow-wrap:anywhere; }
    .answers { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .answers button { text-align:left; min-height:64px; background:var(--legacy-hex-eef3fc); color:var(--legacy-hex-243858); border:2px solid var(--legacy-hex-dce5f5); }
    .answers button.correct { background:var(--legacy-hex-e2f6e8); border-color:var(--legacy-hex-14864a); color:var(--legacy-hex-146637); }
    .answers button.wrong { background:var(--legacy-hex-fde8e8); border-color:var(--legacy-hex-d83b40); color:var(--legacy-hex-a72b30); }
    .answers button:disabled { opacity:1; cursor:default; }
    .quiz-level-picker { padding:14px; background:var(--legacy-hex-f1f5fd); border:1px solid var(--legacy-hex-d8e3f5); border-radius:var(--radius-btn); margin:16px 0; }
    .quiz-level-picker .field-row { margin:0 0 10px; }
    .quiz-level-picker .field-row:last-of-type { margin-bottom:8px; }
    .quiz-level-picker select { min-height:44px; }
    .quiz-type-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:8px; }
    .quiz-type-grid label { display:flex;align-items:center;gap:10px;min-height:48px;padding:8px;border-radius:var(--radius-8px);background:var(--legacy-hex-eef3fc);cursor:pointer;box-sizing:border-box; }
    .quiz-type-grid input { width:20px;height:20px;flex-shrink:0; }
    .mistake-entry,.compare-lesson { border:1px solid var(--legacy-hex-cad6ef);border-radius:var(--radius-btn);margin:12px 0;padding:14px;overflow-wrap:anywhere; }
    .compare-lesson summary { cursor:pointer;min-height:48px;display:flex;align-items:center;font-weight:600; }
    .compare-member { padding:12px;background:var(--legacy-hex-eef3fc);border-radius:var(--radius-8px);margin:10px 0; }
    .compare-example { border:1px solid var(--legacy-hex-cad6ef);border-radius:var(--radius-8px);background:var(--legacy-hex-f8faff);padding:10px 12px;margin:12px 0; }
    .source-links { display:flex;flex-wrap:wrap;gap:12px;margin-top:12px; }
    .source-links a { padding:6px 0; }
    #quizPoolPreview { margin:6px 0 0; }
    #quizFeedback,#srsMessage { margin:16px 0; line-height:1.6; white-space:pre-line; }
    .review-card { position:relative; text-align:center; padding:24px 18px; border:1px solid var(--legacy-hex-d7e3f7); background:var(--legacy-hex-f5f8ff); border-radius:var(--radius-16px); margin:16px 0; }
    .review-card .han { margin:16px 0; }
    #srsAnswer p { margin:8px 0; line-height:1.5; }
    .ratings { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
    .ratings button { padding:12px 4px; font-size:14px; }
    .ratings small { display:block; margin-top:5px; opacity:.9; }
    .ratings [data-rating="again"] { background:var(--legacy-hex-d83b40); }
    .ratings [data-rating="hard"] { background:var(--legacy-hex-ac6c13); }
    .ratings [data-rating="easy"] { background:var(--legacy-hex-14864a); }
    #storageNotice { color:var(--legacy-hex-a72b30); text-align:center; font-size:14px; max-width:740px; }
    .dictionary-summary { width:min(760px,100%); margin:0 auto 16px; font-size:13px; color:var(--legacy-hex-52627b); line-height:1.6; }
    .dictionary-summary summary { cursor:pointer; min-height:44px; display:flex; align-items:center; justify-content:center; text-align:center; }
    .dictionary-summary p { margin:4px 0; }
    .dictionary-extra { border-top:1px solid var(--legacy-hex-d8e1f0); padding-top:16px; margin-top:16px; text-align:left; }
    .dictionary-extra h3 { font-size:16px; margin:0 0 10px; color:var(--legacy-hex-1547b0); }
    .dictionary-extra p { line-height:1.6; margin:8px 0; overflow-wrap:anywhere; }
    .dictionary-source { display:inline-flex; align-items:center; min-height:44px; color:var(--legacy-hex-1547b0); font-size:14px; }
    .dictionary-cn { font-family:'Microsoft YaHei','PingFang SC','Noto Sans CJK SC',sans-serif; font-size:22px; }
    .example-pinyin { font-size:15px; color:var(--legacy-hex-475569); line-height:1.6; overflow-wrap:anywhere; margin:5px 0 8px; }
    .practice-example { padding:12px 0; border-bottom:1px solid var(--legacy-hex-e2e8f0); }
    .card-relations { width:min(680px,100%); margin:16px auto; }
    .word-relations { border:1px solid var(--legacy-hex-c7d7f5); border-radius:var(--radius-btn); padding:12px; background:var(--palette-white); margin-top:12px; overflow-wrap:anywhere; }
    .word-relations summary { min-height:48px; cursor:pointer; font-weight:600; display:flex; align-items:center; gap:8px; }
    .word-relations h4 { margin:16px 0 8px; }
    .relation-list { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(210px,100%),1fr));gap:8px; }
    .relation-word { display:flex; flex-direction:column; align-items:flex-start; text-align:left; gap:4px; padding:12px; min-height:48px; background:var(--legacy-hex-eff4ff); color:var(--legacy-hex-18345d); border:1px solid var(--legacy-hex-cad8f1); border-radius:var(--radius-8px); white-space:normal; overflow-wrap:anywhere; }
    .relation-word strong { font-size:20px; }.relation-word small,.relation-pin {color:var(--legacy-hex-526785);}
    .relation-meaning {line-height:1.5;}
    .practice-example:last-of-type { border-bottom:0; }
    .example-sense { font-weight:600; color:var(--legacy-hex-1547b0); }
    .example-origin { display:block; color:var(--legacy-hex-64748b); line-height:1.5; }
    .example { width:min(340px,100%); box-sizing:border-box; overflow-wrap:anywhere; }
    @media(max-width:500px) { .panel-box { padding:16px; } .result-grid,.answers { grid-template-columns:1fr; } .ratings { grid-template-columns:repeat(2,1fr); } .filter-buttons { max-width:100%; } }


.relation-pair-guides{display:grid;gap:10px;margin-top:12px}.relation-pair{border:1px solid var(--legacy-hex-d7e3ee);border-radius:var(--radius-btn);padding:12px;background:var(--legacy-hex-f8fafc);color:var(--legacy-hex-162b42)}.relation-pair h5{font-size:16px;margin:0 0 6px}.relation-pair-guide>h6{margin:8px 0;font-size:14px;font-weight:600;color:var(--legacy-hex-285b91);line-height:1.5}.relation-pair-guide p{line-height:1.65;overflow-wrap:anywhere}.relation-pair-example{padding:10px;margin:8px 0;background:var(--palette-white);border-radius:var(--radius-8px)}.relation-pair-example>span,.relation-pair-example>strong{display:block;margin:5px 0}.relation-pair-guide small{display:block;line-height:1.6}

.memory-reminder{margin:12px auto;padding:14px;border:1px solid var(--legacy-hex-b6d4ef);border-radius:var(--radius-btn);background:var(--legacy-hex-eff6ff);color:var(--legacy-hex-173b60);max-width:1100px;line-height:1.6}.memory-options{display:grid;gap:10px;margin:12px 0}.memory-options label{display:flex;align-items:center;gap:10px;min-height:44px}.memory-options input{width:22px;height:22px;flex-shrink:0}.memory-schedule{margin:12px 0;padding:12px;border:1px solid var(--legacy-hex-d7e3ee);border-radius:var(--radius-10px)}.memory-schedule summary{min-height:44px;cursor:pointer}.memory-sentence{font-size:24px;line-height:1.8;overflow-wrap:anywhere}#memoryRecall{box-sizing:border-box;max-width:100%;width:100%;min-height:48px;padding:10px;font-size:18px}.memory-context-answer{padding:12px;margin-top:12px;background:var(--legacy-hex-eff6ff);color:var(--legacy-hex-173b60);border-radius:var(--radius-10px)}#memoryUpcoming p{overflow-wrap:anywhere}#memoryLearnCurrent{min-height:48px;margin:12px 0}

#appLoadStatus{padding:16px;margin:12px;background:var(--legacy-hex-eff6ff);color:var(--legacy-hex-173b60);border-radius:var(--radius-btn)}
/* Compact phone layout: the card and its primary actions stay above supporting content. */
.mobile-controls{display:none}
@media(max-width:600px){
 body{padding:10px 12px 24px;gap:0}
 body>h1{font-size:19px;line-height:1.35;margin:2px 0 10px;letter-spacing:0;order:0}
 .mobile-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;max-width:440px;order:1;margin-bottom:8px}
 .mobile-controls label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--legacy-hex-52627b)}
 .mobile-controls select{width:100%;height:44px;min-width:0;font-size:14px;padding:8px}
 body>.filter-buttons,body>.app-tabs{display:none}
 #appLoadStatus{order:2;width:100%;margin:4px 0}
 .memory-reminder{order:3;width:100%;padding:8px 10px;margin:0 0 8px;font-size:12px;line-height:1.4}
 .memory-reminder.no-due{order:7;margin-top:12px}
 #memoryDueStart{min-height:44px;margin-top:4px;font-size:13px}
 .workspace{order:4;width:100%;min-width:0}
 .dictionary-summary{order:6;margin:12px 0 0;font-size:12px}
 #storageNotice{order:2}
 #learnPanel>.field-row{order:0;width:100%;margin:0 0 8px;gap:8px;justify-content:center;font-size:13px}
 #masteryFilter{height:44px;padding:8px;font-size:13px}
 #learnPanel>#flashcard{order:1;width:min(360px,100%);height:clamp(220px,34svh,270px);margin:0 0 10px}
 .front,.back{padding:38px 14px 76px}
 #flashcard .han{font-size:clamp(36px,12vw,52px)}
 #flashcard .mean{font-size:16px;max-height:72px;line-height:1.4}
 #flashcard .pin{font-size:20px;margin-top:4px}
 #flashcard .hv{font-size:13px;margin-top:4px}
 #learnPanel>.buttons{order:2;width:100%;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;margin:0}
 #learnPanel>.buttons button{min-height:44px;padding:8px 4px;font-size:13px;grid-column:span 2}
 #learnPanel>.buttons #prev,#learnPanel>.buttons #next{grid-column:span 3;font-size:15px}
 #learnPanel>#progress{order:3;font-size:13px;margin:8px 0 0}
 #learnPanel>.hint{order:4;font-size:12px;margin:6px 0;line-height:1.4;text-align:center}
 #learnPanel>#memoryLearnCurrent{order:5;margin:6px 0;width:100%;max-width:360px}
 #learnPanel>#learningStats{order:6;margin:4px 0;font-size:12px}
 #learnPanel>.jump-control{order:7;width:100%;display:grid;grid-template-columns:1fr auto;gap:6px;margin-top:8px}
 #jumpInput{width:100%;min-width:0;font-size:13px}#jumpBtn{min-height:44px;font-size:13px}
 #learnPanel>#jumpStatus{order:8;margin:0}
 #learnPanel>#example{order:9;width:100%}
 #learnPanel>#wordRelations{order:10;margin-top:8px}
 .word-relations{padding:10px}.relation-pair{padding:10px}.relation-pair-guides{gap:8px}
 .panel-box{padding:14px}.panel-box h2{font-size:20px}
 .mastery-tools{bottom:12px;left:12px;right:12px;gap:8px}
 .mastery-btn{min-height:48px}
}

.phone-title{display:none}@media(max-width:600px){.full-title{display:none}.phone-title{display:inline}}

.relation-tabs{display:flex;gap:8px;margin:12px 0}.relation-toggle{flex:1;min-height:48px}.relation-toggle[aria-expanded="true"],.relation-word[aria-expanded="true"]{background:var(--legacy-hex-dce8ff);color:var(--legacy-hex-173b75);border-color:var(--legacy-hex-466fd1);box-shadow:var(--shadow-style-5)}.relation-panel[hidden],.relation-pair[hidden]{display:none}.relation-panel .relation-list{grid-template-columns:repeat(auto-fit,minmax(95px,1fr))}.relation-panel .relation-word{min-height:56px;text-align:center;cursor:pointer}.relation-panel .relation-pin{display:block}

.offline-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0;color:var(--legacy-hex-475569);font-size:13px}.offline-bar button{min-height:44px;padding:8px 12px}.offline-bar [hidden]{display:none}
.admin-resource-box[hidden],.admin-resource-notice[hidden]{display:none}
.admin-resource-box{margin:12px 0;padding:12px 14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-14px)}
.admin-resource-heading{margin:0 0 10px;font-size:14px;font-weight:700;color:var(--ink)}
.admin-resource-list{display:flex;flex-direction:column;gap:8px}
.admin-resource-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;box-sizing:border-box;padding:10px 12px;text-align:left;text-decoration:none;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-10px);cursor:pointer;font:inherit}
.admin-resource-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.admin-resource-copy strong{font-size:13.5px;color:var(--ink)}
.admin-resource-copy small{font-size:12px;color:var(--sub)}
.admin-resource-badge{flex-shrink:0;padding:4px 9px;border-radius:var(--radius-pill);font-size:12px;font-weight:600;background:var(--accent-light);color:var(--accent-dark)}
.admin-resource-badge.is-vip{background:color-mix(in srgb,var(--rd-amber) 14%,var(--surface));color:var(--rd-amber)}
.admin-resource-notice{position:fixed;bottom:78px;left:50%;transform:translateX(-50%);z-index:1200;max-width:min(92vw,420px);padding:10px 16px;border-radius:var(--radius-pill);background:var(--surface);color:var(--ink);border:1px solid var(--line-dark);box-shadow:var(--shadow);font-size:13.5px;font-weight:600;text-align:center}
