/* Extracted from approved revision 3; SHA256 fa6f68e523bbec87ccd1811e66a76aed1cfa7c302c15c4f94319f4ad754e7a74. Home-only namespace. */

.yingdu-home-dashboard{color-scheme:light;--ink:#173a2e;--body:#28483a;--muted:#64766b;--green:#236347;--deep:#142c24;--line:#dce5d8;--bg:#f4f7f0;--paper:#fffefb;--soft:#eaf2e6;--gold:#e7d392;--radius:18px;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg)}
.yingdu-home-dashboard,.yingdu-home-dashboard *{box-sizing:border-box}
.yingdu-home-dashboard{margin:0}
.yingdu-home-dashboard button,.yingdu-home-dashboard input,.yingdu-home-dashboard select{font:inherit}
.yingdu-home-dashboard button,.yingdu-home-dashboard a{touch-action:manipulation;-webkit-tap-highlight-color:#23634722}
.yingdu-home-dashboard button{cursor:pointer}
.yingdu-home-dashboard button{color:inherit}
.yingdu-home-dashboard a{color:inherit;text-decoration:none}
.yingdu-home-dashboard button:focus-visible,.yingdu-home-dashboard a:focus-visible,.yingdu-home-dashboard input:focus-visible,.yingdu-home-dashboard select:focus-visible,.yingdu-home-dashboard summary:focus-visible{outline:3px solid #b18b31;outline-offset:3px}
.yingdu-home-dashboard button:hover,.yingdu-home-dashboard a.ydh-action:hover{filter:brightness(.95)}
.yingdu-home-dashboard button:disabled{opacity:.45;cursor:default}
.yingdu-home-dashboard svg{width:19px;height:19px;vertical-align:middle;flex-shrink:0}
.yingdu-home-dashboard h1,.yingdu-home-dashboard h2,.yingdu-home-dashboard h3,.yingdu-home-dashboard p{margin:0}
.yingdu-home-dashboard h1,.yingdu-home-dashboard h2,.yingdu-home-dashboard h3{text-wrap:balance}
.yingdu-home-dashboard h2{font-size:16px;font-weight:700}
.yingdu-home-dashboard h3{font-size:16px}
.yingdu-home-dashboard button{border:0;background:none}
.yingdu-home-dashboard small,.yingdu-home-dashboard .ydh-muted{color:var(--muted)}
.yingdu-home-dashboard .ydh-num{font-variant-numeric:tabular-nums}
.yingdu-home-dashboard .ydh-skip{position:absolute;top:-60px;left:180px;z-index:20;background:var(--paper);padding:10px}
.yingdu-home-dashboard .ydh-skip:focus{top:8px}
.yingdu-home-dashboard .ydh-shell{display:grid;grid-template-columns:164px minmax(0,1fr);min-height:100svh}
.yingdu-home-dashboard .ydh-sidebar{border-right:1px solid var(--line);background:var(--paper);display:flex;flex-direction:column;padding:28px 12px 20px;gap:32px}
.yingdu-home-dashboard .ydh-brand{display:flex;align-items:center;gap:10px;font-weight:750;font-size:16px;white-space:nowrap}
.yingdu-home-dashboard .ydh-brand-mark{display:grid;place-items:center;background:var(--green);color:#fffdf6;width:29px;height:29px;border-radius:8px}
.yingdu-home-dashboard .ydh-nav{display:grid;gap:10px}
.yingdu-home-dashboard .ydh-nav a{display:flex;align-items:center;gap:12px;padding:14px 12px;border-radius:10px;font-size:14px;font-weight:600}
.yingdu-home-dashboard .ydh-nav a[aria-current=page]{background:var(--soft);color:var(--green)}
.yingdu-home-dashboard .ydh-nav a:hover{background:#f0f4ec}
.yingdu-home-dashboard .ydh-side-note{margin-top:auto;display:flex;align-items:center;gap:9px;font-size:13px;color:var(--muted)}
.yingdu-home-dashboard .ydh-avatar{width:31px;height:31px;display:grid;place-items:center;border-radius:50%;background:#e6eddb;color:var(--green);font-weight:700}
.yingdu-home-dashboard .ydh-page{min-width:0;height:100svh;padding:16px 22px;display:grid;grid-template-rows:30px minmax(155px,1.05fr) minmax(136px,.8fr) 84px minmax(194px,1fr);gap:12px}
.yingdu-home-dashboard .ydh-topbar{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px}
.yingdu-home-dashboard .ydh-topbar .ydh-brand{display:none}
.yingdu-home-dashboard .ydh-preview-label{font-size:12px;color:#5e664d;display:flex;align-items:center;gap:6px}
.yingdu-home-dashboard .ydh-preview-label:before{content:"";width:6px;height:6px;border-radius:50%;background:#b29545}
.yingdu-home-dashboard .ydh-top-right{display:flex;gap:12px;align-items:center}
.yingdu-home-dashboard .ydh-top-right a{font-weight:600}
.yingdu-home-dashboard .ydh-card{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);min-width:0}
.yingdu-home-dashboard .ydh-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.yingdu-home-dashboard .ydh-card-head h2{display:flex;align-items:center;gap:8px}
.yingdu-home-dashboard .ydh-card-head h2 svg{color:var(--green);width:17px;height:17px}
.yingdu-home-dashboard .ydh-text-button{font-size:12px;font-weight:650;padding:7px 5px;white-space:nowrap}
.yingdu-home-dashboard .ydh-text-button:hover{text-decoration:underline}
.yingdu-home-dashboard .ydh-action{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:9px 15px;border-radius:9px;background:var(--green);color:#fff;font-size:13px;font-weight:700;border:1px solid var(--green)}
.yingdu-home-dashboard .ydh-action.ydh-secondary{color:var(--green);background:var(--paper);border-color:#cbdac9}
.yingdu-home-dashboard .ydh-action.ydh-soft{color:var(--green);background:var(--soft);border-color:transparent}
.yingdu-home-dashboard .ydh-hero{display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:22px 28px;align-items:center;background:linear-gradient(110deg,#fffefb 32%,#eaf2e5 100%);border-color:#cddfc9}
.yingdu-home-dashboard .ydh-hero-copy{display:grid;gap:12px;justify-items:start;min-width:0}
.yingdu-home-dashboard .ydh-eyebrow{font-size:13px;color:var(--green);font-weight:650}
.yingdu-home-dashboard .ydh-hero h1{font-size:clamp(28px,3.2vw,52px);line-height:1.12;letter-spacing:-1px}
.yingdu-home-dashboard .ydh-hero-desc{font-size:14px;color:#4a6656;line-height:1.65;max-width:38em}
.yingdu-home-dashboard .ydh-chips{display:flex;gap:6px;flex-wrap:wrap}
.yingdu-home-dashboard .ydh-chips span{font-size:11px;line-height:1.4;padding:3px 8px;border-radius:20px;background:#fffdf8;border:1px solid #d1decd;color:#496249}
.yingdu-home-dashboard .ydh-landing-study-panel{align-self:stretch;position:relative;display:grid;align-content:center;gap:12px;border-radius:20px;background:radial-gradient(circle at 16% 16%,rgba(248,222,151,.22),transparent 32%),linear-gradient(145deg,#221d16 0%,#0f201f 45%,#162b25 100%);padding:16px 20px;color:#fff;box-shadow:0 12px 24px #173a2e13;min-width:0}
.yingdu-home-dashboard .ydh-study-panel-badge{display:flex;align-items:center;gap:8px;width:max-content;background:#ffffff14;border:1px solid #ffffff26;color:#f0eedd;font-size:10px;font-weight:750;letter-spacing:.06em;padding:6px 10px;border-radius:20px}
.yingdu-home-dashboard .ydh-study-panel-badge span{width:7px;height:7px;border-radius:50%;background:#e6c567;box-shadow:0 0 0 3px #e6c56720}
.yingdu-home-dashboard .ydh-study-video-card{display:grid;gap:8px;background:#0b1c1ac4;border:1px solid #ffffff20;border-radius:14px;padding:12px}
.yingdu-home-dashboard .ydh-study-video-head{display:flex;justify-content:space-between;font-size:11px;color:#d6e0d8}
.yingdu-home-dashboard .ydh-study-subtitle-line{display:grid;gap:3px;border-radius:9px;padding:9px 12px;background:#ffffff10}
.yingdu-home-dashboard .ydh-study-subtitle-line.ydh-active{background:#ffffff28;box-shadow:inset 3px 0 #f1d68b}
.yingdu-home-dashboard .ydh-study-subtitle-line strong{font-size:16px}
.yingdu-home-dashboard .ydh-study-subtitle-line small{font-size:11px;color:#f0f3e9}
.yingdu-home-dashboard .ydh-study-play-button{position:absolute;right:19px;bottom:17px;border-radius:50%;width:39px;height:39px;background:linear-gradient(145deg,#f6f1ce,#d8c37d);color:#2f4c3e;display:grid;place-items:center}
.yingdu-home-dashboard .ydh-primary-row{display:grid;grid-template-columns:1.1fr 1fr;gap:12px;min-height:0}
.yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card{padding:16px 18px;display:flex;flex-direction:column;gap:12px;min-height:0}
.yingdu-home-dashboard .ydh-continue-content{display:flex;gap:14px;flex:1;min-height:0;align-items:center}
.yingdu-home-dashboard .ydh-cover{width:118px;height:100%;max-height:134px;min-height:70px;object-fit:cover;border-radius:11px}
.yingdu-home-dashboard .ydh-continue-info{flex:1;min-width:0;display:grid;gap:6px}
.yingdu-home-dashboard .ydh-course-name{font-size:17px;line-height:1.35;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-meta-row{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:12px}
.yingdu-home-dashboard .ydh-progress-track{height:6px;border-radius:10px;background:#e8ede2;overflow:hidden}
.yingdu-home-dashboard .ydh-progress-track span{height:100%;display:block;background:var(--green);border-radius:inherit}
.yingdu-home-dashboard .ydh-progress-line{display:flex;align-items:center;gap:12px}
.yingdu-home-dashboard .ydh-progress-line .ydh-progress-track{flex:1}
.yingdu-home-dashboard .ydh-progress-label{font-size:12px;font-weight:650;white-space:nowrap}
.yingdu-home-dashboard .ydh-continue-actions{display:flex;gap:8px;margin-top:3px}
.yingdu-home-dashboard .ydh-continue-actions .ydh-action{min-height:32px;padding:6px 12px;font-size:12px}
.yingdu-home-dashboard .ydh-status-badge{font-size:11px;color:var(--green);padding:3px 7px;border-radius:5px;background:var(--soft);white-space:nowrap}
.yingdu-home-dashboard .ydh-metrics{display:grid;grid-template-columns:repeat(4,1fr);flex:1;min-height:0}
.yingdu-home-dashboard .ydh-metric{padding:8px 4px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;border-radius:9px}
.yingdu-home-dashboard .ydh-metric+ .ydh-metric{border-left:1px solid var(--line)}
.yingdu-home-dashboard .ydh-metric svg{color:var(--green);width:20px;height:20px}
.yingdu-home-dashboard .ydh-metric strong{font-size:clamp(22px,2.3vw,34px);line-height:1}
.yingdu-home-dashboard .ydh-metric strong span{font-size:13px;margin-left:2px;font-weight:500}
.yingdu-home-dashboard .ydh-metric small{font-size:12px;white-space:nowrap}
.yingdu-home-dashboard .ydh-course-stats{display:flex;align-items:center;padding:12px 20px;gap:25px}
.yingdu-home-dashboard .ydh-stats-heading{min-width:120px;display:grid;gap:4px}
.yingdu-home-dashboard .ydh-stats-heading small{font-size:11px}
.yingdu-home-dashboard .ydh-course-counts{display:grid;grid-template-columns:repeat(4,1fr);flex:1;height:100%;align-items:center;gap:8px}
.yingdu-home-dashboard .ydh-course-count{display:flex;align-items:center;justify-content:center;gap:12px;height:100%;border-radius:10px;background:#f0f5e9}
.yingdu-home-dashboard .ydh-course-count strong{font-size:25px;font-weight:700;color:var(--green)}
.yingdu-home-dashboard .ydh-course-count span{font-size:12px}
.yingdu-home-dashboard .ydh-bottom-panels{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px;min-height:0}
.yingdu-home-dashboard .ydh-panel{padding:16px 18px;display:flex;flex-direction:column;min-height:0;gap:10px}
.yingdu-home-dashboard .ydh-goal-summary{display:flex;align-items:baseline;justify-content:space-between;font-size:12px;gap:8px}
.yingdu-home-dashboard .ydh-goal-summary strong{font-size:14px}
.yingdu-home-dashboard .ydh-goal-rows{display:flex;flex-direction:column;justify-content:space-evenly;flex:1;gap:8px}
.yingdu-home-dashboard .ydh-goal-row{display:grid;grid-template-columns:70px 1fr auto;gap:10px;align-items:center;font-size:12px}
.yingdu-home-dashboard .ydh-goal-row>span{display:flex;align-items:center;gap:5px}
.yingdu-home-dashboard .ydh-goal-row svg{width:15px;height:15px;color:var(--green)}
.yingdu-home-dashboard .ydh-goal-row b{font-size:11px;font-weight:600;min-width:56px;text-align:right}
.yingdu-home-dashboard .ydh-goal-foot{display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:11px}
.yingdu-home-dashboard .ydh-goal-foot button{font-size:11px;font-weight:650}
.yingdu-home-dashboard .ydh-segmented{display:inline-flex;background:#eef3e8;border:1px solid #dce5d6;border-radius:7px;padding:2px;flex-shrink:0}
.yingdu-home-dashboard .ydh-segmented button{font-size:11px;padding:5px 8px;border-radius:5px}
.yingdu-home-dashboard .ydh-segmented button[aria-pressed=true]{background:var(--green);color:#fff}
.yingdu-home-dashboard .ydh-trend-body{flex:1;display:flex;flex-direction:column;min-height:0;justify-content:center;gap:4px}
.yingdu-home-dashboard .ydh-trend-plot{width:100%;height:100%;min-height:60px;max-height:160px}
.yingdu-home-dashboard .ydh-trend-days{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.yingdu-home-dashboard .ydh-trend-days button{padding:4px 0;display:grid;gap:3px;border-radius:5px;font-size:11px}
.yingdu-home-dashboard .ydh-trend-days span{color:var(--muted);font-size:10px}
.yingdu-home-dashboard .ydh-trend-caption{font-size:11px;color:var(--muted)}
.yingdu-home-dashboard .ydh-calendar-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:4px;flex:1;align-content:center}
.yingdu-home-dashboard .ydh-calendar-day{background:#edf2e7;border-radius:5px;font-size:11px;min-height:25px;max-height:42px;aspect-ratio:1}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l1{background:#d6e4cb}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l2{background:#b4ce9f}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l3{background:#6c955d;color:#fff}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l4{background:#285f40;color:#fff}
.yingdu-home-dashboard .ydh-calendar-day.ydh-today{outline:1px solid var(--green);outline-offset:1px}
.yingdu-home-dashboard .ydh-calendar-foot{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);gap:4px}
.yingdu-home-dashboard .ydh-legend{display:flex;align-items:center;gap:3px}
.yingdu-home-dashboard .ydh-legend i{width:8px;height:8px;border-radius:2px;background:#edf2e7}
.yingdu-home-dashboard .ydh-legend i:nth-of-type(2){background:#b4ce9f}
.yingdu-home-dashboard .ydh-legend i:nth-of-type(3){background:#285f40}
.yingdu-home-dashboard .ydh-mobile-tools,.yingdu-home-dashboard .ydh-mobile-nav{display:none}
.yingdu-home-dashboard .ydh-live-message{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);max-width:90vw;padding:10px 16px;background:#173a2e;color:white;border-radius:10px;font-size:13px;z-index:40;box-shadow:0 4px 20px #173a2e22}
.yingdu-home-dashboard .ydh-live-message:empty{display:none}
.yingdu-home-dashboard [hidden]{display:none!important}
.yingdu-home-dashboard .ydh-detail-panel{position:fixed;margin:0;inset:64px 18px auto auto;width:min(540px,calc(100vw - 32px));max-height:calc(100svh - 84px);padding:0;border:1px solid #cbd8c3;border-radius:17px;color:var(--ink);background:var(--paper);box-shadow:0 16px 60px #132c2430;z-index:30;overscroll-behavior:contain}
.yingdu-home-dashboard .ydh-detail-panel:not([open]){display:none!important;pointer-events:none}
.yingdu-home-dashboard .ydh-detail-panel[open]{display:flex;flex-direction:column}
.yingdu-home-dashboard .ydh-detail-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 20px;border-bottom:1px solid var(--line);flex-shrink:0}
.yingdu-home-dashboard .ydh-detail-header h2{font-size:18px}
.yingdu-home-dashboard .ydh-close{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--soft);font-size:24px}
.yingdu-home-dashboard .ydh-detail-body{padding:20px;overflow:auto;overscroll-behavior:contain;min-height:0}
.yingdu-home-dashboard .ydh-detail-body h3{font-size:18px;line-height:1.5;margin-bottom:8px}
.yingdu-home-dashboard .ydh-detail-body p{font-size:14px;line-height:1.7}
.yingdu-home-dashboard .ydh-detail-body small{font-size:12px}
.yingdu-home-dashboard .ydh-summary-rows{margin:16px 0;display:grid;gap:0}
.yingdu-home-dashboard .ydh-summary-rows div{display:flex;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.yingdu-home-dashboard .ydh-summary-rows dd{margin:0;text-align:right}
.yingdu-home-dashboard .ydh-summary-rows dt{color:var(--muted)}
.yingdu-home-dashboard details{padding:14px 0;border-bottom:1px solid var(--line)}
.yingdu-home-dashboard summary{cursor:pointer;font-weight:650;font-size:14px;min-height:28px}
.yingdu-home-dashboard .ydh-detail-body .ydh-action{margin-top:14px}
.yingdu-home-dashboard .ydh-sentence-filters{display:flex;gap:8px;margin:12px 0;flex-wrap:wrap}
.yingdu-home-dashboard .ydh-sentence-filters button{padding:7px 10px;border-radius:7px;background:var(--soft);font-size:12px}
.yingdu-home-dashboard .ydh-sentence-filters button[aria-pressed=true]{background:var(--green);color:#fff}
.yingdu-home-dashboard .ydh-sentence-row{display:grid;grid-template-columns:22px 1fr auto;gap:8px;align-items:start;padding:12px 0;border-bottom:1px solid var(--line);font-size:13px}
.yingdu-home-dashboard .ydh-sentence-row p{font-size:13px;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-sentence-row button{padding:5px;color:var(--green);font-size:12px}
.yingdu-home-dashboard .ydh-sentence-row small{display:block;margin-top:4px}
.yingdu-home-dashboard .ydh-pager{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font-size:12px}
.yingdu-home-dashboard .ydh-pager button{padding:8px;background:var(--soft);border-radius:6px}
.yingdu-home-dashboard .ydh-form-grid{display:grid;gap:14px;margin-top:12px}
.yingdu-home-dashboard .ydh-form-grid label{display:grid;gap:7px;font-size:13px;font-weight:600}
.yingdu-home-dashboard .ydh-form-grid input,.yingdu-home-dashboard .ydh-form-grid select{width:100%;border:1px solid #c6d5c0;background:#fffefb;color:var(--ink);border-radius:8px;padding:10px 12px;min-height:44px;font-size:16px}
.yingdu-home-dashboard .ydh-form-row{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.yingdu-home-dashboard .ydh-form-error{color:#9b3a28;font-size:13px;line-height:1.6}
.yingdu-home-dashboard .ydh-check-row{display:flex;flex-wrap:wrap;gap:8px}
.yingdu-home-dashboard .ydh-check-row label{display:flex;align-items:center;gap:6px;font-size:12px;background:var(--soft);border-radius:7px;padding:8px}
.yingdu-home-dashboard .ydh-check-row input{width:17px;min-height:17px;margin:0}
.yingdu-home-dashboard .ydh-plan-item{padding:14px;border:1px solid var(--line);border-radius:10px;margin-bottom:10px}
.yingdu-home-dashboard .ydh-plan-item p{font-size:12px;color:var(--muted)}
.yingdu-home-dashboard .ydh-plan-actions{display:flex;gap:8px;flex-wrap:wrap}
.yingdu-home-dashboard .ydh-plan-actions button{font-size:12px;color:var(--green);padding:8px;background:var(--soft);border-radius:7px;margin-top:10px}
.yingdu-home-dashboard .ydh-empty{padding:24px 10px;text-align:center;color:var(--muted);font-size:14px;line-height:1.8}
.yingdu-home-dashboard .ydh-quote{padding:18px;border-radius:12px;background:var(--soft);margin:18px 0;font-size:18px;line-height:1.6}
.yingdu-home-dashboard .ydh-detail-body .ydh-calendar-grid{grid-template-columns:repeat(6,1fr);gap:8px;margin:16px 0}
.yingdu-home-dashboard .ydh-detail-body .ydh-calendar-day{max-height:none;min-height:44px}
.yingdu-home-dashboard .ydh-detail-body .ydh-trend-plot{height:180px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-rows{gap:22px;margin-top:20px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-row{font-size:14px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-foot{margin-top:24px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-foot button{font-size:14px}
.yingdu-home-dashboard .ydh-detail-body .ydh-panel{padding:0;border:0;background:none}
.yingdu-home-dashboard .ydh-detail-body .ydh-card-head{display:none}
.yingdu-home-dashboard .ydh-detail-body .ydh-calendar-foot{font-size:12px}
.yingdu-home-dashboard .ydh-detail-body .ydh-trend-days button{min-height:44px}
.yingdu-home-dashboard .ydh-detail-body .ydh-trend-days span{font-size:11px}
@media(min-width:1500px){.yingdu-home-dashboard .ydh-page{padding:24px 32px;gap:16px;grid-template-rows:32px minmax(190px,1.05fr) minmax(165px,.8fr) 94px minmax(220px,1fr)}
.yingdu-home-dashboard .ydh-hero{padding:28px 36px}
.yingdu-home-dashboard .ydh-hero-copy{gap:16px}
.yingdu-home-dashboard .ydh-hero-desc{font-size:16px}
.yingdu-home-dashboard .ydh-hero .ydh-action{min-height:44px;font-size:14px}
.yingdu-home-dashboard .ydh-landing-study-panel{padding:24px 28px;gap:16px}
.yingdu-home-dashboard .ydh-study-video-card{padding:18px;gap:12px}
.yingdu-home-dashboard .ydh-study-subtitle-line{padding:14px}
.yingdu-home-dashboard .ydh-study-subtitle-line strong{font-size:20px}
.yingdu-home-dashboard .ydh-study-subtitle-line small{font-size:13px}
.yingdu-home-dashboard .ydh-panel,.yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card{padding:20px 24px}
.yingdu-home-dashboard .ydh-cover{width:155px;max-height:170px}
.yingdu-home-dashboard .ydh-course-name{font-size:21px}
.yingdu-home-dashboard .ydh-continue-info{gap:10px}
.yingdu-home-dashboard .ydh-goal-row{font-size:14px;grid-template-columns:85px 1fr auto}
.yingdu-home-dashboard .ydh-goal-row b{font-size:13px}
.yingdu-home-dashboard .ydh-calendar-day{font-size:13px;min-height:30px;max-height:52px}
.yingdu-home-dashboard .ydh-calendar-foot{font-size:12px}
.yingdu-home-dashboard .ydh-trend-caption{font-size:12px}
.yingdu-home-dashboard .ydh-trend-days button{font-size:13px}
.yingdu-home-dashboard .ydh-trend-days span{font-size:11px}
.yingdu-home-dashboard .ydh-text-button{font-size:13px}
.yingdu-home-dashboard .ydh-trend-plot{max-height:220px}
.yingdu-home-dashboard .ydh-meta-row{font-size:13px}
.yingdu-home-dashboard .ydh-course-count strong{font-size:30px}
.yingdu-home-dashboard .ydh-course-count span{font-size:14px}}
@media(min-width:1001px) and (max-width:1100px) and (orientation:landscape) and (min-height:601px){.yingdu-home-dashboard .ydh-shell{grid-template-columns:70px minmax(0,1fr)}
.yingdu-home-dashboard .ydh-sidebar{padding:24px 8px}
.yingdu-home-dashboard .ydh-sidebar .ydh-brand>span:last-child,.yingdu-home-dashboard .ydh-sidebar .ydh-nav a span,.yingdu-home-dashboard .ydh-side-note>span:last-child{display:none}
.yingdu-home-dashboard .ydh-sidebar .ydh-brand,.yingdu-home-dashboard .ydh-sidebar .ydh-nav a{justify-content:center}
.yingdu-home-dashboard .ydh-nav a{padding:14px}
.yingdu-home-dashboard .ydh-sidebar .ydh-side-note{justify-content:center}
.yingdu-home-dashboard .ydh-page{padding:12px;gap:10px;grid-template-rows:28px minmax(170px,1fr) minmax(145px,.8fr) 85px minmax(236px,1.15fr)}
.yingdu-home-dashboard .ydh-hero{padding:20px;gap:18px}
.yingdu-home-dashboard .ydh-hero h1{font-size:34px}
.yingdu-home-dashboard .ydh-hero-desc{font-size:13px}
.yingdu-home-dashboard .ydh-hero .ydh-chips{display:none}
.yingdu-home-dashboard .ydh-landing-study-panel{padding:15px}
.yingdu-home-dashboard .ydh-study-subtitle-line small{font-size:10px}
.yingdu-home-dashboard .ydh-primary-row{grid-template-columns:1.15fr 1fr}
.yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card{padding:12px;gap:12px}
.yingdu-home-dashboard .ydh-cover{width:73px}
.yingdu-home-dashboard .ydh-continue-actions .ydh-action{padding:8px;min-height:36px;font-size:11px}
.yingdu-home-dashboard .ydh-course-name{font-size:15px}
.yingdu-home-dashboard .ydh-meta-row{font-size:10px}
.yingdu-home-dashboard .ydh-metrics{gap:0}
.yingdu-home-dashboard .ydh-metric strong{font-size:23px}
.yingdu-home-dashboard .ydh-metric small{font-size:10px}
.yingdu-home-dashboard .ydh-metric strong span{font-size:11px}
.yingdu-home-dashboard .ydh-course-stats{padding:12px;gap:12px}
.yingdu-home-dashboard .ydh-stats-heading{min-width:102px}
.yingdu-home-dashboard .ydh-course-count{display:grid;justify-items:center;gap:0}
.yingdu-home-dashboard .ydh-course-count strong{font-size:22px}
.yingdu-home-dashboard .ydh-course-count span{font-size:11px}
.yingdu-home-dashboard .ydh-bottom-panels{gap:10px}
.yingdu-home-dashboard .ydh-panel{padding:13px 11px}
.yingdu-home-dashboard .ydh-card-head{gap:4px}
.yingdu-home-dashboard .ydh-card-head h2{font-size:14px;gap:5px}
.yingdu-home-dashboard .ydh-card-head h2 svg{width:15px}
.yingdu-home-dashboard .ydh-text-button{font-size:10px;padding:6px 2px}
.yingdu-home-dashboard .ydh-goal-row{grid-template-columns:1fr auto;gap:7px}
.yingdu-home-dashboard .ydh-goal-row .ydh-progress-track{grid-column:1/-1;grid-row:auto}
.yingdu-home-dashboard .ydh-goal-row b{grid-column:2;grid-row:auto}
.yingdu-home-dashboard .ydh-goal-row>span{grid-column:1}
.yingdu-home-dashboard .ydh-goal-row .ydh-progress-track{order:3}
.yingdu-home-dashboard .ydh-goal-summary{font-size:10px}
.yingdu-home-dashboard .ydh-goal-summary strong{font-size:12px}
.yingdu-home-dashboard .ydh-goal-foot{font-size:10px}
.yingdu-home-dashboard .ydh-calendar-grid{grid-template-columns:repeat(5,1fr);gap:5px}
.yingdu-home-dashboard .ydh-calendar-day{max-height:38px}
.yingdu-home-dashboard .ydh-calendar-foot{flex-wrap:wrap;font-size:10px}
.yingdu-home-dashboard .ydh-segmented button{padding:5px;font-size:10px}}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-shell{display:block}
.yingdu-home-dashboard .ydh-sidebar{display:none}
.yingdu-home-dashboard .ydh-page{height:100svh;padding:8px 10px 0;gap:8px;grid-template-rows:28px minmax(170px,1fr) 120px 72px 68px 90px 50px calc(56px + env(safe-area-inset-bottom));}
.yingdu-home-dashboard .ydh-topbar .ydh-brand{display:flex;font-size:14px;gap:6px}
.yingdu-home-dashboard .ydh-brand-mark{width:23px;height:23px;border-radius:6px}
.yingdu-home-dashboard .ydh-brand-mark svg{width:16px;height:16px}
.yingdu-home-dashboard .ydh-desktop-date,.yingdu-home-dashboard .ydh-top-right{display:none}
.yingdu-home-dashboard .ydh-preview-label{font-size:10px}
.yingdu-home-dashboard .ydh-preview-label .ydh-wide-label{display:none}
.yingdu-home-dashboard .ydh-topbar{gap:5px}
.yingdu-home-dashboard .ydh-hero{padding:10px 12px;gap:8px;grid-template-columns:1fr;grid-template-rows:minmax(70px,1fr) auto;border-radius:15px;align-items:stretch}
.yingdu-home-dashboard .ydh-hero-copy{grid-row:2;grid-template-columns:1fr auto;gap:3px 8px;align-items:center}
.yingdu-home-dashboard .ydh-eyebrow,.yingdu-home-dashboard .ydh-chips{display:none}
.yingdu-home-dashboard .ydh-hero h1{font-size:25px;letter-spacing:-.5px;grid-column:1;grid-row:1}
.yingdu-home-dashboard .ydh-hero-desc{font-size:11px;line-height:1.4;grid-column:1;grid-row:2}
.yingdu-home-dashboard .ydh-hero-copy>.ydh-action{grid-column:2;grid-row:1/3;min-height:42px;font-size:12px;padding:8px 10px;white-space:nowrap}
.yingdu-home-dashboard .ydh-hero-copy>.ydh-action svg{width:14px}
.yingdu-home-dashboard .ydh-hero-copy>.ydh-action .ydh-desktop-cta{display:none}
.yingdu-home-dashboard .ydh-landing-study-panel{grid-row:1;padding:10px 12px;border-radius:12px;gap:6px;align-content:center;box-shadow:0 5px 10px #173a2e10}
.yingdu-home-dashboard .ydh-study-panel-badge{font-size:8px;padding:3px 7px;gap:6px}
.yingdu-home-dashboard .ydh-study-panel-badge span{width:5px;height:5px}
.yingdu-home-dashboard .ydh-study-video-card{padding:7px 9px;gap:4px;border-radius:9px}
.yingdu-home-dashboard .ydh-study-video-head{font-size:9px}
.yingdu-home-dashboard .ydh-study-subtitle-line{padding:5px 8px;border-radius:6px;gap:2px}
.yingdu-home-dashboard .ydh-study-subtitle-line strong{font-size:13px}
.yingdu-home-dashboard .ydh-study-subtitle-line small{font-size:10px}
.yingdu-home-dashboard .ydh-study-subtitle-line:not(.ydh-active){display:none}
.yingdu-home-dashboard .ydh-study-play-button{width:30px;height:30px;right:12px;bottom:10px}
.yingdu-home-dashboard .ydh-study-play-button svg{width:16px}
.yingdu-home-dashboard .ydh-primary-row{display:contents}
.yingdu-home-dashboard .ydh-continue-card{padding:10px 12px;gap:7px;border-radius:13px}
.yingdu-home-dashboard .ydh-card-head h2{font-size:13px;gap:6px}
.yingdu-home-dashboard .ydh-card-head h2 svg{width:14px;height:14px}
.yingdu-home-dashboard .ydh-text-button{font-size:10px;padding:4px}
.yingdu-home-dashboard .ydh-status-badge{font-size:9px}
.yingdu-home-dashboard .ydh-continue-content{gap:10px}
.yingdu-home-dashboard .ydh-cover{width:64px;min-height:66px;height:100%;max-height:76px;border-radius:8px}
.yingdu-home-dashboard .ydh-course-name{font-size:14px;line-height:1.3}
.yingdu-home-dashboard .ydh-continue-info{gap:5px}
.yingdu-home-dashboard .ydh-meta-row{font-size:10px}
.yingdu-home-dashboard .ydh-continue-actions{gap:6px;margin:0}
.yingdu-home-dashboard .ydh-continue-actions .ydh-action{min-height:32px;padding:5px 9px;font-size:11px;flex:1}
.yingdu-home-dashboard .ydh-progress-track{height:5px}
.yingdu-home-dashboard .ydh-progress-label{font-size:10px}
.yingdu-home-dashboard .ydh-overview-card{padding:8px 12px;gap:3px;border-radius:13px}
.yingdu-home-dashboard .ydh-overview-card .ydh-card-head h2{font-size:11px}
.yingdu-home-dashboard .ydh-metrics{gap:0}
.yingdu-home-dashboard .ydh-metric{gap:3px;padding:3px 2px}
.yingdu-home-dashboard .ydh-metric>svg{display:none}
.yingdu-home-dashboard .ydh-metric strong{font-size:22px}
.yingdu-home-dashboard .ydh-metric strong span{font-size:10px}
.yingdu-home-dashboard .ydh-metric small{font-size:10px}
.yingdu-home-dashboard .ydh-course-stats{display:grid;grid-template-columns:1fr;padding:8px 12px;gap:4px;border-radius:13px}
.yingdu-home-dashboard .ydh-stats-heading{display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0}
.yingdu-home-dashboard .ydh-stats-heading h2{font-size:11px}
.yingdu-home-dashboard .ydh-stats-heading small{font-size:9px}
.yingdu-home-dashboard .ydh-course-counts{gap:5px}
.yingdu-home-dashboard .ydh-course-count{gap:4px;border-radius:6px;padding:4px 0}
.yingdu-home-dashboard .ydh-course-count strong{font-size:19px}
.yingdu-home-dashboard .ydh-course-count span{font-size:9px}
.yingdu-home-dashboard .ydh-bottom-panels{display:block;min-height:0}
.yingdu-home-dashboard .ydh-bottom-panels>.ydh-panel:not(.ydh-goals-panel){display:none}
.yingdu-home-dashboard .ydh-goals-panel{height:100%;padding:9px 12px;gap:5px;border-radius:13px}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary{font-size:10px}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary strong{font-size:11px}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-rows{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;align-items:start}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row{display:grid;grid-template-columns:1fr;gap:4px;font-size:10px}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row>span{display:none}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row b{font-size:10px;text-align:left;min-width:0;grid-row:1}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-foot{display:none}
.yingdu-home-dashboard .ydh-mobile-tools{display:grid;grid-template-columns:repeat(5,1fr);align-items:center;gap:2px}
.yingdu-home-dashboard .ydh-mobile-tools button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;padding:5px 0;min-height:44px;font-size:10px}
.yingdu-home-dashboard .ydh-mobile-tools button svg{width:17px;height:17px;color:var(--green)}
.yingdu-home-dashboard .ydh-mobile-nav{display:grid;grid-template-columns:repeat(4,1fr);padding:5px 0 calc(4px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--paper);gap:5px;margin:0 -10px}
.yingdu-home-dashboard .ydh-mobile-nav a{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;min-height:44px;font-size:10px;border-radius:8px}
.yingdu-home-dashboard .ydh-mobile-nav a[aria-current=page]{background:var(--soft);color:var(--green)}
.yingdu-home-dashboard .ydh-mobile-nav svg{width:18px;height:18px}
.yingdu-home-dashboard .ydh-detail-panel{inset:auto 8px calc(64px + env(safe-area-inset-bottom)) 8px;width:auto;max-height:calc(100svh - 110px);border-radius:14px}
.yingdu-home-dashboard .ydh-detail-header{padding:12px 16px}
.yingdu-home-dashboard .ydh-detail-header h2{font-size:16px}
.yingdu-home-dashboard .ydh-detail-body{padding:16px}
.yingdu-home-dashboard .ydh-close{width:40px;height:40px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-row{grid-template-columns:70px 1fr auto;font-size:12px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-row>span{display:flex}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-row b{grid-row:auto;text-align:right}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-rows{display:flex;gap:20px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-foot{display:flex}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-summary{font-size:12px}
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-summary strong{font-size:14px}
.yingdu-home-dashboard .ydh-live-message{bottom:70px;font-size:12px}
.yingdu-home-dashboard .ydh-form-grid{gap:12px}
.yingdu-home-dashboard .ydh-form-row{gap:10px}
.yingdu-home-dashboard .ydh-form-grid label{font-size:12px}}


@media(prefers-reduced-motion:reduce){.yingdu-home-dashboard,.yingdu-home-dashboard *{scroll-behavior:auto!important}}
.yingdu-home-dashboard .ydh-mobile-preview{display:none}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-mobile-preview{display:flex}}
.yingdu-home-dashboard .ydh-trend-plot{height:0;flex:1;min-height:50px}
.yingdu-home-dashboard .ydh-trend-days,.yingdu-home-dashboard .ydh-trend-caption{flex-shrink:0}
.yingdu-home-dashboard .ydh-goal-row>span{white-space:nowrap}
.yingdu-home-dashboard .ydh-metric{min-height:0}
.yingdu-home-dashboard .ydh-metric>i{line-height:1}
.yingdu-home-dashboard .ydh-detail-body .ydh-card-head{display:flex;justify-content:flex-end}
.yingdu-home-dashboard .ydh-detail-body .ydh-card-head h2{display:none}
@media(min-width:1101px){.yingdu-home-dashboard .ydh-goal-row{grid-template-columns:86px 1fr auto}}
@media(min-width:1101px), (min-width:1001px) and (orientation:landscape) and (min-height:601px){.yingdu-home-dashboard .ydh-landing-study-panel{min-height:0;gap:8px;padding:14px 18px}
.yingdu-home-dashboard .ydh-study-video-card{gap:6px;padding:10px}
.yingdu-home-dashboard .ydh-study-subtitle-line{padding:6px 10px}
.yingdu-home-dashboard .ydh-study-subtitle-line strong{font-size:16px}
.yingdu-home-dashboard .ydh-study-subtitle-line small{font-size:11px}
.yingdu-home-dashboard .ydh-hero-copy{gap:10px}}


@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-page{grid-template-rows:28px minmax(170px,1.1fr) minmax(140px,.65fr) minmax(90px,.4fr) 74px minmax(90px,.4fr) 50px calc(56px + env(safe-area-inset-bottom))}
.yingdu-home-dashboard .ydh-metric>i{display:none}
.yingdu-home-dashboard .ydh-metric{min-height:0}
.yingdu-home-dashboard .ydh-card-head .ydh-text-button,.yingdu-home-dashboard .ydh-stats-heading .ydh-text-button{padding:0;line-height:18px}
.yingdu-home-dashboard .ydh-course-count strong{line-height:1}
.yingdu-home-dashboard .ydh-course-count{padding:3px 0}
.yingdu-home-dashboard .ydh-course-stats{grid-template-rows:18px minmax(0,1fr)}
.yingdu-home-dashboard .ydh-course-counts{min-height:0;height:auto}
.yingdu-home-dashboard .ydh-continue-info{gap:4px}
.yingdu-home-dashboard .ydh-continue-card .ydh-meta-row{line-height:12px}
.yingdu-home-dashboard .ydh-continue-card .ydh-progress-line{line-height:12px}
.yingdu-home-dashboard .ydh-landing-study-panel{align-content:center}
.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row>span{white-space:normal}}



.yingdu-home-dashboard .ydh-goal-summary strong{min-width:0;overflow-wrap:anywhere}
.yingdu-home-dashboard,.yingdu-home-dashboard[data-theme="default"]{--bg:#edf3e7;--paper:#fffefb;--soft:#e7efdf;--hero:#f2f6ed;--ink:#173a2e;--muted:#4f6359;--accent:#236347;--on-accent:#ffffff;--line:#dce5d6;--control-line:#71836d;--track:#c9d9c0;--showcase:#122822;--video:#19372e;--subtitle:#214136;--active-subtitle:#2f5143;--showcase-text:#f6faf5;--showcase-muted:#d7e6dc;--showcase-line:#354e42;--gold:#e7d392;--gold-text:#263b2b;--error:#a02925;--cal1:#d8e6cc;--cal2:#b7d29b;--cal3:#50733b;--cal4:#29523b;--cal1-ink:#14231d;--cal2-ink:#14231d;--cal3-ink:#ffffff;--cal4-ink:#ffffff;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:light}
.yingdu-home-dashboard[data-theme="rose"]{--bg:#f3e3e9;--paper:#fffafb;--soft:#f4e3ea;--hero:#f9edf1;--ink:#38232d;--muted:#714f5e;--accent:#97435f;--on-accent:#ffffff;--line:#ead4dc;--control-line:#a16b80;--track:#e0bbcc;--showcase:#35212c;--video:#432936;--subtitle:#533342;--active-subtitle:#694153;--showcase-text:#fff5f8;--showcase-muted:#f3dce5;--showcase-line:#59404c;--gold:#efcfb2;--gold-text:#422a25;--error:#a02925;--cal1:#edd0dd;--cal2:#d9a5bc;--cal3:#a64d70;--cal4:#71334e;--cal1-ink:#14231d;--cal2-ink:#14231d;--cal3-ink:#ffffff;--cal4-ink:#ffffff;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:light}
.yingdu-home-dashboard[data-theme="glacier"]{--bg:#e1edf5;--paper:#fbfdff;--soft:#e3eff6;--hero:#eaf4fa;--ink:#173849;--muted:#466879;--accent:#186585;--on-accent:#ffffff;--line:#cfdfe8;--control-line:#648497;--track:#bdd6e4;--showcase:#142c3b;--video:#1b3b4d;--subtitle:#254a5d;--active-subtitle:#305e72;--showcase-text:#f3faff;--showcase-muted:#d7eaf4;--showcase-line:#365363;--gold:#e7d79b;--gold-text:#253a44;--error:#a02925;--cal1:#d0e6f1;--cal2:#a4cddd;--cal3:#357b9a;--cal4:#20546d;--cal1-ink:#14231d;--cal2-ink:#14231d;--cal3-ink:#ffffff;--cal4-ink:#ffffff;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:light}
.yingdu-home-dashboard[data-theme="almond"]{--bg:#f2e6d0;--paper:#fffaf0;--soft:#f2e3c5;--hero:#faf0dc;--ink:#3a2b1d;--muted:#6b563f;--accent:#795321;--on-accent:#ffffff;--line:#e4d5b6;--control-line:#92764a;--track:#ddc79e;--showcase:#30271d;--video:#3f3325;--subtitle:#51412e;--active-subtitle:#66523a;--showcase-text:#fff8eb;--showcase-muted:#eddfc9;--showcase-line:#5c4c36;--gold:#ebce86;--gold-text:#3b2b17;--error:#a02925;--cal1:#edd8b2;--cal2:#d9b477;--cal3:#936528;--cal4:#66471f;--cal1-ink:#14231d;--cal2-ink:#14231d;--cal3-ink:#ffffff;--cal4-ink:#ffffff;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:light}
.yingdu-home-dashboard[data-theme="eye"]{--bg:#0d1728;--paper:#172642;--soft:#20365e;--hero:#14233c;--ink:#f8faff;--muted:#e4ecfc;--accent:#aac6ff;--on-accent:#0d203e;--line:#30415c;--control-line:#91a9d2;--track:#3e577e;--showcase:#0b1425;--video:#142541;--subtitle:#1c3354;--active-subtitle:#27466d;--showcase-text:#f4f8ff;--showcase-muted:#eaf1fc;--showcase-line:#304766;--gold:#e8cf83;--gold-text:#14223c;--error:#ffb6b0;--cal1:#2c4771;--cal2:#486a98;--cal3:#7da1cf;--cal4:#b5d1fa;--cal1-ink:#ffffff;--cal2-ink:#ffffff;--cal3-ink:#14231d;--cal4-ink:#14231d;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:dark}
.yingdu-home-dashboard[data-theme="night"]{--bg:#141a1d;--paper:#242d31;--soft:#303c41;--hero:#202a2e;--ink:#fafcfb;--muted:#e2ebe7;--accent:#9bcebd;--on-accent:#12241d;--line:#34413f;--control-line:#9aaea5;--track:#4b6359;--showcase:#101a1c;--video:#19282a;--subtitle:#213335;--active-subtitle:#2d4543;--showcase-text:#ffffff;--showcase-muted:#edf4f0;--showcase-line:#2b3b36;--gold:#e8d391;--gold-text:#1e3028;--error:#ffb6b0;--cal1:#344d43;--cal2:#4f7666;--cal3:#87ae99;--cal4:#b9dac8;--cal1-ink:#ffffff;--cal2-ink:#ffffff;--cal3-ink:#14231d;--cal4-ink:#14231d;--green:var(--accent);--body:var(--ink);--deep:var(--showcase);color-scheme:dark}
.yingdu-home-dashboard{background:var(--bg);color:var(--ink)}
.yingdu-home-dashboard,.yingdu-home-dashboard *,.yingdu-home-dashboard *::before,.yingdu-home-dashboard *::after{box-shadow:none!important;text-shadow:none!important;backdrop-filter:none!important;filter:none!important}
.yingdu-home-dashboard button,.yingdu-home-dashboard a,.yingdu-home-dashboard input,.yingdu-home-dashboard select,.yingdu-home-dashboard summary{-webkit-font-smoothing:auto}
.yingdu-home-dashboard button:focus-visible,.yingdu-home-dashboard a:focus-visible,.yingdu-home-dashboard input:focus-visible,.yingdu-home-dashboard select:focus-visible,.yingdu-home-dashboard summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.yingdu-home-dashboard button:disabled{opacity:1;color:var(--muted);background:var(--soft);cursor:not-allowed}
.yingdu-home-dashboard button:hover:not(:disabled),.yingdu-home-dashboard a.ydh-action:hover{outline:1px solid var(--control-line);outline-offset:1px}
.yingdu-home-dashboard .ydh-card,.yingdu-home-dashboard .ydh-sidebar,.yingdu-home-dashboard .ydh-mobile-nav,.yingdu-home-dashboard .ydh-detail-panel,.yingdu-home-dashboard .ydh-action.ydh-secondary{background:var(--paper);border-color:var(--line)}
.yingdu-home-dashboard .ydh-hero{background:var(--hero);border-color:var(--line)}
.yingdu-home-dashboard .ydh-nav a:hover,.yingdu-home-dashboard .ydh-nav a[aria-current=page],.yingdu-home-dashboard .ydh-avatar,.yingdu-home-dashboard .ydh-status-badge,.yingdu-home-dashboard .ydh-course-count,.yingdu-home-dashboard .ydh-close,.yingdu-home-dashboard .ydh-quote,.yingdu-home-dashboard .ydh-sentence-filters button,.yingdu-home-dashboard .ydh-pager button,.yingdu-home-dashboard .ydh-check-row label,.yingdu-home-dashboard .ydh-plan-actions button,.yingdu-home-dashboard .ydh-action.ydh-soft,.yingdu-home-dashboard .ydh-segmented{background:var(--soft);color:var(--accent)}
.yingdu-home-dashboard .ydh-hero-desc,.yingdu-home-dashboard .ydh-chips span,.yingdu-home-dashboard .ydh-preview-label,.yingdu-home-dashboard .ydh-calendar-foot,.yingdu-home-dashboard .ydh-goal-foot,.yingdu-home-dashboard .ydh-trend-caption,.yingdu-home-dashboard small,.yingdu-home-dashboard .ydh-muted,.yingdu-home-dashboard .ydh-meta-row,.yingdu-home-dashboard .ydh-plan-item p,.yingdu-home-dashboard .ydh-empty,.yingdu-home-dashboard .ydh-summary-rows dt{color:var(--muted)}
.yingdu-home-dashboard .ydh-chips span{background:var(--paper);border-color:var(--line)}
.yingdu-home-dashboard .ydh-action,.yingdu-home-dashboard .ydh-brand-mark,.yingdu-home-dashboard .ydh-segmented button[aria-pressed=true],.yingdu-home-dashboard .ydh-sentence-filters button[aria-pressed=true],.yingdu-home-dashboard .ydh-live-message{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.yingdu-home-dashboard .ydh-action.ydh-secondary,.yingdu-home-dashboard .ydh-action.ydh-soft,.yingdu-home-dashboard .ydh-eyebrow,.yingdu-home-dashboard .ydh-text-button,.yingdu-home-dashboard .ydh-card-head h2 svg,.yingdu-home-dashboard .ydh-metric svg,.yingdu-home-dashboard .ydh-goal-row svg,.yingdu-home-dashboard .ydh-course-count strong,.yingdu-home-dashboard .ydh-mobile-tools button svg,.yingdu-home-dashboard .ydh-sentence-row button{color:var(--accent)}
.yingdu-home-dashboard .ydh-action.ydh-secondary{border-color:var(--control-line)}
.yingdu-home-dashboard .ydh-progress-track{background:var(--track)}
.yingdu-home-dashboard .ydh-progress-track span{background:var(--accent)}
.yingdu-home-dashboard .ydh-landing-study-panel{background:var(--showcase);color:var(--showcase-text);border:1px solid var(--showcase-line)}
.yingdu-home-dashboard .ydh-study-panel-badge{background:var(--video);border-color:var(--showcase-line);color:var(--showcase-text)}
.yingdu-home-dashboard .ydh-study-panel-badge span{background:var(--gold)}
.yingdu-home-dashboard .ydh-study-video-card{background:var(--video);border-color:var(--showcase-line)}
.yingdu-home-dashboard .ydh-study-video-head,.yingdu-home-dashboard .ydh-study-subtitle-line small{color:var(--showcase-muted)}
.yingdu-home-dashboard .ydh-study-subtitle-line{background:var(--subtitle);color:var(--showcase-text);border-left:3px solid transparent}
.yingdu-home-dashboard .ydh-study-subtitle-line.ydh-active{background:var(--active-subtitle);border-left-color:var(--gold)}
.yingdu-home-dashboard .ydh-study-play-button{background:var(--gold);color:var(--gold-text);border:1px solid var(--gold)}
.yingdu-home-dashboard .ydh-study-play-button:hover{outline-color:var(--gold)!important}
.yingdu-home-dashboard .ydh-preview-label:before{background:var(--accent)}
.yingdu-home-dashboard .ydh-trend-plot path:first-of-type{stroke:var(--line)}
.yingdu-home-dashboard .ydh-trend-plot path:nth-of-type(2){fill:var(--soft);opacity:1}
.yingdu-home-dashboard .ydh-trend-plot polyline,.yingdu-home-dashboard .ydh-trend-plot circle{stroke:var(--accent)}
.yingdu-home-dashboard .ydh-trend-plot circle{fill:var(--paper)}
.yingdu-home-dashboard .ydh-trend-plot text{fill:var(--muted)}
.yingdu-home-dashboard .ydh-trend-days span{color:var(--muted)}
.yingdu-home-dashboard .ydh-calendar-day,.yingdu-home-dashboard .ydh-legend i{background:var(--soft);color:var(--ink)}
.yingdu-home-dashboard .ydh-calendar-day{padding:0;min-width:0}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l1{background:var(--cal1);color:var(--cal1-ink)}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l2,.yingdu-home-dashboard .ydh-legend i:nth-of-type(2){background:var(--cal2);color:var(--cal2-ink)}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l3{background:var(--cal3);color:var(--cal3-ink)}
.yingdu-home-dashboard .ydh-calendar-day.ydh-l4,.yingdu-home-dashboard .ydh-legend i:nth-of-type(3){background:var(--cal4);color:var(--cal4-ink)}
.yingdu-home-dashboard .ydh-calendar-day.ydh-today{outline:2px solid var(--accent);outline-offset:1px}
.yingdu-home-dashboard .ydh-detail-panel{border:2px solid var(--control-line)}
.yingdu-home-dashboard .ydh-detail-header,.yingdu-home-dashboard .ydh-summary-rows div,.yingdu-home-dashboard details,.yingdu-home-dashboard .ydh-sentence-row,.yingdu-home-dashboard .ydh-plan-item{border-color:var(--line)}
.yingdu-home-dashboard .ydh-form-grid input,.yingdu-home-dashboard .ydh-form-grid select{background:var(--paper);color:var(--ink);border-color:var(--control-line);accent-color:var(--accent)}
.yingdu-home-dashboard .ydh-form-grid input::placeholder{color:var(--muted);opacity:1}
.yingdu-home-dashboard .ydh-form-error{color:var(--error)}
.yingdu-home-dashboard .ydh-mobile-nav a[aria-current=page]{background:var(--soft);color:var(--accent)}
.yingdu-home-dashboard .ydh-theme-control{display:flex;align-items:center;gap:6px;flex-shrink:0}
.yingdu-home-dashboard .ydh-theme-control select{border:1px solid var(--control-line);background:var(--paper);color:var(--ink);border-radius:8px;padding:5px 8px;font-size:12px;min-height:30px;max-width:140px;cursor:pointer}
.yingdu-home-dashboard .ydh-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.yingdu-home-dashboard .ydh-top-settings{display:flex;align-items:center;gap:15px}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-top-settings{gap:8px}
.yingdu-home-dashboard .ydh-top-settings .ydh-preview-label{font-size:9px}
.yingdu-home-dashboard .ydh-top-settings .ydh-wide-label{display:none}
.yingdu-home-dashboard .ydh-theme-control{gap:0}
.yingdu-home-dashboard .ydh-theme-control select{font-size:11px;padding:3px 4px;min-height:26px;max-width:90px}
.yingdu-home-dashboard .ydh-topbar .ydh-brand{font-size:13px}
.yingdu-home-dashboard .ydh-topbar{gap:4px}}
.yingdu-home-dashboard .ydh-cta-label{white-space:nowrap;letter-spacing:normal;word-spacing:normal}
.yingdu-home-dashboard .ydh-header-plan{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:5px 10px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font-size:12px;font-weight:650;white-space:nowrap}
.yingdu-home-dashboard .ydh-header-plan svg{width:15px;height:15px;color:var(--accent)}
.yingdu-home-dashboard .ydh-plan-short-label{display:none}
.yingdu-home-dashboard .ydh-top-settings{gap:10px}
.yingdu-home-dashboard .ydh-detail-panel{border-width:1px}
.yingdu-home-dashboard .ydh-study-video-card{border-color:var(--showcase-line)}
.yingdu-home-dashboard .ydh-action.ydh-secondary{border-color:var(--line)}
.yingdu-home-dashboard .ydh-plan-manager-actions{display:flex;gap:10px;flex-wrap:wrap}
.yingdu-home-dashboard .ydh-course-progress-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 0;border-bottom:1px solid var(--line)}
.yingdu-home-dashboard .ydh-course-progress-row h3{font-size:15px;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-course-progress-row p{font-size:12px;color:var(--muted)}
.yingdu-home-dashboard .ydh-form-grid{grid-template-columns:minmax(0,1fr)}
.yingdu-home-dashboard .ydh-form-row{grid-template-columns:repeat(2,minmax(0,1fr))}
.yingdu-home-dashboard .ydh-form-grid label,.yingdu-home-dashboard .ydh-form-grid input,.yingdu-home-dashboard .ydh-form-grid select,.yingdu-home-dashboard .ydh-form-row,.yingdu-home-dashboard .ydh-check-row{min-width:0}
.yingdu-home-dashboard .ydh-check-row label{max-width:100%;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-check-row input{flex:0 0 17px}
@media(max-width:480px){.yingdu-home-dashboard .ydh-form-row{grid-template-columns:minmax(0,1fr)}}
@media(max-width:1100px){.yingdu-home-dashboard .ydh-top-settings .ydh-preview-label{display:none}}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-header-plan{font-size:11px;min-height:26px;padding:3px 7px;gap:4px}
.yingdu-home-dashboard .ydh-header-plan svg{width:14px;height:14px}
.yingdu-home-dashboard .ydh-plan-full-label{display:none}
.yingdu-home-dashboard .ydh-plan-short-label{display:inline}
.yingdu-home-dashboard .ydh-top-settings{gap:7px}
.yingdu-home-dashboard .ydh-hero-copy>.ydh-action{font-size:11px;padding:7px 9px}}



@media(forced-colors:active){.yingdu-home-dashboard .ydh-card,.yingdu-home-dashboard .ydh-action,.yingdu-home-dashboard .ydh-detail-panel,.yingdu-home-dashboard .ydh-calendar-day,.yingdu-home-dashboard .ydh-progress-track{border:1px solid CanvasText}
.yingdu-home-dashboard .ydh-progress-track span{background:Highlight}
.yingdu-home-dashboard .ydh-trend-plot polyline,.yingdu-home-dashboard .ydh-trend-plot circle{stroke:Highlight}
.yingdu-home-dashboard .ydh-calendar-day.ydh-today{outline-color:Highlight}}




/* Integration: keep natural content height; no viewport cropping or tiny landscape text. */
body.ydh-home-active { padding-bottom:0; }
.yingdu-home-dashboard { min-height:100svh; line-height:1.45; }
.yingdu-home-dashboard .ydh-page { height:auto; min-height:100svh; grid-template-rows:32px minmax(256px,1.05fr) minmax(170px,.8fr) 84px minmax(230px,auto); }
.yingdu-home-dashboard .ydh-topbar { min-width:0; }
.yingdu-home-dashboard .ydh-resume-empty { display:grid; align-content:center; justify-items:start; gap:12px; text-align:left; flex:1; padding:0; font-size:14px; }
.yingdu-home-dashboard .ydh-cover-placeholder { display:grid; place-items:center; background:var(--soft); color:var(--accent); flex-shrink:0; }
.yingdu-home-dashboard .ydh-trend-empty { flex:1; display:grid; place-items:center; min-height:65px; padding:10px; }
.yingdu-home-dashboard .ydh-account-trend { display:block; width:100%; height:90px; flex:1; min-height:65px; max-height:110px; color:var(--accent); }
.yingdu-home-dashboard .ydh-detail-panel { z-index:500; }
.yingdu-home-dashboard .ydh-detail-body { overflow-wrap:anywhere; }
.yingdu-home-dashboard .ydh-detail-body .ydh-trend-body { min-height:210px; }
.yingdu-home-dashboard .ydh-detail-body .ydh-goal-rows { margin-bottom:20px; }
.yingdu-home-dashboard fieldset { margin:0; padding:10px; border:1px solid var(--line); border-radius:8px; min-width:0; }
.yingdu-home-dashboard legend { font-size:13px; padding:0 5px; }
.yingdu-home-dashboard .ydh-course-choices { max-height:220px; overflow:auto; overscroll-behavior:contain; }
.yingdu-home-dashboard .ydh-plan-item { margin-top:14px; }
.yingdu-home-dashboard .ydh-quote { overflow-wrap:anywhere; }
.yingdu-home-dashboard .ydh-top-settings { gap:10px; }
.yingdu-home-dashboard .ydh-course-progress-row > div { min-width:0; }
.yingdu-home-dashboard .ydh-continue-actions { flex-wrap:wrap; }
.yingdu-home-dashboard .ydh-goal-summary strong { overflow-wrap:anywhere; }
@media(min-width:1001px) and (max-width:1100px) and (orientation:landscape) and (min-height:601px) {
 .yingdu-home-dashboard .ydh-page { grid-template-rows:32px minmax(256px,1fr) minmax(185px,.8fr) 90px minmax(260px,auto); }
 .yingdu-home-dashboard .ydh-primary-row { grid-template-columns:1.1fr 1fr; }
 .yingdu-home-dashboard .ydh-metric small { font-size:11px; white-space:normal; }
 .yingdu-home-dashboard .ydh-calendar-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
 .yingdu-home-dashboard .ydh-text-button { font-size:12px; }
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action { font-size:12px; }
}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px) {
 .yingdu-home-dashboard .ydh-page { height:auto; min-height:100svh; padding:8px 10px 0; gap:8px; grid-template-columns:minmax(0,1fr); grid-template-rows:34px minmax(185px,auto) minmax(132px,auto) 98px 80px minmax(100px,auto) 52px calc(58px + env(safe-area-inset-bottom)); }
 .yingdu-home-dashboard .ydh-bottom-panels { display:block; }
 .yingdu-home-dashboard .ydh-goals-panel { display:flex; }
 .yingdu-home-dashboard .ydh-hero { padding:10px 12px; grid-template-rows:minmax(90px,1fr) auto; }
 .yingdu-home-dashboard .ydh-hero h1 { font-size:25px; }
 .yingdu-home-dashboard .ydh-hero-desc { display:block; font-size:12px; }
 .yingdu-home-dashboard .ydh-hero-copy { grid-template-columns:minmax(0,1fr) auto; }
 .yingdu-home-dashboard .ydh-hero-copy>.ydh-action { font-size:12px; padding:7px 9px; min-height:42px; }
 .yingdu-home-dashboard .ydh-study-panel-badge { display:flex; }
 .yingdu-home-dashboard .ydh-study-video-head { display:flex; }
 .yingdu-home-dashboard .ydh-study-subtitle-line strong { font-size:14px; }
 .yingdu-home-dashboard .ydh-study-subtitle-line small { display:block; font-size:11px; }
 .yingdu-home-dashboard .ydh-topbar .ydh-brand { font-size:13px; gap:5px; }
 .yingdu-home-dashboard .ydh-top-settings { gap:6px; }
 .yingdu-home-dashboard .ydh-theme-control select { font-size:12px; min-height:32px; max-width:93px; }
 .yingdu-home-dashboard .ydh-header-plan { font-size:12px; min-height:32px; padding:4px 6px; }
 .yingdu-home-dashboard .ydh-card-head h2 { font-size:13px; }
 .yingdu-home-dashboard .ydh-text-button { font-size:12px; }
 .yingdu-home-dashboard .ydh-metric small { font-size:11px; }
 .yingdu-home-dashboard .ydh-metric strong span { font-size:11px; }
 .yingdu-home-dashboard .ydh-metric strong { font-size:24px; }
 .yingdu-home-dashboard .ydh-stats-heading h2 { font-size:12px; }
 .yingdu-home-dashboard .ydh-stats-heading small { font-size:11px; }
 .yingdu-home-dashboard .ydh-course-count span { font-size:11px; }
 .yingdu-home-dashboard .ydh-course-count strong { font-size:21px; }
 .yingdu-home-dashboard .ydh-continue-card .ydh-meta-row { display:flex; font-size:11px; line-height:1.4; flex-wrap:wrap; gap:2px; }
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action { min-height:34px; font-size:12px; padding:6px 8px; }
 .yingdu-home-dashboard .ydh-progress-label { font-size:11px; }
 .yingdu-home-dashboard .ydh-cover { width:64px; min-height:72px; }
 .yingdu-home-dashboard .ydh-resume-empty { gap:8px; font-size:13px; }
 .yingdu-home-dashboard .ydh-resume-empty .ydh-action { min-height:34px; padding:6px 12px; font-size:12px; }
 .yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary,.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row b { font-size:11px; }
 .yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary strong { font-size:12px; }
 .yingdu-home-dashboard .ydh-mobile-tools button,.yingdu-home-dashboard .ydh-mobile-nav a { font-size:11px; min-height:44px; }
 .yingdu-home-dashboard .ydh-mobile-nav { position:sticky; bottom:0; z-index:5; }
 .yingdu-home-dashboard .ydh-detail-body .ydh-goal-row { grid-template-columns:76px minmax(0,1fr) auto; }
}
@media(max-width:360px) {
 .yingdu-home-dashboard .ydh-hero-copy { grid-template-columns:minmax(0,1fr); }
 .yingdu-home-dashboard .ydh-hero-copy>.ydh-action { grid-column:1; grid-row:3; justify-self:stretch; }
 .yingdu-home-dashboard .ydh-hero-desc { grid-row:2; }
 .yingdu-home-dashboard .ydh-topbar .ydh-brand-mark { display:none; }
 .yingdu-home-dashboard .ydh-topbar .ydh-brand { font-size:12px; }
}
@media(orientation:landscape) and (max-height:650px) and (min-width:1101px), (orientation:landscape) and (min-height:601px) and (max-height:650px) and (min-width:1001px) {
 .yingdu-home-dashboard .ydh-page { grid-template-rows:34px minmax(256px,auto) minmax(180px,auto) 90px minmax(260px,auto); }
 .yingdu-home-dashboard .ydh-detail-panel { inset:12px 12px auto auto; max-height:calc(100svh - 24px); }
}
/* Plan panel only: the approved homepage and other detail panels keep their styles. */
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"]{overflow:hidden}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-detail-body{scrollbar-gutter:stable}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-footer{display:flex;flex-shrink:0;flex-wrap:wrap;gap:8px;padding:14px 20px;border-top:1px solid var(--line);background:var(--paper)}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-footer .ydh-action{margin:0;min-height:40px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-intro{margin:0 0 8px;color:var(--muted);font-size:13px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-sync{color:var(--accent);font-size:12px;line-height:1.6;margin:0 0 14px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-section-title{font-size:14px;margin:16px 0 8px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-item{margin:0 0 10px;padding:14px;background:var(--paper)}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-heading{display:flex;justify-content:space-between;align-items:start;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-heading h3{font-size:16px;margin:0;min-width:0;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-state{background:var(--soft);color:var(--accent);border:1px solid var(--line);border-radius:6px;padding:3px 7px;font-size:12px;flex-shrink:0}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-facts{display:grid;gap:8px;margin:0;font-size:13px;line-height:1.6}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-facts>div{display:grid;grid-template-columns:64px minmax(0,1fr);gap:10px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-facts dt{color:var(--muted)}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-facts dd{margin:0;color:var(--ink);overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-today{margin:12px 0 0;color:var(--accent);font-size:13px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-actions{align-items:center}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-actions button{min-height:36px;border:1px solid var(--line);color:var(--accent)}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-actions .ydh-plan-end{margin-left:auto;background:transparent;color:var(--muted);border-color:transparent}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-goal-note{margin:14px 0;color:var(--muted);font-size:12px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-empty{padding:16px 0}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-empty p{color:var(--muted)}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-history,.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-more{border:1px solid var(--line);border-radius:10px;padding:12px;margin:10px 0}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] summary{cursor:pointer;font-size:14px;font-weight:650;color:var(--ink);padding:3px 0;min-height:28px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] details[open]>summary{margin-bottom:12px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-history>.ydh-plan-item:last-child{margin-bottom:0}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-form-grid{margin-top:12px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-goal-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] legend{font-size:14px;color:var(--ink);margin-bottom:10px;font-weight:650}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-more label{margin-top:12px}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-form-error:empty{display:none}
.yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-action:disabled{cursor:wait}
@media(max-width:480px){
 .yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-footer{padding:12px 16px}
 .yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-footer .ydh-action{flex:1 1 auto}
 .yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-goal-fields{grid-template-columns:minmax(0,1fr)}
 .yingdu-home-dashboard .ydh-detail-panel[data-plan-panel="true"] .ydh-plan-facts>div{grid-template-columns:minmax(0,1fr);gap:2px}
}
/* Final homepage polish: selectors stay inside the mounted homepage. */
.yingdu-home-dashboard .ydh-preview-label[hidden],.yingdu-home-dashboard .ydh-theme-menu[hidden]{display:none!important}
.yingdu-home-dashboard .ydh-theme-control{position:relative}
.yingdu-home-dashboard .ydh-theme-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--control-line);background:var(--paper);color:var(--ink);border-radius:8px;padding:5px 8px;font:inherit;font-size:12px;min-height:30px;cursor:pointer;white-space:nowrap}
.yingdu-home-dashboard .ydh-theme-menu{position:absolute;right:0;top:calc(100% + 6px);width:136px;max-width:calc(100vw - 24px);overflow:auto;display:grid;gap:2px;padding:5px;background:var(--paper);color:var(--ink);border:1px solid var(--control-line);border-radius:10px;z-index:700;box-shadow:none;overscroll-behavior:contain}
.yingdu-home-dashboard .ydh-theme-menu[data-side="above"]{top:auto;bottom:calc(100% + 6px)}
.yingdu-home-dashboard .ydh-theme-menu button{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;min-height:36px;background:var(--paper);color:var(--ink);font:inherit;font-size:13px;text-align:left;border-radius:6px;cursor:pointer;white-space:nowrap}
.yingdu-home-dashboard .ydh-theme-menu button[aria-selected="true"],.yingdu-home-dashboard .ydh-theme-menu button:hover{background:var(--soft);color:var(--accent)}
.yingdu-home-dashboard .ydh-theme-menu .ydh-theme-check{visibility:hidden}
.yingdu-home-dashboard .ydh-theme-menu [aria-selected="true"] .ydh-theme-check{visibility:visible}
.yingdu-home-dashboard .ydh-theme-menu button:focus-visible,.yingdu-home-dashboard .ydh-theme-trigger:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.yingdu-home-dashboard .ydh-hero-desc{text-wrap:pretty}
.yingdu-home-dashboard .ydh-plan-secondary{display:flex;align-items:center;gap:8px 14px;flex-wrap:wrap;margin:14px 0}
.yingdu-home-dashboard .ydh-plan-secondary button{font-size:12px;min-height:32px}
.yingdu-home-dashboard #ydh-saveFeedback{font-size:12px;color:var(--accent);align-self:center}
.yingdu-home-dashboard .ydh-plan-footer [data-action="reset-defaults"]{font-size:12px;min-height:36px}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"]{overflow:hidden;min-width:0}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"] .ydh-detail-header{padding:12px 16px}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"] .ydh-detail-header h2{font-size:16px}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"] .ydh-detail-body{padding:16px}
.yingdu-home-dashboard .ydh-record-title{font-size:16px!important;margin:0 0 14px;overflow-wrap:anywhere}
.yingdu-home-dashboard .ydh-record-progress{display:grid;grid-template-columns:1fr auto;gap:8px;font-size:13px}
.yingdu-home-dashboard .ydh-record-progress .ydh-progress-track{grid-column:1/-1;height:4px}
.yingdu-home-dashboard .ydh-record-footer{padding:0 16px 16px;flex-shrink:0;background:var(--paper)}
.yingdu-home-dashboard .ydh-record-footer .ydh-action{margin:0;min-height:40px}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"] .ydh-summary-rows{margin:14px 0 0}
.yingdu-home-dashboard .ydh-detail-panel[data-record-panel="true"] .ydh-summary-rows>div{grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:10px 0;font-size:13px}
@media(max-width:1000px), (max-width:1100px) and (orientation:portrait), (max-width:1100px) and (max-height:600px){.yingdu-home-dashboard .ydh-theme-trigger{min-height:32px;padding:4px 6px;gap:5px;font-size:12px}}

/* Tablet portrait / split view: the mobile information order, sized for available width.
   The existing <=700px phone rules and roomy desktop rules remain unchanged.
   Content owns card heights; tall portrait spacing is bounded below. */
@media (min-width:701px) and (max-width:1000px),
       (min-width:701px) and (max-width:1100px) and (orientation:portrait),
       (min-width:701px) and (max-width:1100px) and (max-height:600px) {
 .yingdu-home-dashboard .ydh-page { display:flex; flex-direction:column; height:auto; min-height:100svh; padding:16px 24px 0; gap:12px; }
 .yingdu-home-dashboard .ydh-page>* { flex-shrink:0; }
 .yingdu-home-dashboard .ydh-topbar { min-height:40px; }
 .yingdu-home-dashboard .ydh-topbar .ydh-brand { font-size:16px; gap:8px; }
 .yingdu-home-dashboard .ydh-header-plan,.yingdu-home-dashboard .ydh-theme-trigger { min-height:40px; font-size:13px; padding:6px 10px; }
 .yingdu-home-dashboard .ydh-top-settings { gap:8px; }
 .yingdu-home-dashboard .ydh-primary-row { display:contents; }
 .yingdu-home-dashboard .ydh-hero { grid-template-rows:auto auto; padding:16px 20px; gap:12px; }
 .yingdu-home-dashboard .ydh-hero-copy { gap:4px 16px; }
 .yingdu-home-dashboard .ydh-hero h1 { font-size:34px; }
 .yingdu-home-dashboard .ydh-hero-desc { font-size:14px; }
 .yingdu-home-dashboard .ydh-hero-copy>.ydh-action { min-height:44px; padding:9px 15px; font-size:14px; }
 .yingdu-home-dashboard .ydh-landing-study-panel { align-self:start; height:auto; min-height:0; padding:18px 20px; gap:8px; }
 .yingdu-home-dashboard .ydh-study-panel-badge { font-size:10px; padding:5px 8px; }
 .yingdu-home-dashboard .ydh-study-video-card { padding:10px; gap:6px; }
 .yingdu-home-dashboard .ydh-study-video-head { font-size:11px; }
 .yingdu-home-dashboard .ydh-study-subtitle-line { padding:8px 10px; }
 .yingdu-home-dashboard .ydh-study-subtitle-line strong { font-size:16px; }
 .yingdu-home-dashboard .ydh-study-subtitle-line small { font-size:12px; }
 .yingdu-home-dashboard .ydh-study-play-button { width:39px; height:39px; right:16px; bottom:12px; }
 .yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card { padding:14px 18px; gap:10px; }
 .yingdu-home-dashboard .ydh-card-head h2,.yingdu-home-dashboard .ydh-overview-card .ydh-card-head h2 { font-size:16px; }
 .yingdu-home-dashboard .ydh-text-button { font-size:13px; }
 .yingdu-home-dashboard .ydh-status-badge { font-size:12px; }
 .yingdu-home-dashboard .ydh-continue-content { flex:none; gap:16px; }
 .yingdu-home-dashboard .ydh-cover { width:104px; height:96px; min-height:0; max-height:none; flex-shrink:0; }
 .yingdu-home-dashboard .ydh-course-name { font-size:17px; }
 .yingdu-home-dashboard .ydh-continue-info { gap:8px; }
 .yingdu-home-dashboard .ydh-continue-card .ydh-meta-row { font-size:12px; line-height:1.4; }
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action { flex:0 1 auto; min-width:120px; min-height:38px; font-size:13px; }
 .yingdu-home-dashboard .ydh-progress-label { font-size:12px; }
 .yingdu-home-dashboard .ydh-metrics { flex:none; }
 .yingdu-home-dashboard .ydh-metric { min-height:64px; gap:6px; }
 .yingdu-home-dashboard .ydh-metric strong { font-size:28px; }
 .yingdu-home-dashboard .ydh-metric strong span,.yingdu-home-dashboard .ydh-metric small { font-size:13px; }
 .yingdu-home-dashboard .ydh-course-stats { padding:12px 18px; gap:8px; grid-template-rows:auto auto; }
 .yingdu-home-dashboard .ydh-stats-heading h2 { font-size:15px; }
 .yingdu-home-dashboard .ydh-stats-heading small { font-size:12px; }
 .yingdu-home-dashboard .ydh-course-count { min-height:40px; gap:8px; }
 .yingdu-home-dashboard .ydh-course-count strong { font-size:24px; }
 .yingdu-home-dashboard .ydh-course-count span { font-size:13px; }
 .yingdu-home-dashboard .ydh-goals-panel { height:auto; padding:14px 18px; gap:10px; }
 .yingdu-home-dashboard .ydh-goals-panel .ydh-goal-rows { flex:none; }
 .yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary,.yingdu-home-dashboard .ydh-goals-panel .ydh-goal-row b { font-size:13px; }
 .yingdu-home-dashboard .ydh-goals-panel .ydh-goal-summary strong { font-size:14px; }
 .yingdu-home-dashboard .ydh-mobile-tools { min-height:56px; }
 .yingdu-home-dashboard .ydh-mobile-tools button,.yingdu-home-dashboard .ydh-mobile-nav a { min-height:48px; font-size:13px; }
 .yingdu-home-dashboard .ydh-mobile-nav { margin: auto -24px 0; position:sticky; bottom:0; }
 .yingdu-home-dashboard .ydh-detail-panel { inset:auto 16px calc(72px + env(safe-area-inset-bottom)) auto; width:min(540px,calc(100vw - 32px)); max-height:calc(100svh - 136px); }
}

/* Roomy tablet portrait: distribute useful space, never stretch grid rows.
   At smaller/keyboard-reduced heights the compact rules above take over.
   Each increment is capped; larger text and longer content can scroll naturally. */
@media (min-width:701px) and (max-width:1100px) and (min-height:1000px) and (orientation:portrait) {
 .yingdu-home-dashboard .ydh-page { --ydh-air:clamp(0px,calc((100svh - 1024px) / 19),24px); gap:calc(12px + var(--ydh-air) * .35); }
 .yingdu-home-dashboard .ydh-hero { padding-block:calc(16px + var(--ydh-air) * .5); gap:calc(12px + var(--ydh-air) * .3); }
 .yingdu-home-dashboard .ydh-hero h1 { font-size:calc(34px + var(--ydh-air) * .2); }
 .yingdu-home-dashboard .ydh-hero-desc { font-size:calc(14px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-landing-study-panel { padding-block:calc(18px + var(--ydh-air) * .4); }
 .yingdu-home-dashboard .ydh-study-video-card { padding:calc(10px + var(--ydh-air) * .3); }
 .yingdu-home-dashboard .ydh-study-video-head { font-size:calc(11px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-study-subtitle-line { padding-block:calc(8px + var(--ydh-air) * .3); }
 .yingdu-home-dashboard .ydh-study-subtitle-line strong { font-size:calc(16px + var(--ydh-air) * .15); }
 .yingdu-home-dashboard .ydh-study-subtitle-line small { font-size:calc(12px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card { padding-block:calc(14px + var(--ydh-air) * .4); gap:calc(10px + var(--ydh-air) * .2); }
 .yingdu-home-dashboard .ydh-card-head h2,.yingdu-home-dashboard .ydh-overview-card .ydh-card-head h2 { font-size:calc(16px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-cover { height:calc(96px + var(--ydh-air) * 3); width:calc(104px + var(--ydh-air) * 3.25); object-fit:cover; }
 .yingdu-home-dashboard .ydh-course-name { font-size:calc(17px + var(--ydh-air) * .15); }
 .yingdu-home-dashboard .ydh-continue-info { gap:calc(8px + var(--ydh-air) * .15); }
 .yingdu-home-dashboard .ydh-continue-card .ydh-meta-row { font-size:calc(12px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action { min-height:calc(38px + var(--ydh-air) * .3); font-size:calc(13px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-metric { padding-block:calc(8px + var(--ydh-air) * .4); }
 .yingdu-home-dashboard .ydh-metric strong { font-size:calc(28px + var(--ydh-air) * .3); }
 .yingdu-home-dashboard .ydh-metric small,.yingdu-home-dashboard .ydh-course-count span { font-size:calc(13px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-course-stats { padding-block:calc(12px + var(--ydh-air) * .4); }
 .yingdu-home-dashboard .ydh-course-count { min-height:calc(40px + var(--ydh-air) * .6); }
 .yingdu-home-dashboard .ydh-course-count strong { font-size:calc(24px + var(--ydh-air) * .2); }
 .yingdu-home-dashboard #ydh-goalPanel { padding-block:calc(14px + var(--ydh-air) * .4); gap:calc(10px + var(--ydh-air) * .4); }
 .yingdu-home-dashboard .ydh-goal-summary,.yingdu-home-dashboard .ydh-goal-row b { font-size:calc(13px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-goal-summary strong { font-size:calc(14px + var(--ydh-air) * .1); }
 .yingdu-home-dashboard .ydh-mobile-tools { min-height:calc(56px + var(--ydh-air) * .4); }
 .yingdu-home-dashboard .ydh-mobile-nav a { min-height:calc(48px + var(--ydh-air) * .2); }
}

/* Mobile visible-height budget, including browser chrome and the bottom safe area.
   Keep all real controls; decorative preview chrome shrinks on short phones. */
@media (max-width:700px) {
 .yingdu-home-dashboard .ydh-page {height:100dvh;min-height:0;padding:6px 9px 0;gap:6px;grid-template-rows:32px minmax(116px,1.3fr) minmax(116px,1fr) minmax(66px,.55fr) 66px 80px 44px calc(50px + env(safe-area-inset-bottom));}
 .yingdu-home-dashboard .ydh-hero {padding:8px 10px;gap:6px;grid-template-rows:minmax(0,1fr) auto;}
 .yingdu-home-dashboard .ydh-hero h1 {font-size:22px;}
 .yingdu-home-dashboard .ydh-landing-study-panel {padding:6px 8px;gap:3px;}
 .yingdu-home-dashboard .ydh-study-video-card {padding:4px 6px;gap:2px;}
 .yingdu-home-dashboard .ydh-study-subtitle-line {padding:3px 6px;}
 .yingdu-home-dashboard .ydh-continue-card {padding:8px 10px;gap:4px;}
 .yingdu-home-dashboard .ydh-cover {height:66px;min-height:0;}
 .yingdu-home-dashboard .ydh-overview-card,.yingdu-home-dashboard .ydh-course-stats {padding:6px 10px;gap:2px;}
 .yingdu-home-dashboard .ydh-goals-panel {padding:7px 10px;gap:3px;}
 .yingdu-home-dashboard .ydh-course-count {display:flex;justify-content:center;min-height:0;}
 .yingdu-home-dashboard .ydh-course-count span {white-space:nowrap;font-size:10px;}
 .yingdu-home-dashboard .ydh-mobile-nav {margin:0 -9px;}
 .yingdu-home-dashboard .ydh-mobile-tools button {min-height:40px;gap:3px;}
}
@media (min-width:701px) and (max-width:1100px) and (orientation:portrait) {
 .yingdu-home-dashboard .ydh-page {min-height:100dvh;padding-top:10px;gap:8px;}
 .yingdu-home-dashboard .ydh-hero {padding-block:12px;gap:8px;}
 .yingdu-home-dashboard .ydh-landing-study-panel {padding-block:12px;}
 .yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card {padding-block:10px;}
}
@media (max-width:700px) and (max-height:700px) {
 .yingdu-home-dashboard .ydh-page {gap:4px;padding-top:4px;grid-template-rows:32px minmax(98px,1fr) 116px 66px 66px 80px 44px calc(50px + env(safe-area-inset-bottom));}
 .yingdu-home-dashboard .ydh-study-panel-badge,.yingdu-home-dashboard .ydh-study-video-head {display:none;}
 .yingdu-home-dashboard .ydh-hero {padding:5px 8px;gap:4px;}
 .yingdu-home-dashboard .ydh-hero h1 {font-size:20px;}
 .yingdu-home-dashboard .ydh-hero-copy>.ydh-action {min-height:36px;padding:5px 8px;}
 .yingdu-home-dashboard .ydh-metric strong {font-size:20px;}
}
@media (max-width:700px) and (max-height:600px) {
 /* Accessibility/keyboard fallback: scrolling is preferable to hidden controls. */
 .yingdu-home-dashboard .ydh-page {height:auto;min-height:100dvh;}
 .yingdu-home-dashboard .ydh-mobile-nav {position:sticky;bottom:0;}
}

/* Browser chrome can reduce a portrait tablet below 1024 CSS pixels.
   Keep every functional card and navigation item in its own visible row. */
@media (min-width:701px) and (max-width:1100px) and (orientation:portrait) and (max-height:1000px) {
 .yingdu-home-dashboard .ydh-page {display:grid;height:100dvh;min-height:0;padding:8px 16px 0;gap:6px;grid-template-rows:40px minmax(170px,1fr) 150px 100px 80px 110px 48px calc(58px + env(safe-area-inset-bottom));}
 .yingdu-home-dashboard .ydh-hero {padding:8px 12px;gap:5px;grid-template-rows:minmax(0,1fr) auto;}
 .yingdu-home-dashboard .ydh-landing-study-panel {height:100%;padding:6px 12px;gap:3px;}
 .yingdu-home-dashboard .ydh-study-panel-badge {padding:3px 6px;}
 .yingdu-home-dashboard .ydh-study-video-card {padding:5px 8px;gap:3px;}
 .yingdu-home-dashboard .ydh-study-subtitle-line {padding:4px 8px;}
 .yingdu-home-dashboard .ydh-hero h1 {font-size:28px;}
 .yingdu-home-dashboard .ydh-hero-copy>.ydh-action {min-height:38px;padding:6px 12px;}
 .yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card {padding:8px 14px;gap:5px;}
 .yingdu-home-dashboard .ydh-cover {height:80px;}
 .yingdu-home-dashboard .ydh-continue-info {gap:4px;}
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action {min-height:34px;padding:5px 10px;}
 .yingdu-home-dashboard .ydh-metric {min-height:54px;padding:4px;gap:4px;}
 .yingdu-home-dashboard .ydh-course-stats {padding:6px 14px;gap:4px;}
 .yingdu-home-dashboard .ydh-course-count {min-height:30px;}
 .yingdu-home-dashboard .ydh-goals-panel {height:100%;padding:8px 14px;gap:6px;}
 .yingdu-home-dashboard .ydh-mobile-tools {min-height:48px;}
 .yingdu-home-dashboard .ydh-mobile-nav {margin:0 -16px;position:static;}
}
/* Desktop layout on landscape tablets: compact spacing, full functional panels. */
@media (min-width:1001px) and (orientation:landscape) and (min-height:700px) and (max-height:900px) {
 .yingdu-home-dashboard .ydh-page {height:100dvh;min-height:0;padding:10px 14px;gap:8px;grid-template-rows:32px minmax(164px,1fr) minmax(156px,.9fr) 72px minmax(200px,1.1fr);}
 .yingdu-home-dashboard .ydh-hero {padding:10px 18px;gap:16px;}
 .yingdu-home-dashboard .ydh-hero h1 {font-size:34px;}
 .yingdu-home-dashboard .ydh-hero-copy {gap:6px;}
 .yingdu-home-dashboard .ydh-landing-study-panel {padding:8px 12px;gap:5px;}
 .yingdu-home-dashboard .ydh-study-panel-badge {display:none;}
 .yingdu-home-dashboard .ydh-study-video-card {padding:6px 8px;gap:4px;}
 .yingdu-home-dashboard .ydh-study-subtitle-line {padding:5px 8px;}
 .yingdu-home-dashboard .ydh-continue-card,.yingdu-home-dashboard .ydh-overview-card {padding:8px 12px;gap:6px;}
 .yingdu-home-dashboard .ydh-continue-info {gap:4px;}
 .yingdu-home-dashboard .ydh-cover {min-height:0;max-height:90px;}
 .yingdu-home-dashboard .ydh-continue-actions .ydh-action {min-height:32px;padding:5px 7px;}
 .yingdu-home-dashboard .ydh-course-stats {padding:8px 14px;}
 .yingdu-home-dashboard .ydh-bottom-panels {gap:8px;}
 .yingdu-home-dashboard .ydh-panel {padding:8px 10px;gap:5px;}
 .yingdu-home-dashboard .ydh-card-head h2 {font-size:14px;}
 .yingdu-home-dashboard .ydh-text-button {padding:4px 2px;}
 .yingdu-home-dashboard .ydh-calendar-grid {grid-template-columns:repeat(10,minmax(0,1fr));gap:3px;}
 .yingdu-home-dashboard .ydh-calendar-day {min-height:20px;}
 .yingdu-home-dashboard .ydh-goal-rows {gap:5px;}
 .yingdu-home-dashboard .ydh-goal-row {gap:4px 8px;}
}

:root {
  --bg: #f5f6f3;
  --paper: #ffffff;
  --paper-soft: #fbfbf8;
  --line: #dedfd8;
  --line-strong: #c4c9bd;
  --text: #20231f;
  --muted: #687064;
  --soft: #edf2ea;
  --accent: #2f6f5e;
  --accent-soft: #e2eee8;
  --accent-strong: #235849;
  --mark: #f7e9a1;
  --shadow: 0 12px 36px rgba(32, 35, 31, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (max-width: 859px) {
  .marketing-page {
    min-height: 100dvh;
    padding-bottom: 82px;
    background:
      radial-gradient(circle at 20% 0%, rgba(224, 230, 202, 0.72), transparent 36%),
      linear-gradient(180deg, #fffdf5 0%, #f4f5ef 100%);
  }

  .marketing-page .site-nav {
    display: none;
  }

  .landing-shell,
  .profile-shell,
  .library-shell {
    width: min(100% - 24px, 520px);
  }

  .landing-shell {
    padding: 12px 0 16px;
  }

  .mobile-home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 2px 4px 10px;
  }

  .mobile-home-topbar strong {
    font-size: 17px;
  }

  .mobile-profile-shortcut {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--accent);
  }

  .mobile-profile-shortcut svg {
    width: 19px;
    height: 19px;
  }

  .landing-hero {
    display: block;
    min-height: 0;
    border-radius: 22px;
    padding: 20px 18px 14px;
  }

  .landing-hero-copy {
    max-width: none;
    padding: 0;
  }

  .landing-eyebrow {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .landing-hero h1 {
    margin-bottom: 8px;
    font-size: clamp(29px, 8vw, 38px);
  }

  .landing-hero p {
    max-width: 25em;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.75;
  }

  .landing-cta {
    min-height: 42px;
    padding: 0 18px;
    font-size: 14px;
  }

  .landing-hero-art {
    display: block;
    min-height: 0;
    margin-top: -8px;
  }

  .landing-hero-art img {
    width: 100%;
    max-height: 145px;
    object-fit: contain;
    object-position: center;
  }

  .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .landing-feature-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    min-height: 74px;
    border-radius: 16px;
    padding: 10px;
  }

  .landing-feature-card img {
    width: 40px;
    height: 40px;
  }

  .landing-feature-card h2 {
    margin-bottom: 2px;
    font-size: 14px;
  }

  .landing-feature-card p {
    font-size: 11px;
    line-height: 1.35;
  }

  .app-mobile-tabbar {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: min(420px, calc(100vw - 24px));
    margin: 0 auto;
    border: 1px solid rgba(47, 111, 94, 0.11);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 16px 36px rgba(32, 35, 31, 0.13);
    backdrop-filter: blur(14px);
  }

  .app-mobile-tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    border-radius: 14px;
    padding: 5px 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.15;
  }

  .app-mobile-tabbar a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
  }

  .app-mobile-tabbar svg {
    width: 19px;
    height: 19px;
  }

  .library-page .home-shell {
    padding-bottom: 18px;
  }

  .library-masthead {
    padding-top: 10px;
  }

  .library-masthead h1 {
    font-size: 27px;
  }

  .library-masthead .tagline {
    font-size: 13px;
  }

  .profile-shell {
    padding: 14px 0 18px;
  }

  .profile-topbar {
    min-height: 48px;
    margin-bottom: 10px;
  }

  .profile-topbar h1 {
    font-size: 22px;
  }

  .profile-user-card,
  .profile-membership-card {
    padding: 14px;
  }

  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 19px;
  }

  .profile-menu-item {
    min-height: 52px;
    padding: 10px 14px;
  }
}

@media (max-width: 390px) {
  .landing-hero {
    padding: 17px 15px 12px;
  }

  .landing-hero p {
    font-size: 13px;
  }

  .landing-hero-art img {
    max-height: 125px;
  }

  .landing-feature-card {
    min-height: 68px;
  }
}

body[data-theme="comfort"] {
  --bg: #f3f4df;
  --paper: #fffdf2;
  --paper-soft: #faf7e8;
  --soft: #e8efd9;
  --line: #d8d7bd;
}

body[data-theme="warm"] {
  --bg: #f8f1df;
  --paper: #fffaf0;
  --paper-soft: #fff4dd;
  --soft: #f2e5c8;
  --line: #dfcfb1;
  --mark: #ead088;
}

body[data-theme="dark"] {
  --bg: #171b19;
  --paper: #202622;
  --paper-soft: #252d28;
  --line: #3a443e;
  --line-strong: #59645e;
  --text: #edf1ec;
  --muted: #a7b0a9;
  --soft: #2d3832;
  --accent-soft: #244237;
  --mark: #5f5224;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
}

body[data-highlight="yellow"] {
  --word-highlight: rgba(247, 233, 161, 0.7);
}

body[data-highlight="green"] {
  --word-highlight: rgba(194, 230, 203, 0.72);
}

body[data-highlight="pink"] {
  --word-highlight: rgba(247, 207, 222, 0.72);
}

body[data-highlight="orange"] {
  --word-highlight: rgba(250, 211, 166, 0.74);
}

body[data-highlight="purple"] {
  --word-highlight: rgba(220, 210, 246, 0.72);
}

body[data-highlight="red"] {
  --word-highlight: rgba(246, 194, 190, 0.68);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

h1,
h2,
p {
  margin-top: 0;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.home-shell {
  width: min(92vw, 1720px);
}

.lesson-shell {
  width: min(1440px, calc(100% - 28px));
}

.app-shell-wide {
  width: min(1680px, calc(100vw - 56px));
  margin-right: auto;
  margin-left: auto;
}

.marketing-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 16% 10%, rgba(225, 232, 204, 0.62), transparent 30%),
    linear-gradient(180deg, #fbfaf2 0%, var(--bg) 100%);
  color: var(--text);
}

.site-nav {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(360px, auto) minmax(240px, 0.9fr);
  gap: 14px 24px;
  align-items: center;
  width: min(1680px, calc(100vw - 56px));
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 0;
}

.site-brand,
.site-user-profile,
.site-user,
.site-user button,
.site-nav-links {
  display: inline-flex;
  align-items: center;
}

.site-brand {
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.site-brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.site-nav-links {
  justify-content: center;
  gap: 28px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.site-nav-links a {
  position: relative;
  padding: 6px 0;
}

.site-nav-links a.active {
  color: var(--accent);
  font-weight: 700;
}

.site-nav-links a.active::after {
  position: absolute;
  right: 18%;
  bottom: -2px;
  left: 18%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.site-user {
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.site-user-profile {
  gap: 8px;
  min-width: 0;
}

.site-avatar,
.profile-avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #315f4d, #e7d7a5);
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.site-avatar img,
.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-avatar {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.site-user button {
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
  font-size: 13px;
}

.site-user button svg {
  width: 15px;
  height: 15px;
}

.site-user .site-theme-mode {
  display: inline-block;
}

.site-user .site-theme-mode .theme-mode-summary {
  min-height: 32px;
  border-radius: 8px;
  padding: 6px 9px;
}

.site-user .site-theme-mode .theme-mode-panel {
  top: calc(100% + 7px);
  right: 0;
}

.site-user .site-theme-mode .theme-mode-option {
  min-height: 30px;
  border: 1px solid var(--tool-button-border, var(--line));
  border-radius: 8px;
  background: var(--surface-soft, var(--paper-soft));
  color: var(--text-main, var(--text));
  padding: 0 7px;
  font-size: 12px;
}

.site-user .site-theme-mode .theme-mode-option:hover,
.site-user .site-theme-mode .theme-mode-option.is-active {
  border-color: var(--score-button-border, var(--border-strong));
  background: var(--score-button-bg, var(--accent-soft));
  color: var(--score-button-text, var(--accent-strong));
}

.landing-shell,
.profile-shell {
  width: min(1680px, calc(100vw - 56px));
  margin: 0 auto;
}

.landing-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(18px, 2.2vh, 28px);
  min-height: calc(100svh - 72px);
  padding: 18px 0 32px;
}

.mobile-home-topbar {
  display: none;
}

.landing-hero {
  position: relative;
  display: block;
  align-self: stretch;
  min-height: clamp(460px, 58vh, 680px);
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 26px;
  background: #f4efd9;
  box-shadow: 0 16px 45px rgba(49, 79, 57, 0.11);
}

.landing-hero-art {
  display: block;
  width: 100%;
  height: 100%;
}

.landing-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.landing-feature-card {
  display: grid;
  place-items: center;
  min-height: clamp(112px, 16vh, 178px);
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  box-shadow: 0 8px 24px rgba(32, 35, 31, 0.06);
}

.landing-feature-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.library-page .home-shell {
  padding-bottom: 84px;
}

.library-shell {
  width: min(1680px, calc(100vw - 56px));
}

.library-masthead {
  padding-top: 24px;
}

.profile-shell {
  max-width: 520px;
  padding: 22px 0 96px;
}

.profile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.profile-topbar h1 {
  margin: 0;
  font-size: 28px;
}

.profile-settings-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
}

.profile-settings-icon svg {
  width: 18px;
  height: 18px;
}

.profile-user-card,
.profile-membership-card,
.profile-menu {
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(32, 35, 31, 0.06);
}

.profile-user-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  font-size: 22px;
}

.profile-user-card h2,
.profile-membership-card h2 {
  margin-bottom: 4px;
}

.profile-user-card p,
.profile-membership-card p,
.profile-membership-card span,
.profile-menu-item small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-membership-card {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  padding: 0;
  background: transparent;
}

.profile-membership-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.membership-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent) !important;
  font-weight: 800;
}

.profile-menu {
  display: grid;
  gap: 0;
  margin-top: 14px;
  overflow: hidden;
}

.profile-menu-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 12px 16px;
  color: var(--text);
  text-align: left;
}

.profile-menu-item:last-child {
  border-bottom: 0;
}

.profile-menu-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.profile-menu-icon svg,
.profile-menu-arrow svg {
  width: 17px;
  height: 17px;
}

.profile-menu-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
}

.profile-menu-arrow {
  color: var(--muted);
}

.profile-logout-button {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid rgba(191, 70, 58, 0.32);
  border-radius: 14px;
  background: rgba(255, 250, 247, 0.86);
  color: #bd4a3d;
  font-weight: 800;
}

.profile-settings-backdrop,
.profile-support-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(19, 26, 21, 0.26);
}

.profile-settings-modal,
.profile-support-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 81;
  width: min(320px, calc(100vw - 36px));
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(47, 111, 94, 0.14);
  border-radius: 20px;
  background: var(--paper);
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  padding: 10px;
  box-shadow: 0 24px 70px rgba(20, 30, 24, 0.22);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-support-modal {
  width: min(280px, calc(100vw - 40px));
  padding: 10px;
}

.profile-settings-modal.open,
.profile-support-modal.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.profile-support-card {
  display: grid;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(244, 250, 246, 0.92), rgba(255, 255, 252, 0.98));
  padding: 10px;
  text-align: center;
}

.profile-support-card img {
  width: clamp(120px, 42vw, 140px);
  height: clamp(120px, 42vw, 140px);
  border-radius: 11px;
  background: #fff;
  object-fit: contain;
  padding: 5px;
  box-shadow: 0 12px 30px rgba(26, 64, 51, 0.12);
}

.profile-support-card strong {
  color: var(--accent);
  font-size: 14px;
}

.profile-support-card span,
.profile-support-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-settings-head h2 {
  margin: 0;
  font-size: 16px;
}

.profile-settings-head button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  transform: rotate(180deg);
}

.profile-settings-head svg {
  width: 15px;
  height: 15px;
}

.settings-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-soft);
  padding: 0 14px;
  margin-top: 8px;
  color: var(--text);
  text-align: left;
}

.settings-placeholder span {
  color: var(--muted);
  font-size: 12px;
}

.profile-settings-form + .profile-settings-form {
  margin-top: 7px;
}

.profile-settings-section {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(47, 111, 94, 0.1);
  border-radius: 13px;
  background: rgba(251, 251, 248, 0.82);
  padding: 8px;
}

.profile-settings-section h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
}

.profile-avatar-editor {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-avatar-preview {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  font-size: 22px;
}

.profile-avatar-editor p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.settings-secondary-button,
.settings-save-button {
  border: 0;
  border-radius: 999px;
  font-weight: 800;
}

.settings-secondary-button {
  min-height: 29px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 14px;
}

.settings-save-button {
  min-height: 34px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  box-shadow: 0 10px 22px rgba(47, 111, 94, 0.16);
}

.settings-field {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.settings-field input,
.profile-settings-form .auth-password-control input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 0 9px;
  font: inherit;
}

.settings-field input[readonly] {
  background: rgba(237, 242, 234, 0.72);
  color: var(--muted);
}

.settings-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.profile-settings-form .auth-field {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.profile-settings-form .auth-password-control {
  width: 100%;
}

.profile-settings-form .auth-password-toggle {
  right: 6px;
}

.app-mobile-tabbar {
  display: none;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
  gap: 28px;
  align-items: center;
  padding: 8px 0 20px;
}

.eyebrow,
.time {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.masthead h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.home-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.library-theme-toggle {
  display: none;
}

.search {
  display: flex;
  flex: 0 0 300px;
  gap: 8px;
  align-items: center;
}

.search input,
.practice-card input,
.drawer-field input,
.drawer-field select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--paper);
  min-height: 40px;
}

.search input {
  height: 36px;
  min-height: 36px;
  padding: 6px 10px;
}

.my-learning-link,
.filter-toggle,
.more-filter-button {
  min-height: 36px;
  height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
  white-space: nowrap;
}

.toolbar button,
.study-card button,
.plain-action,
.filter-toggle,
.drawer-actions button,
.desktop-tool-strip button,
.desktop-tool-strip label,
.segment-actions button,
.modal-primary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px 11px;
  color: var(--text);
}

.icon-btn {
  --btn-size: clamp(24px, 2vw, 32px);
  --icon-size: clamp(13px, 1.15vw, 17px);
  width: var(--btn-size);
  height: var(--btn-size);
  min-width: var(--btn-size);
  min-height: var(--btn-size);
  border-radius: clamp(7px, 0.8vw, 10px);
  border: 1px solid rgba(33, 94, 75, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  flex: 0 0 auto;
}

.icon-btn svg,
.feature-icon svg,
.desktop-tool-strip button svg {
  width: var(--icon-size, 16px);
  height: var(--icon-size, 16px);
  display: block;
}

.icon-btn.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: clamp(12px, 1vw, 15px);
  height: clamp(12px, 1vw, 15px);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: clamp(9px, 0.75vw, 11px);
  line-height: clamp(12px, 1vw, 15px);
  text-align: center;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--paper);
}

.my-learning-link,
.more-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.my-learning-link {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.filter-toggle {
  display: none;
  flex: 0 0 auto;
  min-height: 36px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  width: max-content;
  max-width: 100%;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}

.filter-group:last-of-type {
  border-right: 0;
}

.filter-group > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.filter-group div,
.tag-row,
.word-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip,
.tag-row span,
.word-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  height: 26px;
  min-height: 26px;
  padding: 3px 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.chip.active,
.desktop-tool-strip .active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.course-card {
  overflow: hidden;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(32, 35, 31, 0.03);
}

.course-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--soft);
}

.course-body {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.course-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.course-title-row span,
.course-title-row button.saved-state {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--soft);
  padding: 3px 7px;
  color: var(--accent);
  font-size: 11px;
  font-family: inherit;
  white-space: nowrap;
}

.course-title-row .saved-state svg {
  width: 11px;
  height: 11px;
}

.course-body h2 {
  display: -webkit-box;
  min-height: 34px;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-body p {
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-cta {
  display: inline-flex;
  width: max-content;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 5px 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.drawer-backdrop,
.lesson-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(30, 35, 31, 0.26);
}

.drawer-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.filter-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: min(400px, 88vw);
  transform: translateX(105%);
  border-left: 1px solid var(--line);
  background: var(--paper);
  transition: transform 180ms ease;
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer form {
  display: grid;
  gap: 12px;
  height: 100%;
  padding: 16px 14px 84px;
  overflow: auto;
}

.drawer-head,
.drawer-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.drawer-head a {
  font-weight: 650;
}

.drawer-head {
  align-items: flex-start;
}

.drawer-title {
  display: grid;
  gap: 3px;
}

.drawer-title strong {
  font-size: 16px;
}

.drawer-title span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.drawer-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.drawer-home-link {
  display: inline-flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

.drawer-actions {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.drawer-actions button {
  flex: 1;
}

.drawer-actions button:last-child {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.lesson-header,
.lesson-overview {
  padding-bottom: 10px;
}

.back {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-learn-topbar {
  display: none;
}

.lesson-title {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 12px;
  align-items: center;
}

.lesson-title.compact {
  grid-template-columns: 70px 1fr;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.lesson-title img {
  width: 98px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
}

.lesson-title.compact img {
  width: 70px;
}

.detail-shell .lesson-header .lesson-title img {
  display: block;
  width: 98px;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.lesson-title h1 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.18;
}

.lesson-title.compact h1 {
  margin: 0;
  font-size: 20px;
}

.title-line {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.lesson-title p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.goal-line {
  margin-bottom: 0 !important;
}

.plain-action {
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 12px;
}

.button-icon {
  --icon-size: 14px;
  display: inline-flex;
  margin-right: 5px;
  color: currentColor;
  vertical-align: -2px;
}

.button-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

.learning-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.46fr);
  grid-template-rows: auto 1fr;
  gap: 10px;
  align-items: start;
}

.player-column {
  min-width: 0;
  display: grid;
  gap: 0;
  align-content: start;
}

.player-column > .lesson-overview,
.player-column > video,
.player-column > .lesson-video-progress,
.player-column > .desktop-playback-controls,
.player-column > .info-chips,
.player-column > .desktop-tool-strip,
.player-column > .lesson-intro {
  width: 100%;
  max-width: 100%;
}

video {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  box-shadow: var(--shadow);
}

.info-chips,
.desktop-tool-strip,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
}

.info-chips span,
.desktop-tool-strip button,
.desktop-tool-strip label,
.desktop-tool-strip .desktop-tool-link,
.desktop-tool-strip summary {
  flex: 0 0 auto;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.info-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.desktop-tool-strip button,
.desktop-tool-strip label,
.desktop-tool-strip .desktop-tool-link,
.desktop-tool-strip summary {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.desktop-tool-strip .rate-mini {
  padding: 6px 8px;
  min-width: 44px;
  justify-content: center;
}

.desktop-tool-strip span {
  color: var(--accent);
  font-weight: 700;
}

.desktop-tool-strip select {
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  outline: 0;
}

.playback-controls {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 3vw, 36px);
  margin: 8px auto 0;
}

.playback-control-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
}

.playback-control-btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

.playback-control-btn.is-primary {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  aspect-ratio: 1 / 1;
  padding: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 91, 0.18);
}

.playback-control-btn.is-primary svg {
  width: 23px;
  height: 23px;
}

.playback-control-btn.is-primary svg,
.playback-control-btn.is-primary svg * {
  color: #fff;
  fill: currentColor;
  stroke: currentColor;
}

.playback-control-btn.is-active {
  color: var(--accent);
}

.playback-control-btn:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.playback-control-hint {
  display: block;
  color: currentColor;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.desktop-playback-controls {
  display: grid;
  justify-items: center;
}

.desktop-playback-panel[hidden],
.desktop-playback-expand[hidden] {
  display: none;
}

.desktop-playback-expand {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.08);
  color: var(--accent-strong);
}

.desktop-playback-expand svg {
  width: 16px;
  height: 16px;
}

.playback-control-btn[data-playback-action="continuous-play"] {
  display: inline-flex;
  width: auto;
  min-width: 72px;
  gap: 4px;
}

@media (max-width: 720px) {
  .desktop-playback-controls {
    display: none;
  }
}

.current-card,
.subtitle-panel,
.study-card,
.practice-card,
.exercise-layout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 11px;
}

.lesson-shell .current-card {
  display: none;
}

.current-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.line-en {
  margin-bottom: 7px;
  font-size: 19px;
  line-height: 1.35;
}

.line-zh {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.subtitle-hidden {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.word-hit {
  border: 0;
  border-radius: 5px;
  background: var(--word-highlight, rgba(247, 233, 161, 0.68));
  display: inline;
  padding: 0 3px;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(47, 111, 94, 0.3);
  text-underline-offset: 3px;
}

.core-term-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.core-term-chip {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  max-width: 100%;
  border: 1px solid rgba(47, 111, 94, 0.2);
  border-radius: 999px;
  background: var(--word-highlight, rgba(247, 233, 161, 0.68));
  padding: 3px 8px;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
}

.core-term-chip span {
  font-weight: 700;
}

.core-term-chip small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.timed-word {
  display: inline;
  border-radius: 5px;
  padding: 0 1px;
  transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.timed-word.current-word {
  background: rgba(255, 229, 117, 0.92);
  color: #174c3a;
  box-shadow: 0 0 0 1px rgba(33, 94, 75, 0.2);
  font-weight: 750;
}

.subtitle-panel {
  position: sticky;
  top: 12px;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 0;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
}

.panel-title h2,
.section-title {
  margin-bottom: 0;
  font-size: 16px;
}

.panel-title span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  font-size: 11px;
}

.subtitle-list {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 88px);
  overflow: auto;
  padding-right: 3px;
}

.subtitle-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 8px;
}

.subtitle-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.subtitle-main {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.subtitle-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.subtitle-meta b {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 11px;
}

.subtitle-lines .line-en {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.subtitle-lines .line-zh {
  display: block;
  margin-bottom: 0;
  font-size: 12px;
}

.segment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.segment-actions .segment-action-btn {
  --icon-size: 15px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  color: var(--accent);
}

.segment-action-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.segment-action-icon svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

.segment-actions .loop-action.is-active,
.segment-actions .sentence-favorite-action.is-active {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent-strong, var(--accent));
  box-shadow: none;
}

.segment-actions .sentence-favorite-action.is-active {
  color: #d69216;
  background: rgba(255, 244, 214, 0.55);
}

.segment-actions .segment-action-btn:hover {
  border: 0;
  background: rgba(33, 94, 75, 0.07);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.feature-dock {
  grid-column: 1;
  grid-row: 2;
}

.feature-grid a {
  display: flex;
  min-width: 0;
  gap: 5px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 7px 8px;
  text-align: center;
  color: var(--text);
  font-size: 12px;
}

.feature-grid a > span:last-child {
  display: none;
}

.feature-icon {
  --icon-size: 14px;
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.highlight-menu,
.export-menu {
  position: relative;
  flex: 0 0 auto;
}

.highlight-menu summary,
.export-menu summary {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}

.highlight-menu summary::-webkit-details-marker,
.export-menu summary::-webkit-details-marker {
  display: none;
}

.highlight-panel,
.export-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 25;
  display: grid;
  gap: 8px;
  width: 184px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 10px;
  box-shadow: var(--shadow);
}

.export-panel {
  z-index: 95;
  gap: 6px;
  width: 160px;
  border-color: rgba(47, 111, 94, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 253, 244, 0.98), rgba(241, 248, 238, 0.98));
  padding: 8px;
  box-shadow: 0 14px 34px rgba(31, 107, 83, 0.14);
  backdrop-filter: blur(12px);
}

.highlight-panel button,
.highlight-panel label,
.export-panel button {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.highlight-panel button,
.export-panel button {
  justify-content: center;
  color: var(--text);
}

.export-panel button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.export-panel button:hover,
.export-panel button:focus-visible {
  background: rgba(47, 111, 94, 0.08);
  color: var(--accent);
  outline: 0;
}

body[data-theme="dark"] .export-panel {
  border-color: rgba(126, 183, 159, 0.28);
  background: linear-gradient(180deg, rgba(34, 43, 38, 0.98), rgba(25, 32, 29, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .export-panel button {
  color: #edf1ec;
}

body[data-theme="dark"] .export-panel button:hover,
body[data-theme="dark"] .export-panel button:focus-visible {
  background: rgba(126, 183, 159, 0.16);
  color: #bfe3d4;
}

.highlight-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 6px 8px;
  color: var(--text);
}

.lesson-intro {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px;
}

.lesson-intro h2 {
  margin-bottom: 6px;
  font-size: 16px;
}

.lesson-intro dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 10px;
  margin: 0;
}

.lesson-intro dt {
  color: var(--muted);
  font-size: 12px;
}

.lesson-intro dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.detail-shell {
  width: min(1180px, calc(100% - 32px));
}

.detail-shell:has(.fill-practice-layout) {
  width: min(1440px, calc(100% - 20px));
}

.cards-shell {
  width: min(1280px, calc(100% - 32px));
}

.content-stack {
  display: grid;
  gap: 22px;
}

.small-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.cards-shell .small-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 240px));
  justify-content: start;
  align-items: start;
}

.cards-shell .small-grid > .study-card.learning-card {
  width: min(100%, 240px);
  max-width: 240px;
  min-height: auto;
  padding: 12px;
  flex: 0 0 240px;
  border-color: rgba(68, 104, 84, 0.18);
  background: linear-gradient(180deg, rgba(247, 251, 247, 0.98), rgba(255, 255, 252, 0.98));
  box-shadow: 0 8px 22px rgba(41, 67, 53, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.cards-shell .small-grid > .study-card.learning-card:hover {
  transform: translateY(-1px);
  border-color: rgba(33, 94, 75, 0.28);
  box-shadow: 0 12px 28px rgba(41, 67, 53, 0.09);
}

.cards-shell .study-card h2 {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
}

.cards-shell .study-card small {
  color: rgba(72, 82, 74, 0.72);
  font-size: 11px;
}

.cards-shell .study-card p,
.cards-shell .study-card blockquote {
  margin-bottom: 5px;
  color: rgba(44, 50, 44, 0.78);
  font-size: 12px;
  line-height: 1.45;
}

.cards-shell .study-card .card-meaning {
  color: #24372d !important;
  font-size: 13px;
  font-weight: 700;
}

.learning-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
}

.card-title-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}

.card-meaning {
  color: var(--text) !important;
  font-weight: 650;
}

.study-card h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.study-card small {
  color: var(--muted);
  font-size: 13px;
}

.study-card p,
.study-card blockquote,
.practice-card p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.study-card blockquote,
.lookup-modal blockquote {
  margin: 8px 0;
  padding-left: 10px;
  border-left: 3px solid var(--accent-soft);
}

.exercise-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.exercise-layout .section-title {
  grid-column: 1 / -1;
}

.exercise-layout video {
  box-shadow: none;
}

.fill-card {
  display: grid;
  gap: 8px;
}

.fill-paragraph {
  white-space: normal;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.55;
}

.inline-fill-blank {
  display: inline-block;
  min-width: 72px;
  height: 1em;
  margin: 0 4px;
  border-bottom: 2px solid currentColor;
  line-height: 1;
  vertical-align: baseline;
}

.inline-blank-input {
  display: inline-block;
  width: clamp(96px, 12vw, 160px);
  height: 1.35em;
  max-width: 100%;
  margin: 0 3px;
  appearance: none;
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid var(--accent);
  background: transparent;
  padding: 0 4px;
  color: var(--text);
  font-size: 0.92em;
  line-height: 1.2;
  outline: 0;
  text-align: center;
  vertical-align: -0.08em;
}

.inline-cloze-field {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  margin: 0 4px;
  white-space: nowrap;
}

.blank-number {
  color: var(--accent);
  font-size: 0.72em;
  font-weight: 700;
}

.practice-card.fill-card .fill-paragraph input.inline-blank-input {
  display: inline-block !important;
  width: clamp(90px, 12vw, 150px) !important;
  min-width: 90px !important;
  max-width: 160px !important;
  height: 1.4em !important;
  min-height: 0 !important;
  margin: 0 4px !important;
  border: 0 !important;
  border-bottom: 1px solid currentColor !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 4px !important;
  box-shadow: none !important;
  line-height: 1.4em !important;
  vertical-align: baseline !important;
}

.answer-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.answer-chip-row span {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  padding: 4px 8px;
  color: var(--text);
  font-size: 12px;
}

@media (max-width: 640px) {
  .cards-shell .small-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .cards-shell .small-grid > .study-card.learning-card {
    width: 100%;
    max-width: none;
  }
}

.blank-slot {
  display: inline-block;
  min-width: 74px;
  border-bottom: 2px solid var(--accent);
  color: transparent;
  vertical-align: baseline;
}

.answer-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.practice-video-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 11px;
}

.practice-video-panel button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 8px 10px;
}

.fill-practice-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(600px, 1.05fr) minmax(520px, 0.95fr);
  gap: 10px;
  align-items: start;
}

.fill-video-pane,
.fill-question-pane {
  min-width: 0;
}

.fill-video-pane {
  align-self: start;
}

.fill-question-pane {
  display: grid;
  gap: 8px;
  align-content: start;
  height: min(560px, calc(100vh - 170px));
  min-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px;
}

.fill-question-pane.is-full-passage-pane {
  height: min(720px, calc(100vh - 132px));
  min-height: 460px;
}

.practice-card.fill-card {
  gap: 6px;
  padding: 8px 10px;
  box-shadow: none;
}

.practice-card.fill-card h2 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.3;
}

.practice-card.fill-card .toolbar {
  margin-top: 2px;
  gap: 6px;
}

.practice-card.fill-card .toolbar button {
  padding: 6px 9px;
  font-size: 12px;
}

.practice-card.fill-card .answer p {
  margin-bottom: 4px;
}

.practice-card.fill-card.is-full-passage .fill-paragraph {
  max-height: none;
  overflow: visible;
  padding-right: 0;
  font-size: 18px;
  line-height: 1.75;
}

.practice-card.fill-card.is-full-passage {
  padding: 14px;
}

.answer-hint {
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 860px) and (max-width: 1100px) {
  .fill-practice-layout {
    grid-template-columns: minmax(390px, 1fr) minmax(310px, 420px);
  }

  .fill-question-pane {
    height: min(480px, calc(100vh - 170px));
  }
}

.favorites-page .learning-home-shell {
  width: min(92vw, 1720px);
}

.learning-home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0 2px;
}

.learning-home-header h1 {
  margin-bottom: 6px;
  color: #123d31;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
}

.learning-home-header p,
.source-line {
  color: var(--muted);
}

.learning-home-copy {
  max-width: 760px;
}

.collection-refresh-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  align-self: center;
}

.collection-refresh-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  align-self: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(237, 246, 236, 0.72);
  color: var(--accent);
  line-height: 1;
  box-shadow: none;
}

.collection-refresh-button svg {
  width: 19px;
  height: 19px;
}

.collection-refresh-button:hover,
.collection-refresh-button:focus-visible {
  background: rgba(226, 241, 226, 0.92);
  border-color: rgba(47, 111, 94, 0.16);
}

.collection-refresh-button.is-loading {
  opacity: 0.72;
  transform: rotate(18deg);
}

.collection-refresh-hint {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  z-index: 4;
  width: max-content;
  transform: translateY(-50%);
  border: 1px solid rgba(47, 111, 94, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 244, 0.96);
  padding: 5px 9px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(31, 73, 56, 0.1);
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.collection-refresh-hint.is-hidden {
  opacity: 0;
  transform: translateY(-50%) translateX(4px);
  pointer-events: none;
}

body[data-theme="dark"] .collection-refresh-hint {
  border-color: rgba(132, 196, 165, 0.22);
  background: rgba(34, 43, 38, 0.96);
  color: #bfe6d2;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.learning-home-copy .eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.06em;
}

.learning-section {
  display: grid;
  gap: 10px;
}

.collection-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(47, 111, 94, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 6px 18px rgba(31, 73, 56, 0.045);
}

.collection-tabs a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 7px 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.collection-tabs a.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #216f56, #2f7a5e);
  color: #fff;
  box-shadow: 0 8px 16px rgba(47, 111, 94, 0.18);
}

.collection-tabs a span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.collection-tabs a.active span {
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
}

.collection-panel .learning-section {
  gap: 12px;
}

.collection-panel .small-grid {
  gap: 12px;
}

.collection-panel[data-active-collection="sentences"] .small-grid {
  grid-template-columns: 1fr;
}

.learning-course-card {
  min-height: 100%;
}

.learning-home-shell .small-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.learning-course-card {
  display: grid;
  grid-template-columns: minmax(116px, 0.42fr) minmax(0, 1fr);
  min-height: 0;
  border-color: rgba(47, 111, 94, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(244, 249, 238, 0.72), rgba(255, 255, 255, 0) 38%),
    var(--paper);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.learning-course-card:hover {
  border-color: rgba(47, 111, 94, 0.22);
  box-shadow: 0 12px 26px rgba(31, 73, 56, 0.1);
  transform: translateY(-1px);
}

.learning-course-cover {
  position: relative;
  display: grid;
  align-self: center;
  place-items: center;
  overflow: hidden;
  min-height: 0;
  padding: 12px 0 12px 12px;
}

.learning-home-shell .learning-course-card img {
  position: relative;
  z-index: 1;
  aspect-ratio: 4 / 3;
  height: auto;
  min-height: 0;
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

.learning-cover-placeholder {
  position: absolute;
  inset: 12px 0 12px 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 10px;
  background:
    radial-gradient(circle at 70% 25%, rgba(239, 214, 139, 0.22), transparent 34%),
    linear-gradient(135deg, #f8f4df, #e8f3e4);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.learning-course-cover.is-missing-cover .learning-cover-placeholder {
  z-index: 2;
}

.learning-home-shell .learning-course-card .course-body {
  align-content: center;
  gap: 6px;
  padding: 12px;
}

.learning-home-shell .learning-course-card .course-body h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.learning-course-meta {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.learning-home-shell .learning-course-card .course-cta {
  font-size: 11px;
  justify-self: start;
  border-color: rgba(47, 111, 94, 0.18);
  background: #edf6ec;
  color: var(--accent);
  padding: 5px 10px;
}

.my-study-card {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 10px;
}

.my-study-card h2 {
  margin-bottom: 0;
  line-height: 1.35;
}

.sentence-card h2 {
  font-size: 16px;
}

.collection-sentence-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 246, 213, 0.48), rgba(255, 255, 255, 0) 30%),
    rgba(255, 255, 255, 0.9);
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(31, 73, 56, 0.055);
}

.collection-sentence-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #77a878, #efd68b);
}

.collection-sentence-meta .time {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.collection-sentence-body {
  min-width: 0;
}

.collection-sentence-body h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 2px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sentence-translation {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.collection-sentence-body .source-line {
  margin: 0;
  font-size: 11px;
}

.collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.collection-actions .plain-action {
  min-height: 26px;
  border-color: rgba(47, 111, 94, 0.14);
  background: rgba(255, 255, 255, 0.72);
  padding: 3px 8px;
  font-size: 11px;
  text-decoration: none;
}

.collection-actions .danger-action {
  border-color: rgba(168, 82, 65, 0.16);
  background: rgba(255, 248, 244, 0.72);
  color: #8a3d2f;
}

.collection-actions .disabled-action {
  color: var(--muted);
}

.compact-collection-card {
  gap: 4px;
  border-color: rgba(47, 111, 94, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(233, 246, 235, 0.72), rgba(255, 250, 230, 0.42)),
    var(--paper);
  padding: 10px 12px;
  box-shadow: 0 6px 16px rgba(31, 73, 56, 0.045);
}

.compact-collection-card h2 {
  font-size: 15px;
}

.collection-compact-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.compact-collection-card .saved-state {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(237, 246, 236, 0.86);
  padding: 3px 7px;
  color: var(--accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.compact-collection-card .saved-state svg {
  width: 11px;
  height: 11px;
}

.compact-collection-card p {
  margin: 0;
  font-size: 12px;
}

@media (max-width: 720px) {
  .favorites-page .learning-home-shell {
    width: min(100% - 20px, 720px);
    padding-bottom: calc(142px + env(safe-area-inset-bottom)) !important;
  }

  .learning-home-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 0 0;
  }

  .collection-refresh-button {
    width: 40px;
    height: 40px;
  }

  .collection-refresh-button svg {
    width: 18px;
    height: 18px;
  }

  .collection-refresh-hint {
    right: 0;
    top: calc(100% + 6px);
    transform: none;
    font-size: 11px;
    padding: 5px 8px;
  }

  .collection-refresh-hint.is-hidden {
    transform: translateY(-3px);
  }

  .learning-home-header h1 {
    margin-bottom: 6px;
    font-size: 34px;
  }

  .learning-home-header p {
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.55;
  }

  .learning-home-copy .eyebrow {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .collection-tabs {
    gap: 6px;
    padding: 6px;
    border-radius: 15px;
  }

  .collection-tabs a {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    min-height: 34px;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 11px;
  }

  .collection-panel .small-grid,
  .learning-home-shell .small-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .learning-course-card {
    grid-template-columns: 104px minmax(0, 1fr);
    border-radius: 12px;
  }

  .learning-course-cover {
    padding: 9px 0 9px 9px;
  }

  .learning-cover-placeholder {
    inset: 9px 0 9px 9px;
    border-radius: 9px;
    font-size: 11px;
  }

  .learning-home-shell .learning-course-card img {
    min-height: 92px;
    border-radius: 9px;
  }

  .learning-home-shell .learning-course-card .course-body {
    gap: 4px;
    padding: 9px 10px;
  }

  .learning-home-shell .learning-course-card .course-body h2 {
    font-size: 13px;
    line-height: 1.28;
  }

  .learning-course-card .saved-state {
    font-size: 10px;
  }

  .learning-home-shell .learning-course-card .course-body p {
    margin-bottom: 0;
    font-size: 11px;
    line-height: 1.35;
  }

  .learning-home-shell .learning-course-card .course-cta {
    margin-top: 2px;
    padding: 4px 8px;
    font-size: 10.5px;
  }

  .collection-sentence-card {
    grid-template-columns: 1fr;
    gap: 5px;
    border-radius: 12px;
    padding: 8px 9px;
  }

  .collection-sentence-meta .time {
    font-size: 10.5px;
  }

  .collection-sentence-body h2 {
    font-size: 13px;
    line-height: 1.28;
  }

  .sentence-translation {
    font-size: 11px;
    line-height: 1.28;
    -webkit-line-clamp: 2;
  }

  .collection-actions {
    justify-content: flex-start;
    gap: 4px;
  }

  .collection-actions .plain-action {
    min-height: 26px;
    padding: 3px 7px;
  }

  .compact-collection-card {
    padding: 9px 10px;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .favorites-page .learning-home-shell {
    width: min(100% - 32px, 1040px);
  }

  .learning-home-shell .small-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .learning-course-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}

.word-card h2,
.phrase-card h2 {
  color: var(--accent);
}

.empty-card {
  border-style: dashed;
  background: var(--paper-soft);
}

.lookup-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.lookup-word-list button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 10px;
}

.toolbar button {
  padding: 7px 9px;
  font-size: 12px;
}

.toolbar .active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.answer {
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.empty {
  color: var(--muted);
}

.lesson-overlay {
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
}

.lookup-modal {
  position: relative;
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 18px;
  box-shadow: var(--shadow);
}

.practice-menu-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.practice-menu-list a,
.practice-menu-list button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 10px;
  color: var(--text);
  font-size: 14px;
  text-align: left;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.lookup-title {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.lookup-title h2,
.lookup-modal h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.lookup-title button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.phonetic,
.lookup-modal p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.lookup-meaning {
  color: var(--text) !important;
  font-weight: 650;
}

.lookup-kind {
  margin-bottom: 0 !important;
  color: var(--accent) !important;
  font-size: 12px;
  font-weight: 650;
}

.term-detail-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.term-detail-list div {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 8px 9px;
}

.term-detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.term-detail-list dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.term-example {
  margin: 10px 0;
}

.term-example-header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.term-example > span,
.term-example-header > span {
  color: var(--muted);
  font-size: 12px;
}

.term-example-speaker {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
}

.term-example-speaker svg {
  width: 15px;
  height: 15px;
}

.term-example blockquote {
  margin-top: 5px;
}

.modal-primary {
  display: inline-flex;
  justify-content: center;
  margin-top: 6px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.intensive-list {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
}

.intensive-list dt {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.intensive-list dd {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.mobile-bottom-tools {
  display: none;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
}

.admin-header {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.admin-header-links a {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

.admin-header h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 3vw, 38px);
}

.admin-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 12px;
}

.admin-alert.success {
  border-color: rgba(47, 111, 94, 0.28);
  color: var(--accent);
}

.admin-alert.pending,
.admin-alert.warning {
  border-color: rgba(171, 122, 44, 0.32);
  color: #7a5619;
}

.admin-alert.error,
.admin-form-message[data-type="error"] {
  color: #b24636;
}

.admin-course-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-course-list,
.admin-editor,
.admin-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 10px 28px rgba(32, 35, 31, 0.06);
}

.admin-course-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 12px;
}

.admin-section-head,
.admin-form-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-section-head h2,
.admin-section-head h3,
.admin-form-title h2 {
  margin: 0;
  font-size: 18px;
}

.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-section-head span {
  color: var(--muted);
  font-size: 13px;
}

.admin-course-filters {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-soft);
  padding: 10px;
}

.admin-course-filters input,
.admin-course-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

.admin-course-filters button,
.admin-empty-state button {
  border: 1px solid rgba(47, 111, 94, 0.28);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.admin-bulk-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px;
}

.admin-bulk-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-bulk-toolbar button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.admin-bulk-toolbar button[data-admin-bulk-action="publish"] {
  border-color: rgba(47, 111, 94, 0.32);
  background: var(--accent);
  color: #fff;
}

.admin-bulk-toolbar button[data-admin-bulk-action="unpublish"] {
  border-color: rgba(178, 70, 54, 0.26);
  color: #b24636;
}

.admin-bulk-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.admin-course-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  border: 1px solid transparent;
  border-radius: 10px;
}

.admin-course-row.active,
.admin-course-row.selected {
  border-color: rgba(47, 111, 94, 0.42);
  background: var(--accent-soft);
}

.admin-course-check {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.admin-course-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.admin-course-list [data-admin-course] {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 10px;
  text-align: left;
}

.admin-course-row.active [data-admin-course] {
  border-color: rgba(47, 111, 94, 0.42);
  background: var(--accent-soft);
}

.admin-course-list [data-admin-course] span,
.admin-course-list [data-admin-course] small {
  color: var(--muted);
}

.admin-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.admin-form-title button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-weight: 800;
}

.admin-form-title button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.admin-form-title button.danger {
  background: #b42318;
}

.admin-current-state {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-form-grid .wide {
  grid-column: 1 / -1;
}

.admin-form-grid input,
.admin-form-grid textarea,
.admin-form-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-weight: 500;
}

.admin-form-grid textarea {
  resize: vertical;
}

.admin-form-grid input:disabled,
.admin-form-grid select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.admin-resource-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-key-grid {
  display: grid;
  gap: 8px;
}

.admin-key-grid p {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-key-grid code {
  overflow-wrap: anywhere;
  color: var(--text);
}

.admin-operation-debug {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-operation-debug p {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-operation-debug code,
.admin-operation-debug span {
  overflow-wrap: anywhere;
  color: var(--text);
}

.admin-debug-warning span {
  color: #b24636;
}

.admin-form-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0)),
    var(--bg);
  padding: clamp(24px, 7vh, 58px) 20px;
}

.auth-card {
  width: min(92vw, 448px);
  border: 1px solid rgba(47, 111, 94, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: clamp(26px, 4.4vw, 38px);
  box-shadow: 0 18px 48px rgba(32, 35, 31, 0.1);
  color: var(--text);
}

.auth-policy-card {
  width: min(92vw, 760px);
}

.auth-back {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 4.2vw, 32px);
  line-height: 1.18;
  letter-spacing: 0;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.auth-brand {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-brand-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.auth-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-mode-title {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--soft);
  padding: 4px;
}

.auth-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
  font-size: 15px;
  font-weight: 750;
}

.auth-tabs button.active {
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(32, 35, 31, 0.07);
  text-decoration: none;
}

.auth-form {
  display: grid;
  gap: 0;
}

.auth-field {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  padding: 9px 11px;
  margin-bottom: 10px;
}

.auth-field span {
  height: auto;
  overflow: visible;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.auth-field input::placeholder {
  color: #9aa19b;
  opacity: 1;
}

.auth-password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.auth-password-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.auth-password-toggle svg {
  width: 19px;
  height: 19px;
}

.auth-password-toggle:hover {
  color: var(--accent);
  background: rgba(47, 111, 94, 0.08);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.auth-code-row .auth-field {
  margin-bottom: 0;
}

.auth-code-row button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.auth-terms {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-terms input {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
}

.auth-terms input:checked {
  border-color: var(--accent);
  background:
    radial-gradient(circle at center, var(--accent) 45%, transparent 48%),
    #fff;
}

.auth-terms a {
  color: var(--accent);
  font-weight: 750;
}

.auth-submit,
.auth-enter {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(47, 111, 94, 0.18);
  text-align: center;
}

.auth-submit {
  width: 100%;
}

.auth-enter {
  display: grid;
  place-items: center;
  margin-top: 14px;
}

.auth-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-message[data-type="success"] {
  color: var(--accent);
}

.auth-message[data-type="error"] {
  color: #b24636;
}

.auth-register-note,
.auth-sms-pending {
  margin: 0 0 10px;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-register-note {
  background: rgba(237, 242, 234, 0.72);
  color: var(--accent-strong);
}

.auth-login-note {
  margin: -4px 0 14px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.auth-sms-pending {
  border: 1px solid rgba(47, 111, 94, 0.12);
  background: rgba(255, 253, 245, 0.86);
  color: var(--muted);
}

.auth-switch-line {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch-line span {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-switch-line a {
  color: var(--accent);
  font-weight: 800;
}

.auth-session {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.auth-session button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.auth-policy {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  padding: 18px;
  line-height: 1.7;
}

.auth-policy h2 {
  margin: 0;
}

.auth-policy h3 {
  margin: 6px 0 -4px;
  color: var(--text);
  font-size: 15px;
}

.auth-policy p {
  margin: 0;
  color: var(--muted);
}

.policy-qr-placeholders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.policy-qr-placeholders span {
  display: grid;
  min-height: 88px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 520px) {
  .auth-page {
    place-items: center;
    padding-top: clamp(24px, 6vh, 48px);
    padding-bottom: clamp(24px, 6vh, 48px);
    padding-right: 0;
    padding-left: 0;
  }

  .auth-card {
    width: min(88vw, 360px);
    padding: 18px 14px;
    border-radius: 16px;
  }

  .auth-policy-card {
    width: min(92vw, 430px);
  }

  .auth-back {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .auth-card h1 {
    font-size: clamp(20px, 5.4vw, 23px);
  }

  .auth-brand {
    gap: 6px;
    margin-bottom: 16px;
  }

  .auth-brand-kicker {
    font-size: 12px;
  }

  .auth-subtitle {
    font-size: 12px;
  }

  .auth-mode-title {
    margin-bottom: 12px;
    font-size: 16px;
  }

  .auth-tabs {
    margin-bottom: 16px;
  }

  .auth-tabs button {
    padding: 7px 8px;
    font-size: 14px;
  }

  .auth-field {
    gap: 4px;
    padding: 7px 9px;
    margin-bottom: 8px;
  }

  .auth-field input {
    font-size: 13px;
  }

  .auth-field input[name="activationCode"] {
    font-size: clamp(12px, 3.25vw, 13px);
  }

  .auth-code-row {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 6px;
  }

  .auth-code-row button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .auth-terms {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
  }

  .auth-terms input {
    width: 20px;
    height: 20px;
  }

  .auth-submit,
  .auth-enter {
    min-height: 44px;
    font-size: 16px;
  }

  .policy-qr-placeholders {
    grid-template-columns: 1fr;
  }

  .auth-message {
    margin-top: 10px;
    font-size: 12px;
  }
}

@media (min-width: 1220px) {
  .course-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1460px) {
  .course-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 980px) and (max-width: 1219px) {
  .course-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 860px) and (max-width: 979px) {
  .course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learning-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.5fr);
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 860px) {
  .learning-layout {
    grid-template-rows: auto auto auto auto auto auto;
  }

  .player-column {
    display: contents;
  }

  .player-column > .lesson-overview {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .player-column > video {
    grid-column: 1;
    grid-row: 2;
  }

  .player-column > .lesson-video-progress {
    grid-column: 1;
    grid-row: 3;
  }

  .player-column > .desktop-playback-controls {
    grid-column: 1;
    grid-row: 4;
  }

  .player-column > .info-chips {
    grid-column: 1;
    grid-row: 5;
  }

  .player-column > .desktop-tool-strip {
    grid-column: 1;
    grid-row: 6;
  }

  .player-column > .lesson-intro {
    grid-column: 1;
    grid-row: 7;
  }

  .subtitle-panel {
    grid-column: 2;
    grid-row: 2 / span 6;
  }

  .feature-dock {
    grid-column: 1;
    grid-row: 8;
  }
}

@media (max-width: 859px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .shell,
  .lesson-shell,
  .detail-shell {
    width: min(100% - 20px, 760px);
    padding-top: 12px;
  }

  .lesson-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: calc(100dvh - 96px);
    overflow: visible;
    padding-bottom: calc(106px + env(safe-area-inset-bottom));
  }

  .masthead,
  .learning-layout,
  .lesson-title,
  .exercise-layout {
    grid-template-columns: 1fr;
  }

  .masthead {
    gap: 10px;
    align-items: start;
  }

  .masthead h1 {
    font-size: 30px;
  }

  .tagline {
    white-space: normal;
  }

  .home-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .search {
    flex: 1 1 180px;
  }

  .filter-toggle {
    display: inline-flex;
  }

  .desktop-filters {
    display: none;
  }

  .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .course-grid {
    align-items: stretch;
  }

  .course-card img {
    aspect-ratio: 16 / 11;
  }

  .course-title-row {
    grid-template-columns: 1fr;
  }

  .course-title-row span {
    width: max-content;
  }

  .filter-drawer {
    left: 0;
    right: auto;
    width: min(86vw, 360px);
    transform: translateX(-105%);
    border-right: 1px solid var(--line);
    border-left: 0;
  }

  .filter-drawer.open {
    transform: translateX(0);
  }

  .course-body h2 {
    min-height: 32px;
    font-size: 13px;
  }

  .mobile-learn-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px 32px 32px;
    gap: 4px;
    align-items: center;
    margin: -12px -2px 8px;
    padding: 8px 0;
    background: var(--bg);
  }

  .mobile-learn-topbar a,
  .mobile-learn-topbar button {
    display: inline-grid;
    height: 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
  }

  .mobile-learn-topbar strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .lesson-overview {
    display: none;
  }

  .learning-layout {
    gap: 9px;
    min-height: 0;
    overflow: visible;
    grid-template-rows: auto;
  }

  .lesson-shell .learning-layout {
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .lesson-shell .player-column {
    min-height: 0;
  }

  video {
    box-shadow: none;
  }

  .lesson-shell video {
    max-height: min(34dvh, 260px);
    object-fit: contain;
  }

  .lesson-shell .player-column > .lesson-intro {
    display: none;
  }

  .info-chips,
  .desktop-tool-strip,
  .current-card {
    display: none;
  }

  .subtitle-panel {
    position: static;
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .panel-title {
    margin: 4px 0 8px;
  }

  .subtitle-list {
    min-height: 0;
    max-height: none;
    padding-right: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .subtitle-item {
    gap: 5px;
    padding: 7px 8px;
    background: var(--paper);
  }

  .subtitle-main {
    gap: 3px;
  }

  .subtitle-meta b {
    width: 20px;
    height: 20px;
  }

  .subtitle-lines .line-en {
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.35;
  }

  .subtitle-lines .line-zh {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .segment-actions .segment-action-btn {
    width: 36px;
    height: 34px;
    min-width: 36px;
    min-height: 34px;
    padding: 0;
  }

  .core-term-row {
    gap: 5px;
    margin-top: 2px;
  }

  .core-term-chip {
    padding: 4px 6px;
    gap: 2px;
  }

  .feature-dock {
    display: none;
  }

  .feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2px;
  }

  .feature-grid a {
    padding: 8px 6px;
    font-size: 12px;
  }

  .lesson-overlay {
    z-index: 120;
    align-items: end;
    place-items: end stretch;
    padding: 12px 10px calc(92px + env(safe-area-inset-bottom));
  }

  .lookup-modal {
    align-self: end;
    width: 100%;
    max-height: min(78dvh, calc(100dvh - 126px - env(safe-area-inset-bottom)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px 16px 0 0;
    padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .practice-menu-modal {
    align-self: end;
  }

  .admin-shell {
    width: min(100% - 18px, 760px);
  }

  .admin-course-layout {
    grid-template-columns: 1fr;
  }

  .admin-course-list {
    max-height: 280px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-title {
    align-items: start;
    flex-direction: column;
  }

  .admin-form-title button {
    width: 100%;
  }

  .admin-form-actions {
    width: 100%;
  }

  .admin-key-grid p {
    grid-template-columns: 1fr;
  }

  .fill-practice-layout {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .detail-shell:has(.fill-practice-layout) {
    padding-top: 6px;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-header {
    padding-bottom: 4px;
  }

  .detail-shell:has(.fill-practice-layout) .back {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-title.compact {
    grid-template-columns: 52px 1fr;
    gap: 8px;
    padding: 6px;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-title.compact img {
    width: 52px;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-title.compact h1 {
    font-size: 17px;
    line-height: 1.15;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-title.compact p {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.3;
  }

  .detail-shell:has(.fill-practice-layout) .lesson-title.compact .plain-action {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 12px;
  }

  .fill-video-pane {
    order: 1;
  }

  .fill-question-pane {
    order: 2;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .fill-video-pane video {
    max-height: 176px;
    object-fit: contain;
  }

  .fill-video-pane .practice-video-panel {
    gap: 5px;
    padding: 6px;
  }

  .fill-video-pane .practice-video-panel button {
    padding: 5px 8px;
    font-size: 12px;
  }

  .fill-question-pane .fill-card {
    gap: 6px;
    padding: 8px;
  }

  .fill-card .time,
  .fill-card > p {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .fill-paragraph {
    padding: 8px;
    font-size: 14px;
    line-height: 1.4;
  }

  .inline-fill-blank {
    min-width: 54px;
    margin: 0 2px;
  }

  .practice-card.fill-card .fill-paragraph input.inline-blank-input {
    width: 58px !important;
    min-width: 50px !important;
    max-width: 82px !important;
    color: var(--accent);
    caret-color: var(--accent);
  }
}

@media (max-width: 430px) {
  .shell,
  .lesson-shell,
  .detail-shell {
    width: min(100% - 16px, 430px);
  }

  .search {
    display: flex;
    grid-template-columns: none;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-body {
    padding: 8px;
  }

  .tag-row span {
    font-size: 11px;
    padding: 4px 7px;
  }
}



/* ===== mobile learning final polish: video fixed, subtitle internal scroll, balanced toolbar ===== */
@media (max-width: 720px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .lesson-shell {
    min-height: 100dvh !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .lesson-shell .learning-layout {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  .lesson-shell .player-column {
    min-height: 0 !important;
    overflow: visible !important;
  }

  .lesson-shell video,
  .lesson-shell #lessonVideo {
    width: 100% !important;
    max-height: min(34dvh, 260px) !important;
    object-fit: contain !important;
  }

  .lesson-shell .subtitle-panel {
    min-height: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .lesson-shell .subtitle-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding-top: 16px !important;
    padding-bottom: 92px !important;
  }

  #mobileThemeToggle {
    color: var(--ink) !important;
  }

  #mobileThemeToggle .moon-glyph {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1em !important;
    height: 1em !important;
    font-size: 19px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    color: currentColor !important;
  }

}


/* ===== mobile learning hard override v2 start ===== */
@media (max-width: 720px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .lesson-shell {
    min-height: 100dvh !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    padding-bottom: calc(112px + env(safe-area-inset-bottom)) !important;
  }

  .lesson-shell .learning-layout {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  .lesson-shell .player-column {
    min-height: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 3 !important;
  }

  .lesson-shell video,
  .lesson-shell #lessonVideo {
    width: 100% !important;
    max-height: min(32dvh, 250px) !important;
    object-fit: contain !important;
    display: block !important;
  }

  .lesson-shell .subtitle-panel {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .lesson-shell .subtitle-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: calc(100dvh - 320px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-padding-top: 10px !important;
    padding-bottom: 98px !important;
  }

  #mobileThemeToggle {
    color: var(--ink) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #mobileThemeToggle .moon-icon {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    color: currentColor !important;
    stroke: currentColor !important;
  }

}
/* ===== mobile learning hard override v2 end ===== */

/* ===== mobile bottom toolbar final fixed tabbar ===== */
@media (max-width: 720px) {
  .lesson-shell .subtitle-list {
    padding-bottom: 118px !important;
  }

  .mobile-bottom-tools {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    width: min(392px, calc(100vw - 24px)) !important;
    height: 64px !important;
    padding: 6px 10px !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 0 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    border: 1px solid rgba(26, 73, 61, 0.12) !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 24px rgba(20, 40, 30, 0.08) !important;
    backdrop-filter: none !important;
    z-index: 100 !important;
  }

  .mobile-bottom-tools button {
    box-sizing: border-box !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    font-family: inherit !important;
  }

  .mobile-bottom-tools button:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary) {
    width: auto !important;
    min-width: 0 !important;
    height: 52px !important;
    padding: 2px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;

    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .mobile-bottom-tools button:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary) span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 20px !important;
    line-height: 1 !important;
  }

  .mobile-bottom-tools button:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary) svg,
  .mobile-bottom-tools button:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary) span svg {
    width: 19px !important;
    height: 19px !important;
    display: block !important;
  }

  .mobile-bottom-tools .mobile-learning-tools[hidden],
  .mobile-bottom-tools .mobile-playback-tools[hidden] {
    display: none !important;
    pointer-events: none !important;
  }

  .mobile-bottom-tools .mobile-learning-tools,
  .mobile-bottom-tools .mobile-playback-tools {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-items: center;
  }

  .mobile-bottom-tools .mobile-learning-tools {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px minmax(0, 1fr) minmax(0, 1fr) 26px;
    column-gap: clamp(8px, 2.6vw, 14px);
  }

  .mobile-bottom-tools .mobile-playback-tools {
    grid-template-columns: minmax(58px, 1fr) minmax(52px, 1fr) 48px minmax(52px, 1fr) minmax(58px, 1fr);
    column-gap: clamp(14px, 4vw, 20px);
  }

  #mobilePlayToggle,
  .mobile-bottom-tools .mobile-primary-play {
    grid-column: 3 !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    transform: none !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    line-height: 1 !important;
  }

  #mobilePlayToggle > span:first-child,
  .mobile-primary-play-circle {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 999px !important;
    display: grid !important;
    grid-template-rows: 17px 11px !important;
    align-content: center !important;
    justify-items: center !important;
    gap: 2px !important;
    background: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(31, 122, 91, 0.18) !important;
  }

  #mobilePlayToggle .mobile-primary-play-icon {
    display: inline-grid !important;
    place-items: center !important;
    width: 18px !important;
    height: 17px !important;
    min-height: 0 !important;
    color: #fff !important;
    line-height: 1 !important;
  }

  #mobilePlayToggle .mobile-primary-play-label {
    color: #fff !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  #mobilePlaybackPlayToggle,
  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    aspect-ratio: 1 / 1 !important;
    transform: none !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center !important;
    border-radius: 999px !important;
    background: var(--accent) !important;
    color: #fff !important;
  }

  #mobilePlayToggle > span:first-child svg,
  .mobile-primary-play-circle svg {
    width: 16px !important;
    height: 16px !important;
  }

  #mobilePlaybackPlayToggle svg,
  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary svg {
    width: 20px !important;
    height: 20px !important;
  }

  #mobilePlayToggle > span:first-child svg,
  #mobilePlayToggle > span:first-child svg *,
  .mobile-primary-play-circle svg,
  .mobile-primary-play-circle svg *,
  #mobilePlaybackPlayToggle svg,
  #mobilePlaybackPlayToggle svg *,
  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary svg,
  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary svg * {
    color: #fff !important;
    fill: currentColor !important;
    stroke: currentColor !important;
  }

  #mobileBilingual { grid-column: 1 !important; }
  #mobileRateToggle { grid-column: 2 !important; }
  #mobilePlayToggle { grid-column: 3 !important; }
  #mobilePracticeMenu {
    display: flex !important;
    grid-column: 4 !important;
  }
  #mobileIntensive { grid-column: 5 !important; }
  #mobilePlaybackExpand { grid-column: 6 !important; }

  .mobile-playback-expand {
    position: static;
    z-index: 2;
    display: inline-grid;
    width: 26px;
    height: 32px;
    min-width: 26px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(235, 247, 237, 0.98);
    color: var(--accent-strong);
  }

  .mobile-playback-expand svg {
    width: 15px;
    height: 15px;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: 58px !important;
    height: 50px !important;
    padding: 0 !important;
    display: inline-flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #64776d !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-active {
    color: var(--accent-strong) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn[data-playback-action="continuous-play"] {
    max-width: 58px !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn[data-playback-action="continuous-play"].is-active {
    background: rgba(47, 111, 94, 0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(47, 111, 94, 0.18) !important;
    color: var(--accent-strong) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn[data-playback-action="collapse-controls"] {
    width: 48px !important;
    max-width: 48px !important;
    height: 48px !important;
    border-radius: 999px !important;
    background: rgba(235, 247, 237, 0.78) !important;
    color: var(--accent-strong) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn[data-playback-action="collapse-controls"] svg {
    width: 15px !important;
    height: 15px !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary {
    background: var(--accent) !important;
    box-shadow: 0 8px 16px rgba(31, 122, 91, 0.18) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-hint {
    font-size: 9px;
  }
}

/* ===== marketing home/library/profile mobile shell ===== */
@media (max-width: 859px) {
  .marketing-page .landing-shell,
  .marketing-page .profile-shell,
  .marketing-page .library-shell {
    width: min(100% - 24px, 520px);
    margin-right: auto;
    margin-left: auto;
  }

  .marketing-page .library-shell {
    padding-top: 8px;
    padding-bottom: 96px;
  }

}

@media (max-width: 390px) {
  .marketing-page .landing-shell,
  .marketing-page .profile-shell,
  .marketing-page .library-shell {
    width: min(100% - 20px, 500px);
  }
}

/* ===== home v2 targeted repair ===== */
@media (min-width: 860px) {
  .home-page .landing-shell {
    min-height: calc(100svh - 72px);
    grid-template-rows: minmax(420px, 1fr) auto;
    gap: clamp(18px, 2.4vh, 28px);
    padding-bottom: 32px;
  }

  .home-page .landing-hero {
    min-height: clamp(420px, 54vh, 620px);
  }

  .home-page .landing-feature-grid {
    gap: 16px;
    margin-top: 0;
  }

  .home-page .landing-feature-card {
    min-height: clamp(140px, 18vh, 190px);
    padding: 8px;
  }

  .home-page .landing-feature-card img {
    width: 96%;
    height: 92%;
    object-fit: contain;
  }
}

@media (max-width: 859px) {
  .marketing-page {
    padding-bottom: 88px;
  }

  .home-page .landing-shell {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 9px;
    min-height: calc(100svh - 88px);
    padding: 10px 0 10px;
  }

  .home-page .landing-hero {
    min-height: 0;
    border-radius: 22px;
    padding: 0;
    background: #f4efd9;
  }

  .home-page .landing-hero-art {
    display: block;
    width: 100%;
    height: clamp(300px, 40svh, 390px);
    margin: 0;
  }

  .home-page .landing-hero-art img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
  }

  .home-page .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
  }

  .home-page .landing-feature-card {
    min-height: clamp(108px, 14.5svh, 138px);
    border-radius: 16px;
    padding: 5px;
  }

  .home-page .landing-feature-card img {
    width: 96%;
    height: 94%;
    object-fit: contain;
  }

  .app-mobile-tabbar {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: min(430px, calc(100vw - 24px));
    margin: 0 auto;
    border: 1px solid rgba(47, 111, 94, 0.11);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 16px 36px rgba(32, 35, 31, 0.13);
    backdrop-filter: blur(14px);
  }

  .app-mobile-tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    border-radius: 14px;
    padding: 5px 2px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .app-mobile-tabbar a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 800;
  }

  .app-mobile-tabbar svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 390px) {
  .home-page .landing-feature-grid {
    gap: 8px;
  }

  .home-page .landing-feature-card {
    min-height: clamp(96px, 13.5svh, 122px);
  }
}

/* ===== home product layout final pass ===== */
.profile-page .profile-membership-card {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-page .profile-membership-card img {
  border-radius: 18px;
}

@media (min-width: 860px) {
  .home-page .landing-shell {
    display: grid;
    grid-template-rows: minmax(300px, 1fr) auto;
    gap: clamp(16px, 2vh, 24px);
    min-height: calc(100svh - 72px);
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .home-page .landing-hero {
    display: grid;
    grid-template-columns: minmax(330px, 0.42fr) minmax(420px, 0.58fr);
    align-items: center;
    gap: clamp(20px, 3vw, 48px);
    min-height: clamp(340px, 44vh, 520px);
    padding: clamp(28px, 4vw, 56px);
    background: linear-gradient(135deg, #fffdf0 0%, #eef3dd 100%);
  }

  .home-page .landing-hero-copy {
    max-width: 520px;
    padding: 0;
  }

  .home-page .landing-eyebrow {
    display: block;
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
  }

  .home-page .landing-hero h1 {
    margin-bottom: 14px;
    font-size: clamp(42px, 4vw, 64px);
    line-height: 1.04;
    letter-spacing: 0;
  }

  .home-page .landing-hero p {
    max-width: 34em;
    margin-bottom: 22px;
    color: #465248;
    font-size: 16px;
    line-height: 1.85;
  }

  .home-page .landing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    padding: 0 24px;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(47, 111, 94, 0.2);
  }

  .home-page .landing-hero-art {
    width: 100%;
    height: 100%;
    min-height: 260px;
  }

  .home-page .landing-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center right;
  }

  .home-page .landing-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .home-page .landing-feature-card {
    min-height: clamp(130px, 16vh, 170px);
    padding: 8px;
  }

  .home-page .landing-feature-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

@media (max-width: 859px) {
  .home-page .landing-shell {
    grid-template-rows: auto auto auto;
    gap: 10px;
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 88px;
  }

  .home-page .landing-hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    padding: 14px 14px 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, #fffdf0 0%, #eef3dd 100%);
  }

  .home-page .landing-hero-art {
    order: -1;
    width: 100%;
    height: clamp(118px, 18svh, 172px);
  }

  .home-page .landing-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .home-page .landing-hero-copy {
    padding: 0;
    text-align: left;
  }

  .home-page .landing-eyebrow {
    display: none;
  }

  .home-page .landing-hero h1 {
    margin-bottom: 6px;
    font-size: clamp(27px, 7vw, 34px);
    line-height: 1.08;
  }

  .home-page .landing-hero p {
    margin-bottom: 10px;
    color: #465248;
    font-size: clamp(12px, 3.35vw, 14px);
    line-height: 1.65;
  }

  .home-page .landing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(47, 111, 94, 0.18);
  }

  .home-page .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-page .landing-feature-card {
    min-height: clamp(100px, 13.2svh, 124px);
    padding: 5px;
  }

  .home-page .landing-feature-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

/* ===== final home + profile product polish ===== */
.home-page.marketing-page,
.profile-page.marketing-page {
  overflow-x: hidden;
}

.home-page .landing-shell {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
}

.home-page .landing-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.12);
  box-shadow: 0 20px 54px rgba(32, 35, 31, 0.09);
}

.home-page .landing-hero::before {
  content: "";
  position: absolute;
  inset: auto -8% -32% 42%;
  height: 58%;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(circle at 68% 42%, rgba(247, 218, 134, 0.32), transparent 24%),
    linear-gradient(100deg, rgba(126, 159, 116, 0.1), rgba(47, 111, 94, 0.18));
  pointer-events: none;
}

.landing-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.landing-tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #425044;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(32, 35, 31, 0.04);
}

.landing-hero-note {
  color: #5a665b !important;
}

.landing-study-panel {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 310px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 16% 16%, rgba(248, 222, 151, 0.22), transparent 28%),
    linear-gradient(145deg, #221d16 0%, #0f201f 45%, #162b25 100%);
  padding: 30px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 48px rgba(32, 35, 31, 0.18);
}

.study-panel-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.study-panel-badge span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f1c767;
  box-shadow: 0 0 0 5px rgba(241, 199, 103, 0.16);
}

.study-video-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(9, 23, 25, 0.72);
  padding: 16px;
}

.study-video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
}

.study-video-head div {
  display: inline-flex;
  gap: 6px;
}

.study-video-head b {
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.study-subtitle-line {
  display: grid;
  gap: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 14px 16px;
}

.study-subtitle-line.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 4px 0 0 #f1d68b;
}

.study-subtitle-line strong {
  font-size: 17px;
  letter-spacing: 0;
}

.study-subtitle-line small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.study-play-button {
  position: absolute;
  right: 26px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(145deg, #f6f1ce, #d8c37d);
  color: #2f4c3e;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.study-play-button svg {
  width: 24px;
  height: 24px;
}

.home-page .landing-feature-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.11);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(32, 35, 31, 0.06);
}

.home-page .landing-feature-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.06);
}

.landing-feature-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.landing-feature-icon svg {
  width: 25px;
  height: 25px;
}

.home-page .landing-feature-card strong {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.home-page .landing-feature-card small {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.landing-feature-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.08);
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.profile-page .profile-shell {
  gap: 12px;
}

.profile-page .profile-user-card,
.profile-page .profile-menu {
  box-shadow: 0 10px 26px rgba(32, 35, 31, 0.055);
}

.profile-page .profile-membership-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  margin-top: 0;
  border: 1px solid rgba(47, 111, 94, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 36%, rgba(239, 200, 112, 0.28), transparent 24%),
    linear-gradient(135deg, #fff8df 0%, #edf5e7 100%);
  padding: 18px;
  box-shadow: 0 14px 34px rgba(32, 35, 31, 0.07);
}

.profile-page .profile-membership-card p {
  margin: 0 0 8px;
  color: #5d674f;
  font-size: 13px;
  font-weight: 800;
}

.profile-page .profile-membership-card h2 {
  margin: 0 0 8px;
  color: #20231f;
  font-size: 24px;
  line-height: 1.1;
}

.profile-page .profile-membership-card span {
  color: #63705d;
  font-size: 13px;
}

.profile-page .membership-badge {
  position: relative;
  z-index: 1;
  min-width: 72px;
  height: 32px;
  background: rgba(47, 111, 94, 0.12);
  color: var(--accent) !important;
}

.membership-crown {
  position: absolute;
  right: 18px;
  bottom: 9px;
  width: 86px;
  height: 62px;
  opacity: 0.2;
}

.membership-crown::before {
  content: "";
  position: absolute;
  inset: 8px 8px 10px;
  background: #d7a64f;
  clip-path: polygon(0 100%, 0 42%, 22% 62%, 38% 18%, 55% 62%, 78% 34%, 100% 62%, 100% 100%);
}

.membership-crown::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 5px;
  left: 16px;
  height: 8px;
  border-radius: 999px;
  background: #d7a64f;
}

@media (min-width: 860px) {
  .home-page .landing-shell {
    display: grid;
    grid-template-rows: minmax(340px, 48vh) auto;
    gap: 18px;
    min-height: calc(100svh - 72px);
    padding-top: 18px;
    padding-bottom: 28px;
  }

  .home-page .landing-hero {
    display: grid;
    grid-template-columns: minmax(360px, 0.46fr) minmax(420px, 0.54fr);
    align-items: center;
    gap: clamp(24px, 4vw, 54px);
    min-height: 0;
    padding: clamp(28px, 4vw, 52px);
    background: linear-gradient(135deg, #fffdf0 0%, #eef3dd 100%);
  }

  .home-page .landing-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 540px;
    padding: 0;
  }

  .home-page .landing-hero h1 {
    margin-bottom: 14px;
    font-size: clamp(44px, 4.3vw, 66px);
    line-height: 1.04;
    letter-spacing: 0;
  }

  .home-page .landing-hero p {
    max-width: 35em;
    margin-bottom: 16px;
    color: #465248;
    font-size: 16px;
    line-height: 1.85;
  }

  .home-page .landing-hero .landing-hero-note {
    margin-bottom: 22px;
  }

  .home-page .landing-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    padding: 0 26px;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(47, 111, 94, 0.2);
  }

  .home-page .landing-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .home-page .landing-feature-card {
    min-height: clamp(118px, 15vh, 148px);
    padding: 18px;
  }
}

@media (max-width: 859px) {
  .home-page .landing-shell {
    width: min(100% - 24px, 520px);
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 10px;
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 92px;
  }

  .home-page .landing-hero {
    display: grid;
    gap: 12px;
    max-height: none;
    padding: 12px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf2 0%, #f0f5e7 100%);
  }

  .home-page .landing-hero-copy {
    display: grid;
    gap: 8px;
    text-align: left;
  }

  .home-page .landing-eyebrow {
    display: none;
  }

  .home-page .landing-hero h1 {
    margin: 0;
    font-size: clamp(31px, 8.2vw, 40px);
    line-height: 1.08;
  }

  .home-page .landing-hero p {
    margin: 0;
    color: #4f5b51;
    font-size: clamp(13px, 3.35vw, 15px);
    line-height: 1.58;
  }

  .landing-tag-row {
    gap: 7px;
    margin: 2px 0;
  }

  .landing-tag-row span {
    min-height: 28px;
    padding: 0 11px;
    font-size: 12px;
  }

  .home-page .landing-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 2px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(47, 111, 94, 0.18);
  }

  .landing-study-panel {
    order: -1;
    min-height: 168px;
    gap: 10px;
    border-radius: 22px;
    padding: 14px;
  }

  .study-panel-badge {
    padding: 7px 11px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .study-video-card {
    gap: 8px;
    border-radius: 18px;
    padding: 10px;
  }

  .study-video-head {
    font-size: 11px;
  }

  .study-video-head b {
    min-width: 30px;
    height: 23px;
    font-size: 10px;
  }

  .study-subtitle-line {
    gap: 3px;
    border-radius: 14px;
    padding: 9px 11px;
  }

  .study-subtitle-line strong {
    font-size: 14px;
  }

  .study-subtitle-line small {
    font-size: 11px;
  }

  .study-subtitle-line + .study-subtitle-line {
    display: none;
  }

  .study-play-button {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }

  .study-play-button svg {
    width: 18px;
    height: 18px;
  }

  .home-page .landing-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-page .landing-feature-card {
    min-height: 104px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
    border-radius: 18px;
  }

  .landing-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .landing-feature-icon svg {
    width: 22px;
    height: 22px;
  }

  .home-page .landing-feature-card strong {
    font-size: 14px;
  }

  .home-page .landing-feature-card small {
    font-size: 11px;
  }

  .landing-feature-arrow {
    top: 10px;
    right: 10px;
    width: 21px;
    height: 21px;
    font-size: 12px;
  }

  .profile-page .profile-shell {
    width: min(100% - 24px, 520px);
    gap: 10px;
    padding-top: 12px;
    padding-bottom: 92px;
  }

  .profile-topbar {
    margin-bottom: 2px;
  }

  .profile-topbar h1 {
    font-size: 24px;
  }

  .profile-user-card {
    padding: 14px;
  }

  .profile-avatar {
    width: 52px;
    height: 52px;
  }

  .profile-page .profile-membership-card {
    padding: 15px;
    border-radius: 20px;
  }

  .profile-page .profile-membership-card h2 {
    font-size: 21px;
  }

  .profile-menu {
    margin-top: 0;
  }

  .profile-menu-item {
    min-height: 50px;
    padding: 11px 12px;
  }

  .profile-logout-button {
    margin-top: 2px;
  }
}

@media (max-width: 390px) {
  .home-page .landing-shell {
    width: min(100% - 20px, 520px);
  }

  .home-page .landing-hero {
    padding: 10px;
  }

  .landing-study-panel {
    min-height: 154px;
  }

  .home-page .landing-feature-card {
    min-height: 96px;
    padding: 10px;
  }
}

/* ===== final product polish pass ===== */
.home-page .landing-feature-card {
  grid-template-rows: auto auto auto;
  align-content: center;
}

.landing-feature-tags {
  position: relative;
  z-index: 1;
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.landing-feature-tags b {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.08);
  color: var(--accent);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 800;
}

.profile-sync-note {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(47, 111, 94, 0.1);
  border-radius: 18px;
  background: rgba(237, 242, 234, 0.68);
  padding: 14px 16px;
  color: var(--accent-strong);
  box-shadow: 0 10px 24px rgba(32, 35, 31, 0.04);
}

.profile-sync-note strong {
  font-size: 14px;
}

.profile-sync-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (min-width: 860px) {
  .home-page .landing-shell {
    grid-template-rows: minmax(330px, 46vh) auto;
    gap: 14px;
    padding-bottom: 22px;
  }

  .home-page .landing-hero {
    padding: clamp(26px, 3.7vw, 48px);
  }

  .home-page .landing-feature-card {
    min-height: clamp(150px, 17vh, 178px);
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 6px 14px;
    padding: 20px 18px;
  }

  .landing-feature-icon {
    width: 54px;
    height: 54px;
  }

  .home-page .landing-feature-card strong {
    font-size: 17px;
  }

  .home-page .landing-feature-card small {
    max-width: 18em;
    font-size: 13px;
    line-height: 1.5;
  }

  .profile-page .profile-shell {
    width: min(520px, calc(100vw - 48px));
    gap: 12px;
    padding-top: 22px;
    padding-bottom: 28px;
  }
}

@media (max-width: 859px) {
  .home-page .landing-hero {
    align-content: start;
    gap: 10px;
  }

  .home-page .landing-hero-copy {
    gap: 7px;
  }

  .home-page .landing-hero .landing-hero-note {
    margin-bottom: 4px;
  }

  .home-page .landing-cta {
    margin-top: 6px;
  }

  .home-page .landing-feature-card {
    min-height: 126px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 5px 10px;
    align-content: center;
  }

  .landing-feature-tags {
    gap: 5px;
    margin-top: 2px;
  }

  .landing-feature-tags b {
    min-height: 20px;
    padding: 0 7px;
    font-size: 10px;
  }

  .profile-page .profile-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - 84px);
    gap: 11px;
  }

  .profile-page .profile-user-card,
  .profile-page .profile-membership-card,
  .profile-page .profile-menu,
  .profile-page .profile-logout-button,
  .profile-page .profile-sync-note {
    width: 100%;
  }

  .profile-page .profile-membership-card {
    min-height: 112px;
    padding: 16px;
  }

  .profile-page .profile-membership-card p {
    margin-bottom: 6px;
  }

  .profile-page .profile-membership-card h2 {
    margin-bottom: 6px;
  }

  .profile-menu-item {
    min-height: 52px;
  }

  .profile-logout-button {
    min-height: 44px;
  }

  .profile-sync-note {
    margin-top: auto;
    min-height: 66px;
  }
}

@media (max-width: 430px) {
  .home-page .landing-shell {
    gap: 9px;
  }

  .landing-study-panel {
    min-height: 160px;
  }

  .home-page .landing-feature-card {
    min-height: 118px;
  }

  .home-page .landing-feature-card small {
    line-height: 1.34;
  }
}

/* ===== final detail polish: feature modules and vertical balance ===== */
.marketing-toast {
  position: fixed;
  left: 50%;
  bottom: max(96px, calc(24px + env(safe-area-inset-bottom)));
  z-index: 1000;
  max-width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, 14px);
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.9);
  color: #fff;
  padding: 11px 18px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 16px 34px rgba(32, 35, 31, 0.18);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.marketing-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.home-page .landing-feature-card {
  appearance: none;
  cursor: pointer;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto auto;
  align-content: stretch;
  text-align: left;
  font: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-page .landing-feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 94, 0.2);
  box-shadow: 0 18px 34px rgba(32, 35, 31, 0.09);
}

.home-page .landing-feature-card:focus-visible {
  outline: 3px solid rgba(47, 111, 94, 0.24);
  outline-offset: 3px;
}

.home-page .landing-feature-card .landing-feature-icon {
  grid-row: 1 / span 2;
}

.home-page .landing-feature-card strong {
  grid-column: 2;
  align-self: end;
  letter-spacing: 0;
}

.home-page .landing-feature-card small {
  grid-column: 2 / 4;
  min-height: 2.8em;
}

.home-page .landing-feature-tags {
  grid-column: 1 / 4;
  align-self: center;
}

.feature-preview {
  position: relative;
  z-index: 1;
  grid-column: 1 / 4;
  display: grid;
  overflow: hidden;
  min-height: 58px;
  border: 1px solid rgba(47, 111, 94, 0.09);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(237, 242, 234, 0.9), rgba(255, 253, 245, 0.94));
  padding: 10px 12px;
}

.feature-preview-subtitle,
.feature-preview-card {
  gap: 3px;
}

.feature-preview b {
  color: #25302a;
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0;
}

.feature-preview small {
  min-height: 0 !important;
  color: #667264 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.feature-preview-card::before {
  content: "";
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.22);
}

.feature-preview-loop {
  grid-template-columns: repeat(4, 1fr) 34px;
  align-items: end;
  gap: 6px;
}

.feature-preview-loop i {
  display: block;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.22);
}

.feature-preview-loop i:nth-child(1) { height: 20px; }
.feature-preview-loop i:nth-child(2) { height: 34px; }
.feature-preview-loop i:nth-child(3) { height: 26px; }
.feature-preview-loop i:nth-child(4) { height: 42px; }

.feature-preview-loop em {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-style: normal;
}

.feature-preview-loop svg {
  width: 18px;
  height: 18px;
}

.feature-preview-materials {
  min-height: 58px;
}

.feature-preview-materials i {
  position: absolute;
  top: 14px;
  display: block;
  width: 52px;
  height: 34px;
  border: 1px solid rgba(47, 111, 94, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(32, 35, 31, 0.05);
}

.feature-preview-materials i:nth-child(1) {
  left: 12px;
  transform: rotate(-5deg);
}

.feature-preview-materials i:nth-child(2) {
  left: 50%;
  transform: translateX(-50%);
}

.feature-preview-materials i:nth-child(3) {
  right: 12px;
  transform: rotate(5deg);
}

@media (min-width: 860px) {
  .home-page .landing-shell {
    gap: 12px;
  }

  .home-page .landing-feature-card {
    min-height: clamp(198px, 22vh, 232px);
    padding: 18px;
  }
}

@media (max-width: 859px) {
  .home-page .landing-shell {
    padding-top: 18px;
    padding-bottom: 78px;
    gap: 8px;
  }

  .home-page .landing-hero {
    gap: 9px;
  }

  .landing-study-panel {
    min-height: 176px;
  }

  .home-page .landing-feature-grid {
    gap: 9px;
  }

  .home-page .landing-feature-card {
    min-height: 148px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 4px 9px;
    padding: 10px;
  }

  .home-page .landing-feature-card .landing-feature-icon {
    width: 38px;
    height: 38px;
  }

  .home-page .landing-feature-card strong {
    font-size: 13px;
  }

  .home-page .landing-feature-card small {
    min-height: 3.4em;
    font-size: 10.5px;
  }

  .feature-preview {
    min-height: 44px;
    border-radius: 12px;
    padding: 7px 9px;
  }

  .feature-preview b {
    font-size: 10.5px;
  }

  .feature-preview small {
    font-size: 9.5px !important;
  }

  .feature-preview-loop {
    grid-template-columns: repeat(4, 1fr) 28px;
    gap: 5px;
  }

  .feature-preview-loop em {
    width: 28px;
    height: 28px;
  }

  .feature-preview-loop i:nth-child(1) { height: 14px; }
  .feature-preview-loop i:nth-child(2) { height: 26px; }
  .feature-preview-loop i:nth-child(3) { height: 19px; }
  .feature-preview-loop i:nth-child(4) { height: 31px; }

  .feature-preview-materials i {
    top: 10px;
    width: 42px;
    height: 28px;
  }

  .profile-page .profile-shell {
    padding-top: 20px;
    gap: 10px;
  }

  .profile-page .profile-sync-note {
    padding: 13px 15px;
  }
}

@media (max-width: 390px) {
  .home-page .landing-feature-card {
    min-height: 140px;
  }

  .home-page .landing-feature-card small {
    font-size: 10px;
  }
}

/* ===== mobile interaction hotfix: keep pages scrollable and fixed bars non-blocking ===== */
@media (max-width: 859px) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #app,
  .marketing-page,
  .shell,
  .detail-shell,
  .learning-home-shell,
  .library-shell,
  .profile-shell,
  .favorites-page {
    min-height: 100dvh;
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .marketing-page,
  .detail-shell,
  .learning-home-shell,
  .library-shell,
  .profile-shell {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
  }

  .lesson-shell {
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom)) !important;
  }

  .lesson-shell .learning-layout,
  .lesson-shell .player-column,
  .lesson-shell .subtitle-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .lesson-shell .subtitle-list {
    min-height: 220px !important;
    max-height: min(560px, calc(100dvh - 430px)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: calc(126px + env(safe-area-inset-bottom)) !important;
  }

  .exercise-layout,
  .content-stack,
  .fill-practice-layout,
  .fill-question-pane,
  .dictation-question-pane {
    overflow: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  .fill-question-pane,
  .dictation-question-pane {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-bottom: calc(116px + env(safe-area-inset-bottom)) !important;
  }

  .app-mobile-tabbar {
    pointer-events: auto;
  }

  .drawer-backdrop[hidden],
  .profile-settings-backdrop[hidden],
  .lesson-overlay[hidden] {
    display: none !important;
    pointer-events: none !important;
  }

  .lesson-overlay {
    touch-action: manipulation;
  }
}

/* ===== mobile library UX + compact lesson layout ===== */
.course-card {
  position: relative;
  display: grid;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.course-card-main-link {
  display: grid;
  color: inherit;
  text-decoration: none;
}

.course-cover-wrap {
  position: relative;
  overflow: hidden;
  display: block;
  aspect-ratio: 16 / 10;
  background:
    linear-gradient(135deg, rgba(47, 111, 94, 0.08), rgba(247, 233, 161, 0.22)),
    var(--soft);
}

.course-cover-wrap::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: rgba(47, 111, 94, 0.55);
  content: "英语影读社";
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.course-cover-wrap img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-cover-wrap.cover-failed img,
.course-cover-wrap img.cover-failed {
  opacity: 0;
  visibility: hidden;
}

.course-duration-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(20, 24, 22, 0.76);
  padding: 3px 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.course-favorite-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #2b342f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
}

.course-favorite-toggle svg {
  width: 21px;
  height: 21px;
}

.course-favorite-toggle.active {
  color: #d99a00;
}

.course-card .course-cta {
  text-decoration: none;
}

.course-description {
  display: -webkit-box;
  white-space: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mode-button svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 768px) {
  .library-page .course-grid,
  .favorites-page .course-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .library-page .course-card,
  .favorites-page .learning-course-card {
    border-radius: 8px;
  }

  .library-page .course-card img,
  .favorites-page .learning-course-card img {
    aspect-ratio: 16 / 9 !important;
  }

  .library-page .course-body {
    gap: 6px;
    padding: 12px 13px 13px;
  }

  .library-page .course-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .library-page .course-body h2 {
    min-height: 0;
    font-size: 15px;
    line-height: 1.25;
  }

  .library-page .course-body p {
    font-size: 12px;
  }

  .library-page .tag-row {
    gap: 5px;
  }

  .library-page .tag-row span {
    padding: 3px 7px;
    font-size: 11px;
  }

  .library-page .course-cta {
    margin-top: 2px;
    padding: 6px 10px;
    font-size: 12px;
  }

}

/* AI voice score polished modal and mobile sheet */
.segment-actions .segment-action-btn.ai-score-action,
.lesson-shell .segment-actions .ai-score-action {
  width: auto !important;
  min-width: 112px !important;
  height: 32px !important;
  margin-left: 6px !important;
  padding: 0 11px !important;
  border: 1px solid rgba(47, 111, 94, 0.14) !important;
  border-radius: 999px !important;
  background: rgba(47, 111, 94, 0.10) !important;
  color: var(--accent-strong) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 780 !important;
  white-space: nowrap !important;
}

.segment-actions .segment-action-btn.ai-score-action,
.lesson-shell .segment-actions .ai-score-action,
.current-score-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-actions .segment-action-btn.ai-score-action .speech-score-action-svg,
.lesson-shell .segment-actions .ai-score-action .speech-score-action-svg,
.current-score-actions .speech-score-action-svg {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.current-score-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.current-score-actions button {
  min-height: 38px;
  border: 1px solid rgba(47, 111, 94, 0.16);
  border-radius: 999px;
  background: var(--accent);
  padding: 8px 14px;
  color: #fff;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(47, 111, 94, 0.16);
}

.speech-score-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
  background: rgba(32, 35, 31, 0.28);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.speech-score-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(760px, calc(100vw - 56px));
  max-height: min(600px, calc(100vh - 84px));
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 251, 0.98), rgba(250, 251, 246, 0.98));
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(32, 35, 31, 0.18);
  pointer-events: auto;
}

.speech-score-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.speech-score-sheet-handle {
  display: none;
}

.speech-score-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px 8px;
}

.speech-score-topbar > span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 5px 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.speech-score-close {
  position: relative;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.08);
  color: #21332d;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  pointer-events: auto;
}

.speech-score-close:hover {
  background: rgba(47, 111, 94, 0.14);
}

.speech-score-main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 252px;
  grid-template-areas:
    "heading score"
    "wave score"
    "controls score"
    "status score"
    "live score";
  gap: 12px 20px;
  min-height: 0;
  padding: 8px 20px 14px;
}

.speech-score-heading {
  grid-area: heading;
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 0;
}

.speech-score-heading h2 {
  margin: 0;
  color: #18231f;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

.speech-score-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.speech-score-wave {
  grid-area: wave;
  display: flex;
  align-items: center;
  width: min(100%, 500px);
  min-width: 360px;
  gap: 4px;
  height: 48px;
  padding: 0 2px;
}

.speech-score-wave span {
  display: block;
  width: 4px;
  height: var(--wave-height);
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.3);
  transform-origin: center;
}

.speech-score-dialog[data-score-state="recording"] .speech-score-wave span {
  animation: speechWavePulse 0.92s ease-in-out infinite;
}

.speech-score-dialog[data-score-state="recording"] .speech-score-wave span:nth-child(2n) {
  animation-delay: 0.12s;
}

.speech-score-dialog[data-score-state="recording"] .speech-score-wave span:nth-child(3n) {
  animation-delay: 0.24s;
}

@keyframes speechWavePulse {
  0%, 100% { transform: scaleY(0.62); opacity: 0.58; }
  50% { transform: scaleY(1.12); opacity: 1; }
}

.speech-score-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 0;
}

.speech-score-action,
.speech-score-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  white-space: normal;
}

.speech-score-action > span:last-child {
  min-width: 0;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.speech-score-action.is-loading {
  cursor: progress;
}

.speech-score-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  font-size: 15px;
  line-height: 1;
}

.speech-score-action-svg {
  display: block;
  width: 14px;
  height: 14px;
  color: currentColor;
}

.speech-score-action-secondary,
.speech-score-footer button:first-child {
  border: 1px solid rgba(47, 111, 94, 0.34);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-strong);
}

.speech-score-action-secondary.is-active {
  background: rgba(47, 111, 94, 0.1);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 94, 0.14);
}

.speech-score-action-primary,
.speech-score-footer button:last-child {
  border: 1px solid rgba(17, 97, 66, 0.1);
  background: linear-gradient(180deg, #1d7b5c, #106446);
  color: #fff;
  box-shadow: 0 12px 24px rgba(16, 100, 70, 0.18);
}

.speech-score-action:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.speech-score-status {
  grid-area: status;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(226, 238, 232, 0.56);
  padding: 8px 11px;
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1.35;
}

.speech-score-live {
  grid-area: live;
  min-height: 40px;
  margin: 0;
  border: 1px dashed rgba(47, 111, 94, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  padding: 8px 11px;
  color: var(--muted);
  font-size: 13px;
}

.speech-score-score-panel {
  grid-area: score;
  min-width: 0;
}

.speech-score-ring-card,
.speech-score-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 196px;
  height: 100%;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 246, 0.92));
  padding: 15px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.speech-score-ring {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--paper) 0 56%, transparent 57%),
    conic-gradient(var(--accent) var(--score-deg, 0deg), var(--ai-score-modal-ring-track, rgba(47, 111, 94, 0.16)) 0);
}

.speech-score-ring span {
  color: #17231f;
  font-size: 37px;
  font-weight: 900;
  line-height: 1;
}

.speech-score-ring em {
  margin-top: -20px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
}

.speech-score-ring-card strong,
.speech-score-empty strong {
  color: #17231f;
  font-size: 21px;
  font-weight: 900;
}

.speech-score-ring-card p,
.speech-score-empty span {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.speech-score-dimensions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 10px;
}

.speech-score-dimensions span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 999px;
  background: rgba(47, 111, 94, 0.08);
  padding: 3px 7px;
  color: #40534c;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.speech-score-dimensions strong {
  color: var(--accent-strong);
  font-weight: 900;
}

.speech-score-ring-card small {
  display: block;
  margin-top: 12px;
  border-top: 1px solid rgba(47, 111, 94, 0.1);
  padding-top: 11px;
  color: #40534c;
  font-size: 13px;
  line-height: 1.5;
}

.speech-score-empty-warning {
  border-color: rgba(188, 118, 35, 0.2);
  background: rgba(255, 246, 222, 0.78);
}

.speech-score-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  min-height: 112px;
  margin: 0 20px 12px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.speech-score-highlight {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 13px;
}

.speech-score-highlight + .speech-score-highlight {
  border-left: 1px solid rgba(47, 111, 94, 0.1);
}

.speech-score-highlight h3 {
  margin: 0 0 8px;
  color: #17231f;
  font-size: 14px;
}

.speech-score-highlight p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
}

.speech-score-highlight .matched {
  display: inline-block;
  margin: 2px;
  border-radius: 7px;
  background: rgba(47, 111, 94, 0.12);
  padding: 2px 7px;
  color: var(--accent-strong);
  font-weight: 800;
}

.speech-score-highlight .missed {
  display: inline-block;
  margin: 2px;
  border-radius: 7px;
  background: rgba(220, 67, 75, 0.09);
  padding: 2px 7px;
  color: #c83d48;
  font-weight: 800;
  text-decoration: none;
}

.speech-score-highlight .unmatched,
.speech-score-muted-text {
  color: #899189;
}

.speech-score-footer {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  border-top: 0;
  background: transparent;
  padding: 0 96px 18px;
  box-shadow: none;
}

.speech-score-footer [data-speech-clear] {
  min-width: 98px;
  border: 0;
  background: transparent;
  color: #6d7771;
  box-shadow: none;
  font-size: 13px;
}

.speech-score-footer [data-speech-clear]:hover {
  color: var(--accent-strong);
  background: rgba(47, 111, 94, 0.07);
}

@media (min-width: 769px) {
  .speech-score-dialog {
    width: min(720px, calc(100vw - 56px));
    max-height: min(560px, calc(100vh - 72px));
  }

  .speech-score-topbar {
    padding: 13px 18px 6px;
  }

  .speech-score-main {
    grid-template-columns: minmax(0, 1.32fr) 224px;
    gap: 8px 16px;
    padding: 6px 18px 10px;
  }

  .speech-score-heading {
    gap: 4px;
  }

  .speech-score-heading h2 {
    font-size: 19px;
    line-height: 1.24;
  }

  .speech-score-heading p {
    font-size: 12.5px;
    line-height: 1.32;
  }

  .speech-score-wave {
    width: min(100%, 430px);
    min-width: 320px;
    height: 42px;
  }

  .speech-score-controls {
    gap: 10px;
  }

  .speech-score-action,
  .speech-score-footer button {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 13px;
  }

  .speech-score-status {
    padding: 6px 10px;
    font-size: 12.5px;
    line-height: 1.28;
  }

  .speech-score-live {
    min-height: 34px;
    max-height: 48px;
    overflow-y: auto;
    padding: 7px 10px;
    font-size: 12.5px;
    line-height: 1.4;
  }

  .speech-score-score-panel {
    align-self: stretch;
  }

  .speech-score-ring-card,
  .speech-score-empty {
    min-height: 168px;
    height: 100%;
    padding: 12px;
  }

  .speech-score-ring {
    width: 88px;
    height: 88px;
    margin-bottom: 7px;
    background:
      radial-gradient(circle at center, var(--paper) 0 52%, transparent 53%),
      conic-gradient(var(--accent) var(--score-deg, 0deg), var(--ai-score-modal-ring-track, rgba(47, 111, 94, 0.16)) 0);
  }

  .speech-score-ring span {
    font-size: 32px;
  }

  .speech-score-ring em {
    margin-top: -17px;
    font-size: 11px;
  }

  .speech-score-ring-card strong,
  .speech-score-empty strong {
    font-size: 18px;
    line-height: 1.14;
  }

  .speech-score-ring-card p,
  .speech-score-empty span {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.25;
  }

  .speech-score-dimensions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    gap: 4px 5px;
    margin-top: 7px;
  }

  .speech-score-dimensions span {
    justify-content: center;
    min-width: 0;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .speech-score-dimensions strong {
    flex: 0 0 auto;
    font-size: 11.5px;
  }

  .speech-score-ring-card small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .speech-score-details {
    min-height: 98px;
    max-height: 118px;
    margin: 0 18px 10px;
  }

  .speech-score-highlight {
    max-height: 118px;
    overflow-y: auto;
    padding: 10px 11px;
  }

  .speech-score-highlight h3 {
    margin-bottom: 5px;
    font-size: 13px;
  }

  .speech-score-highlight p {
    font-size: 12.5px;
    line-height: 1.52;
  }

  .speech-score-highlight .matched,
  .speech-score-highlight .missed {
    margin: 1px;
    border-radius: 6px;
    padding: 1px 5px;
  }

  .speech-score-footer {
    gap: 10px;
    padding: 0 88px 14px;
  }
}

@media (max-width: 768px) {
  .segment-actions .segment-action-btn.ai-score-action,
  .lesson-shell .segment-actions .ai-score-action {
    width: auto !important;
    min-width: 112px !important;
    height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  .speech-score-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 12px 12px max(12px, env(safe-area-inset-bottom));
    background: rgba(32, 35, 31, 0.18);
  }

  .speech-score-dialog {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(430px, calc(100vw - 24px));
    height: auto;
    max-height: min(56vh, 510px);
    border-radius: 22px;
    padding-bottom: 0 !important;
  }

  .speech-score-sheet-handle {
    display: block;
    width: 66px;
    height: 4px;
    margin: 6px auto 0;
    border-radius: 999px;
    background: rgba(32, 35, 31, 0.22);
  }

  .speech-score-topbar {
    min-height: 36px;
    padding: 5px 14px 3px;
  }

  .speech-score-topbar > span {
    padding: 4px 10px;
    font-size: 12px;
  }

  .speech-score-close {
    width: 34px;
    height: 34px;
    margin: -4px -4px -4px 0;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 6px 16px rgba(32, 35, 31, 0.08);
    z-index: 5;
    pointer-events: auto;
  }

  .speech-score-scroll {
    overflow-y: auto;
    padding-bottom: 4px;
  }

  .speech-score-main {
    grid-template-columns: minmax(0, 1.12fr) minmax(132px, 0.94fr);
    grid-template-areas:
      "heading heading"
      "wave score"
      "controls controls"
      "status status"
      "live live";
    gap: 3px 7px;
    overflow: visible;
    padding: 2px 13px 5px 14px;
  }

  .speech-score-heading h2 {
    font-size: 16.5px;
    line-height: 1.24;
    overflow-wrap: anywhere;
  }

  .speech-score-heading {
    gap: 3px;
  }

  .speech-score-heading p {
    font-size: 12.5px;
    line-height: 1.28;
    overflow-wrap: anywhere;
  }

  .speech-score-wave {
    width: 100%;
    min-width: 0;
    height: 44px;
    gap: 3px;
    margin: 4px 0 0;
    align-self: center;
    justify-content: space-between;
    padding: 3px 0 1px;
  }

  .speech-score-wave span {
    width: 3px;
    min-height: 8px;
    opacity: 0.78;
  }

  .speech-score-controls {
    gap: 7px;
  }

  .speech-score-action,
  .speech-score-footer button {
    min-height: 36px;
    border-radius: 13px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .speech-score-status {
    overflow: hidden;
    padding: 4px 9px;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .speech-score-live {
    min-height: 42px;
    max-height: 58px;
    overflow-y: auto;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
  }

  .speech-score-live:empty {
    display: none;
  }

  .speech-score-score-panel {
    align-self: center;
    justify-self: stretch;
    padding-right: 1px;
  }

  .speech-score-ring-card,
  .speech-score-empty {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    align-content: center;
    min-height: 76px;
    height: auto;
    gap: 0;
    border-color: rgba(47, 111, 94, 0.18);
    padding: 5px 6px;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 243, 0.96));
    text-align: center;
  }

  .speech-score-ring {
    width: 43px;
    height: 43px;
    margin: 0 0 2px;
    background:
      radial-gradient(circle at center, var(--paper) 0 51%, transparent 52%),
      conic-gradient(var(--accent) var(--score-deg, 0deg), var(--ai-score-modal-ring-track, rgba(47, 111, 94, 0.18)) 0);
  }

  .speech-score-ring span {
    font-size: 18px;
  }

  .speech-score-ring em {
    margin-top: -11px;
    font-size: 8px;
  }

  .speech-score-ring-card strong,
  .speech-score-empty strong {
    display: block;
    overflow: hidden;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.08;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .speech-score-ring-card p,
  .speech-score-empty span,
  .speech-score-ring-card small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    margin-top: 1px;
    font-size: 9.5px;
    line-height: 1.16;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .speech-score-dimensions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    gap: 2px 4px;
    margin-top: 2px;
  }

  .speech-score-dimensions span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    overflow: visible;
    min-width: 0;
    padding: 2px 4px;
    font-size: 9.5px;
    line-height: 1.15;
    white-space: nowrap;
    text-overflow: clip;
  }

  .speech-score-dimensions strong {
    flex: 0 0 auto;
    font-size: 10px;
  }

  .speech-score-ring-card small {
    display: none;
  }

  .speech-score-details {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3px;
    min-height: 0;
    margin: 0 14px 5px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .speech-score-highlight {
    min-height: 58px;
    max-height: 70px;
    overflow-y: auto;
    border: 1px solid rgba(47, 111, 94, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    padding: 6px 8px;
  }

  .speech-score-highlight + .speech-score-highlight {
    border-left: 1px solid rgba(47, 111, 94, 0.12);
  }

  .speech-score-highlight h3 {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .speech-score-highlight p {
    font-size: 11px;
    line-height: 1.5;
  }

  .speech-score-highlight .matched,
  .speech-score-highlight .missed {
    display: inline;
    margin: 0;
    border-radius: 0;
    background: transparent;
    padding: 0 1px;
  }

  .speech-score-highlight .matched {
    color: var(--accent-strong);
    font-weight: 760;
  }

  .speech-score-highlight .missed {
    color: #c83d48;
    font-weight: 820;
  }

  .speech-score-footer {
    position: sticky;
    bottom: 0;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 7px;
    padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 251, 0.96);
    box-shadow: 0 -12px 28px rgba(32, 35, 31, 0.08);
  }

  .speech-score-footer [data-speech-clear] {
    min-width: 70px;
    padding-inline: 8px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .speech-score-dialog {
    width: calc(100vw - 20px);
    max-height: min(56vh, 510px);
  }

  .speech-score-main {
    grid-template-columns: minmax(0, 1.02fr) minmax(132px, 0.98fr);
    padding-inline: 12px;
    gap: 4px 7px;
  }

  .speech-score-ring-card,
  .speech-score-empty {
    min-height: 76px;
    padding-inline: 5px;
  }

  .speech-score-dimensions {
    gap: 3px;
  }

  .speech-score-details {
    margin-inline: 12px;
  }

  .speech-score-footer [data-speech-clear] {
    min-width: 58px;
    min-height: 36px;
  }
}

@media (max-width: 640px) {
  .speech-score-overlay {
    position: fixed;
    inset: 0;
    z-index: 130;
    align-items: flex-end;
    justify-content: center;
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    pointer-events: auto;
  }

  .speech-score-dialog {
    display: flex;
    flex-direction: column;
    width: min(430px, calc(100vw - 20px));
    height: auto;
    max-height: min(82vh, 620px);
    min-height: 0;
    border-radius: 18px;
    overflow: hidden;
    pointer-events: auto;
  }

  @supports (max-height: 100svh) {
    .speech-score-dialog {
      max-height: min(calc(100svh - 22px), 620px);
    }
  }

  @supports (max-height: 100dvh) {
    .speech-score-dialog {
      max-height: min(calc(100dvh - 22px), 620px);
    }
  }

  .speech-score-sheet-handle {
    flex: 0 0 auto;
    margin-top: 5px;
  }

  .speech-score-topbar {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 4px 12px 2px;
  }

  .speech-score-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }

  .speech-score-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "heading"
      "wave"
      "controls"
      "score"
      "status"
      "live";
    gap: 6px;
    min-height: 0;
    overflow: visible;
    padding: 4px 10px 7px;
  }

  .speech-score-heading h2 {
    font-size: 15.5px;
    line-height: 1.26;
    overflow-wrap: anywhere;
  }

  .speech-score-heading p {
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .speech-score-wave {
    height: 30px;
    margin: 0;
    padding: 0;
  }

  .speech-score-controls {
    gap: 6px;
  }

  .speech-score-action,
  .speech-score-footer button {
    min-height: 34px;
    border-radius: 11px;
    padding: 0 8px;
    font-size: 12px;
  }

  .speech-score-score-panel {
    width: 100%;
    align-self: stretch;
    justify-self: stretch;
    padding-right: 0;
  }

  .speech-score-ring-card,
  .speech-score-empty {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    align-content: center;
    min-height: 84px;
    height: auto;
    padding: 9px 10px;
    text-align: left;
  }

  .speech-score-ring {
    grid-row: 1 / span 4;
    width: 54px;
    height: 54px;
    margin: 0 10px 0 0;
  }

  .speech-score-ring span {
    font-size: 21px;
  }

  .speech-score-ring em {
    margin-top: -12px;
    font-size: 8px;
  }

  .speech-score-ring-card strong,
  .speech-score-empty strong,
  .speech-score-ring-card p,
  .speech-score-empty span,
  .speech-score-dimensions,
  .speech-score-ring-card small {
    grid-column: 2;
  }

  .speech-score-ring-card strong,
  .speech-score-empty strong {
    white-space: normal;
  }

  .speech-score-ring-card p,
  .speech-score-empty span {
    white-space: normal;
  }

  .speech-score-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 4px;
  }

  .speech-score-dimensions span {
    padding: 2px 5px;
    font-size: 10px;
  }

  .speech-score-ring-card small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 5px;
    padding-top: 5px;
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
    -webkit-line-clamp: 2;
  }

  .speech-score-status {
    white-space: normal;
  }

  .speech-score-live {
    min-height: 0;
    max-height: 48px;
    padding: 6px 8px;
  }

  .speech-score-details {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    min-height: 0;
    margin: 0 10px 6px;
    overflow: visible;
  }

  .speech-score-highlight {
    box-sizing: border-box;
    width: 100%;
    min-height: auto;
    max-height: 108px;
    overflow-y: auto;
    padding: 7px 9px;
    -webkit-overflow-scrolling: touch;
  }

  .speech-score-highlight + .speech-score-highlight {
    border-left: 1px solid rgba(47, 111, 94, 0.12);
  }

  .speech-score-highlight h3 {
    font-size: 11.5px;
  }

  .speech-score-highlight p {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .speech-score-footer {
    position: static;
    flex: 0 0 auto;
    gap: 6px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  }

  .speech-score-footer [data-speech-clear] {
    min-width: 62px;
  }
}

@media (max-width: 340px) {
  .speech-score-details {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== final mobile library single-column override ===== */
@media (max-width: 768px) {
  .library-page section.course-grid[aria-label="课程库"],
  .library-page .course-grid,
  .library-shell section.course-grid[aria-label="课程库"],
  .library-shell .course-grid,
  .library-page .course-list,
  .library-shell .course-list {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
  }

  .library-page section.course-grid[aria-label="课程库"] > .course-card,
  .library-page .course-grid > .course-card,
  .library-shell section.course-grid[aria-label="课程库"] > .course-card,
  .library-shell .course-grid > .course-card,
  .library-page .course-list > .course-card,
  .library-shell .course-list > .course-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .library-page .course-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .library-page .course-cover-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
  }

  .library-page .course-cover-wrap img,
  .library-page .course-card > img {
    display: block !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: cover !important;
  }

  .library-page .course-favorite-toggle {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 5 !important;
    display: grid !important;
    width: 40px !important;
    height: 40px !important;
    place-items: center !important;
    color: #2b342f !important;
  }

  .library-page .course-favorite-toggle.active {
    color: #d99a00 !important;
  }

  .library-page .course-duration-badge {
    position: absolute !important;
    right: 10px !important;
    bottom: 10px !important;
    z-index: 4 !important;
    background: rgba(20, 24, 22, 0.78) !important;
    color: #fff !important;
  }

  .library-page .course-body {
    gap: 4px !important;
    padding: 10px 11px 11px !important;
  }

  .library-page .course-title-row {
    gap: 6px !important;
  }

  .library-page .course-body h2 {
    line-height: 1.2 !important;
  }

  .library-page .course-body p {
    line-height: 1.28 !important;
  }

  .library-page .tag-row {
    gap: 4px !important;
    margin-top: 0 !important;
  }

  .library-page .tag-row span {
    padding: 2px 6px !important;
  }

  .library-page .course-cta {
    margin-top: 0 !important;
    padding: 5px 9px !important;
  }
}

/* ===== final mobile library top spacing trim ===== */
@media (max-width: 768px) {
  body.filter-drawer-open {
    overflow: hidden !important;
  }

  body.filter-drawer-open .app-mobile-tabbar {
    display: none !important;
  }

  .library-page .library-shell,
  .library-page .home-shell.library-shell,
  .marketing-page .library-shell {
    padding-top: 16px !important;
    gap: 12px !important;
  }

  .library-page .library-masthead,
  .library-page .masthead.library-masthead {
    gap: 8px !important;
    margin-bottom: 0 !important;
  }

  .library-page .library-masthead h1 {
    margin-bottom: 4px !important;
    line-height: 1.08 !important;
  }

  .library-page .library-masthead .tagline {
    margin-bottom: 0 !important;
    line-height: 1.35 !important;
  }

  .library-page .home-actions {
    gap: 8px !important;
    margin-top: 0 !important;
  }

  .library-page .search {
    min-height: 0 !important;
  }

  .library-page .search input {
    min-height: 40px !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }

  .library-page section.course-grid[aria-label="课程库"],
  .library-page .course-grid {
    margin-top: 12px !important;
  }
}

/* ===== final mobile library hard top compression ===== */
@media (max-width: 768px) {
  .library-page .library-shell,
  .library-page .home-shell.library-shell,
  .marketing-page .library-shell {
    padding-top: calc(72px + env(safe-area-inset-top, 0px)) !important;
    gap: 8px !important;
  }

  .library-page .library-masthead,
  .library-page .masthead.library-masthead {
    gap: 4px !important;
    margin-bottom: 0 !important;
  }

  .library-page .library-masthead h1 {
    margin-bottom: 2px !important;
    line-height: 1.02 !important;
  }

  .library-page .library-masthead .tagline {
    margin-bottom: 4px !important;
    line-height: 1.25 !important;
  }

  .library-page .home-actions {
    gap: 8px !important;
    margin-top: 0 !important;
    margin-bottom: 6px !important;
  }

  .library-page section.course-grid[aria-label="课程库"],
  .library-page .course-grid,
  .library-shell section.course-grid[aria-label="课程库"],
  .library-shell .course-grid {
    grid-template-columns: 1fr !important;
    margin-top: 0 !important;
    gap: 10px !important;
  }

  .library-page .library-count {
    margin: 0 !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .library-page .library-refresh-status {
    margin: 0 !important;
    color: var(--accent) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  .library-page .filter-drawer {
    top: 0 !important;
    bottom: auto !important;
    z-index: 120 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
  }

  .library-page .drawer-backdrop {
    z-index: 119 !important;
  }

  .library-page .filter-drawer form {
    display: flex !important;
    height: 100% !important;
    max-height: 100dvh !important;
    flex-direction: column !important;
    gap: 10px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .library-page .drawer-actions {
    position: fixed !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 121 !important;
    width: min(86vw, 360px) !important;
    margin: 0 !important;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid var(--line) !important;
    background: var(--paper) !important;
    box-shadow: 0 -10px 24px rgba(30, 35, 31, 0.12) !important;
  }

  .library-page .library-empty-state {
    display: grid !important;
    gap: 10px !important;
    justify-items: center !important;
    padding: 22px 12px !important;
  }

  .library-page .library-empty-state button {
    min-height: 38px !important;
    border-color: var(--accent) !important;
    background: var(--accent) !important;
    color: #fff !important;
  }
}

/* ===== mobile library sticky tool strip ===== */
@media (max-width: 768px) {
  .library-page .library-masthead,
  .library-page .masthead.library-masthead {
    display: contents !important;
  }

  .library-page .library-shell,
  .library-page .home-shell.library-shell,
  .marketing-page .library-shell {
    padding-top: calc(52px + env(safe-area-inset-top, 0px)) !important;
  }

  .library-page .library-masthead > div,
  .library-page .masthead.library-masthead > div {
    display: grid !important;
    gap: 4px !important;
  }

  .library-page .home-actions {
    position: fixed !important;
    top: env(safe-area-inset-top, 0px) !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 58 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 6px 14px 7px !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(47, 111, 94, 0.1) !important;
    border-radius: 0 !important;
    background: rgba(245, 246, 243, 0.98) !important;
    box-shadow: 0 4px 12px rgba(47, 111, 94, 0.06) !important;
    backdrop-filter: blur(12px);
  }

  .library-page .search {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .library-page .search input {
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    padding: 6px 11px !important;
    font-size: 13px !important;
    background: rgba(255, 255, 252, 0.96) !important;
  }

  .library-page .my-learning-link {
    display: none !important;
  }

  .library-page .filter-toggle,
  .library-page .library-theme-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
  }

  .library-page .filter-toggle,
  .library-page .library-theme-toggle {
    width: 34px !important;
    padding: 0 !important;
    color: var(--accent) !important;
    background: rgba(237, 242, 234, 0.86) !important;
    border: 1px solid rgba(47, 111, 94, 0.12) !important;
  }

  .library-page .filter-toggle svg,
  .library-page .library-theme-toggle svg {
    width: 17px !important;
    height: 17px !important;
  }

  .library-page .filter-toggle span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }
}

/* CATALOG PREMIUM SIDEBAR V2 */
@media (min-width: 860px) {
  .library-page {
    --catalog-nav-height: 0px;
    --catalog-sticky-top: var(--catalog-nav-height);
    --catalog-tools-height: 58px;
    --catalog-sidebar-top: calc(var(--catalog-sticky-top) + var(--catalog-tools-height) + 8px);
    --catalog-page-bg: var(--bg);
    --catalog-surface: var(--surface, var(--paper));
    --catalog-surface-soft: var(--surface-soft, var(--paper-soft));
    --catalog-border: var(--border-soft, var(--line));
    --catalog-border-strong: var(--border-strong, var(--line-strong));
    --catalog-text: var(--text-main, var(--text));
    --catalog-muted: var(--text-muted, var(--muted));
    --catalog-primary: var(--primary, var(--accent));
    --catalog-primary-strong: var(--primary-strong, var(--accent-strong));
  }

  .marketing-page.library-page {
    background: var(--catalog-page-bg) !important;
  }

  .library-page .site-nav,
  .favorites-page .site-nav {
    width: min(1840px, calc(100vw - 16px));
  }

  .library-page .site-user .site-theme-mode .theme-mode-summary,
  .favorites-page .site-user .site-theme-mode .theme-mode-summary {
    border-color: var(--tool-button-border, var(--catalog-border)) !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-text)) !important;
    box-shadow: none !important;
  }

  .library-page .site-user .site-theme-mode .theme-mode-panel,
  .favorites-page .site-user .site-theme-mode .theme-mode-panel {
    border-color: var(--modal-border, var(--catalog-border)) !important;
    background: var(--modal-bg, var(--catalog-surface)) !important;
    color: var(--modal-text, var(--catalog-text)) !important;
    box-shadow: none !important;
  }

  .library-page .site-user .site-theme-mode .theme-mode-option,
  .favorites-page .site-user .site-theme-mode .theme-mode-option {
    border-color: var(--tool-button-border, var(--catalog-border)) !important;
    background: var(--catalog-surface-soft) !important;
    color: var(--catalog-text) !important;
    box-shadow: none !important;
  }

  .library-page .library-shell,
  .library-page .home-shell.library-shell,
  .marketing-page .library-shell {
    width: min(1840px, calc(100vw - 16px)) !important;
    padding: 6px 0 40px !important;
  }

  .library-page .library-masthead,
  .library-page .masthead.library-masthead {
    display: none !important;
  }

  .library-page .library-count,
  .library-page .library-refresh-status {
    margin: 4px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .library-page .library-refresh-status {
    color: var(--accent) !important;
    font-weight: 700 !important;
  }

  .catalog-top-tools {
    position: sticky;
    top: var(--catalog-sticky-top);
    z-index: 35;
    display: grid;
    grid-template-columns: minmax(236px, 0.7fr) minmax(0, 1.3fr);
    gap: 12px;
    align-items: center;
    min-height: var(--catalog-tools-height);
    margin: 0 0 8px;
    border: 0;
    border-bottom: 1px solid var(--catalog-border);
    border-radius: 0;
    background: var(--catalog-page-bg);
    padding: 6px 0 8px;
    box-shadow: none;
  }

  .catalog-tool-context {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .catalog-tool-context strong {
    overflow: hidden;
    color: var(--catalog-text);
    font-size: 19px;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-tool-context small {
    overflow: hidden;
    color: var(--catalog-muted);
    font-size: 11px;
    line-height: 1.28;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-tool-context span,
  .catalog-results-head,
  .library-result-count {
    color: var(--catalog-muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .catalog-top-tools .home-actions {
    display: grid !important;
    grid-template-columns: minmax(260px, min(45vw, 580px)) max-content max-content;
    gap: 7px !important;
    align-items: center;
    justify-content: end;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
  }

  .catalog-search {
    position: relative;
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  .catalog-search .search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: var(--tool-button-icon, var(--catalog-primary));
    transform: translateY(-50%);
    pointer-events: none;
  }

  .catalog-search .search-icon svg {
    width: 16px;
    height: 16px;
  }

  .catalog-search input {
    height: 36px !important;
    min-height: 36px !important;
    border: 1px solid var(--input-border, var(--catalog-border)) !important;
    border-radius: 9px !important;
    background: var(--input-bg, var(--catalog-surface)) !important;
    color: var(--input-text, var(--catalog-text)) !important;
    padding: 0 12px 0 38px !important;
    box-shadow: none !important;
    font-size: 13px !important;
  }

  .catalog-search input::placeholder {
    color: var(--text-soft, var(--catalog-muted));
    opacity: 1;
  }

  .catalog-search input:focus {
    outline: 2px solid var(--score-button-border, var(--catalog-border-strong)) !important;
    outline-offset: 1px;
    border-color: var(--catalog-border-strong) !important;
    box-shadow: none !important;
  }

  .catalog-top-tools .my-learning-link {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
    height: 36px !important;
    min-height: 36px !important;
    border-radius: 9px !important;
    padding: 0 14px !important;
    font-weight: 780;
  }

  .catalog-top-tools .my-learning-link svg {
    width: 16px;
    height: 16px;
  }

  .catalog-top-tools .catalog-more-filter-button {
    display: inline-flex !important;
    gap: 6px;
    align-items: center;
    justify-content: center;
    height: 36px !important;
    min-height: 36px !important;
    border: 1px solid var(--tool-button-border, var(--catalog-border)) !important;
    border-radius: 9px !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-primary-strong)) !important;
    padding: 0 12px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 780 !important;
    white-space: nowrap;
  }

  .catalog-top-tools .catalog-more-filter-button svg {
    width: 15px;
    height: 15px;
  }

  .catalog-layout {
    position: relative;
    display: grid;
    grid-template-columns: clamp(148px, 10.8vw, 166px) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-width: 0;
  }

  .catalog-filter-sidebar {
    position: sticky;
    top: var(--catalog-sidebar-top);
    display: grid !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - var(--catalog-sidebar-top) - 8px);
    gap: 8px !important;
    align-self: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 2px 4px 0 0 !important;
    box-shadow: none;
  }

  .catalog-filter-head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
  }

  .catalog-filter-head strong {
    color: var(--catalog-primary-strong);
    font-size: 15px;
    line-height: 1.25;
  }

  .catalog-reset-filter {
    border: 1px solid var(--tool-button-border, var(--catalog-border));
    border-radius: 7px;
    background: var(--tool-button-bg, var(--catalog-surface));
    padding: 3px 6px;
    color: var(--catalog-primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
  }

  .catalog-reset-filter:disabled {
    opacity: 0.42;
    cursor: default;
  }

  .catalog-filter-section {
    display: grid !important;
    gap: 6px !important;
    min-width: 0;
    border-right: 0 !important;
    border-bottom: 1px solid var(--catalog-border);
    padding: 0 0 8px !important;
  }

  .catalog-filter-section:last-child {
    border-bottom: 0;
    padding-bottom: 0 !important;
  }

  .catalog-filter-section-head span {
    color: var(--catalog-muted);
    font-size: 12px;
    font-weight: 780;
  }

  .catalog-filter-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px !important;
  }

  .catalog-filter-section-one .catalog-filter-options {
    grid-template-columns: 1fr;
  }

  .catalog-filter-sidebar .chip {
    width: 100%;
    height: auto !important;
    min-height: 26px !important;
    border: 1px solid var(--tool-button-border, var(--catalog-border)) !important;
    border-radius: 7px !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-text)) !important;
    padding: 5px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    text-align: center;
    white-space: normal !important;
    box-shadow: none !important;
  }

  .catalog-filter-sidebar .chip.active {
    border-color: var(--catalog-primary) !important;
    background: var(--catalog-primary) !important;
    color: var(--button-primary-text, #fff) !important;
  }

  .catalog-filter-search-row {
    display: grid;
    grid-template-columns: minmax(0, 52px) minmax(0, 1fr);
    gap: 6px;
    align-items: center;
  }

  .catalog-filter-search-row .catalog-filter-apply {
    grid-column: 2;
    min-height: 28px;
    border: 1px solid var(--tool-button-border, var(--catalog-border));
    border-radius: 7px;
    background: var(--tool-button-bg, var(--catalog-surface));
    color: var(--tool-button-text, var(--catalog-primary-strong));
    cursor: pointer;
    font-size: 12px;
    font-weight: 760;
  }

  .catalog-filter-combobox {
    min-width: 0;
  }

  .catalog-filter-combobox input {
    width: 100%;
    min-width: 0;
    height: 28px;
    border: 1px solid var(--input-border, var(--catalog-border));
    border-radius: 7px;
    background: var(--input-bg, var(--catalog-surface));
    color: var(--input-text, var(--catalog-text));
    padding: 0 8px;
    font-size: 12px;
    outline: none;
  }

  .catalog-filter-combobox input:focus {
    outline: 2px solid var(--score-button-border, var(--catalog-border-strong));
    outline-offset: 1px;
    border-color: var(--catalog-border-strong);
    box-shadow: none;
  }

  .catalog-filter-section-searchable .chip {
    min-width: 0;
  }

  .catalog-filter-more {
    display: grid;
    gap: 6px;
  }

  .catalog-filter-more summary {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    cursor: pointer;
    color: var(--catalog-primary);
    font-size: 12px;
    font-weight: 750;
    list-style: none;
  }

  .catalog-filter-more summary::-webkit-details-marker {
    display: none;
  }

  .catalog-more-close,
  .catalog-filter-more[open] .catalog-more-open {
    display: none;
  }

  .catalog-filter-more[open] .catalog-more-close {
    display: inline;
  }

  .catalog-filter-options-extra {
    margin-top: 0;
  }

  .catalog-results-panel {
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .catalog-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin-bottom: 8px;
  }

  .library-page .course-grid {
    margin-top: 0 !important;
    gap: 8px !important;
  }

  .library-page .course-card {
    border-radius: 7px !important;
    border-color: var(--catalog-border) !important;
    background: var(--catalog-surface) !important;
    color: var(--catalog-text) !important;
    box-shadow: none !important;
  }

  .library-page .course-cover-wrap {
    aspect-ratio: 16 / 9 !important;
  }

  .library-page .course-body {
    gap: 5px !important;
    padding: 7px !important;
  }

  .library-page .course-body h2 {
    min-height: 32px !important;
    font-size: 12.5px !important;
    line-height: 1.22 !important;
    color: var(--catalog-text) !important;
  }

  .library-page .course-description {
    font-size: 11px !important;
    line-height: 1.32 !important;
    -webkit-line-clamp: 2 !important;
    color: var(--catalog-muted) !important;
  }

  .library-page .course-meta-line {
    overflow: hidden;
    color: var(--catalog-muted);
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .library-page .tag-row {
    gap: 4px !important;
  }

  .library-page .tag-row span {
    height: 22px !important;
    min-height: 22px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    border-color: var(--tool-button-border, var(--catalog-border)) !important;
    background: var(--tool-button-bg, var(--catalog-surface-soft)) !important;
    color: var(--tool-button-text, var(--catalog-text)) !important;
  }

  .library-page .course-cta {
    justify-content: center;
    width: 100% !important;
    min-height: 30px;
    margin-top: 1px !important;
    border: 1px solid var(--tool-button-border, var(--catalog-border));
    border-radius: 7px !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-primary-strong)) !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
  }

  .library-page .course-favorite-toggle {
    top: 6px !important;
    right: 6px !important;
    width: 32px !important;
    height: 32px !important;
    color: var(--tool-button-icon, var(--catalog-primary)) !important;
  }

  .library-page .course-favorite-toggle svg {
    width: 17px !important;
    height: 17px !important;
  }

  .library-page .course-duration-badge {
    right: 7px !important;
    bottom: 7px !important;
    padding: 3px 6px !important;
    font-size: 10px !important;
  }

  .library-page .drawer-backdrop,
  .library-page .drawer-backdrop[hidden] {
    display: none !important;
  }

  .library-page .filter-drawer {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 34 !important;
    display: none !important;
    width: min(420px, calc(100% - 190px)) !important;
    max-height: min(calc(100vh - var(--catalog-sticky-top) - 96px), 760px) !important;
    overflow: auto !important;
    transform: none !important;
    border: 1px solid var(--modal-border, var(--catalog-border)) !important;
    border-radius: 10px !important;
    background: var(--modal-bg, var(--paper)) !important;
    color: var(--modal-text, var(--text)) !important;
    box-shadow: none !important;
  }

  .library-page .filter-drawer.open {
    display: block !important;
  }

  .library-page .filter-drawer form {
    display: grid !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 7px !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  .library-page .drawer-head {
    align-items: center !important;
  }

  .library-page .drawer-head button,
  .library-page .drawer-home-link {
    min-height: 30px !important;
    border-color: var(--tool-button-border, var(--catalog-border)) !important;
    border-radius: 8px !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-primary-strong)) !important;
    font-size: 12px !important;
    box-shadow: none !important;
  }

  .library-page .drawer-home-link {
    display: none !important;
  }

  .library-page .drawer-field {
    gap: 4px !important;
    font-size: 12px !important;
    color: var(--modal-muted, var(--muted)) !important;
  }

  .library-page .drawer-field input,
  .library-page .drawer-field select {
    min-height: 31px !important;
    border-color: var(--input-border, var(--catalog-border)) !important;
    border-radius: 8px !important;
    background: var(--input-bg, var(--paper)) !important;
    color: var(--input-text, var(--text)) !important;
  }

  .library-page .drawer-field input::placeholder {
    color: var(--text-soft, var(--modal-muted, var(--catalog-muted)));
    opacity: 1;
  }

  .library-page .drawer-field select option {
    background: var(--modal-bg, var(--catalog-surface));
    color: var(--modal-text, var(--catalog-text));
  }

  .library-page .drawer-actions {
    position: sticky !important;
    bottom: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 8px !important;
    margin-top: 2px !important;
    border-top: 1px solid var(--modal-border, var(--catalog-border)) !important;
    background: var(--modal-bg, var(--paper)) !important;
    padding-top: 8px !important;
    box-shadow: none !important;
  }

  .library-page .drawer-actions button {
    min-height: 34px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    box-shadow: none !important;
  }

  .library-page .drawer-actions button[type="submit"] {
    border-color: var(--catalog-primary) !important;
    background: var(--catalog-primary) !important;
    color: var(--button-primary-text, #fff) !important;
  }

  .library-page .drawer-actions #resetFilters {
    border-color: var(--tool-button-border, var(--catalog-border)) !important;
    background: var(--tool-button-bg, var(--catalog-surface)) !important;
    color: var(--tool-button-text, var(--catalog-primary-strong)) !important;
  }
}

@media (min-width: 1180px) {
  .library-page .course-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 980px) and (max-width: 1179px) {
  .library-page .course-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 860px) and (max-width: 979px) {
  .catalog-layout {
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 8px;
  }

  .library-page .course-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 859px) {
  .library-page .catalog-top-tools {
    display: contents !important;
  }

  .library-page .catalog-tool-context,
  .library-page .catalog-results-head,
  .library-page .catalog-filter-sidebar {
    display: none !important;
  }

  .library-page .catalog-layout,
  .library-page .catalog-results-panel {
    display: block !important;
    min-width: 0 !important;
  }

  .library-page .catalog-search .search-icon {
    display: none !important;
  }
}

/* ===== final mobile lesson controls polish ===== */
@media (max-width: 768px) {
  #mobileThemeToggle,
  .mobile-learn-topbar #mobileThemeToggle {
    color: var(--accent) !important;
    display: inline-grid !important;
    place-items: center !important;
  }

  #mobileThemeToggle svg,
  .mobile-learn-topbar #mobileThemeToggle svg,
  .mode-button svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    color: currentColor !important;
    fill: currentColor;
    stroke: currentColor;
  }

}

/* ===== final theme icon + desktop lesson alignment ===== */
.mode-button svg,
#themeToggle svg,
#mobileThemeToggle svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  color: currentColor !important;
}

.mode-button svg circle,
.mode-button svg path,
#themeToggle svg circle,
#themeToggle svg path,
#mobileThemeToggle svg circle,
#mobileThemeToggle svg path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
}

.mode-button svg.sun-icon,
#themeToggle svg.sun-icon,
#mobileThemeToggle svg.sun-icon {
  width: 20px !important;
  height: 20px !important;
}

.mode-button svg.sun-icon .sun-core,
#themeToggle svg.sun-icon .sun-core,
#mobileThemeToggle svg.sun-icon .sun-core {
  fill: currentColor !important;
  stroke: currentColor !important;
  stroke-width: 2.1 !important;
}

.mode-button svg.sun-icon .sun-rays,
#themeToggle svg.sun-icon .sun-rays,
#mobileThemeToggle svg.sun-icon .sun-rays {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.4 !important;
  stroke-linecap: round !important;
}

/* final desktop lesson stable layout */
@media (min-width: 860px) {
  .lesson-shell .learning-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.95fr) !important;
    grid-template-rows: auto auto auto auto auto auto auto auto !important;
    position: relative !important;
    gap: 8px 16px !important;
    align-items: start !important;
    align-content: start !important;
  }

  .lesson-shell .player-column,
  .lesson-shell .video-column,
  .lesson-shell .lesson-main-column {
    align-self: start !important;
    align-content: start !important;
    justify-content: flex-start !important;
  }

  .lesson-shell .player-column > video {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .lesson-shell .player-column > .lesson-video-progress {
    grid-column: 1 !important;
    grid-row: 3 !important;
    justify-self: center !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
  }

  .lesson-shell .player-column > .desktop-playback-controls {
    grid-column: 1 !important;
    grid-row: 4 !important;
    justify-self: center !important;
    margin-top: 6px !important;
    margin-bottom: 0 !important;
  }

  .lesson-shell .player-column > .info-chips {
    grid-column: 1 !important;
    grid-row: 5 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .lesson-shell .player-column > .desktop-tool-strip {
    grid-column: 1 !important;
    grid-row: 6 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .lesson-shell .player-column > .lesson-intro {
    grid-column: 1 !important;
    grid-row: 8 !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }

  .lesson-shell .feature-dock {
    grid-column: 1 !important;
    grid-row: 7 !important;
    margin-top: 4px !important;
    padding-top: 0 !important;
    align-self: start !important;
    justify-self: stretch !important;
    transform: none !important;
  }

  .lesson-shell .feature-grid {
    align-content: start !important;
    align-self: start !important;
    gap: 7px !important;
  }

  .lesson-shell .subtitle-panel {
    grid-column: 2 !important;
    grid-row: 2 / 9 !important;
    position: absolute !important;
    inset: 0 0 auto 0 !important;
    align-self: start !important;
    justify-self: stretch !important;
    width: 100% !important;
    min-width: 420px !important;
    max-width: 540px !important;
    height: clamp(580px, 74vh, 740px) !important;
    max-height: clamp(580px, 74vh, 740px) !important;
    margin-top: 0 !important;
    padding-top: 8px !important;
    overflow: hidden !important;
  }

  .lesson-shell .subtitle-list {
    max-height: calc(100% - 42px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
  }

  .lesson-shell .subtitle-item {
    padding: 7px 8px !important;
  }
}

/* final mobile compact subtitles */
@media (max-width: 768px) {
  .lesson-shell .subtitle-list {
    gap: 4px !important;
    padding-bottom: 82px !important;
    scroll-padding-top: 8px !important;
  }

  .lesson-shell .subtitle-item {
    gap: 4px !important;
    padding: 6px 7px !important;
    border-radius: 7px !important;
  }

  .lesson-shell .subtitle-main {
    gap: 3px !important;
  }

  .lesson-shell .subtitle-meta {
    gap: 4px !important;
    font-size: 10px !important;
  }

  .lesson-shell .subtitle-meta b {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
  }

  .lesson-shell .subtitle-lines .line-en {
    margin-bottom: 2px !important;
    font-size: 13px !important;
    line-height: 1.34 !important;
  }

  .lesson-shell .subtitle-lines .line-zh {
    font-size: 11.5px !important;
    line-height: 1.32 !important;
  }

  .lesson-shell .core-term-tags {
    gap: 3px !important;
    margin-top: 2px !important;
  }

  .lesson-shell .core-term-chip {
    gap: 2px !important;
    padding: 1px 4px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  .lesson-shell .core-term-chip small {
    font-size: 9px !important;
  }

  .lesson-shell .segment-actions {
    gap: 4px !important;
    margin-top: 2px !important;
  }

  .lesson-shell .segment-actions button {
    --btn-size: 28px !important;
    --icon-size: 14px !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
  }
}

/* subtitle visual system polish */
.subtitle-item {
  border-color: rgba(47, 111, 94, 0.12);
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 84%, var(--soft));
  box-shadow: 0 8px 22px rgba(32, 35, 31, 0.045);
}

.subtitle-item.active {
  border-color: rgba(47, 111, 94, 0.48);
  background:
    linear-gradient(180deg, rgba(255, 252, 236, 0.98), rgba(239, 249, 235, 0.97)),
    radial-gradient(circle at 100% 0%, rgba(255, 224, 158, 0.26), transparent 34%);
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 10px 26px rgba(47, 111, 94, 0.11);
}

.subtitle-meta {
  opacity: 0.78;
}

.subtitle-lines .line-en {
  color: var(--text);
  font-weight: 680;
  letter-spacing: 0;
}

.subtitle-lines .line-zh {
  color: color-mix(in srgb, var(--muted) 86%, var(--text));
  font-weight: 500;
}

.word-hit {
  border-radius: 7px;
  padding: 0 4px 1px;
  background:
    linear-gradient(180deg, rgba(255, 251, 219, 0.5), rgba(255, 233, 158, 0.72)),
    linear-gradient(90deg, rgba(190, 230, 194, 0.48), rgba(255, 219, 157, 0.4));
  box-shadow: 0 0 0 1px rgba(188, 143, 42, 0.14);
  text-decoration-line: underline;
  text-decoration-thickness: 1.75px;
  text-decoration-color: rgba(216, 128, 43, 0.66);
  text-underline-offset: 4px;
  text-decoration-skip-ink: auto;
}

.subtitle-item.active .word-hit {
  background:
    linear-gradient(180deg, rgba(255, 251, 218, 0.64), rgba(255, 222, 145, 0.78)),
    linear-gradient(90deg, rgba(177, 226, 188, 0.58), rgba(255, 211, 146, 0.5));
  box-shadow: 0 0 0 1px rgba(47, 111, 94, 0.16);
  text-decoration-color: rgba(47, 111, 94, 0.7);
}

.core-term-chip {
  border-color: rgba(47, 111, 94, 0.14);
  background: linear-gradient(180deg, rgba(255, 246, 203, 0.94), rgba(239, 247, 225, 0.92));
  box-shadow: 0 3px 10px rgba(47, 111, 94, 0.055);
  text-decoration: none;
}

.core-term-chip span,
.core-term-chip small {
  text-decoration: none;
}

.segment-actions .segment-action-btn {
  border-radius: 999px;
}

body[data-theme="dark"] .subtitle-item {
  border-color: rgba(177, 209, 192, 0.14);
  background: linear-gradient(180deg, rgba(39, 48, 43, 0.94), rgba(30, 38, 34, 0.94));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .subtitle-item.active {
  border-color: rgba(132, 196, 165, 0.56);
  background:
    linear-gradient(180deg, rgba(48, 74, 61, 0.94), rgba(30, 50, 42, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(179, 125, 54, 0.18), transparent 36%);
  box-shadow:
    inset 3px 0 0 #82c9a7,
    0 12px 28px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .subtitle-lines .line-en {
  color: #f4f7f1;
}

body[data-theme="dark"] .subtitle-lines .line-zh,
body[data-theme="dark"] .subtitle-meta {
  color: #b7c2ba;
}

body[data-theme="dark"] .word-hit {
  background:
    linear-gradient(180deg, rgba(142, 109, 43, 0.58), rgba(94, 80, 35, 0.62)),
    linear-gradient(90deg, rgba(71, 120, 92, 0.46), rgba(134, 87, 43, 0.36));
  color: #fff5bd;
  box-shadow: 0 0 0 1px rgba(238, 211, 115, 0.24);
  text-decoration-color: rgba(238, 172, 92, 0.82);
}

body[data-theme="dark"] .subtitle-item.active .word-hit {
  background:
    linear-gradient(180deg, rgba(158, 119, 44, 0.72), rgba(105, 89, 38, 0.72)),
    linear-gradient(90deg, rgba(83, 143, 109, 0.56), rgba(151, 96, 45, 0.45));
  color: #fff6c8;
  text-decoration-color: rgba(151, 224, 181, 0.82);
}

body[data-theme="dark"] .core-term-chip {
  border-color: rgba(229, 201, 105, 0.2);
  background: linear-gradient(180deg, rgba(92, 80, 36, 0.76), rgba(48, 66, 52, 0.72));
  color: #f7f0c8;
  box-shadow: none;
}

body[data-theme="dark"] .core-term-chip small {
  color: #c1c8bf;
}

body[data-theme="dark"] .segment-actions .segment-action-btn:hover {
  background: rgba(132, 196, 165, 0.14);
}

body[data-theme="dark"] .segment-actions .loop-action.is-active {
  background: rgba(132, 196, 165, 0.18);
  color: #bfe6d2;
}

body[data-theme="dark"] .segment-actions .sentence-favorite-action.is-active {
  background: rgba(232, 184, 74, 0.16);
  color: #ffd986;
}

@media (max-width: 768px) {
  .lesson-shell .subtitle-list {
    gap: 7px !important;
  }

  .lesson-shell .subtitle-item {
    gap: 7px !important;
    padding: 9px 10px !important;
    border-radius: 12px !important;
  }

  .lesson-shell .subtitle-main {
    gap: 5px !important;
  }

  .lesson-shell .subtitle-meta {
    gap: 5px !important;
    font-size: 10px !important;
  }

  .lesson-shell .subtitle-meta b {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    opacity: 0.86 !important;
  }

  .lesson-shell .subtitle-lines .line-en {
    margin-bottom: 5px !important;
    font-size: 16px !important;
    line-height: 1.48 !important;
    font-weight: 710 !important;
  }

  .lesson-shell .subtitle-lines .line-zh {
    font-size: 13px !important;
    line-height: 1.48 !important;
  }

  .lesson-shell .core-term-row,
  .lesson-shell .core-term-tags {
    gap: 5px !important;
    margin-top: 4px !important;
  }

  .lesson-shell .core-term-chip {
    gap: 3px !important;
    padding: 3px 7px !important;
    font-size: 11px !important;
    line-height: 1.34 !important;
  }

  .lesson-shell .core-term-chip small {
    font-size: 10px !important;
  }

  .lesson-shell .segment-actions {
    gap: 6px !important;
    margin-top: 3px !important;
  }

  .lesson-shell .segment-actions .segment-action-btn,
  .lesson-shell .segment-actions button {
    --icon-size: 15px !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
  }

  .lesson-shell .segment-actions .segment-action-btn.ai-score-action,
  .lesson-shell .segment-actions button.ai-score-action {
    width: auto !important;
    min-width: 116px !important;
    margin-left: 6px !important;
    padding: 0 10px !important;
    gap: 6px !important;
  }
}

/* word lookup card visual polish */
.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) {
  width: min(480px, 100%);
  border-color: rgba(47, 111, 94, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 92% 6%, rgba(255, 228, 164, 0.26), transparent 32%),
    linear-gradient(180deg, rgba(255, 253, 244, 0.98), rgba(242, 248, 237, 0.98));
  padding: 22px;
  box-shadow: 0 22px 60px rgba(31, 73, 56, 0.16);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-close {
  top: 14px;
  right: 14px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title {
  align-items: flex-start;
  gap: 14px;
  padding-right: 38px;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title h2,
.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) > h2 {
  margin-bottom: 7px;
  color: var(--text);
  font-size: clamp(27px, 6vw, 36px);
  line-height: 1.08;
  letter-spacing: 0;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-kind {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  border: 1px solid rgba(47, 111, 94, 0.14);
  border-radius: 999px;
  background: rgba(237, 246, 236, 0.86);
  padding: 4px 9px;
  color: var(--accent) !important;
  font-size: 12px;
  line-height: 1;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title button[data-speak] {
  width: 42px;
  height: 42px;
  border-color: rgba(47, 111, 94, 0.16);
  background: linear-gradient(180deg, #f8fff4, #e7f3e7);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(31, 107, 83, 0.1);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .phonetic {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 12px 0 10px;
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 12px;
  background: rgba(255, 250, 230, 0.74);
  padding: 6px 10px;
  color: color-mix(in srgb, var(--muted) 82%, var(--text));
  font-size: 14px;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-meaning {
  border: 1px solid rgba(47, 111, 94, 0.12);
  border-radius: 14px;
  background: rgba(255, 250, 230, 0.72);
  padding: 12px;
  line-height: 1.72;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list {
  gap: 9px;
  margin: 12px 0;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list div {
  gap: 5px;
  border-color: rgba(47, 111, 94, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 250, 0.76);
  padding: 10px 12px;
  box-shadow: 0 5px 14px rgba(31, 73, 56, 0.04);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list dt {
  color: var(--accent);
  font-weight: 700;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list dd {
  line-height: 1.62;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example {
  margin: 12px 0;
  border-left: 3px solid rgba(47, 111, 94, 0.34);
  border-radius: 14px;
  background: rgba(243, 248, 235, 0.86);
  padding: 11px 12px;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-header {
  margin-bottom: 6px;
  padding-right: 26px;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example > span,
.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-header > span {
  display: inline-flex;
  color: var(--accent);
  font-weight: 700;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-speaker {
  width: 32px;
  height: 32px;
  border-color: rgba(47, 111, 94, 0.16);
  background: rgba(255, 255, 255, 0.66);
  color: var(--accent);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example blockquote {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.58;
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example p {
  margin-bottom: 0;
  color: var(--muted);
}

.lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-primary {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 760;
  box-shadow: 0 12px 24px rgba(47, 111, 94, 0.2);
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) {
  border-color: rgba(132, 196, 165, 0.24);
  background:
    radial-gradient(circle at 92% 6%, rgba(166, 119, 53, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(36, 48, 42, 0.98), rgba(24, 33, 29, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-close,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title button[data-speak],
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-speaker {
  border-color: rgba(132, 196, 165, 0.24);
  background: rgba(132, 196, 165, 0.12);
  color: #dcebe2;
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-kind {
  border-color: rgba(132, 196, 165, 0.22);
  background: rgba(132, 196, 165, 0.12);
  color: #bfe6d2 !important;
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .phonetic,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-meaning,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list div {
  border-color: rgba(177, 209, 192, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: #edf1ec;
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .phonetic,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example p {
  color: #b7c2ba;
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list dt,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example > span,
body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-header > span {
  color: #bfe6d2;
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example {
  border-left-color: rgba(132, 196, 165, 0.42);
  background: rgba(132, 196, 165, 0.08);
}

body[data-theme="dark"] .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example blockquote {
  color: #f4f7f1;
}

@media (max-width: 859px) {
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) {
    max-height: min(78dvh, calc(100dvh - 132px - env(safe-area-inset-bottom)));
    border-radius: 22px 22px 0 0;
    padding: 18px 16px calc(28px + env(safe-area-inset-bottom));
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title h2,
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) > h2 {
    font-size: 30px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-primary {
    min-height: 46px;
  }
}

@media (max-width: 859px) {
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) {
    max-height: min(72dvh, calc(100dvh - 152px - env(safe-area-inset-bottom)));
    padding: 14px 14px calc(22px + env(safe-area-inset-bottom));
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-close {
    top: 10px;
    right: 10px;
    min-width: 34px;
    min-height: 34px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .eyebrow {
    margin-bottom: 5px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title {
    gap: 10px;
    padding-right: 34px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title h2,
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) > h2 {
    margin-bottom: 5px;
    font-size: 26px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-title button[data-speak] {
    width: 38px;
    height: 38px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-kind {
    padding: 3px 8px;
    font-size: 11px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .phonetic {
    margin: 8px 0 7px;
    padding: 5px 9px;
    font-size: 13px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .lookup-meaning,
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list div,
  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example {
    padding: 8px 10px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-detail-list {
    gap: 7px;
    margin: 8px 0;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example {
    margin: 8px 0;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example-header {
    padding-right: 24px;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .term-example blockquote {
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.48;
  }

  .lookup-modal:not(.practice-menu-modal):not(.intensive-modal) .modal-primary {
    min-height: 42px;
    margin-top: 4px;
  }
}


/* continue learning polish */
.continue-learning-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(47, 111, 94, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 253, 244, 0.96), rgba(239, 249, 234, 0.94)),
    var(--paper);
  box-shadow: 0 14px 34px rgba(31, 73, 56, 0.08);
}

.continue-learning-cover {
  width: 82px;
  height: 56px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(47, 111, 94, 0.08);
}

.continue-learning-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-learning-cover span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.continue-learning-card .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.continue-learning-card h2 {
  margin: 0 0 5px;
  font-size: 19px;
  line-height: 1.22;
}

.continue-learning-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.continue-learning-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.continue-learning-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  padding: 0 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.resume-learning-prompt {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(47, 111, 94, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 253, 244, 0.96), rgba(237, 248, 236, 0.96));
  box-shadow: 0 10px 24px rgba(31, 73, 56, 0.08);
}

.resume-learning-prompt strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.resume-learning-prompt span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.resume-learning-prompt button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  padding: 7px 12px;
  color: #fff;
  font-weight: 800;
}

.resume-learning-prompt .resume-dismiss {
  background: rgba(47, 111, 94, 0.08);
  color: var(--accent);
  min-width: 30px;
  padding: 7px 9px;
}

.learning-progress-line {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

body[data-theme="dark"] .continue-learning-card,
body[data-theme="dark"] .resume-learning-prompt {
  border-color: rgba(126, 183, 159, 0.22);
  background: linear-gradient(135deg, rgba(31, 42, 36, 0.96), rgba(24, 35, 30, 0.96));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .continue-learning-card h2,
body[data-theme="dark"] .resume-learning-prompt strong {
  color: #f4f7f1;
}

body[data-theme="dark"] .continue-learning-card p,
body[data-theme="dark"] .continue-learning-card small,
body[data-theme="dark"] .resume-learning-prompt span {
  color: #b7c2ba;
}

body[data-theme="dark"] .continue-learning-action,
body[data-theme="dark"] .resume-learning-prompt button {
  background: #2f7f64;
}

body[data-theme="dark"] .resume-learning-prompt .resume-dismiss {
  background: rgba(126, 183, 159, 0.14);
  color: #bfe3d4;
}

@media (max-width: 768px) {
  .continue-learning-card {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
  }

  .continue-learning-cover {
    width: 70px;
    height: 52px;
  }

  .continue-learning-card h2 {
    font-size: 16px;
  }

  .continue-learning-card p,
  .continue-learning-card small {
    font-size: 11.5px;
  }

  .continue-learning-action {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 36px;
  }

  .resume-learning-prompt {
    margin-top: 8px;
    padding: 9px 10px;
  }

  .resume-learning-prompt strong {
    font-size: 13px;
  }

  .resume-learning-prompt span,
  .learning-progress-line {
    font-size: 11.5px;
  }
}

/* ===== responsive learning layout minimal overlap guard 20260802 v3 ===== */
/*
  只做防覆盖兜底，不重做页面设计：
  - 不改 lesson-shell 宽度
  - 不改 video 宽高 / aspect-ratio
  - 不重排桌面布局
  - 不重排功能按钮
  - 仅防止 subtitle-panel absolute/inset 覆盖视频
*/

@media (max-width: 859px) {
  .lesson-shell .subtitle-panel {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .lesson-shell .subtitle-list {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .mobile-bottom-tools {
    max-width: calc(100vw - 20px) !important;
  }
}

@media (min-width: 860px) and (max-width: 1024px) {
  .lesson-shell .player-column,
  .lesson-shell .subtitle-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .lesson-shell .subtitle-panel {
    position: sticky !important;
    top: 12px !important;
    inset: auto !important;
    overflow: hidden !important;
    z-index: auto !important;
  }

  .lesson-shell .subtitle-list {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ===== responsive learning layout desktop absolute guard 20260802 v4 ===== */
/*
  只处理桌面/横屏平板 subtitle-panel 仍为 absolute 的风险。
  不改页面宽度、视频尺寸、按钮布局、课程结构。
*/
@media (min-width: 1025px) {
  .lesson-shell .subtitle-panel {
    position: sticky !important;
    top: 12px !important;
    inset: auto !important;
    align-self: start !important;
    justify-self: stretch !important;
    overflow: hidden !important;
    z-index: auto !important;
  }

  .lesson-shell .subtitle-list {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ===== mobile learning flicker stability closeout v1 ===== */
@media (max-width: 720px) {
  .lesson-shell {
    min-height: 100vh !important;
    min-height: 100svh !important;
  }

  .lesson-shell .subtitle-list {
    max-height: calc(100vh - 430px) !important;
    max-height: clamp(220px, calc(100vh - 430px), 560px) !important;
    max-height: clamp(220px, calc(100svh - 430px), 560px) !important;
    padding-bottom: 118px !important;
    padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important;
  }
}


/* HOST_BROWSER_COMPAT_MINIMAL_PATCH_V1
   Only special/embedded browser compatibility.
   Do not alter the mainstream Chrome/Safari/Edge baseline. */

html.cn-legacy-browser .speech-score-overlay,
html.wechat-browser .speech-score-overlay,
html.feishu-browser .speech-score-overlay {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
  padding: 10px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html.cn-legacy-browser .speech-score-dialog,
html.wechat-browser .speech-score-dialog,
html.feishu-browser .speech-score-dialog {
  box-sizing: border-box !important;
  position: relative !important;
  width: calc(100% - 20px) !important;
  max-width: 430px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 88vh !important;
  margin: auto !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

html.cn-legacy-browser .speech-score-scroll,
html.wechat-browser .speech-score-scroll,
html.feishu-browser .speech-score-scroll {
  box-sizing: border-box !important;
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

html.cn-legacy-browser .speech-score-main,
html.wechat-browser .speech-score-main,
html.feishu-browser .speech-score-main {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

html.cn-legacy-browser .speech-score-details,
html.wechat-browser .speech-score-details,
html.feishu-browser .speech-score-details {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

html.cn-legacy-browser .speech-score-footer,
html.wechat-browser .speech-score-footer,
html.feishu-browser .speech-score-footer {
  position: static !important;
  flex: 0 0 auto !important;
  width: 100% !important;
}

html.cn-legacy-browser .speech-score-topbar,
html.wechat-browser .speech-score-topbar,
html.feishu-browser .speech-score-topbar {
  position: static !important;
  flex: 0 0 auto !important;
}

html.cn-legacy-browser .speech-score-controls,
html.wechat-browser .speech-score-controls,
html.feishu-browser .speech-score-controls {
  width: 100% !important;
}

@media (max-width: 640px) {
  html.cn-legacy-browser .speech-score-overlay,
  html.wechat-browser .speech-score-overlay,
  html.feishu-browser .speech-score-overlay {
    align-items: flex-end !important;
    padding: 8px !important;
  }

  html.cn-legacy-browser .speech-score-dialog,
  html.wechat-browser .speech-score-dialog,
  html.feishu-browser .speech-score-dialog {
    width: calc(100% - 8px) !important;
    max-width: 430px !important;
    max-height: 90vh !important;
    margin: 0 auto !important;
  }
}

@media (max-width: 340px) {
html.cn-legacy-browser .speech-score-details,
html.wechat-browser .speech-score-details,
html.feishu-browser .speech-score-details {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* FINAL RC V2 PLAYER + THEME 20260823 */
:root,
:root[data-theme="default"],
body[data-theme="default"] {
  --app-bg: linear-gradient(135deg, #f8fff9 0%, #eef7f0 48%, #dfeee5 100%);
  --surface: #ffffff;
  --surface-soft: #f3faf5;
  --surface-elevated: #ffffff;
  --text-main: #172c23;
  --text-muted: #52685d;
  --text-soft: #6f8378;
  --primary: #287553;
  --primary-strong: #185a3d;
  --primary-soft: #e5f2eb;
  --border-soft: #c7ded1;
  --border-strong: #287553;
  --subtitle-card-bg: #fbfffc;
  --subtitle-card-active-bg: #e7f5eb;
  --subtitle-card-text: #172c23;
  --subtitle-card-muted: #52685d;
  --subtitle-card-border: #c7ded1;
  --subtitle-card-active-border: #287553;
  --word-highlight-bg: #f7e96a;
  --word-highlight-text: #172c23;
  --word-chip-bg: #f1f6c6;
  --word-chip-text: #3f5721;
  --word-chip-border: #c5d79a;
  --tool-button-bg: #f7fbf8;
  --tool-button-text: #172c23;
  --tool-button-icon: #236f50;
  --tool-button-border: #c7ded1;
  --score-button-bg: #e5f2eb;
  --score-button-text: #185a3d;
  --score-button-border: #9bc4ac;
  --modal-bg: #ffffff;
  --modal-text: #172c23;
  --modal-muted: #52685d;
  --modal-border: #c7ded1;
  --input-bg: #ffffff;
  --input-text: #172c23;
  --input-border: #c7ded1;
  --bottom-bar-bg: rgba(255, 255, 255, 0.96);
  --bottom-bar-text: #172c23;
  --bottom-bar-border: #c7ded1;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #185a3d;
  --sleep-timer-icon: #287553;
  --sleep-timer-bg: #f7fbf8;
  --sleep-timer-border: #c7ded1;
  --sleep-timer-active-bg: #e5f2eb;
  --sleep-timer-active-text: #185a3d;
  --sleep-timer-active-border: #9bc4ac;
  --shadow-soft: rgba(23, 44, 35, 0.12);
  --theme-menu-shadow: 0 16px 36px var(--shadow-soft);
  --bg: #e8f3ec;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 14px 38px var(--shadow-soft);
  color-scheme: light;
}

:root[data-theme="rose"],
body[data-theme="rose"] {
  --app-bg: linear-gradient(135deg, #fffefd 0%, #fff1f4 48%, #f2d8e1 100%);
  --surface: #fffdfd;
  --surface-soft: #fcf0f4;
  --surface-elevated: #ffffff;
  --text-main: #2d1f25;
  --text-muted: #704f5b;
  --text-soft: #8a6a75;
  --primary: #9a4860;
  --primary-strong: #7c3349;
  --primary-soft: #f5e1e8;
  --border-soft: #e4bdc9;
  --border-strong: #9a4860;
  --subtitle-card-bg: #fffdfb;
  --subtitle-card-active-bg: #f7e2e9;
  --subtitle-card-text: #2d1f25;
  --subtitle-card-muted: #704f5b;
  --subtitle-card-border: #e4bdc9;
  --subtitle-card-active-border: #9a4860;
  --word-highlight-bg: #ffe76b;
  --word-highlight-text: #2d1f25;
  --word-chip-bg: #fff3c7;
  --word-chip-text: #5b3e17;
  --word-chip-border: #dfc27d;
  --tool-button-bg: #fff7fa;
  --tool-button-text: #2d1f25;
  --tool-button-icon: #9a4860;
  --tool-button-border: #e4bdc9;
  --score-button-bg: #f5e1e8;
  --score-button-text: #7c3349;
  --score-button-border: #c78ba0;
  --modal-bg: #fffdfd;
  --modal-text: #2d1f25;
  --modal-muted: #704f5b;
  --modal-border: #e4bdc9;
  --input-bg: #ffffff;
  --input-text: #2d1f25;
  --input-border: #e4bdc9;
  --bottom-bar-bg: rgba(255, 248, 250, 0.96);
  --bottom-bar-text: #2d1f25;
  --bottom-bar-border: #e4bdc9;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #7c3349;
  --sleep-timer-icon: #9a4860;
  --sleep-timer-bg: #fff7fa;
  --sleep-timer-border: #e4bdc9;
  --sleep-timer-active-bg: #f5e1e8;
  --sleep-timer-active-text: #7c3349;
  --sleep-timer-active-border: #c78ba0;
  --shadow-soft: rgba(80, 35, 49, 0.12);
  --theme-menu-shadow: 0 16px 36px var(--shadow-soft);
  --bg: #f2d8e1;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 14px 38px var(--shadow-soft);
  color-scheme: light;
}

:root[data-theme="glacier"],
body[data-theme="glacier"] {
  --app-bg: linear-gradient(135deg, #ffffff 0%, #eaf8ff 48%, #d5eaf7 100%);
  --surface: #ffffff;
  --surface-soft: #edf8fd;
  --surface-elevated: #ffffff;
  --text-main: #172f3b;
  --text-muted: #496a7a;
  --text-soft: #668494;
  --primary: #247da4;
  --primary-strong: #145f7f;
  --primary-soft: #dff1f9;
  --border-soft: #b9ddea;
  --border-strong: #247da4;
  --subtitle-card-bg: #fcfeff;
  --subtitle-card-active-bg: #dff1f9;
  --subtitle-card-text: #172f3b;
  --subtitle-card-muted: #496a7a;
  --subtitle-card-border: #b9ddea;
  --subtitle-card-active-border: #247da4;
  --word-highlight-bg: #fff06a;
  --word-highlight-text: #172f3b;
  --word-chip-bg: #e5f5ff;
  --word-chip-text: #155f80;
  --word-chip-border: #acd4e6;
  --tool-button-bg: #f4fbff;
  --tool-button-text: #172f3b;
  --tool-button-icon: #1f789f;
  --tool-button-border: #b9ddea;
  --score-button-bg: #dff1f9;
  --score-button-text: #145f7f;
  --score-button-border: #8fc7dc;
  --modal-bg: #ffffff;
  --modal-text: #172f3b;
  --modal-muted: #496a7a;
  --modal-border: #b9ddea;
  --input-bg: #ffffff;
  --input-text: #172f3b;
  --input-border: #b9ddea;
  --bottom-bar-bg: rgba(247, 252, 255, 0.96);
  --bottom-bar-text: #172f3b;
  --bottom-bar-border: #b9ddea;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #145f7f;
  --sleep-timer-icon: #247da4;
  --sleep-timer-bg: #f4fbff;
  --sleep-timer-border: #b9ddea;
  --sleep-timer-active-bg: #dff1f9;
  --sleep-timer-active-text: #145f7f;
  --sleep-timer-active-border: #8fc7dc;
  --shadow-soft: rgba(23, 47, 59, 0.12);
  --theme-menu-shadow: 0 16px 36px var(--shadow-soft);
  --bg: #d5eaf7;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 14px 38px var(--shadow-soft);
  color-scheme: light;
}

:root[data-theme="almond"],
body[data-theme="almond"] {
  --app-bg: linear-gradient(135deg, #fffdf7 0%, #fff5e3 48%, #f5e5c9 100%);
  --surface: #fff9ee;
  --surface-soft: #f3e2be;
  --surface-elevated: #fffdf7;
  --text-main: #3a2b1d;
  --text-muted: #6b563f;
  --text-soft: #7c674c;
  --primary: #a6753e;
  --primary-strong: #70491d;
  --primary-soft: #f3e2be;
  --border-soft: #d7ba84;
  --border-strong: #a6753e;
  --subtitle-card-bg: #fff9ee;
  --subtitle-card-active-bg: #f3e2be;
  --subtitle-card-text: #3a2b1d;
  --subtitle-card-muted: #6b563f;
  --subtitle-card-border: #d7ba84;
  --subtitle-card-active-border: #a6753e;
  --word-highlight-bg: #f6d986;
  --word-highlight-text: #3a2b1d;
  --word-chip-bg: #f3e2be;
  --word-chip-text: #4b3217;
  --word-chip-border: #d7ba84;
  --tool-button-bg: #fff9ee;
  --tool-button-text: #3a2b1d;
  --tool-button-icon: #79552c;
  --tool-button-border: #d7ba84;
  --score-button-bg: #f3e2be;
  --score-button-text: #4b3217;
  --score-button-border: #b68a4f;
  --modal-bg: #fffdf7;
  --modal-text: #3a2b1d;
  --modal-muted: #6b563f;
  --modal-border: #d7ba84;
  --input-bg: #fffdf7;
  --input-text: #3a2b1d;
  --input-border: #d7ba84;
  --bottom-bar-bg: rgba(255, 249, 238, 0.96);
  --bottom-bar-text: #3a2b1d;
  --bottom-bar-border: #d7ba84;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #4b3217;
  --sleep-timer-icon: #79552c;
  --sleep-timer-bg: #fff9ee;
  --sleep-timer-border: #d7ba84;
  --sleep-timer-active-bg: #f3e2be;
  --sleep-timer-active-text: #4b3217;
  --sleep-timer-active-border: #b68a4f;
  --progress-track: #d7ba84;
  --progress-fill: #a6753e;
  --progress-thumb: #70491d;
  --progress-thumb-ring: rgba(166, 117, 62, 0.38);
  --time-text: #6b563f;
  --shadow-soft: rgba(71, 46, 20, 0.12);
  --theme-menu-shadow: 0 16px 36px var(--shadow-soft);
  --bg: #f5e5c9;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 14px 38px var(--shadow-soft);
  color-scheme: light;
}

:root[data-theme="eye"],
body[data-theme="eye"] {
  --app-bg: linear-gradient(135deg, #0d1728 0%, #142945 50%, #1b3152 100%);
  --surface: #172642;
  --surface-soft: #20365e;
  --surface-elevated: #1b3152;
  --text-main: #f4f7ff;
  --text-muted: #c8d3ea;
  --text-soft: #91a5c8;
  --primary: #6e9bff;
  --primary-strong: #d8e5ff;
  --primary-soft: #20365e;
  --border-soft: #344a70;
  --border-strong: #5f86c9;
  --subtitle-card-bg: #172642;
  --subtitle-card-active-bg: #20365e;
  --subtitle-card-text: #f4f7ff;
  --subtitle-card-muted: #c8d3ea;
  --subtitle-card-border: #344a70;
  --subtitle-card-active-border: #5f86c9;
  --word-highlight-bg: #ffe780;
  --word-highlight-text: #0d1728;
  --word-chip-bg: #263f6a;
  --word-chip-text: #f4f7ff;
  --word-chip-border: #5f86c9;
  --tool-button-bg: #172642;
  --tool-button-text: #f4f7ff;
  --tool-button-icon: #a8bfea;
  --tool-button-border: #344a70;
  --score-button-bg: #20365e;
  --score-button-text: #f4f7ff;
  --score-button-border: #5f86c9;
  --modal-bg: #172642;
  --modal-text: #f4f7ff;
  --modal-muted: #c8d3ea;
  --modal-border: #344a70;
  --input-bg: #20365e;
  --input-text: #f4f7ff;
  --input-border: #5f86c9;
  --bottom-bar-bg: rgba(23, 38, 66, 0.96);
  --bottom-bar-text: #f4f7ff;
  --bottom-bar-border: #344a70;
  --button-primary-text: #08101e;
  --sleep-timer-text: #f4f7ff;
  --sleep-timer-icon: #a8bfea;
  --sleep-timer-bg: #172642;
  --sleep-timer-border: #344a70;
  --sleep-timer-active-bg: #20365e;
  --sleep-timer-active-text: #f4f7ff;
  --sleep-timer-active-border: #5f86c9;
  --progress-track: #344a70;
  --progress-fill: #6e9bff;
  --progress-thumb: #d8e5ff;
  --progress-thumb-ring: rgba(110, 155, 255, 0.46);
  --time-text: #c8d3ea;
  --shadow-soft: rgba(0, 0, 0, 0.34);
  --theme-menu-shadow: 0 20px 48px var(--shadow-soft);
  --bg: #0d1728;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 20px 48px var(--shadow-soft);
  color-scheme: dark;
}

:root[data-theme="night"],
body[data-theme="night"] {
  --app-bg: linear-gradient(135deg, #171b1d 0%, #202629 50%, #293134 100%);
  --surface: #252c2f;
  --surface-soft: #2b3437;
  --surface-elevated: #303a3e;
  --text-main: #f1f4f3;
  --text-muted: #c4cdca;
  --text-soft: #96a5a0;
  --primary: #87b6a7;
  --primary-strong: #d8eee6;
  --primary-soft: #303a3e;
  --border-soft: #465256;
  --border-strong: #718b83;
  --subtitle-card-bg: #252c2f;
  --subtitle-card-active-bg: #303a3e;
  --subtitle-card-text: #f1f4f3;
  --subtitle-card-muted: #c4cdca;
  --subtitle-card-border: #465256;
  --subtitle-card-active-border: #718b83;
  --word-highlight-bg: #e8cf78;
  --word-highlight-text: #171b1d;
  --word-chip-bg: #303a3e;
  --word-chip-text: #f1f4f3;
  --word-chip-border: #718b83;
  --tool-button-bg: #252c2f;
  --tool-button-text: #f1f4f3;
  --tool-button-icon: #b9cac5;
  --tool-button-border: #465256;
  --score-button-bg: #303a3e;
  --score-button-text: #f1f4f3;
  --score-button-border: #718b83;
  --modal-bg: #252c2f;
  --modal-text: #f1f4f3;
  --modal-muted: #c4cdca;
  --modal-border: #465256;
  --input-bg: #2b3437;
  --input-text: #f1f4f3;
  --input-border: #718b83;
  --bottom-bar-bg: rgba(37, 44, 47, 0.96);
  --bottom-bar-text: #f1f4f3;
  --bottom-bar-border: #465256;
  --button-primary-text: #171b1d;
  --sleep-timer-text: #f1f4f3;
  --sleep-timer-icon: #b9cac5;
  --sleep-timer-bg: #252c2f;
  --sleep-timer-border: #465256;
  --sleep-timer-active-bg: #303a3e;
  --sleep-timer-active-text: #f1f4f3;
  --sleep-timer-active-border: #718b83;
  --progress-track: #465256;
  --progress-fill: #87b6a7;
  --progress-thumb: #f1f4f3;
  --progress-thumb-ring: rgba(135, 182, 167, 0.48);
  --time-text: #c4cdca;
  --shadow-soft: rgba(0, 0, 0, 0.3);
  --theme-menu-shadow: 0 20px 48px var(--shadow-soft);
  --bg: #171b1d;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: 0 20px 48px var(--shadow-soft);
  color-scheme: dark;
}

body,
.marketing-page,
.lesson-shell {
  background: var(--app-bg, var(--bg)) !important;
  color: var(--text-main, var(--text)) !important;
}

.lesson-overview,
.current-card,
.subtitle-panel,
.study-card,
.practice-card,
.continue-learning-card,
.resume-learning-prompt {
  border-color: var(--border-soft, var(--line)) !important;
  background: var(--surface, var(--paper)) !important;
  color: var(--text-main, var(--text)) !important;
}

.lesson-title h1,
.lesson-overview h1,
.panel-title h2,
.current-card .line-en,
.subtitle-lines .line-en {
  color: var(--subtitle-card-text, var(--text-main)) !important;
}

.lesson-title p,
.lesson-overview p,
.panel-title span,
.subtitle-lines .line-zh,
.subtitle-meta,
.current-card .line-zh,
.info-chips span {
  color: var(--subtitle-card-muted, var(--text-muted)) !important;
}

.subtitle-item {
  border-color: var(--subtitle-card-border, var(--border-soft)) !important;
  background: var(--subtitle-card-bg, var(--surface)) !important;
  color: var(--subtitle-card-text, var(--text-main)) !important;
  box-shadow: 0 10px 26px var(--shadow-soft, rgba(0, 0, 0, 0.08)) !important;
}

.subtitle-item.active {
  border-color: var(--subtitle-card-active-border, var(--border-strong)) !important;
  background: var(--subtitle-card-active-bg, var(--surface-soft)) !important;
  box-shadow:
    inset 3px 0 0 var(--subtitle-card-active-border, var(--border-strong)),
    0 12px 30px var(--shadow-soft, rgba(0, 0, 0, 0.08)) !important;
}

.word-hit,
.subtitle-item.active .word-hit,
.timed-word.current-word {
  background: var(--word-highlight-bg, var(--mark)) !important;
  color: var(--word-highlight-text, var(--text-main)) !important;
  box-shadow: 0 0 0 1px var(--word-chip-border, var(--border-soft)) !important;
  text-decoration-color: var(--word-highlight-text, var(--text-main)) !important;
}

.core-term-chip,
.subtitle-item.active .core-term-chip {
  border-color: var(--word-chip-border, var(--border-soft)) !important;
  background: var(--word-chip-bg, var(--surface-soft)) !important;
  color: var(--word-chip-text, var(--text-main)) !important;
}

.core-term-chip small {
  color: var(--text-muted, var(--muted)) !important;
}

.segment-actions .segment-action-btn,
.lesson-shell .segment-actions button {
  color: var(--tool-button-icon, var(--accent)) !important;
}

.segment-actions .segment-action-btn.ai-score-action,
.lesson-shell .segment-actions .ai-score-action,
.current-score-actions button,
.speech-score-action,
.speech-score-footer button {
  border-color: var(--score-button-border, var(--border-strong)) !important;
  background: var(--score-button-bg, var(--accent-soft)) !important;
  color: var(--score-button-text, var(--accent-strong)) !important;
}

.theme-mode-menu,
.playback-rate-menu,
.sleep-timer-menu {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  color: var(--tool-button-text, var(--text-main));
}

.theme-mode-menu summary,
.playback-rate-menu summary,
.sleep-timer-menu summary {
  list-style: none;
  cursor: pointer;
}

.theme-mode-menu summary::-webkit-details-marker,
.playback-rate-menu summary::-webkit-details-marker,
.sleep-timer-menu summary::-webkit-details-marker {
  display: none;
}

.theme-mode-summary,
.playback-rate-summary,
.sleep-timer-summary,
.desktop-tool-strip button,
.desktop-tool-strip label,
.desktop-tool-strip .desktop-tool-link,
.desktop-tool-strip summary,
.info-chips span,
.playback-control-btn:not(.is-primary) {
  border-color: var(--tool-button-border, var(--line)) !important;
  background: var(--tool-button-bg, var(--paper)) !important;
  color: var(--tool-button-text, var(--text)) !important;
}

.theme-mode-summary,
.playback-rate-summary {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  border: 1px solid var(--tool-button-border, var(--line));
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.theme-mode-summary::after,
.playback-rate-summary::after,
.sleep-timer-summary::after {
  content: "▾";
  margin-left: 2px;
  color: currentColor;
  font-size: 8px;
  line-height: 1;
}

.theme-mode-menu[open] .theme-mode-summary,
.playback-rate-menu[open] .playback-rate-summary,
.sleep-timer-menu[open] .sleep-timer-summary,
.sleep-timer-menu.is-active .sleep-timer-summary,
.playback-control-btn.is-active:not(.is-primary),
.playback-control-btn[data-playback-action="continuous-play"].is-active,
.playback-control-btn[data-playback-action="loop-current-lesson"].is-active {
  border-color: var(--score-button-border, var(--border-strong)) !important;
  background: var(--score-button-bg, var(--accent-soft)) !important;
  color: var(--score-button-text, var(--accent-strong)) !important;
}

.theme-mode-panel,
.playback-rate-panel,
.sleep-timer-panel,
.export-panel,
.highlight-panel {
  position: absolute;
  z-index: 220;
  box-sizing: border-box;
  border: 1px solid var(--modal-border, var(--line));
  border-radius: 10px;
  background: var(--modal-bg, var(--paper));
  color: var(--modal-text, var(--text));
  box-shadow: var(--theme-menu-shadow, 0 16px 36px rgba(0, 0, 0, 0.12));
}

.theme-mode-panel {
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  max-width: calc(100vw - 32px);
  padding: 10px;
}

.playback-rate-panel {
  bottom: calc(100% + 8px);
  left: 50%;
  width: 152px;
  max-width: calc(100vw - 32px);
  padding: 7px;
  transform: translateX(-50%);
}

.sleep-timer-panel {
  top: calc(100% + 8px);
  left: 50%;
  width: 236px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  transform: translateX(-50%);
}

.theme-mode-options,
.playback-rate-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.theme-mode-option,
.playback-rate-option,
.sleep-timer-options button {
  display: inline-flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--tool-button-border, var(--line));
  border-radius: 8px;
  background: var(--surface-soft, var(--paper-soft));
  color: var(--text-main, var(--text));
  padding: 0 7px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.theme-mode-option:hover,
.theme-mode-option.is-active,
.playback-rate-option:hover,
.playback-rate-option.is-active,
.sleep-timer-options button:hover,
.sleep-timer-options button.is-active {
  border-color: var(--score-button-border, var(--border-strong));
  background: var(--score-button-bg, var(--accent-soft));
  color: var(--score-button-text, var(--accent-strong));
}

.theme-mode-swatch {
  width: 8px;
  height: 8px;
  border: 1px solid var(--modal-border, var(--line));
  border-radius: 999px;
  background: var(--theme-swatch);
}

.sleep-timer-summary {
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--sleep-timer-border, var(--tool-button-border));
  border-radius: 999px;
  background: var(--sleep-timer-bg, var(--tool-button-bg));
  color: var(--sleep-timer-text, var(--tool-button-text));
  padding: 0 7px;
  font-size: 11px;
  font-weight: 760;
}

.sleep-timer-summary svg,
.playback-rate-summary svg,
.theme-mode-summary svg,
.playback-control-btn svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.sleep-timer-menu.is-active .sleep-timer-summary {
  border-color: var(--sleep-timer-active-border, var(--score-button-border)) !important;
  background: var(--sleep-timer-active-bg, var(--score-button-bg)) !important;
  color: var(--sleep-timer-active-text, var(--score-button-text)) !important;
}

.sleep-timer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sleep-timer-panel-head strong,
.sleep-timer-custom-title {
  color: var(--modal-text, var(--text));
}

.sleep-timer-panel-head span,
.sleep-timer-note,
.sleep-timer-custom-field {
  color: var(--modal-muted, var(--muted));
}

.sleep-timer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.sleep-timer-custom[hidden] {
  display: none;
}

.sleep-timer-custom {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  border-top: 1px solid var(--modal-border, var(--line));
  padding-top: 8px;
}

.sleep-timer-custom-row {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sleep-timer-custom-field {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 650;
}

.sleep-timer-custom-field input {
  width: 40px;
  min-width: 40px;
  height: 28px;
  border: 1px solid var(--input-border, var(--line));
  border-radius: 8px;
  background: var(--input-bg, var(--paper));
  color: var(--input-text, var(--text));
  text-align: center;
}

.sleep-timer-custom-confirm {
  min-width: 46px;
  height: 28px;
  border: 1px solid var(--score-button-border, var(--border-strong)) !important;
  border-radius: 999px;
  background: var(--score-button-bg, var(--accent-soft)) !important;
  color: var(--score-button-text, var(--accent-strong)) !important;
  font-size: 11px;
  font-weight: 760;
}

.sleep-timer-note {
  margin: 6px 0 0;
  font-size: 11px;
}

.lesson-video-progress,
.lesson-shell .player-column > .lesson-video-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: min(100%, 720px);
  align-items: center;
  gap: 8px;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--time-text, var(--text-muted)) !important;
  font-size: 11px;
  font-weight: 680;
  user-select: none;
  box-shadow: none !important;
}

.lesson-video-progress-time {
  min-width: 38px;
  color: var(--time-text, var(--text-muted)) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.lesson-video-progress-time:last-child {
  text-align: right;
}

.lesson-video-progress-track {
  position: relative;
  display: grid;
  min-width: 0;
  height: 28px;
  align-items: center;
  border: 0;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  touch-action: none;
}

.lesson-video-progress-track::before {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--progress-track, color-mix(in srgb, var(--border-soft) 78%, transparent)) !important;
  content: "";
}

.lesson-video-progress-fill {
  position: absolute;
  left: 0;
  width: 0%;
  height: 3px;
  border-radius: 999px;
  background: var(--progress-fill, var(--primary)) !important;
}

.lesson-video-progress-thumb {
  position: absolute;
  left: 0%;
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface-elevated, var(--surface)) !important;
  border-radius: 999px;
  background: var(--progress-thumb, var(--primary-strong)) !important;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px var(--progress-thumb-ring, color-mix(in srgb, var(--primary) 42%, transparent)) !important;
}

.lesson-video-progress.is-scrubbing .lesson-video-progress-track::before,
.lesson-video-progress-track:hover::before,
.lesson-video-progress-track:focus-visible::before {
  background: color-mix(in srgb, var(--progress-track, var(--border-soft)) 72%, var(--progress-fill, var(--primary)) 28%) !important;
}

.lesson-video-progress.is-scrubbing .lesson-video-progress-thumb,
.lesson-video-progress-track:hover .lesson-video-progress-thumb,
.lesson-video-progress-track:focus-visible .lesson-video-progress-thumb {
  transform: translateX(-50%) scale(1.08);
}

.lesson-video-progress-track:focus-visible {
  outline: 2px solid var(--progress-thumb-ring, color-mix(in srgb, var(--primary) 44%, transparent));
  outline-offset: 3px;
  border-radius: 999px;
}

.lesson-video-progress.is-disabled {
  opacity: 0.64;
}

.lesson-video-progress-track.is-disabled {
  cursor: default;
  pointer-events: none;
}

.desktop-playback-panel {
  gap: clamp(16px, 2.1vw, 26px) !important;
}

.playback-control-btn[data-playback-action="loop-current-lesson"] {
  display: inline-flex;
  width: auto;
  min-width: 72px;
  gap: 4px;
}

.playback-control-btn.is-primary {
  background: var(--primary, var(--accent)) !important;
  color: var(--button-primary-text, #fff) !important;
}

.collection-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.library-theme-toggle {
  display: inline-block;
}

@media (max-width: 720px) {
  .mobile-learn-topbar {
    grid-template-columns: 32px minmax(0, 1fr) 32px 32px 82px !important;
    gap: 6px !important;
    align-items: center !important;
    background: var(--surface, var(--paper)) !important;
    color: var(--text-main, var(--text)) !important;
  }

  .mobile-learn-topbar > #mobileThemeToggle.theme-mode-menu {
    display: inline-flex !important;
    width: 82px !important;
    min-width: 82px !important;
    justify-content: flex-end !important;
  }

  .mobile-learn-topbar .theme-mode-summary {
    width: 82px !important;
    min-width: 82px !important;
    height: 32px !important;
    min-height: 32px !important;
    border-radius: 999px !important;
    padding: 0 8px !important;
  }

  .mobile-learn-topbar .theme-mode-panel {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    transform: none;
  }

  .mobile-bottom-tools {
    border-color: var(--bottom-bar-border, var(--line)) !important;
    background: var(--bottom-bar-bg, var(--paper)) !important;
    color: var(--bottom-bar-text, var(--text)) !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle.playback-rate-menu {
    grid-column: 2 !important;
    display: block !important;
    width: 100%;
    min-width: 0;
    height: 52px;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle .playback-rate-summary {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 52px !important;
    min-height: 52px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--tool-button-icon, var(--accent)) !important;
    padding: 2px 0 !important;
    font-size: 11px !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle > .playback-rate-panel {
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 50%;
    width: 144px;
    transform: translateX(-50%);
  }

  .lesson-shell .player-column > .lesson-video-progress {
    width: 100% !important;
    gap: 6px !important;
    margin: 5px 0 0 !important;
    font-size: 10.5px !important;
  }

  .lesson-video-progress-track {
    height: 36px !important;
  }

  .mobile-bottom-tools .mobile-playback-tools {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 0 1px !important;
    align-items: center !important;
    justify-items: stretch !important;
  }

  .mobile-bottom-tools .mobile-playback-tools > * {
    min-width: 0 !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn,
  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-summary {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 42px !important;
    border-color: transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--tool-button-icon, var(--accent)) !important;
    padding: 0 2px !important;
    box-shadow: none !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn.is-primary {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    justify-self: center !important;
    border-radius: 999px !important;
    background: var(--primary, var(--accent)) !important;
    color: var(--button-primary-text, #fff) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-hint,
  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-label-text,
  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-countdown {
    color: currentColor !important;
    font-size: 9px !important;
    font-weight: 760 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-menu {
    grid-column: auto;
    position: static;
    width: 100%;
  }

  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-summary {
    flex-direction: column;
    gap: 1px;
  }

  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-summary::after {
    display: none;
  }

  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-menu > .sleep-timer-panel {
    position: fixed !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 50% !important;
    width: min(236px, calc(100vw - 32px));
    transform: translateX(-50%) !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-trigger-icon,
  .mobile-bottom-tools .mobile-playback-tools .sleep-timer-trigger-icon svg,
  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn svg {
    width: 18px !important;
    height: 18px !important;
  }

  .mobile-bottom-tools .mobile-playback-tools .playback-control-btn[data-playback-action="collapse-controls"] {
    width: 100% !important;
    max-width: none !important;
    height: 42px !important;
    background: transparent !important;
  }
}

/* FINAL RC V2 THEME VISUAL POLISH */
:root,
:root[data-theme="default"],
body[data-theme="default"] {
  --app-bg: linear-gradient(135deg, #fbfff8 0%, #f3faef 46%, #e7f2e3 100%);
  --surface: #fffffc;
  --surface-soft: #f4f9ef;
  --surface-elevated: #ffffff;
  --surface-highlight: rgba(255, 255, 255, 0.72);
  --surface-gloss: rgba(255, 255, 255, 0.46);
  --text-main: #14291f;
  --text-muted: #4c6459;
  --text-soft: #6b8076;
  --primary: #2f8060;
  --primary-strong: #1f6046;
  --primary-soft: #e8f4ea;
  --border-soft: #c7dece;
  --border-strong: #2f8060;
  --subtitle-card-bg: #fffffc;
  --subtitle-card-active-bg: #edf7eb;
  --subtitle-card-text: #14291f;
  --subtitle-card-muted: #4c6459;
  --subtitle-card-border: #c7dece;
  --subtitle-card-active-border: #2f8060;
  --word-highlight-bg: #f3e891;
  --word-highlight-text: #14291f;
  --word-chip-bg: #f3f6cd;
  --word-chip-text: #36531f;
  --word-chip-border: #bfd3a0;
  --tool-button-bg: #fbfffb;
  --tool-button-text: #14291f;
  --tool-button-icon: #277556;
  --tool-button-border: #c7dece;
  --score-button-bg: #eaf5ee;
  --score-button-text: #1f6046;
  --score-button-border: #8fbca5;
  --modal-bg: #fffffc;
  --modal-text: #14291f;
  --modal-muted: #4c6459;
  --modal-border: #c7dece;
  --input-bg: #ffffff;
  --input-text: #14291f;
  --input-border: #bcd6c7;
  --bottom-bar-bg: rgba(255, 255, 252, 0.98);
  --bottom-bar-text: #14291f;
  --bottom-bar-border: #bfd9c9;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #1f6046;
  --sleep-timer-icon: #277556;
  --sleep-timer-bg: #fbfffb;
  --sleep-timer-border: #c7dece;
  --sleep-timer-active-bg: #eaf5ee;
  --sleep-timer-active-text: #1f6046;
  --sleep-timer-active-border: #8fbca5;
  --progress-track: #c7dece;
  --progress-fill: #2f8060;
  --progress-thumb: #1f6046;
  --progress-thumb-ring: rgba(47, 128, 96, 0.34);
  --time-text: #435d51;
  --shadow-soft: rgba(34, 73, 53, 0.11);
  --panel-shadow: 0 16px 42px rgba(34, 73, 53, 0.09);
  --card-shadow: 0 10px 28px rgba(34, 73, 53, 0.075);
  --active-card-shadow: 0 14px 34px rgba(34, 73, 53, 0.12);
  --theme-menu-shadow: 0 18px 44px rgba(34, 73, 53, 0.14);
  --bg: #e7f2e3;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="rose"],
body[data-theme="rose"] {
  --app-bg: linear-gradient(135deg, #fffefe 0%, #fff3f5 48%, #f7e5eb 100%);
  --surface: #fffdfc;
  --surface-soft: #fff4f6;
  --surface-elevated: #ffffff;
  --surface-highlight: rgba(255, 255, 255, 0.72);
  --surface-gloss: rgba(255, 255, 255, 0.48);
  --text-main: #2d2026;
  --text-muted: #6f5360;
  --text-soft: #876b76;
  --primary: #9c5266;
  --primary-strong: #7a3d51;
  --primary-soft: #f7e7ec;
  --border-soft: #e7c5d0;
  --border-strong: #a66075;
  --subtitle-card-bg: #fffdfc;
  --subtitle-card-active-bg: #fbeaf0;
  --subtitle-card-text: #2d2026;
  --subtitle-card-muted: #6f5360;
  --subtitle-card-border: #e7c5d0;
  --subtitle-card-active-border: #a66075;
  --word-highlight-bg: #f8e6a3;
  --word-highlight-text: #2d2026;
  --word-chip-bg: #fff1e6;
  --word-chip-text: #5b3f2a;
  --word-chip-border: #e8c7a8;
  --tool-button-bg: #fffafb;
  --tool-button-text: #2d2026;
  --tool-button-icon: #984f63;
  --tool-button-border: #e7c5d0;
  --score-button-bg: #f8e8ee;
  --score-button-text: #7a3d51;
  --score-button-border: #c992a2;
  --modal-bg: #fffdfc;
  --modal-text: #2d2026;
  --modal-muted: #6f5360;
  --modal-border: #e7c5d0;
  --input-bg: #ffffff;
  --input-text: #2d2026;
  --input-border: #e2bac7;
  --bottom-bar-bg: rgba(255, 250, 251, 0.98);
  --bottom-bar-text: #2d2026;
  --bottom-bar-border: #e4c0cb;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #7a3d51;
  --sleep-timer-icon: #984f63;
  --sleep-timer-bg: #fffafb;
  --sleep-timer-border: #e7c5d0;
  --sleep-timer-active-bg: #f8e8ee;
  --sleep-timer-active-text: #7a3d51;
  --sleep-timer-active-border: #c992a2;
  --progress-track: #e7c5d0;
  --progress-fill: #9c5266;
  --progress-thumb: #7a3d51;
  --progress-thumb-ring: rgba(156, 82, 102, 0.32);
  --time-text: #654a56;
  --shadow-soft: rgba(90, 40, 57, 0.105);
  --panel-shadow: 0 16px 42px rgba(90, 40, 57, 0.085);
  --card-shadow: 0 10px 28px rgba(90, 40, 57, 0.07);
  --active-card-shadow: 0 14px 34px rgba(90, 40, 57, 0.12);
  --theme-menu-shadow: 0 18px 44px rgba(90, 40, 57, 0.14);
  --bg: #f7e5eb;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="glacier"],
body[data-theme="glacier"] {
  --app-bg: linear-gradient(135deg, #fdfeff 0%, #eef9ff 48%, #dceef9 100%);
  --surface: #ffffff;
  --surface-soft: #f0f9ff;
  --surface-elevated: #fbfdff;
  --surface-highlight: rgba(255, 255, 255, 0.72);
  --surface-gloss: rgba(255, 255, 255, 0.5);
  --text-main: #143148;
  --text-muted: #4d6c7f;
  --text-soft: #6f8a9b;
  --primary: #2f7eaa;
  --primary-strong: #1d6086;
  --primary-soft: #e4f4fc;
  --border-soft: #bfdeee;
  --border-strong: #3989b5;
  --subtitle-card-bg: #fbfdff;
  --subtitle-card-active-bg: #e9f6fd;
  --subtitle-card-text: #143148;
  --subtitle-card-muted: #4d6c7f;
  --subtitle-card-border: #bfdeee;
  --subtitle-card-active-border: #3989b5;
  --word-highlight-bg: #eef2a2;
  --word-highlight-text: #143148;
  --word-chip-bg: #e9f5ff;
  --word-chip-text: #1f5f82;
  --word-chip-border: #b7d9eb;
  --tool-button-bg: #f9fdff;
  --tool-button-text: #143148;
  --tool-button-icon: #2878a4;
  --tool-button-border: #bfdeee;
  --score-button-bg: #e4f4fc;
  --score-button-text: #1d6086;
  --score-button-border: #91c7df;
  --modal-bg: #ffffff;
  --modal-text: #143148;
  --modal-muted: #4d6c7f;
  --modal-border: #bfdeee;
  --input-bg: #ffffff;
  --input-text: #143148;
  --input-border: #b7d9eb;
  --bottom-bar-bg: rgba(249, 253, 255, 0.98);
  --bottom-bar-text: #143148;
  --bottom-bar-border: #badbea;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #1d6086;
  --sleep-timer-icon: #2878a4;
  --sleep-timer-bg: #f9fdff;
  --sleep-timer-border: #bfdeee;
  --sleep-timer-active-bg: #e4f4fc;
  --sleep-timer-active-text: #1d6086;
  --sleep-timer-active-border: #91c7df;
  --progress-track: #bddded;
  --progress-fill: #2f7eaa;
  --progress-thumb: #1d6086;
  --progress-thumb-ring: rgba(47, 126, 170, 0.32);
  --time-text: #425f73;
  --shadow-soft: rgba(28, 83, 111, 0.105);
  --panel-shadow: 0 16px 42px rgba(28, 83, 111, 0.085);
  --card-shadow: 0 10px 28px rgba(28, 83, 111, 0.07);
  --active-card-shadow: 0 14px 34px rgba(28, 83, 111, 0.12);
  --theme-menu-shadow: 0 18px 44px rgba(28, 83, 111, 0.14);
  --bg: #dceef9;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="almond"],
body[data-theme="almond"] {
  --app-bg: linear-gradient(135deg, #fffdf8 0%, #fbf4e7 48%, #f2e6d0 100%);
  --surface: #fffaf1;
  --surface-soft: #f8eedc;
  --surface-elevated: #fffdf8;
  --surface-highlight: rgba(255, 255, 255, 0.72);
  --surface-gloss: rgba(255, 255, 255, 0.46);
  --text-main: #342819;
  --text-muted: #665540;
  --text-soft: #7e6c52;
  --primary: #927246;
  --primary-strong: #6d5635;
  --primary-soft: #f3ead8;
  --border-soft: #d9c8a8;
  --border-strong: #9a7a4f;
  --subtitle-card-bg: #fffaf1;
  --subtitle-card-active-bg: #f6ecd7;
  --subtitle-card-text: #342819;
  --subtitle-card-muted: #665540;
  --subtitle-card-border: #d9c8a8;
  --subtitle-card-active-border: #9a7a4f;
  --word-highlight-bg: #ecd99b;
  --word-highlight-text: #342819;
  --word-chip-bg: #f5ead2;
  --word-chip-text: #4c3a20;
  --word-chip-border: #d7c394;
  --tool-button-bg: #fffaf1;
  --tool-button-text: #342819;
  --tool-button-icon: #806238;
  --tool-button-border: #d9c8a8;
  --score-button-bg: #f4ead7;
  --score-button-text: #6d5635;
  --score-button-border: #b49767;
  --modal-bg: #fffdf8;
  --modal-text: #342819;
  --modal-muted: #665540;
  --modal-border: #d9c8a8;
  --input-bg: #fffdf8;
  --input-text: #342819;
  --input-border: #d5c29e;
  --bottom-bar-bg: rgba(255, 250, 241, 0.98);
  --bottom-bar-text: #342819;
  --bottom-bar-border: #d6c4a3;
  --button-primary-text: #ffffff;
  --sleep-timer-text: #6d5635;
  --sleep-timer-icon: #806238;
  --sleep-timer-bg: #fffaf1;
  --sleep-timer-border: #d9c8a8;
  --sleep-timer-active-bg: #f4ead7;
  --sleep-timer-active-text: #6d5635;
  --sleep-timer-active-border: #b49767;
  --progress-track: #d9c8a8;
  --progress-fill: #927246;
  --progress-thumb: #6d5635;
  --progress-thumb-ring: rgba(146, 114, 70, 0.34);
  --time-text: #5f4e3a;
  --shadow-soft: rgba(79, 57, 29, 0.11);
  --panel-shadow: 0 16px 42px rgba(79, 57, 29, 0.085);
  --card-shadow: 0 10px 28px rgba(79, 57, 29, 0.07);
  --active-card-shadow: 0 14px 34px rgba(79, 57, 29, 0.12);
  --theme-menu-shadow: 0 18px 44px rgba(79, 57, 29, 0.14);
  --bg: #f2e6d0;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="eye"],
body[data-theme="eye"] {
  --app-bg: linear-gradient(135deg, #12243c 0%, #183257 50%, #223f66 100%);
  --surface: #1c3457;
  --surface-soft: #243f68;
  --surface-elevated: #294a75;
  --surface-highlight: rgba(255, 255, 255, 0.08);
  --surface-gloss: rgba(137, 175, 225, 0.13);
  --text-main: #f7faff;
  --text-muted: #d2dcf0;
  --text-soft: #a9bad8;
  --primary: #82adff;
  --primary-strong: #e4eeff;
  --primary-soft: #263f68;
  --border-soft: #3f5d86;
  --border-strong: #7ea6dc;
  --subtitle-card-bg: #1c3457;
  --subtitle-card-active-bg: #253f68;
  --subtitle-card-text: #f7faff;
  --subtitle-card-muted: #d2dcf0;
  --subtitle-card-border: #3f5d86;
  --subtitle-card-active-border: #85abe2;
  --word-highlight-bg: #f4d26f;
  --word-highlight-text: #13243b;
  --word-chip-bg: #2c4a75;
  --word-chip-text: #f7faff;
  --word-chip-border: #759cd4;
  --tool-button-bg: #1c3457;
  --tool-button-text: #f7faff;
  --tool-button-icon: #c2d4f4;
  --tool-button-border: #3f5d86;
  --score-button-bg: #263f68;
  --score-button-text: #f7faff;
  --score-button-border: #7ea6dc;
  --modal-bg: #1c3457;
  --modal-text: #f7faff;
  --modal-muted: #d2dcf0;
  --modal-border: #3f5d86;
  --input-bg: #243f68;
  --input-text: #f7faff;
  --input-border: #7ea6dc;
  --bottom-bar-bg: rgba(28, 52, 87, 0.98);
  --bottom-bar-text: #f7faff;
  --bottom-bar-border: #3f5d86;
  --button-primary-text: #101f35;
  --sleep-timer-text: #f7faff;
  --sleep-timer-icon: #c2d4f4;
  --sleep-timer-bg: #1c3457;
  --sleep-timer-border: #3f5d86;
  --sleep-timer-active-bg: #263f68;
  --sleep-timer-active-text: #f7faff;
  --sleep-timer-active-border: #7ea6dc;
  --progress-track: #3f5d86;
  --progress-fill: #82adff;
  --progress-thumb: #e4eeff;
  --progress-thumb-ring: rgba(130, 173, 255, 0.48);
  --time-text: #d2dcf0;
  --shadow-soft: rgba(2, 8, 18, 0.28);
  --panel-shadow: 0 18px 46px rgba(2, 8, 18, 0.28);
  --card-shadow: 0 12px 30px rgba(2, 8, 18, 0.22);
  --active-card-shadow: 0 16px 36px rgba(2, 8, 18, 0.32);
  --theme-menu-shadow: 0 20px 48px rgba(2, 8, 18, 0.38);
  --bg: #12243c;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="night"],
body[data-theme="night"] {
  --app-bg: linear-gradient(135deg, #111b18 0%, #172822 50%, #203430 100%);
  --surface: #1d2a27;
  --surface-soft: #23342f;
  --surface-elevated: #2a3f39;
  --surface-highlight: rgba(255, 255, 255, 0.075);
  --surface-gloss: rgba(142, 209, 189, 0.11);
  --text-main: #f4f8f5;
  --text-muted: #ccd8d2;
  --text-soft: #a3b3ad;
  --primary: #8ccfba;
  --primary-strong: #dcf5ed;
  --primary-soft: #263b35;
  --border-soft: #3f5851;
  --border-strong: #83aa9e;
  --subtitle-card-bg: #1d2a27;
  --subtitle-card-active-bg: #283e38;
  --subtitle-card-text: #f4f8f5;
  --subtitle-card-muted: #ccd8d2;
  --subtitle-card-border: #3f5851;
  --subtitle-card-active-border: #8ccfba;
  --word-highlight-bg: #e6cf77;
  --word-highlight-text: #111b18;
  --word-chip-bg: #2b403a;
  --word-chip-text: #f4f8f5;
  --word-chip-border: #83aa9e;
  --tool-button-bg: #1d2a27;
  --tool-button-text: #f4f8f5;
  --tool-button-icon: #c7dad3;
  --tool-button-border: #3f5851;
  --score-button-bg: #263b35;
  --score-button-text: #f4f8f5;
  --score-button-border: #83aa9e;
  --modal-bg: #1d2a27;
  --modal-text: #f4f8f5;
  --modal-muted: #ccd8d2;
  --modal-border: #3f5851;
  --input-bg: #23342f;
  --input-text: #f4f8f5;
  --input-border: #83aa9e;
  --bottom-bar-bg: rgba(25, 38, 35, 0.98);
  --bottom-bar-text: #f4f8f5;
  --bottom-bar-border: #3f5851;
  --button-primary-text: #0f1c19;
  --sleep-timer-text: #f4f8f5;
  --sleep-timer-icon: #c7dad3;
  --sleep-timer-bg: #1d2a27;
  --sleep-timer-border: #3f5851;
  --sleep-timer-active-bg: #263b35;
  --sleep-timer-active-text: #f4f8f5;
  --sleep-timer-active-border: #83aa9e;
  --progress-track: #3f5851;
  --progress-fill: #8ccfba;
  --progress-thumb: #f4f8f5;
  --progress-thumb-ring: rgba(140, 207, 186, 0.48);
  --time-text: #ccd8d2;
  --shadow-soft: rgba(0, 0, 0, 0.26);
  --panel-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  --active-card-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  --theme-menu-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  --bg: #111b18;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

.lesson-overview,
.current-card,
.subtitle-panel,
.study-card,
.practice-card,
.lesson-intro,
.continue-learning-card,
.resume-learning-prompt {
  border-color: var(--border-soft, var(--line)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.55)), transparent 58%),
    var(--surface, var(--paper)) !important;
  color: var(--text-main, var(--text)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.4)),
    var(--panel-shadow, var(--shadow)) !important;
}

.subtitle-item {
  position: relative;
  border-color: var(--subtitle-card-border, var(--border-soft)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.5)), transparent 64%),
    var(--subtitle-card-bg, var(--surface)) !important;
  color: var(--subtitle-card-text, var(--text-main)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.36)),
    var(--card-shadow, 0 10px 28px rgba(0, 0, 0, 0.08)) !important;
}

.subtitle-item.active {
  border-color: var(--subtitle-card-active-border, var(--border-strong)) !important;
  background:
    linear-gradient(180deg, var(--surface-gloss, rgba(255, 255, 255, 0.34)), transparent 62%),
    linear-gradient(90deg, color-mix(in srgb, var(--subtitle-card-active-border, var(--border-strong)) 12%, transparent), transparent 36%),
    var(--subtitle-card-active-bg, var(--surface-soft)) !important;
  box-shadow:
    inset 5px 0 0 var(--subtitle-card-active-border, var(--border-strong)),
    inset 0 1px 0 var(--surface-highlight, rgba(255, 255, 255, 0.48)),
    var(--active-card-shadow, 0 14px 34px rgba(0, 0, 0, 0.1)) !important;
}

.subtitle-meta,
.subtitle-lines .line-zh,
.current-card .line-zh,
.info-chips span,
.lesson-video-progress-time {
  color: var(--subtitle-card-muted, var(--text-muted)) !important;
}

.subtitle-lines .line-en,
.current-card .line-en {
  color: var(--subtitle-card-text, var(--text-main)) !important;
  font-weight: 760 !important;
}

.subtitle-meta b {
  background: var(--primary-soft, var(--surface-soft)) !important;
  color: var(--primary-strong, var(--primary)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--subtitle-card-active-border, var(--border-strong)) 26%, transparent);
}

.subtitle-item.active .subtitle-meta b {
  background: var(--subtitle-card-active-border, var(--border-strong)) !important;
  color: var(--button-primary-text, #fff) !important;
}

.word-hit,
.subtitle-item.active .word-hit,
.timed-word.current-word {
  background: linear-gradient(180deg, color-mix(in srgb, var(--word-highlight-bg, var(--mark)) 74%, #ffffff), var(--word-highlight-bg, var(--mark))) !important;
  color: var(--word-highlight-text, var(--text-main)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--word-highlight-text, var(--text-main)) 18%, transparent) !important;
}

.core-term-chip,
.subtitle-item.active .core-term-chip {
  border-color: var(--word-chip-border, var(--border-soft)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.42)), transparent 58%),
    var(--word-chip-bg, var(--surface-soft)) !important;
  color: var(--word-chip-text, var(--text-main)) !important;
}

.core-term-chip small {
  color: var(--text-muted, var(--muted)) !important;
}

.theme-mode-summary,
.playback-rate-summary,
.sleep-timer-summary,
.desktop-tool-strip button,
.desktop-tool-strip label,
.desktop-tool-strip .desktop-tool-link,
.desktop-tool-strip summary,
.info-chips span,
.playback-control-btn:not(.is-primary),
.segment-actions .segment-action-btn,
.lesson-shell .segment-actions button {
  border-color: var(--tool-button-border, var(--line)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.42)), transparent 62%),
    var(--tool-button-bg, var(--paper)) !important;
  color: var(--tool-button-text, var(--text)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.34)),
    0 6px 16px color-mix(in srgb, var(--shadow-soft, rgba(0, 0, 0, 0.1)) 70%, transparent) !important;
}

.theme-mode-summary svg,
.playback-rate-summary svg,
.sleep-timer-summary svg,
.desktop-tool-strip svg,
.mobile-bottom-tools svg,
.playback-control-btn svg,
.segment-actions .segment-action-btn svg,
.lesson-shell .segment-actions button svg,
.speech-score-action-svg {
  color: var(--tool-button-icon, var(--primary)) !important;
  stroke: currentColor !important;
}

.theme-mode-menu[open] .theme-mode-summary,
.playback-rate-menu[open] .playback-rate-summary,
.sleep-timer-menu[open] .sleep-timer-summary,
.sleep-timer-menu.is-active .sleep-timer-summary,
.playback-control-btn.is-active:not(.is-primary),
.playback-control-btn[data-playback-action="continuous-play"].is-active,
.playback-control-btn[data-playback-action="loop-current-lesson"].is-active,
.theme-mode-option:hover,
.theme-mode-option.is-active,
.playback-rate-option:hover,
.playback-rate-option.is-active,
.sleep-timer-options button:hover,
.sleep-timer-options button.is-active {
  border-color: var(--score-button-border, var(--border-strong)) !important;
  background:
    linear-gradient(180deg, var(--surface-gloss, rgba(255, 255, 255, 0.32)), transparent 62%),
    var(--score-button-bg, var(--primary-soft)) !important;
  color: var(--score-button-text, var(--primary-strong)) !important;
}

.segment-actions .segment-action-btn.ai-score-action,
.lesson-shell .segment-actions .ai-score-action,
.current-score-actions button,
.speech-score-action,
.speech-score-footer button {
  border-color: var(--score-button-border, var(--border-strong)) !important;
  background:
    linear-gradient(180deg, var(--surface-gloss, rgba(255, 255, 255, 0.32)), transparent 62%),
    var(--score-button-bg, var(--primary-soft)) !important;
  color: var(--score-button-text, var(--primary-strong)) !important;
}

.segment-actions .segment-action-btn.ai-score-action svg,
.lesson-shell .segment-actions .ai-score-action svg,
.current-score-actions button svg,
.speech-score-action svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.theme-mode-panel,
.playback-rate-panel,
.sleep-timer-panel,
.export-panel,
.highlight-panel {
  border-color: var(--modal-border, var(--line)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.5)), transparent 58%),
    var(--modal-bg, var(--paper)) !important;
  color: var(--modal-text, var(--text)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.36)),
    var(--theme-menu-shadow, 0 18px 44px rgba(0, 0, 0, 0.14)) !important;
}

.theme-mode-option,
.playback-rate-option,
.sleep-timer-options button,
.sleep-timer-custom-field input {
  border-color: var(--tool-button-border, var(--line)) !important;
  background: var(--surface-soft, var(--paper-soft)) !important;
  color: var(--text-main, var(--text)) !important;
}

.sleep-timer-panel-head strong,
.sleep-timer-custom-title {
  color: var(--modal-text, var(--text)) !important;
}

.sleep-timer-panel-head span,
.sleep-timer-note,
.sleep-timer-custom-field {
  color: var(--modal-muted, var(--muted)) !important;
}

.lesson-video-progress,
.lesson-shell .player-column > .lesson-video-progress {
  color: var(--time-text, var(--text-muted)) !important;
}

.lesson-video-progress-track::before {
  height: 4px !important;
  background: var(--progress-track, var(--border-soft)) !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-highlight, rgba(255, 255, 255, 0.5)) 44%, transparent) !important;
}

.lesson-video-progress-fill {
  height: 4px !important;
  background: var(--progress-fill, var(--primary)) !important;
}

.lesson-video-progress-thumb {
  width: 12px !important;
  height: 12px !important;
  background: var(--progress-thumb, var(--primary-strong)) !important;
  box-shadow:
    0 0 0 2px var(--surface-elevated, var(--surface)),
    0 0 0 4px var(--progress-thumb-ring, rgba(0, 0, 0, 0.12)) !important;
}

.mobile-bottom-tools {
  border-color: var(--bottom-bar-border, var(--line)) !important;
  background:
    linear-gradient(180deg, var(--surface-highlight, rgba(255, 255, 255, 0.46)), transparent 65%),
    var(--bottom-bar-bg, var(--paper)) !important;
  color: var(--bottom-bar-text, var(--text)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.34)),
    0 -10px 26px color-mix(in srgb, var(--shadow-soft, rgba(0, 0, 0, 0.1)) 82%, transparent) !important;
}

.mobile-bottom-tools button:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary),
.mobile-bottom-tools .playback-rate-summary,
.mobile-bottom-tools .sleep-timer-summary,
.mobile-bottom-tools .playback-control-btn:not(.is-primary) {
  color: var(--tool-button-icon, var(--primary)) !important;
}

.mobile-bottom-tools button.is-active,
.mobile-bottom-tools .playback-control-btn.is-active:not(.is-primary),
.mobile-bottom-tools .playback-rate-menu[open] .playback-rate-summary,
.mobile-bottom-tools .sleep-timer-menu[open] .sleep-timer-summary,
.mobile-bottom-tools .sleep-timer-menu.is-active .sleep-timer-summary {
  color: var(--score-button-text, var(--primary-strong)) !important;
}

/* FINAL RC V2 VISUAL MICRO POLISH */
:root,
:root[data-theme="default"],
body[data-theme="default"] {
  --text-main: #11251c;
  --text-muted: #415e52;
  --subtitle-card-text: #11251c;
  --subtitle-card-muted: #415e52;
  --subtitle-card-border: #bdd8c7;
  --subtitle-card-active-border: #277f5c;
  --tool-button-icon: #1f7350;
  --tool-button-border: #b8d5c5;
  --score-button-border: #82b79d;
  --modal-border: #b8d5c5;
  --bottom-bar-border: #b8d5c5;
  --progress-track: #b7d3c2;
  --progress-fill: #277e5a;
  --progress-thumb: #1e5f43;
  --time-text: #38564a;
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
}

:root[data-theme="rose"],
body[data-theme="rose"] {
  --text-main: #2b1d24;
  --text-muted: #654956;
  --subtitle-card-text: #2b1d24;
  --subtitle-card-muted: #654956;
  --subtitle-card-border: #deb6c3;
  --subtitle-card-active-border: #a15b70;
  --tool-button-icon: #8d4559;
  --tool-button-border: #deb6c3;
  --score-button-border: #bd8496;
  --modal-border: #deb6c3;
  --bottom-bar-border: #deb6c3;
  --progress-track: #deb6c3;
  --progress-fill: #934e62;
  --progress-thumb: #71384b;
  --time-text: #5d4350;
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
}

:root[data-theme="glacier"],
body[data-theme="glacier"] {
  --text-main: #102f47;
  --text-muted: #425f73;
  --subtitle-card-text: #102f47;
  --subtitle-card-muted: #425f73;
  --subtitle-card-border: #accfe2;
  --subtitle-card-active-border: #327da8;
  --tool-button-icon: #236f98;
  --tool-button-border: #accfe2;
  --score-button-border: #84bfdc;
  --modal-border: #accfe2;
  --bottom-bar-border: #accfe2;
  --progress-track: #accfe2;
  --progress-fill: #287ba6;
  --progress-thumb: #195c82;
  --time-text: #3a5a70;
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
}

:root[data-theme="almond"],
body[data-theme="almond"] {
  --app-bg: linear-gradient(135deg, #fffdf8 0%, #fff8e8 50%, #fff2d8 100%);
  --surface: #fffcf6;
  --surface-soft: #fff7eb;
  --surface-elevated: #fffefa;
  --surface-highlight: rgba(255, 255, 255, 0.76);
  --surface-gloss: rgba(255, 255, 255, 0.54);
  --text-main: #332719;
  --text-muted: #5f503d;
  --text-soft: #746550;
  --primary: #8d7047;
  --primary-strong: #655133;
  --primary-soft: #fff3e1;
  --border-soft: #dfcfae;
  --border-strong: #9a8053;
  --subtitle-card-bg: #fff9ef;
  --subtitle-card-active-bg: #fff4e4;
  --subtitle-card-text: #332719;
  --subtitle-card-muted: #5f503d;
  --subtitle-card-border: #dfcfae;
  --subtitle-card-active-border: #9a8053;
  --word-highlight-bg: #ead89f;
  --word-highlight-text: #332719;
  --word-chip-bg: #fff2df;
  --word-chip-text: #45361f;
  --word-chip-border: #d9c394;
  --tool-button-bg: #fffaf1;
  --tool-button-text: #332719;
  --tool-button-icon: #735b38;
  --tool-button-border: #dfcfae;
  --score-button-bg: #fff1df;
  --score-button-text: #655133;
  --score-button-border: #b99d6e;
  --modal-bg: #fffcf6;
  --modal-text: #332719;
  --modal-muted: #5f503d;
  --modal-border: #dfcfae;
  --input-bg: #fffefa;
  --input-text: #332719;
  --input-border: #d9c394;
  --bottom-bar-bg: rgba(255, 250, 241, 0.98);
  --bottom-bar-text: #332719;
  --bottom-bar-border: #d9c394;
  --sleep-timer-text: #655133;
  --sleep-timer-icon: #735b38;
  --sleep-timer-bg: #fffaf1;
  --sleep-timer-border: #dfcfae;
  --sleep-timer-active-bg: #fff1df;
  --sleep-timer-active-text: #655133;
  --sleep-timer-active-border: #b99d6e;
  --progress-track: #dfcfae;
  --progress-fill: #8d7047;
  --progress-thumb: #655133;
  --progress-thumb-ring: rgba(141, 112, 71, 0.36);
  --time-text: #574832;
  --shadow-soft: rgba(76, 56, 28, 0.095);
  --panel-shadow: 0 14px 38px rgba(76, 56, 28, 0.072);
  --card-shadow: 0 9px 24px rgba(76, 56, 28, 0.058);
  --active-card-shadow: 0 12px 30px rgba(76, 56, 28, 0.092);
  --theme-menu-shadow: 0 17px 42px rgba(76, 56, 28, 0.13);
  --bg: #fff2d8;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
  --shadow: var(--panel-shadow);
}

:root[data-theme="eye"],
body[data-theme="eye"] {
  --text-main: #fbfdff;
  --text-muted: #dbe5f6;
  --text-soft: #b6c6e0;
  --subtitle-card-text: #fbfdff;
  --subtitle-card-muted: #dbe5f6;
  --subtitle-card-border: #496b96;
  --subtitle-card-active-border: #91b8ec;
  --tool-button-icon: #d0def7;
  --tool-button-border: #496b96;
  --score-button-border: #8bb2e6;
  --modal-border: #496b96;
  --bottom-bar-border: #496b96;
  --progress-track: #496b96;
  --progress-fill: #8bb5ff;
  --progress-thumb: #f1f6ff;
  --time-text: #dbe5f6;
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
}

:root[data-theme="night"],
body[data-theme="night"] {
  --text-main: #f7faf7;
  --text-muted: #d5e0db;
  --text-soft: #b0c1ba;
  --subtitle-card-text: #f7faf7;
  --subtitle-card-muted: #d5e0db;
  --subtitle-card-border: #4b675f;
  --subtitle-card-active-border: #97ddc7;
  --tool-button-icon: #d3e5de;
  --tool-button-border: #4b675f;
  --score-button-border: #91baad;
  --modal-border: #4b675f;
  --bottom-bar-border: #4b675f;
  --progress-track: #4b675f;
  --progress-fill: #97ddc7;
  --progress-thumb: #f7faf7;
  --time-text: #d5e0db;
  --line: var(--border-soft);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
}

.theme-mode-summary,
.playback-rate-summary,
.sleep-timer-summary,
.desktop-tool-strip button,
.desktop-tool-strip label,
.desktop-tool-strip .desktop-tool-link,
.desktop-tool-strip summary,
.info-chips span {
  border-color: var(--tool-button-border, var(--line)) !important;
}

.subtitle-item {
  border-color: var(--subtitle-card-border, var(--border-soft)) !important;
}

.subtitle-item.active {
  border-color: var(--subtitle-card-active-border, var(--border-strong)) !important;
  box-shadow:
    inset 5px 0 0 var(--subtitle-card-active-border, var(--border-strong)),
    inset 0 1px 0 var(--surface-highlight, rgba(255, 255, 255, 0.48)),
    var(--active-card-shadow, 0 14px 34px rgba(0, 0, 0, 0.1)) !important;
}

.segment-actions .segment-action-btn:not(.ai-score-action),
.lesson-shell .segment-actions button:not(.ai-score-action) {
  --icon-size: 16px !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--tool-button-icon, var(--primary)) !important;
  box-shadow: none !important;
}

.segment-actions .segment-action-btn:not(.ai-score-action) svg,
.lesson-shell .segment-actions button:not(.ai-score-action) svg {
  width: var(--icon-size) !important;
  height: var(--icon-size) !important;
  color: currentColor !important;
  stroke: currentColor !important;
  stroke-width: 2.25 !important;
}

.segment-actions .segment-action-btn:not(.ai-score-action):hover,
.lesson-shell .segment-actions button:not(.ai-score-action):hover {
  background: color-mix(in srgb, var(--primary, currentColor) 8%, transparent) !important;
  color: var(--primary-strong, var(--primary)) !important;
  box-shadow: none !important;
}

.segment-actions .segment-action-btn:not(.ai-score-action):focus-visible,
.lesson-shell .segment-actions button:not(.ai-score-action):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary, currentColor) 42%, transparent) !important;
  outline-offset: 2px !important;
  background: color-mix(in srgb, var(--primary, currentColor) 7%, transparent) !important;
  box-shadow: none !important;
}

.segment-actions .loop-action.is-active,
.segment-actions .sentence-favorite-action.is-active,
.lesson-shell .segment-actions .loop-action.is-active,
.lesson-shell .segment-actions .sentence-favorite-action.is-active {
  background: color-mix(in srgb, var(--primary, currentColor) 10%, transparent) !important;
  color: var(--primary-strong, var(--primary)) !important;
  box-shadow: none !important;
}

.segment-actions .segment-action-btn.ai-score-action,
.lesson-shell .segment-actions .ai-score-action {
  border-color: var(--score-button-border, var(--border-strong)) !important;
  background:
    linear-gradient(180deg, var(--surface-gloss, rgba(255, 255, 255, 0.32)), transparent 62%),
    var(--score-button-bg, var(--primary-soft)) !important;
  color: var(--score-button-text, var(--primary-strong)) !important;
  box-shadow:
    inset 0 1px 0 var(--surface-gloss, rgba(255, 255, 255, 0.3)),
    0 6px 16px color-mix(in srgb, var(--shadow-soft, rgba(0, 0, 0, 0.1)) 62%, transparent) !important;
}

/* CATALOG + FAVORITES FINAL VISUAL CLEANUP V3 */
:root[data-theme="eye"],
body[data-theme="eye"] {
  --app-bg: linear-gradient(135deg, #0b1322 0%, #101d30 52%, #17293f 100%);
  --surface: #142238;
  --surface-soft: #1b2d44;
  --surface-elevated: #22364f;
  --text-main: #f2f6ff;
  --text-muted: #c8d3e4;
  --text-soft: #a9b8cf;
  --primary: #8ea8d8;
  --primary-strong: #dce8ff;
  --primary-soft: #223650;
  --border-soft: #34475f;
  --border-strong: #718bb3;
  --subtitle-card-bg: #142238;
  --subtitle-card-active-bg: #1d3049;
  --subtitle-card-text: #f2f6ff;
  --subtitle-card-muted: #c8d3e4;
  --subtitle-card-border: #34475f;
  --subtitle-card-active-border: #7f99c2;
  --word-chip-bg: #203650;
  --word-chip-text: #f2f6ff;
  --word-chip-border: #607ca6;
  --tool-button-bg: #172840;
  --tool-button-text: #f2f6ff;
  --tool-button-icon: #c5d4ef;
  --tool-button-border: #405672;
  --score-button-bg: #203650;
  --score-button-text: #f2f6ff;
  --score-button-border: #6d87af;
  --modal-bg: #142238;
  --modal-text: #f2f6ff;
  --modal-muted: #c8d3e4;
  --modal-border: #405672;
  --input-bg: #1b2d44;
  --input-text: #f2f6ff;
  --input-border: #607ca6;
  --bottom-bar-bg: rgba(20, 34, 56, 0.98);
  --bottom-bar-text: #f2f6ff;
  --bottom-bar-border: #405672;
  --button-primary-text: #09111e;
  --progress-track: #405672;
  --progress-fill: #90a8d6;
  --progress-thumb: #edf4ff;
  --progress-thumb-ring: rgba(142, 168, 216, 0.38);
  --time-text: #c8d3e4;
  --shadow-soft: rgba(2, 8, 17, 0.32);
  --panel-shadow: 0 16px 42px rgba(2, 8, 17, 0.3);
  --card-shadow: 0 10px 26px rgba(2, 8, 17, 0.24);
  --active-card-shadow: 0 14px 32px rgba(2, 8, 17, 0.34);
  --theme-menu-shadow: 0 18px 44px rgba(2, 8, 17, 0.4);
  --bg: #0b1322;
  --paper: var(--surface);
  --paper-soft: var(--surface-soft);
  --line: var(--border-soft);
  --line-strong: var(--border-strong);
  --text: var(--text-main);
  --muted: var(--text-muted);
  --ink: var(--text-main);
  --soft: var(--surface-soft);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --accent-strong: var(--primary-strong);
  --shadow: var(--panel-shadow);
}

.favorites-page {
  --favorites-surface: var(--surface, var(--paper));
  --favorites-surface-soft: var(--surface-soft, var(--paper-soft));
  --favorites-border: var(--border-soft, var(--line));
  --favorites-border-strong: var(--border-strong, var(--line-strong));
  --favorites-text: var(--text-main, var(--text));
  --favorites-muted: var(--text-muted, var(--muted));
  --favorites-primary: var(--primary, var(--accent));
  --favorites-primary-strong: var(--primary-strong, var(--accent-strong));
}

.favorites-page .learning-home-header h1,
.favorites-page .section-title,
.favorites-page .collection-sentence-body h2,
.favorites-page .compact-collection-card h2,
.favorites-page .learning-home-shell .learning-course-card .course-body h2,
.favorites-page .study-card.empty-card h2 {
  color: var(--favorites-text) !important;
}

.favorites-page .learning-home-header p,
.favorites-page .source-line,
.favorites-page .sentence-translation,
.favorites-page .learning-course-meta,
.favorites-page .learning-progress-line,
.favorites-page .compact-collection-card p,
.favorites-page .study-card.empty-card p {
  color: var(--favorites-muted) !important;
}

.favorites-page .learning-home-copy .eyebrow,
.favorites-page .collection-sentence-meta .time {
  color: var(--favorites-primary-strong) !important;
}

.favorites-page .collection-tabs {
  border-color: var(--favorites-border) !important;
  background: var(--favorites-surface) !important;
  box-shadow: none !important;
}

.favorites-page .collection-tabs a {
  border-color: var(--favorites-border) !important;
  background: var(--favorites-surface-soft) !important;
  color: var(--favorites-text) !important;
}

.favorites-page .collection-tabs a.active {
  border-color: var(--favorites-primary) !important;
  background: var(--favorites-primary) !important;
  color: var(--button-primary-text, #fff) !important;
  box-shadow: none !important;
}

.favorites-page .collection-tabs a span {
  border: 1px solid var(--favorites-border);
  background: var(--favorites-surface) !important;
  color: var(--favorites-primary-strong) !important;
}

.favorites-page .collection-tabs a.active span {
  border-color: color-mix(in srgb, var(--button-primary-text, #fff) 54%, transparent);
  background: var(--button-primary-text, #fff) !important;
  color: var(--favorites-primary-strong) !important;
}

.favorites-page .learning-course-card,
.favorites-page .collection-sentence-card,
.favorites-page .compact-collection-card,
.favorites-page .study-card.empty-card {
  border-color: var(--favorites-border) !important;
  background: var(--favorites-surface) !important;
  color: var(--favorites-text) !important;
  box-shadow: none !important;
}

.favorites-page .collection-sentence-card::before {
  background: var(--favorites-primary) !important;
}

.favorites-page .collection-refresh-button,
.favorites-page .collection-actions .plain-action,
.favorites-page .compact-collection-card .saved-state,
.favorites-page .learning-home-shell .learning-course-card .course-cta,
.favorites-page .site-user .site-theme-mode .theme-mode-summary {
  border-color: var(--tool-button-border, var(--favorites-border)) !important;
  background: var(--tool-button-bg, var(--favorites-surface)) !important;
  color: var(--tool-button-text, var(--favorites-text)) !important;
  box-shadow: none !important;
}

.favorites-page .collection-refresh-button svg,
.favorites-page .compact-collection-card .saved-state svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.favorites-page .collection-actions .danger-action {
  border-color: var(--score-button-border, var(--favorites-border-strong)) !important;
  background: var(--score-button-bg, var(--favorites-surface-soft)) !important;
  color: var(--score-button-text, var(--favorites-primary-strong)) !important;
}

.favorites-page .collection-actions .disabled-action {
  color: var(--favorites-muted) !important;
}

.favorites-page .collection-refresh-hint {
  border-color: var(--favorites-border) !important;
  background: var(--modal-bg, var(--favorites-surface)) !important;
  color: var(--modal-text, var(--favorites-text)) !important;
  box-shadow: none !important;
}

.favorites-page .site-user .site-theme-mode .theme-mode-panel {
  border-color: var(--modal-border, var(--favorites-border)) !important;
  background: var(--modal-bg, var(--favorites-surface)) !important;
  color: var(--modal-text, var(--favorites-text)) !important;
  box-shadow: none !important;
}

.favorites-page .site-user .site-theme-mode .theme-mode-option {
  border-color: var(--tool-button-border, var(--favorites-border)) !important;
  background: var(--favorites-surface-soft) !important;
  color: var(--favorites-text) !important;
}

@media (max-width: 720px) {
  .lesson-shell .segment-actions .segment-action-btn:not(.ai-score-action),
  .lesson-shell .segment-actions button:not(.ai-score-action) {
    --icon-size: 16px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }
}

/* FINAL RC V2 MOBILE RATE MENU ANCHOR FIX */
@media (max-width: 720px) {
  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle.playback-rate-menu {
    position: relative !important;
    overflow: visible !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle > .playback-rate-panel {
    position: absolute !important;
    top: auto !important;
    right: auto !important;
    bottom: calc(100% + 7px) !important;
    left: 50% !important;
    width: clamp(150px, 40vw, 160px) !important;
    max-width: calc(100vw - 24px) !important;
    padding: 7px !important;
    transform: translateX(-50%) !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle .playback-rate-options {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 7px !important;
    row-gap: 3px !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle .playback-rate-option:not(#mobilePlayToggle):not(#mobilePlaybackPlayToggle):not(.is-primary) {
    min-height: 36px !important;
    height: 36px !important;
    max-height: 36px !important;
    padding: 0 4px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
    font-weight: 720 !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle .playback-rate-option.is-active {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score-button-border, var(--border-strong)) 44%, transparent) !important;
  }

  .mobile-bottom-tools .mobile-learning-tools #mobileRateToggle .playback-rate-option:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary, currentColor) 42%, transparent) !important;
    outline-offset: 2px !important;
  }
}

/* FINAL RC V2 MOBILE SUBTITLE FINAL COMPACTION */
@media (max-width: 720px) {
  .lesson-shell .subtitle-list {
    gap: 6px !important;
  }

  .lesson-shell .subtitle-item {
    gap: 5px !important;
    padding: 7px 9px !important;
    border-radius: 10px !important;
  }

  .lesson-shell .subtitle-main {
    gap: 3px !important;
  }

  .lesson-shell .subtitle-meta {
    gap: 4px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .lesson-shell .subtitle-meta b {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
  }

  .lesson-shell .subtitle-lines .line-en {
    margin-bottom: 4px !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    font-weight: 730 !important;
  }

  .lesson-shell .subtitle-lines .line-zh {
    font-size: 13px !important;
    line-height: 1.38 !important;
  }

  .lesson-shell .core-term-row,
  .lesson-shell .core-term-tags {
    gap: 4px !important;
    margin-top: 3px !important;
  }

  .lesson-shell .core-term-chip {
    gap: 3px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    line-height: 1.28 !important;
  }

  .lesson-shell .core-term-chip small {
    font-size: 10px !important;
  }

  .lesson-shell .segment-actions {
    gap: 5px !important;
    margin-top: 1px !important;
    align-items: center !important;
  }

  .lesson-shell .segment-actions .segment-action-btn:not(.ai-score-action),
  .lesson-shell .segment-actions button:not(.ai-score-action) {
    --icon-size: 17px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border: 0 !important;
    background: transparent !important;
    color: color-mix(in srgb, var(--tool-button-icon, var(--primary)) 72%, var(--text-main, var(--primary-strong)) 28%) !important;
    box-shadow: none !important;
  }

  .lesson-shell .segment-actions .segment-action-btn:not(.ai-score-action) svg,
  .lesson-shell .segment-actions button:not(.ai-score-action) svg {
    width: var(--icon-size) !important;
    height: var(--icon-size) !important;
    color: currentColor !important;
    stroke: currentColor !important;
    stroke-width: 2.35 !important;
  }
}

/* FINAL RC V2 DESKTOP THEME MENU UPWARD ANCHOR */
@media (min-width: 721px) {
  .desktop-tool-strip {
    overflow: visible !important;
  }

  .desktop-tool-strip .theme-mode-menu.lesson-theme-menu {
    position: relative !important;
    overflow: visible !important;
  }

  .desktop-tool-strip .theme-mode-menu.lesson-theme-menu > .theme-mode-panel {
    top: auto !important;
    right: auto !important;
    bottom: calc(100% + 7px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}

/* ==========================================================
   FINAL WORD HIGHLIGHT CONTROL HOTFIX — 2026-08-24

   Priority:
   user data-highlight selection > theme default highlight.
   data-highlight-enabled=false disables visible highlighting.
   ========================================================== */

body[data-highlight="yellow"] {
  --word-highlight-bg: #f7e59a;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

body[data-highlight="green"] {
  --word-highlight-bg: #bfe5ca;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

body[data-highlight="pink"] {
  --word-highlight-bg: #f4c9dc;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

body[data-highlight="orange"] {
  --word-highlight-bg: #f7d19d;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

body[data-highlight="purple"] {
  --word-highlight-bg: #d8cef5;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

body[data-highlight="red"] {
  --word-highlight-bg: #f2beb9;
  --word-highlight-text: #17231d;
  --mark: var(--word-highlight-bg);
  --word-highlight: var(--word-highlight-bg);
}

/*
 * highlightEnabled=false:
 * keep timing/state logic running internally, but remove every
 * visible word-highlight treatment.
 */
body[data-highlight-enabled="false"] .word-hit,
body[data-highlight-enabled="false"] .subtitle-item.active .word-hit,
body[data-highlight-enabled="false"] .timed-word.current-word,
body[data-highlight-enabled="false"] .timed-word.passed-word {
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  text-decoration-color: currentColor !important;
}

/*
 * Core-term/highlight rows are part of the same visual feature.
 * JS already stops rendering core-term tags after refresh; these
 * rules also protect against stale DOM during the toggle frame.
 */
body[data-highlight-enabled="false"] .core-term-row,
body[data-highlight-enabled="false"] .word-row {
  display: none !important;
}

/* AI SCORE MODAL THEME-AWARE CONTRAST HOTFIX 20260824 */
.speech-score-dialog {
  --ai-score-modal-bg: #f5fbf3;
  --ai-score-modal-surface: #fbfff8;
  --ai-score-modal-surface-soft: #e9f4ec;
  --ai-score-modal-text: #10231c;
  --ai-score-modal-muted: #38584b;
  --ai-score-modal-soft-text: #526d61;
  --ai-score-modal-accent: #287553;
  --ai-score-modal-accent-strong: #185a3d;
  --ai-score-modal-accent-soft: #dceee4;
  --ai-score-modal-border: #6f967f;
  --ai-score-modal-border-soft: #6f967f;
  --ai-score-modal-wave: #247d5b;
  --ai-score-modal-wave-idle: #487d65;
  --ai-score-modal-ring-track: #6f967f;
  --ai-score-modal-secondary-bg: #f9fff9;
  --ai-score-modal-secondary-text: #185a3d;
  --ai-score-modal-primary-bg: #287553;
  --ai-score-modal-primary-strong: #185a3d;
  --ai-score-modal-primary-text: #ffffff;
  --ai-score-modal-primary-shadow: rgba(40, 117, 83, 0.24);
  --ai-score-modal-chip-bg: #e2f1e8;
  --ai-score-modal-chip-text: #163d2f;
  --ai-score-modal-danger-bg: #fff0f1;
  --ai-score-modal-danger-text: #9d2534;
  --ai-score-modal-disabled-bg: #edf4ef;
  --ai-score-modal-disabled-text: #50655b;
  --ai-score-modal-warning-bg: #fff4d8;
  --ai-score-modal-warning-border: #9a7a3b;
  --ai-score-modal-footer-bg: #f5fbf3;
  --ai-score-modal-shadow: 0 24px 70px rgba(16, 35, 28, 0.18);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --paper: var(--ai-score-modal-surface);
  --paper-soft: var(--ai-score-modal-surface-soft);
  --surface: var(--ai-score-modal-surface);
  --surface-soft: var(--ai-score-modal-surface-soft);
  --surface-highlight: rgba(255, 255, 255, 0.78);
  --surface-gloss: rgba(255, 255, 255, 0.62);
  --text: var(--ai-score-modal-text);
  --text-main: var(--ai-score-modal-text);
  --muted: var(--ai-score-modal-muted);
  --text-muted: var(--ai-score-modal-muted);
  --text-soft: var(--ai-score-modal-soft-text);
  --accent: var(--ai-score-modal-accent);
  --accent-strong: var(--ai-score-modal-accent-strong);
  --accent-soft: var(--ai-score-modal-accent-soft);
  --primary: var(--ai-score-modal-accent);
  --primary-strong: var(--ai-score-modal-accent-strong);
  --primary-soft: var(--ai-score-modal-accent-soft);
  --line: var(--ai-score-modal-border-soft);
  --line-strong: var(--ai-score-modal-border);
  --border-soft: var(--ai-score-modal-border-soft);
  --border-strong: var(--ai-score-modal-border);
  --tool-button-icon: var(--ai-score-modal-accent-strong);
  --score-button-bg: var(--ai-score-modal-secondary-bg);
  --score-button-text: var(--ai-score-modal-secondary-text);
  --score-button-border: var(--ai-score-modal-border);
  --modal-bg: var(--ai-score-modal-surface);
  --modal-text: var(--ai-score-modal-text);
  --modal-muted: var(--ai-score-modal-muted);
  --modal-border: var(--ai-score-modal-border-soft);
  --button-primary-text: var(--ai-score-modal-primary-text);
  border-color: var(--ai-score-modal-border-soft) !important;
  background: linear-gradient(180deg, var(--ai-score-modal-bg), var(--ai-score-modal-surface-soft)) !important;
  color: var(--ai-score-modal-text) !important;
  box-shadow: var(--ai-score-modal-shadow) !important;
  color-scheme: light;
}

body[data-theme="default"] .speech-score-dialog {
  --ai-score-modal-bg: #f5fbf3;
  --ai-score-modal-surface: #fbfff8;
  --ai-score-modal-surface-soft: #e9f4ec;
  --ai-score-modal-text: #10231c;
  --ai-score-modal-muted: #38584b;
  --ai-score-modal-soft-text: #526d61;
  --ai-score-modal-accent: #287553;
  --ai-score-modal-accent-strong: #185a3d;
  --ai-score-modal-accent-soft: #dceee4;
  --ai-score-modal-border: #6f967f;
  --ai-score-modal-border-soft: #6f967f;
  --ai-score-modal-wave: #247d5b;
  --ai-score-modal-wave-idle: #487d65;
  --ai-score-modal-ring-track: #6f967f;
  --ai-score-modal-secondary-bg: #f9fff9;
  --ai-score-modal-secondary-text: #185a3d;
  --ai-score-modal-primary-bg: #287553;
  --ai-score-modal-primary-strong: #185a3d;
  --ai-score-modal-primary-text: #ffffff;
  --ai-score-modal-primary-shadow: rgba(40, 117, 83, 0.24);
  --ai-score-modal-chip-bg: #e2f1e8;
  --ai-score-modal-chip-text: #163d2f;
  --ai-score-modal-danger-bg: #fff0f1;
  --ai-score-modal-danger-text: #9d2534;
  --ai-score-modal-disabled-bg: #edf4ef;
  --ai-score-modal-disabled-text: #50655b;
  --ai-score-modal-warning-bg: #fff4d8;
  --ai-score-modal-warning-border: #9a7a3b;
  --ai-score-modal-footer-bg: #f5fbf3;
  --ai-score-modal-shadow: 0 24px 70px rgba(16, 35, 28, 0.18);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body[data-theme="rose"] .speech-score-dialog {
  --ai-score-modal-bg: #fff7f8;
  --ai-score-modal-surface: #fffdfc;
  --ai-score-modal-surface-soft: #f6e9ed;
  --ai-score-modal-text: #2b1d24;
  --ai-score-modal-muted: #5f4650;
  --ai-score-modal-soft-text: #765e68;
  --ai-score-modal-accent: #9a5266;
  --ai-score-modal-accent-strong: #6f3446;
  --ai-score-modal-accent-soft: #f2dde5;
  --ai-score-modal-border: #9b6e7e;
  --ai-score-modal-border-soft: #a9828f;
  --ai-score-modal-wave: #a35b70;
  --ai-score-modal-wave-idle: #906a78;
  --ai-score-modal-ring-track: #a9828f;
  --ai-score-modal-secondary-bg: #fffafa;
  --ai-score-modal-secondary-text: #6f3446;
  --ai-score-modal-primary-bg: #9a5266;
  --ai-score-modal-primary-strong: #7a3d51;
  --ai-score-modal-primary-text: #ffffff;
  --ai-score-modal-primary-shadow: rgba(154, 82, 102, 0.23);
  --ai-score-modal-chip-bg: #f4e3e8;
  --ai-score-modal-chip-text: #4b2734;
  --ai-score-modal-danger-bg: #fff0f1;
  --ai-score-modal-danger-text: #9d2534;
  --ai-score-modal-disabled-bg: #f1e9ec;
  --ai-score-modal-disabled-text: #67545c;
  --ai-score-modal-warning-bg: #fff1d8;
  --ai-score-modal-warning-border: #8f6f39;
  --ai-score-modal-footer-bg: #fff7f8;
  --ai-score-modal-shadow: 0 24px 70px rgba(62, 28, 39, 0.17);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body[data-theme="glacier"] .speech-score-dialog {
  --ai-score-modal-bg: #f2faff;
  --ai-score-modal-surface: #fbfdff;
  --ai-score-modal-surface-soft: #e3f2fa;
  --ai-score-modal-text: #102c3d;
  --ai-score-modal-muted: #385b70;
  --ai-score-modal-soft-text: #3f6075;
  --ai-score-modal-accent: #2b779f;
  --ai-score-modal-accent-strong: #1d5d80;
  --ai-score-modal-accent-soft: #dceff8;
  --ai-score-modal-border: #5f91aa;
  --ai-score-modal-border-soft: #5f91aa;
  --ai-score-modal-wave: #2d7fa8;
  --ai-score-modal-wave-idle: #507c95;
  --ai-score-modal-ring-track: #5f91aa;
  --ai-score-modal-secondary-bg: #f8fdff;
  --ai-score-modal-secondary-text: #1d5d80;
  --ai-score-modal-primary-bg: #2b779f;
  --ai-score-modal-primary-strong: #1d5d80;
  --ai-score-modal-primary-text: #ffffff;
  --ai-score-modal-primary-shadow: rgba(43, 119, 159, 0.22);
  --ai-score-modal-chip-bg: #deeff8;
  --ai-score-modal-chip-text: #153f57;
  --ai-score-modal-danger-bg: #fff0f1;
  --ai-score-modal-danger-text: #9d2534;
  --ai-score-modal-disabled-bg: #e8f0f4;
  --ai-score-modal-disabled-text: #516675;
  --ai-score-modal-warning-bg: #fff3d6;
  --ai-score-modal-warning-border: #8b713e;
  --ai-score-modal-footer-bg: #f2faff;
  --ai-score-modal-shadow: 0 24px 70px rgba(16, 48, 64, 0.17);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body[data-theme="almond"] .speech-score-dialog {
  --ai-score-modal-bg: #fff8ed;
  --ai-score-modal-surface: #fffdf7;
  --ai-score-modal-surface-soft: #f5ead8;
  --ai-score-modal-text: #32271a;
  --ai-score-modal-muted: #5d4e3a;
  --ai-score-modal-soft-text: #766851;
  --ai-score-modal-accent: #80643d;
  --ai-score-modal-accent-strong: #604929;
  --ai-score-modal-accent-soft: #efe2ce;
  --ai-score-modal-border: #96784f;
  --ai-score-modal-border-soft: #aa8f66;
  --ai-score-modal-wave: #8a6b42;
  --ai-score-modal-wave-idle: #8d7a5e;
  --ai-score-modal-ring-track: #aa8f66;
  --ai-score-modal-secondary-bg: #fffdf7;
  --ai-score-modal-secondary-text: #604929;
  --ai-score-modal-primary-bg: #80643d;
  --ai-score-modal-primary-strong: #604929;
  --ai-score-modal-primary-text: #ffffff;
  --ai-score-modal-primary-shadow: rgba(128, 100, 61, 0.22);
  --ai-score-modal-chip-bg: #f0e3ce;
  --ai-score-modal-chip-text: #44331e;
  --ai-score-modal-danger-bg: #fff0f1;
  --ai-score-modal-danger-text: #9d2534;
  --ai-score-modal-disabled-bg: #f2eadf;
  --ai-score-modal-disabled-text: #655a4a;
  --ai-score-modal-warning-bg: #fff0cf;
  --ai-score-modal-warning-border: #8b6f38;
  --ai-score-modal-footer-bg: #fff8ed;
  --ai-score-modal-shadow: 0 24px 70px rgba(62, 44, 22, 0.16);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body[data-theme="eye"] .speech-score-dialog {
  --ai-score-modal-bg: #172842;
  --ai-score-modal-surface: #1e3556;
  --ai-score-modal-surface-soft: #263f62;
  --ai-score-modal-text: #f5f8ff;
  --ai-score-modal-muted: #cfdaee;
  --ai-score-modal-soft-text: #d1dded;
  --ai-score-modal-accent: #8ba9d8;
  --ai-score-modal-accent-strong: #dbe7ff;
  --ai-score-modal-accent-soft: #263d5e;
  --ai-score-modal-border: #7391bd;
  --ai-score-modal-border-soft: #6687b2;
  --ai-score-modal-wave: #9ebbe7;
  --ai-score-modal-wave-idle: #91add3;
  --ai-score-modal-ring-track: #8aa5ca;
  --ai-score-modal-secondary-bg: #213957;
  --ai-score-modal-secondary-text: #f1f6ff;
  --ai-score-modal-primary-bg: #8ba9d8;
  --ai-score-modal-primary-strong: #7896c4;
  --ai-score-modal-primary-text: #0c1726;
  --ai-score-modal-primary-shadow: rgba(139, 169, 216, 0.2);
  --ai-score-modal-chip-bg: #263d5e;
  --ai-score-modal-chip-text: #f2f6ff;
  --ai-score-modal-danger-bg: #4a2731;
  --ai-score-modal-danger-text: #ffd5dc;
  --ai-score-modal-disabled-bg: #2b3b51;
  --ai-score-modal-disabled-text: #d0daea;
  --ai-score-modal-warning-bg: #3f3423;
  --ai-score-modal-warning-border: #d1b06c;
  --ai-score-modal-footer-bg: #172842;
  --ai-score-modal-shadow: 0 26px 72px rgba(2, 8, 18, 0.46);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

body[data-theme="night"] .speech-score-dialog {
  --ai-score-modal-bg: #1b2623;
  --ai-score-modal-surface: #22312d;
  --ai-score-modal-surface-soft: #2b3b36;
  --ai-score-modal-text: #f4f7f5;
  --ai-score-modal-muted: #d0dad6;
  --ai-score-modal-soft-text: #d1e0d8;
  --ai-score-modal-accent: #8fc9b5;
  --ai-score-modal-accent-strong: #d9f0e7;
  --ai-score-modal-accent-soft: #2d463f;
  --ai-score-modal-border: #7ca396;
  --ai-score-modal-border-soft: #6f8f84;
  --ai-score-modal-wave: #9bd6c2;
  --ai-score-modal-wave-idle: #8dc9b5;
  --ai-score-modal-ring-track: #8eb5a6;
  --ai-score-modal-secondary-bg: #253631;
  --ai-score-modal-secondary-text: #f4f7f5;
  --ai-score-modal-primary-bg: #8fc9b5;
  --ai-score-modal-primary-strong: #78b5a1;
  --ai-score-modal-primary-text: #102019;
  --ai-score-modal-primary-shadow: rgba(143, 201, 181, 0.2);
  --ai-score-modal-chip-bg: #2d463f;
  --ai-score-modal-chip-text: #f0f8f5;
  --ai-score-modal-danger-bg: #4a2c31;
  --ai-score-modal-danger-text: #ffd7dc;
  --ai-score-modal-disabled-bg: #2e3a37;
  --ai-score-modal-disabled-text: #d2ded8;
  --ai-score-modal-warning-bg: #3f3624;
  --ai-score-modal-warning-border: #d0b06a;
  --ai-score-modal-footer-bg: #1b2623;
  --ai-score-modal-shadow: 0 26px 72px rgba(0, 0, 0, 0.42);
  --ai-score-modal-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

.speech-score-dialog .speech-score-topbar > span {
  background: var(--ai-score-modal-accent-soft) !important;
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-close {
  border: 1px solid var(--ai-score-modal-border-soft) !important;
  background: var(--ai-score-modal-secondary-bg) !important;
  color: var(--ai-score-modal-text) !important;
  box-shadow: 0 8px 18px rgba(16, 35, 28, 0.1) !important;
}

.speech-score-dialog .speech-score-close:hover {
  background: var(--ai-score-modal-accent-soft) !important;
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-heading h2,
.speech-score-dialog .speech-score-ring span,
.speech-score-dialog .speech-score-ring-card strong,
.speech-score-dialog .speech-score-empty strong,
.speech-score-dialog .speech-score-highlight h3,
.speech-score-dialog .speech-score-highlight p,
.speech-score-dialog .speech-score-plain-reference,
.speech-score-dialog .speech-score-highlight .plain {
  color: var(--ai-score-modal-text) !important;
}

.speech-score-dialog .speech-score-heading p,
.speech-score-dialog .speech-score-ring em,
.speech-score-dialog .speech-score-ring-card p,
.speech-score-dialog .speech-score-empty span,
.speech-score-dialog .speech-score-ring-card small {
  color: var(--ai-score-modal-muted) !important;
}

.speech-score-dialog .speech-score-wave span {
  background: var(--ai-score-modal-wave-idle) !important;
  opacity: 1 !important;
}

.speech-score-overlay[data-score-state="recording"] .speech-score-dialog .speech-score-wave span {
  background: var(--ai-score-modal-wave) !important;
}

.speech-score-dialog .speech-score-status {
  border: 1px solid var(--ai-score-modal-border-soft) !important;
  background: var(--ai-score-modal-accent-soft) !important;
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-live {
  border-color: var(--ai-score-modal-border) !important;
  background: var(--ai-score-modal-secondary-bg) !important;
  color: var(--ai-score-modal-text) !important;
}

.speech-score-dialog .speech-score-ring-card,
.speech-score-dialog .speech-score-empty,
.speech-score-dialog .speech-score-details,
.speech-score-dialog .speech-score-highlight {
  border-color: var(--ai-score-modal-border-soft) !important;
  background: var(--ai-score-modal-surface) !important;
  color: var(--ai-score-modal-text) !important;
  box-shadow: var(--ai-score-modal-card-shadow) !important;
}

.speech-score-dialog .speech-score-highlight + .speech-score-highlight {
  border-left-color: var(--ai-score-modal-border-soft) !important;
}

.speech-score-dialog .speech-score-ring-card small {
  border-top-color: var(--ai-score-modal-border-soft) !important;
}

.speech-score-dialog .speech-score-empty-warning {
  border-color: var(--ai-score-modal-warning-border) !important;
  background: var(--ai-score-modal-warning-bg) !important;
}

.speech-score-dialog .speech-score-dimensions span {
  background: var(--ai-score-modal-chip-bg) !important;
  color: var(--ai-score-modal-chip-text) !important;
}

.speech-score-dialog .speech-score-dimensions strong {
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-highlight .matched {
  background: var(--ai-score-modal-chip-bg) !important;
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-highlight .missed {
  background: var(--ai-score-modal-danger-bg) !important;
  color: var(--ai-score-modal-danger-text) !important;
}

.speech-score-dialog .speech-score-highlight .unmatched,
.speech-score-dialog .speech-score-muted-text {
  color: var(--ai-score-modal-soft-text) !important;
}

.speech-score-dialog .speech-score-action-secondary,
.speech-score-dialog .speech-score-footer button:first-child {
  border-color: var(--ai-score-modal-border) !important;
  background: var(--ai-score-modal-secondary-bg) !important;
  color: var(--ai-score-modal-secondary-text) !important;
  box-shadow: 0 8px 18px rgba(16, 35, 28, 0.08) !important;
}

.speech-score-dialog .speech-score-action-secondary.is-active {
  background: var(--ai-score-modal-accent-soft) !important;
  color: var(--ai-score-modal-accent-strong) !important;
  box-shadow: inset 0 0 0 1px var(--ai-score-modal-border) !important;
}

.speech-score-dialog .speech-score-action-primary,
.speech-score-dialog .speech-score-footer button:last-child {
  border-color: var(--ai-score-modal-primary-strong) !important;
  background: linear-gradient(180deg, var(--ai-score-modal-primary-bg), var(--ai-score-modal-primary-strong)) !important;
  color: var(--ai-score-modal-primary-text) !important;
  box-shadow: 0 12px 24px var(--ai-score-modal-primary-shadow) !important;
}

.speech-score-dialog .speech-score-footer {
  background: var(--ai-score-modal-footer-bg) !important;
  box-shadow: 0 -12px 28px rgba(16, 35, 28, 0.08) !important;
}

.speech-score-dialog .speech-score-footer [data-speech-clear] {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--ai-score-modal-muted) !important;
  box-shadow: none !important;
}

.speech-score-dialog .speech-score-footer [data-speech-clear]:hover {
  background: var(--ai-score-modal-accent-soft) !important;
  color: var(--ai-score-modal-accent-strong) !important;
}

.speech-score-dialog .speech-score-action:disabled {
  border-color: var(--ai-score-modal-border-soft) !important;
  background: var(--ai-score-modal-disabled-bg) !important;
  color: var(--ai-score-modal-disabled-text) !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

.speech-score-dialog .speech-score-action-svg,
.speech-score-dialog .speech-score-action svg,
.speech-score-dialog .speech-score-action-icon svg,
.speech-score-dialog .speech-score-footer button svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.speech-score-dialog .speech-score-sheet-handle {
  background: var(--ai-score-modal-border) !important;
}

.speech-score-dialog .speech-score-debug-badge {
  background: var(--ai-score-modal-chip-bg) !important;
  color: var(--ai-score-modal-chip-text) !important;
}

/* Shared main-page navigation and library layout. Learning/player pages are excluded. */
.nav-frame {
  --frame-surface: var(--surface, var(--paper));
  --frame-border: var(--border-soft, var(--line));
  --frame-text: var(--text-main, var(--text));
}
.nav-frame .site-nav-links a svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nav-frame a:focus-visible, .nav-frame button:focus-visible,
.nav-frame select:focus-visible, .nav-frame input:focus-visible, .nav-frame summary:focus-visible {
  outline: 3px solid var(--primary-strong) !important; outline-offset: 3px;
}
@media (min-width: 860px) {
  main.nav-frame { padding-left: 184px !important; }
  .nav-frame > .site-nav {
    position: fixed !important; inset: 0 auto 0 0 !important; z-index: 70 !important;
    display: flex !important; flex-direction: column; align-items: stretch !important;
    width: 184px !important; height: 100dvh; margin: 0 !important; padding: 22px 12px !important;
    border: 0 !important; border-right: 1px solid var(--frame-border) !important; border-radius: 0 !important;
    background: var(--frame-surface) !important; box-shadow: none !important; overflow-y: auto;
  }
  .nav-frame .site-brand { gap: 8px; min-height: 52px; white-space: normal; font-size: 16px; }
  .nav-frame .site-brand img { width: 30px; height: 30px; }
  .nav-frame .site-nav-links { display: flex !important; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 24px; }
  .nav-frame .site-nav-links a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px !important; border-radius: 9px; font-size: 15px; white-space: normal; }
  .nav-frame .site-nav-links a.active { color: var(--accent) !important; background: var(--paper-soft) !important; font-weight: 750; }
  .nav-frame .site-user { display: flex !important; flex-direction: column; align-items: stretch; margin-top: auto; padding-top: 28px; gap: 10px; }
  .nav-frame .site-user-profile { min-height: 44px; }
  .nav-frame .site-user > button { min-height: 44px; }
  .nav-frame > .app-mobile-tabbar { display: none !important; }
  .nav-frame > .landing-shell, .nav-frame > .profile-shell,
  .nav-frame > .learning-home-shell { width: 100% !important; max-width: 1440px; margin: 0 auto !important; padding: 24px !important; }
}
.library-page.nav-frame { background: var(--app-bg, var(--bg)) !important; background-attachment: fixed !important; }
.library-page.nav-frame .library-shell {
  display: block !important; width: 100% !important; max-width: none !important;
  margin: 0 !important; padding: 0 18px 28px !important; overflow: visible !important;
}
.library-page.nav-frame .catalog-top-tools {
  position: sticky !important; top: 0 !important; z-index: 60 !important;
  display: grid !important; grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center; gap: 8px 10px; margin: 0 -18px 12px !important; padding: 10px 18px 8px !important;
  min-height: 0 !important; height: auto !important; border: 0 !important;
  border-bottom: 1px solid var(--frame-border) !important; border-radius: 0 !important;
  background: var(--frame-surface) !important; box-shadow: 0 3px 12px #10251d08 !important;
}
.library-page.nav-frame .catalog-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.library-page.nav-frame .catalog-title-row h1 { margin: 0; font-size: 23px; line-height: 1.35; }
.library-page.nav-frame [data-library-count] { font-size: 14px; color: var(--muted); }
.library-page.nav-frame .catalog-title-row .theme-mode-menu { margin-left: auto; }
.library-page.nav-frame .library-theme-toggle { display: block !important; width: auto !important; height: auto !important; padding: 0 !important; border: 0 !important; background: none !important; }
.library-page.nav-frame .theme-mode-summary { min-height: 32px; padding: 5px 8px !important; font-size: 14px !important; }
.library-page.nav-frame .catalog-search { position: relative !important; width: 100% !important; min-width: 0 !important; margin: 0 !important; }
.library-page.nav-frame .catalog-search input { width: 100%; height: 36px !important; min-height: 36px !important; border-radius: 6px !important; padding: 6px 10px 6px 34px !important; font-size: 16px !important; background: var(--input-bg) !important; }
.library-page.nav-frame .catalog-search .search-icon { position: absolute; left: 10px; top: 8px; }
.library-page.nav-frame .catalog-top-tools > button { min-height: 32px !important; width: auto !important; height: auto !important; padding: 5px 10px !important; font-size: 14px !important; border-radius: 6px !important; }
.library-page.nav-frame .filter-toggle { display: inline-flex !important; gap: 7px; align-items: center; justify-content: center; }
.library-page.nav-frame .filter-toggle span { position: static !important; clip: auto !important; width: auto !important; height: auto !important; overflow: visible !important; white-space: normal !important; }
.library-page.nav-frame .catalog-quick-filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.library-page.nav-frame .catalog-quick-field { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 14px; }
.library-page.nav-frame .catalog-quick-field select { height: 32px; min-height: 32px; padding: 3px 6px; min-width: 74px; max-width: 160px; font-size: 15px; color: var(--text); background: var(--frame-surface); border: 1px solid var(--frame-border); border-radius: 8px; }
.library-page.nav-frame .catalog-active-filters { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; max-height: 104px; overflow-y: auto; }
.library-page.nav-frame .catalog-active-filters:empty { display: none; }
.library-page.nav-frame .catalog-active-filters button { min-height: 32px; padding: 4px 8px; max-width: 100%; text-align: left; overflow-wrap: anywhere; border-radius: 8px; font-size: 14px; color: var(--accent); }
.library-page.nav-frame .catalog-layout { display: block !important; margin: 0 !important; padding: 0 !important; }
.library-page.nav-frame .catalog-results-panel { padding: 0 !important; min-width: 0; }
.library-page.nav-frame .catalog-results-head { min-height: 0 !important; padding: 0 0 6px !important; margin: 0 !important; }
.library-page.nav-frame [data-catalog-search-status] { display: inline-block; font-size: 14px; margin-bottom: 12px; }
.library-page.nav-frame .course-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; gap: 16px !important; }
.library-page.nav-frame .course-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--frame-border) !important; border-radius: 12px !important; background: var(--frame-surface) !important; box-shadow: 0 3px 10px #10251d06 !important; overflow: hidden; }
.library-page.nav-frame .course-card-main-link { display: flex !important; flex-direction: column; height: 100%; }
.library-page.nav-frame .course-cover-wrap { width: 100%; aspect-ratio: 16 / 9 !important; height: auto !important; }
.library-page.nav-frame .course-cover-wrap img { width: 100%; height: 100% !important; object-fit: cover !important; }
.library-page.nav-frame .course-body { display: flex !important; flex: 1; flex-direction: column; gap: 5px !important; padding: 10px !important; }
.library-page.nav-frame .course-title-row { display: block !important; }
.library-page.nav-frame .course-title-row h2 { min-height: 2.8em; font-size: 16px !important; line-height: 1.4 !important; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-page.nav-frame .course-title-row > span { font-size: 13px; color: var(--muted); }
.library-page.nav-frame .course-description { font-size: 14px !important; line-height: 1.5 !important; min-height: 0; margin: 0 !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-page.nav-frame .course-meta-line, .library-page.nav-frame .tag-row { font-size: 14px !important; line-height: 1.5 !important; }
.library-page.nav-frame .tag-row { min-height: 24px; }
.library-page.nav-frame .course-cta { margin-top: auto !important; min-height: 34px !important; display: flex; align-items: center; justify-content: center; font-size: 15px !important; }
.library-page.nav-frame .course-favorite-toggle { width: 44px !important; height: 44px !important; }
.library-page.nav-frame #filterBackdrop { position: fixed !important; inset: 0 !important; z-index: 1000 !important; background: #10251d66; }
.library-page.nav-frame #filterBackdrop[hidden] { display: none !important; }
.library-page.nav-frame #filterDrawer {
  position: fixed !important; inset: max(24px, 12dvh) 20px auto auto !important; z-index: 1001 !important;
  display: none !important; width: min(380px, calc(100vw - 40px)) !important; max-width: none !important;
  height: auto !important; max-height: 75dvh !important; margin: 0 !important;
  padding: 0 !important; border: 1px solid var(--frame-border); border-radius: 14px !important;
  background: var(--frame-surface) !important; transform: none !important; overflow-y: auto !important;
}
.library-page.nav-frame #filterDrawer.open { display: block !important; }
.library-page.nav-frame #drawerFilterForm { display: flex; flex-direction: column; gap: 12px; padding: 16px !important; }
.library-page.nav-frame .drawer-head { position: static !important; padding: 0 !important; }
.library-page.nav-frame .drawer-field { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0; font-size: 15px; }
.library-page.nav-frame .drawer-field input, .library-page.nav-frame .drawer-field select { min-height: 34px !important; height: 34px !important; font-size: 16px !important; padding: 4px 6px !important; width: 100%; min-width: 0; }
.library-page.nav-frame .drawer-facet-list { border: 1px solid var(--frame-border); border-radius: 8px; padding: 8px; }
.library-page.nav-frame .drawer-facet-list summary { min-height: 44px; padding: 10px 4px; cursor: pointer; font-size: 15px; overflow-wrap: anywhere; }
.library-page.nav-frame .drawer-facet-list .drawer-field { margin-top: 8px; }
.library-page.nav-frame .drawer-facet-list select { height: 180px !important; max-height: 180px !important; }
.library-page.nav-frame .drawer-facet-list option { padding: 8px; }
.library-page.nav-frame .drawer-actions { position: sticky !important; bottom: -16px !important; margin: 0 -16px -16px !important; padding: 12px 16px !important; background: var(--frame-surface); }
.library-page.nav-frame .drawer-actions button, .library-page.nav-frame #closeFilterDrawer { min-height: 44px !important; font-size: 15px !important; }
@media (max-width: 1199px) and (min-width: 860px) {
  .library-page.nav-frame .catalog-top-tools { grid-template-columns: minmax(0, 1fr) auto auto; }
  .library-page.nav-frame .catalog-title-row { grid-column: 1 / -1; }
}
@media (max-width: 859px) {
  main.nav-frame { padding: 0 0 calc(88px + env(safe-area-inset-bottom)) !important; }
  .nav-frame > .site-nav { display: none !important; }
  .nav-frame > .app-mobile-tabbar {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed !important;
    inset: auto 0 0 !important; z-index: 80 !important; margin: 0 !important;
    min-height: 68px; height: auto !important; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    background: var(--frame-surface) !important; border-top: 1px solid var(--frame-border); border-radius: 0 !important;
  }
  .nav-frame > .app-mobile-tabbar a { min-height: 52px; padding: 5px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
  .nav-frame > .app-mobile-tabbar small { font-size: 13px; white-space: normal; text-align: center; }
  .library-page.nav-frame .library-shell { padding: 0 12px 16px !important; }
  .library-page.nav-frame .catalog-top-tools { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0 -12px 12px !important; padding: calc(8px + env(safe-area-inset-top)) 12px 8px !important; }
  .library-page.nav-frame .catalog-title-row { grid-column: 1; }
  .library-page.nav-frame .catalog-title-row h1 { font-size: 20px; }
  .library-page.nav-frame [data-library-count] { display: inline; }
  .library-page.nav-frame .catalog-title-row .theme-mode-summary { font-size: 14px !important; }
  .library-page.nav-frame #searchForm { grid-row: 2; grid-column: 1; }
  .library-page.nav-frame .catalog-reset-filter { grid-row: 1; grid-column: 2; }
  .library-page.nav-frame #filterToggle { grid-row: 2; grid-column: 2; }
  .library-page.nav-frame #filterToggle svg { display: none; }
  .library-page.nav-frame .catalog-quick-filters { display: none; }
  .library-page.nav-frame .catalog-active-filters { max-height: 96px; }
  .library-page.nav-frame .course-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)) !important; gap: 14px !important; }
  .library-page.nav-frame #filterDrawer { inset: 10dvh 16px auto !important; width: auto !important; max-height: 80dvh !important; padding-bottom: env(safe-area-inset-bottom) !important; }
  .nav-frame .collection-header-actions .theme-mode-menu { display: block !important; }
}
@media (max-height: 500px) and (max-width: 859px) {
  .library-page.nav-frame .catalog-top-tools { position: relative !important; }
}
.library-page.nav-frame [hidden] { display: none !important; }
.nav-frame .site-nav-links a.active::after { display: none; }
.library-page.nav-frame .course-cta { align-self: stretch !important; width: 100% !important; border: 1px solid var(--frame-border) !important; border-radius: 8px !important; }
.library-page.nav-frame .catalog-results-head { display: flex !important; }
.library-page.nav-frame .library-result-count { display: inline !important; font-size: 14px !important; }
/* The legacy mobile body overflow creates an extra scroll container and defeats sticky. */
@media (max-width: 859px) {
  html:has(.library-page.nav-frame), body:has(.library-page.nav-frame):not(.filter-drawer-open) {
    overflow-x: clip !important; overflow-y: visible !important;
  }
}
@media (max-width: 859px) {
  .nav-frame > .app-mobile-tabbar { width: 100% !important; max-width: none !important; }
}
.library-page.nav-frame #drawerFilterForm { height: auto !important; overflow: visible !important; }
.library-page.nav-frame #drawerFilterForm > * { flex-shrink: 0; }
.library-page.nav-frame .drawer-actions { width: auto !important; left: auto !important; right: auto !important; }

/* Original theme tokens provide every surface; no new palette or preference key. */
.nav-frame .site-brand, .nav-frame .site-nav { color: var(--text-main) !important; }
.nav-frame .site-nav-links a, .nav-frame .site-user, .nav-frame .site-user button { color: var(--text-muted) !important; }
.nav-frame .site-nav-links a.active { color: var(--primary-strong) !important; background: var(--primary-soft) !important; }
.nav-frame .app-mobile-tabbar a { color: var(--text-muted) !important; }
.nav-frame .app-mobile-tabbar a.active { color: var(--primary-strong) !important; background: var(--primary-soft) !important; }
.nav-frame .theme-mode-summary, .nav-frame .theme-mode-panel {
  background: var(--surface-elevated) !important; color: var(--text-main) !important;
  border-color: var(--border-strong) !important; box-shadow: 0 2px 8px var(--shadow-soft) !important;
}
.nav-frame .theme-mode-option { background: var(--surface-elevated) !important; color: var(--text-main) !important; }
.nav-frame .theme-mode-option:hover, .nav-frame .theme-mode-option.is-active { background: var(--primary-soft) !important; color: var(--primary-strong) !important; }
.library-page.nav-frame :is(input, select, option) {
  background: var(--input-bg) !important; color: var(--input-text) !important; border-color: var(--border-strong) !important;
}
.library-page.nav-frame input::placeholder { color: var(--text-muted) !important; opacity: 1; }
.library-page.nav-frame :is(button, .course-cta) {
  background: var(--tool-button-bg) !important; color: var(--tool-button-text) !important;
  border: 1px solid var(--border-strong) !important; box-shadow: none !important;
}
.library-page.nav-frame button:disabled { opacity: 1 !important; color: var(--text-muted) !important; background: var(--surface-soft) !important; border-style: dashed !important; cursor: not-allowed; }
.library-page.nav-frame #drawerFilterForm [data-view-filter-results] { background: var(--primary-strong) !important; color: var(--button-primary-text) !important; border-color: var(--primary-strong) !important; }
.library-page.nav-frame :is(.course-title-row h2, .drawer-field, .drawer-title) { color: var(--text-main) !important; }
.library-page.nav-frame :is(.course-description, .course-meta-line, [data-library-count], .course-title-row > span) { color: var(--text-muted) !important; }
.library-page.nav-frame .tag-row span { background: var(--surface-soft) !important; color: var(--text-main) !important; border-color: var(--border-soft) !important; }
.library-page.nav-frame .course-favorite-toggle { background: var(--surface-elevated) !important; color: var(--primary-strong) !important; border-color: var(--border-strong) !important; }
.library-page.nav-frame .course-favorite-toggle svg { color: inherit !important; stroke: currentColor !important; }
.library-page.nav-frame .course-favorite-toggle.active { background: var(--primary-strong) !important; color: var(--button-primary-text) !important; }
.library-page.nav-frame #filterDrawer { overscroll-behavior: contain; color: var(--text-main); box-shadow: 0 8px 24px var(--shadow-soft); }
.library-page.nav-frame .drawer-head { min-height: 34px; }
.library-page.nav-frame .drawer-actions { border-top: 1px solid var(--border-soft); }
.library-page.nav-frame .drawer-actions button, .library-page.nav-frame #closeFilterDrawer { min-height: 34px !important; padding: 5px 10px !important; border-radius: 6px; }
.library-page.nav-frame .drawer-legacy-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; overflow-wrap: anywhere; }
.library-page.nav-frame .drawer-legacy-filter button { flex-shrink: 0; min-height: 34px; }
.library-page.nav-frame .library-empty-state { background: var(--frame-surface); color: var(--text-main); border: 1px solid var(--frame-border); border-radius: 8px; padding: 16px; }
.library-page.nav-frame .library-empty-state p { color: var(--text-main); }
.library-page.nav-frame .library-empty-state button { min-height: 34px; padding: 5px 10px; border-radius: 6px; }
/* Toast is appended to body, so inherit the existing body theme only on main pages. */
body:has(main.nav-frame) .marketing-toast { background: var(--surface-elevated); color: var(--text-main); border-color: var(--border-strong); box-shadow: 0 4px 14px var(--shadow-soft); }
@media (max-width: 859px), (pointer: coarse) {
  .library-page.nav-frame .catalog-top-tools > button,
  .library-page.nav-frame .theme-mode-summary, .library-page.nav-frame .catalog-search-info > summary,
  .library-page.nav-frame .catalog-search-info-panel button, .library-page.nav-frame .catalog-active-filters button,
  .library-page.nav-frame .course-cta, .library-page.nav-frame .library-empty-state button,
  .library-page.nav-frame .drawer-actions button, .library-page.nav-frame #closeFilterDrawer,
  .library-page.nav-frame .drawer-legacy-filter button { min-height: 44px !important; }
  .library-page.nav-frame .drawer-field select, .library-page.nav-frame .catalog-quick-field select { min-height: 44px !important; height: 44px !important; }
  .library-page.nav-frame .catalog-search input { height: 44px !important; min-height: 44px !important; }
  .library-page.nav-frame .catalog-search .search-icon { top: 12px; }
  .library-page.nav-frame .catalog-search-info > summary { display: flex; align-items: center; }
}

@media (max-width: 859px) {
  .library-page.nav-frame .course-title-row h2 { min-height: 0; }
  .library-page.nav-frame #filterDrawer { max-width: 400px !important; margin-inline: auto !important; }
}

@media (min-width: 860px) {
  .library-page.nav-frame .course-body { gap: 3px !important; }
}

/* Library-only anchored pickers. The form select is retained as the value source. */
.library-page.nav-frame .catalog-heading { display: flex; flex-direction: column; gap: 1px; }
.library-page.nav-frame .catalog-heading [data-library-count] { font-size: 13px; line-height: 18px; white-space: nowrap; }
.library-page.nav-frame .catalog-picker { position: relative; min-width: 0; }
.library-page.nav-frame .catalog-picker-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 32px; width: 100%; padding: 4px 9px; border-radius: 6px;
  font-size: 15px; line-height: 22px; text-align: left;
}
.library-page.nav-frame .catalog-picker-trigger [data-picker-value] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-page.nav-frame .catalog-quick-field .catalog-picker { min-width: 74px; max-width: 168px; }
.library-page.nav-frame .catalog-picker-menu {
  position: absolute; inset: calc(100% + 4px) auto auto 0; z-index: 95;
  width: max-content; min-width: 100%; max-width: 280px; padding: 4px;
  background: var(--surface-elevated); color: var(--text-main);
  border: 1px solid var(--border-strong); border-radius: 7px; box-shadow: 0 3px 10px var(--shadow-soft);
}
.library-page.nav-frame .catalog-picker-options { max-height: min(300px, 45dvh); padding: 6px; overflow-y: auto; overscroll-behavior: contain; }
.library-page.nav-frame .catalog-picker-menu [role="option"] {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; min-height: 36px; padding: 6px 9px; border: 0 !important; border-radius: 4px;
  background: var(--surface-elevated) !important; color: var(--text-main) !important;
  font-size: 15px; line-height: 22px; text-align: left; white-space: normal;
}
.library-page.nav-frame .catalog-picker-menu [role="option"]:is(:hover, [aria-selected="true"]) {
  background: var(--primary-soft) !important; color: var(--primary-strong) !important;
}
.library-page.nav-frame .catalog-picker-menu [role="option"][aria-selected="true"] { font-weight: 700; }
.library-page.nav-frame .catalog-picker-menu small { color: inherit; font-size: 13px; }
.library-page.nav-frame .catalog-picker-group { padding: 9px 9px 3px; font-size: 13px; color: var(--text-muted); }
.library-page.nav-frame .catalog-picker-search { width: 100%; min-height: 36px; padding: 6px 8px; font-size: 15px; border: 1px solid var(--border-strong); border-radius: 4px; margin-bottom: 4px; }
.library-page.nav-frame .drawer-field .catalog-picker-menu { position: static; width: 100%; max-width: none; min-width: 0; margin-top: 4px; }
.library-page.nav-frame .drawer-field .catalog-picker-options { max-height: min(220px, 32dvh); }
.library-page.nav-frame .drawer-field { align-items: start; }
.library-page.nav-frame .drawer-field > span { padding-top: 6px; line-height: 22px; }
.library-page.nav-frame .drawer-actions { bottom: 0 !important; }
.library-page.nav-frame .catalog-picker-trigger[aria-expanded="true"] { outline: 2px solid var(--primary-strong); outline-offset: 1px; }
@media (max-width: 859px) {
  .library-page.nav-frame .catalog-top-tools { gap: 4px 8px; padding-top: calc(4px + env(safe-area-inset-top)) !important; padding-bottom: 4px !important; margin-bottom: 8px !important; }
  .library-page.nav-frame .catalog-title-row { justify-content: space-between; gap: 4px; }
  .library-page.nav-frame .catalog-title-row h1 { font-size: 18px; line-height: 24px; }
  .library-page.nav-frame .catalog-top-tools > button, .library-page.nav-frame .theme-mode-summary { padding: 4px 8px !important; border-color: transparent !important; background: transparent !important; box-shadow: none !important; }
  .library-page.nav-frame .catalog-search input { padding-left: 30px !important; font-size: 15px !important; }
  .library-page.nav-frame #drawerFilterForm { gap: 6px; padding: 12px !important; }
  .library-page.nav-frame .drawer-field { gap: 8px; grid-template-columns: 68px minmax(0, 1fr); }
  .library-page.nav-frame .drawer-field > span { padding-top: 11px; }
  .library-page.nav-frame .catalog-picker-trigger, .library-page.nav-frame .catalog-picker-menu [role="option"], .library-page.nav-frame .catalog-picker-search { min-height: 44px !important; }
  .library-page.nav-frame .catalog-picker-menu { position: static; width: 100%; max-width: none; margin-top: 4px; }
  .library-page.nav-frame .drawer-actions { bottom: 0 !important; margin: 0 -12px -12px !important; padding: 8px 12px !important; }
  .library-page.nav-frame .course-grid { gap: 8px !important; }
  .library-page.nav-frame .course-card-main-link { display: grid !important; grid-template-columns: 104px minmax(0, 1fr); gap: 8px; padding: 8px; align-items: start; }
  .library-page.nav-frame .course-cover-wrap { margin: 0; border-radius: 6px; overflow: hidden; }
  .library-page.nav-frame .course-body { padding: 0 !important; gap: 3px !important; min-width: 0; height: 100%; }
  .library-page.nav-frame .course-title-row > span { position: absolute; left: 8px; top: 72px; max-width: 104px; font-size: 13px; line-height: 19px; }
  .library-page.nav-frame .course-description { -webkit-line-clamp: 1; }
  .library-page.nav-frame .tag-row { min-height: 20px; gap: 3px; flex-wrap: nowrap; overflow: hidden; }
  .library-page.nav-frame .tag-row span { padding: 1px 5px; line-height: 16px; white-space: nowrap; }
  .library-page.nav-frame .course-cta { margin-top: 4px !important; border-radius: 6px !important; }
  .library-page.nav-frame .course-favorite-toggle { left: 8px !important; top: 98px !important; right: auto !important; }
}
@media (max-width: 859px) and (orientation: landscape) {
  .library-page.nav-frame .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Library browsing: both layouts use the same cards, actions, and original theme tokens. */
.library-page.nav-frame .catalog-top-tools { grid-template-columns: auto minmax(180px, 1fr) auto; overflow: visible !important; }
.library-page.nav-frame .catalog-browse-tools { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.library-page.nav-frame .catalog-browse-tools #filterToggle { width: auto !important; min-width: 54px; padding: 4px !important; }
.library-page.nav-frame .catalog-browse-tools #filterToggle span { white-space: nowrap !important; }
.library-page.nav-frame .catalog-browse-tools :is(button, a) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 4px 8px; border-radius: 6px; font-size: 14px; line-height: 22px; white-space: nowrap; }
.library-page.nav-frame .catalog-browse-tools > button, .library-page.nav-frame .catalog-browse-tools > a,
.library-page.nav-frame .catalog-view-switch button { background: transparent !important; border-color: transparent !important; color: var(--text-main) !important; }
.library-page.nav-frame .catalog-browse-tools [aria-pressed="true"] { background-color: var(--primary-soft) !important; color: var(--primary-strong) !important; box-shadow: inset 0 -2px var(--primary-strong) !important; font-weight: 700; }
.library-page.nav-frame .catalog-view-switch { display: flex; gap: 3px; margin-left: auto; }
.library-page.nav-frame .catalog-view-switch svg, .library-page.nav-frame #filterToggle svg { display: block; width: 18px; height: 18px; }
.library-page.nav-frame .catalog-order .catalog-picker-menu { position: absolute; top: calc(100% + 4px); left: 0; width: 152px; margin: 0; }
.library-page.nav-frame .catalog-order [role="option"] { justify-content: space-between; }
.library-page.nav-frame .catalog-order [aria-selected="true"]::after { content: "✓"; }
.library-page.nav-frame .catalog-recent-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.library-page.nav-frame .catalog-recent-note button { padding: 4px 8px; min-height: 32px; border-radius: 6px; }
.library-page.nav-frame .catalog-search-info { position: relative; margin-left: auto; font-size: 13px; color: var(--text-muted); }
.library-page.nav-frame .catalog-search-info summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; padding: 4px; border-radius: 5px; list-style: none; text-decoration: underline dotted; text-underline-offset: 4px; }
.library-page.nav-frame .catalog-search-info summary::-webkit-details-marker { display: none; }
.library-page.nav-frame .catalog-search-info-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 96; width: 280px; padding: 12px; background: var(--surface-elevated); color: var(--text-main); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 3px 10px var(--shadow-soft); }
.library-page.nav-frame .catalog-search-info-panel p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.library-page.nav-frame .catalog-search-info-panel button { min-height: 32px; padding: 4px 8px; border-radius: 5px; }
.library-page.nav-frame[data-library-layout="list"] .course-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
.library-page.nav-frame[data-library-layout="list"] .course-card-main-link { display: grid !important; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 8px; align-items: start; }
.library-page.nav-frame[data-library-layout="list"] .course-body { padding: 0 !important; gap: 3px !important; min-width: 0; height: 100%; }
.library-page.nav-frame[data-library-layout="list"] .course-cover-wrap { margin: 0; border-radius: 6px; overflow: hidden; }
.library-page.nav-frame[data-library-layout="list"] .course-title-row h2 { min-height: 0; }
.library-page.nav-frame[data-library-layout="list"] .course-title-row > span { position: absolute; left: 8px; top: 106px; max-width: 104px; font-size: 13px; line-height: 19px; }
.library-page.nav-frame[data-library-layout="list"] .course-description { -webkit-line-clamp: 1; }
.library-page.nav-frame[data-library-layout="list"] .course-favorite-toggle { left: 120px !important; top: 106px !important; right: auto !important; }
.library-page.nav-frame[data-library-layout="list"] .course-cta { margin-top: 4px !important; }
@media (min-width: 860px) {
  .library-page.nav-frame .catalog-browse-tools #filterToggle { height: 32px !important; min-height: 32px !important; }
  .library-page.nav-frame[data-library-layout="list"] .course-cta { width: 160px !important; align-self: flex-start !important; }
}
@media (max-width: 859px) {
  .library-page.nav-frame .catalog-top-tools { grid-template-columns: minmax(0, 1fr) auto; position: sticky !important; }
  .library-page.nav-frame .catalog-title-row { flex-wrap: nowrap; }
  .library-page.nav-frame .catalog-heading { flex-shrink: 1; min-width: 0; }
  .library-page.nav-frame .catalog-heading [data-library-count] { white-space: normal; }
  .library-page.nav-frame .catalog-title-row .theme-mode-menu { margin-left: 0; flex-shrink: 0; }
  .library-page.nav-frame .catalog-title-row .theme-mode-summary { padding-inline: 2px !important; }
  .library-page.nav-frame .catalog-search-info { flex-shrink: 0; }
  .library-page.nav-frame .catalog-search-info summary { min-height: 44px; padding-inline: 2px; }
  .library-page.nav-frame .catalog-search-info-panel { position: absolute; left: auto; right: -76px; width: min(280px, calc(100vw - 24px)); }
  .library-page.nav-frame #searchForm { grid-column: 1 / -1; grid-row: 2; }
  .library-page.nav-frame .catalog-browse-tools { grid-row: 3; gap: 2px; justify-content: space-between; }
  .library-page.nav-frame .catalog-browse-tools :is(button, a) { min-height: 44px !important; padding: 4px; font-size: 14px; }
  .library-page.nav-frame .catalog-order .catalog-picker-trigger { gap: 2px; border-color: transparent !important; }
  .library-page.nav-frame .catalog-view-switch { gap: 0; margin-left: 0; }
  .library-page.nav-frame .catalog-view-switch button { min-width: 34px; }
  .library-page.nav-frame #filterToggle { gap: 3px; }
  .library-page.nav-frame .catalog-recent-note button { min-height: 44px; }
  .library-page.nav-frame[data-library-layout="grid"] .course-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)) !important; }
  .library-page.nav-frame[data-library-layout="grid"] .course-card-main-link { display: flex !important; padding: 0; gap: 0; }
  .library-page.nav-frame[data-library-layout="grid"] .course-cover-wrap { height: clamp(126px, 17dvh, 154px) !important; aspect-ratio: auto !important; border-radius: 0; background: var(--surface-soft); }
  .library-page.nav-frame[data-library-layout="grid"] .course-cover-wrap img { object-fit: contain !important; }
  .library-page.nav-frame[data-library-layout="grid"] .course-body { padding: 8px !important; width: 100%; }
  .library-page.nav-frame[data-library-layout="grid"] .course-title-row { display: flex !important; align-items: flex-start; gap: 6px; }
  .library-page.nav-frame[data-library-layout="grid"] .course-title-row h2 { min-width: 0; flex: 1; }
  .library-page.nav-frame[data-library-layout="grid"] .course-title-row > span { position: static; flex-shrink: 0; max-width: none; padding: 2px 4px; background: var(--surface-soft); color: var(--text-muted); }
  .library-page.nav-frame[data-library-layout="grid"] .course-favorite-toggle { top: 8px !important; right: 8px !important; left: auto !important; }
  .library-page.nav-frame[data-library-layout="list"] .course-card-main-link { grid-template-columns: 104px minmax(0, 1fr); gap: 8px; }
  .library-page.nav-frame[data-library-layout="list"] .course-title-row > span { top: 72px; }
  .library-page.nav-frame[data-library-layout="list"] .course-favorite-toggle { left: 8px !important; top: 98px !important; }
}
@media (max-width: 859px) and (orientation: landscape) {
  .library-page.nav-frame[data-library-layout="grid"] .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .library-page.nav-frame[data-library-layout="grid"] .course-cover-wrap { height: 120px !important; }
}

/* Candidate readability: paired existing theme tokens, without changing learning states. */
.home-page.nav-frame .landing-hero { background: linear-gradient(135deg, var(--surface), var(--surface-soft)); color: var(--text-main); border-color: var(--border-soft); box-shadow: 0 6px 20px var(--shadow-soft); }
.home-page.nav-frame .landing-hero::before { background: linear-gradient(100deg, transparent, var(--primary-soft)); }
.home-page.nav-frame .landing-hero :is(h1, .eyebrow) { color: var(--text-main); }
.home-page.nav-frame .landing-hero :is(p, .landing-hero-note) { color: var(--text-muted) !important; }
.home-page.nav-frame .landing-tag-row span { background: var(--surface-elevated); color: var(--text-main); border-color: var(--border-soft); box-shadow: none; }
.home-page.nav-frame .landing-feature-card { background: var(--surface-elevated); color: var(--text-main); border-color: var(--border-soft); box-shadow: 0 2px 8px var(--shadow-soft); }
.home-page.nav-frame .landing-feature-card::after { background: var(--primary-soft); }
.home-page.nav-frame .landing-feature-card strong { color: var(--text-main); }
.home-page.nav-frame .landing-feature-card small { color: var(--text-muted); }
.home-page.nav-frame :is(.landing-feature-icon, .landing-feature-arrow, .landing-feature-tags b) { background: var(--primary-soft); color: var(--primary-strong); }
.home-page.nav-frame :is(.landing-primary-cta, .home-resume-action) { color: var(--button-primary-text); background: var(--primary-strong); }
.library-page.nav-frame[data-library-layout="grid"] .course-cover-wrap { height: auto !important; aspect-ratio: auto !important; background: var(--surface-soft); }
.library-page.nav-frame[data-library-layout="grid"] .course-cover-wrap img { display: block; position: relative; width: 100%; height: auto !important; max-height: none; aspect-ratio: auto; object-fit: contain !important; }
.library-page.nav-frame .tag-row { gap: 6px; }
.library-page.nav-frame .tag-row span { padding: 0; background: transparent !important; border: 0; border-radius: 0; color: var(--text-muted); box-shadow: none; font-size: 14px; }
.library-page.nav-frame .tag-row span + span::before { content: "·"; margin-right: 6px; }
.library-page.nav-frame .catalog-search-info[hidden] { display: none; }
.library-page.nav-frame .catalog-search-info-panel { max-height: min(65dvh, 420px); overflow-y: auto; }
.library-page.nav-frame .catalog-view-switch button { min-width: 44px; }
.library-page.nav-frame .catalog-browse-tools [aria-pressed="true"] { box-shadow: none !important; }
.nav-frame :is(.theme-mode-panel, .catalog-picker-menu, .catalog-search-info-panel, .filter-drawer) { border: 1px solid var(--border-soft) !important; box-shadow: 0 3px 12px var(--shadow-soft) !important; }
.nav-frame .theme-mode-option { border-color: transparent !important; box-shadow: none !important; }
.library-page.nav-frame .catalog-picker-trigger, .library-page.nav-frame #searchForm input { border: 1px solid var(--border-soft) !important; box-shadow: none !important; }
.library-page.nav-frame .course-card { border-color: var(--border-soft) !important; box-shadow: 0 1px 4px var(--shadow-soft); }
.library-page.nav-frame .course-favorite-toggle { border-color: var(--border-soft) !important; box-shadow: none !important; }
.library-page.nav-frame .catalog-reset-filter:disabled { color: var(--text-muted) !important; opacity: 1 !important; border: 1px dashed var(--border-soft) !important; background: var(--surface-soft) !important; }
.library-page.nav-frame :is(.catalog-picker-trigger, #searchForm input, .catalog-browse-tools button, .catalog-search-info summary):focus-visible,
.home-page.nav-frame .landing-feature-card:focus-visible { outline: 2px solid var(--primary-strong) !important; outline-offset: 2px; }
@media (max-width: 859px) {
 .library-page.nav-frame .catalog-browse-tools .catalog-view-switch button { min-width: 44px; height: 44px; background-clip: padding-box !important; border-block: 6px solid transparent !important; border-radius: 11px; }
}
/* Readable supporting surfaces across the existing six modes. */
.nav-frame :is(.site-avatar, .profile-avatar) { background: linear-gradient(135deg, var(--surface-soft), var(--primary-soft)); color: var(--primary-strong); }
.home-page.nav-frame :is(.landing-cta, .continue-learning-action) { background: var(--primary-strong) !important; color: var(--button-primary-text) !important; }
.home-page.nav-frame .continue-learning-card .eyebrow { color: var(--text-muted); }
.home-page.nav-frame :is(.study-video-head b, .study-subtitle-line small) { color: #fff; }
.home-page.nav-frame .feature-preview { background: var(--surface); color: var(--text-main); border-color: var(--border-soft); }
.home-page.nav-frame .feature-preview :is(b, small) { color: var(--text-main) !important; }
.profile-page.nav-frame :is(.profile-user-card, .profile-menu, .profile-settings-modal, .profile-support-modal, .profile-support-card) { background: var(--surface-elevated); color: var(--text-main); border-color: var(--border-soft); box-shadow: 0 2px 8px var(--shadow-soft); }
.profile-page.nav-frame .profile-membership-card { background: linear-gradient(135deg, var(--surface), var(--surface-soft)); color: var(--text-main); border: 1px solid var(--border-soft); box-shadow: none; }
.profile-page.nav-frame :is(.profile-user-card h2, .profile-menu-item strong, .profile-membership-card h2, .profile-settings-head h2, .profile-support-card strong) { color: var(--text-main); }
.profile-page.nav-frame :is(.profile-user-card p, .profile-menu-item small, .profile-membership-card p, .profile-membership-card span, .profile-sync-note, .profile-sync-note strong, .profile-sync-note span, .profile-support-card p, .profile-support-card span, .profile-settings-form p, .settings-field small) { color: var(--text-muted); }
.profile-page.nav-frame :is(.membership-badge, .profile-menu-icon, .profile-menu-arrow, .profile-settings-icon) { background: var(--primary-soft); color: var(--primary-strong); border-color: var(--border-soft); }
.profile-page.nav-frame .profile-logout-button { background: var(--surface-elevated); color: var(--text-main); border-color: var(--border-soft); }
.profile-page.nav-frame :is(input, .settings-secondary-button, .profile-settings-head button) { background: var(--input-bg); color: var(--text-main); border-color: var(--border-soft); }
.profile-page.nav-frame input::placeholder { color: var(--text-muted); opacity: 1; }
.profile-page.nav-frame .settings-save-button { background: var(--primary-strong); color: var(--button-primary-text); }
.favorites-page .collection-tabs a.active { background: var(--primary-strong) !important; }
.lesson-shell .subtitle-meta { color: var(--text-muted) !important; opacity: 1 !important; }
.lesson-shell .subtitle-meta b, .lesson-shell .subtitle-item.active .subtitle-meta b { background: var(--primary-soft) !important; color: var(--text-main) !important; }
.lesson-shell .playback-control-btn:disabled { opacity: 1; color: var(--text-muted); background: var(--surface-soft); }
.lesson-shell :is(.theme-mode-summary, .playback-speed-menu summary) { background: var(--surface-elevated); color: var(--text-main); }

.profile-page.nav-frame .profile-sync-note { background: var(--surface-soft); border-color: var(--border-soft); box-shadow: none; }
.profile-page.nav-frame .membership-badge { color: var(--primary-strong) !important; }
.lesson-shell :is(.theme-mode-summary, .theme-mode-summary-label, .playback-rate-summary, .playback-rate-summary span) { background: var(--surface-elevated) !important; color: var(--text-main) !important; }
@media (max-width: 859px) {
 .library-page.nav-frame .catalog-browse-tools > :is(button, a) { padding-inline: 0 !important; }
 .library-page.nav-frame .catalog-order { flex: 0 0 auto; }
 .library-page.nav-frame .catalog-order .catalog-picker-trigger { padding-inline: 0 !important; }
 .library-page.nav-frame .catalog-view-switch { flex-shrink: 0; }
}
@media (max-width: 340px) {
 .library-page.nav-frame .catalog-browse-tools { flex-wrap: wrap; justify-content: flex-start; column-gap: 8px; }
 .library-page.nav-frame .catalog-view-switch { margin-left: auto; }
}
.profile-page.nav-frame .profile-settings-section { background: var(--surface-soft); border-color: var(--border-soft); color: var(--text-main); }
.profile-page.nav-frame .profile-settings-section h3 { color: var(--text-main); }
.lesson-shell .lesson-video-progress.is-disabled { opacity: 1; }

/* Library card refinement: retain original images, actions and theme tokens. */
.library-page.nav-frame .course-details-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; min-width: 0; font-size: 14px; line-height: 21px; color: var(--text-muted); }
.library-page.nav-frame .course-details-line .course-meta-line { min-width: 0; max-width: 100%; }
.library-page.nav-frame .course-details-line .tag-row { display: inline-flex; min-height: 0; gap: 6px; }
.library-page.nav-frame .course-details-line .tag-row span { height: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; line-height: 21px; }
.library-page.nav-frame .course-details-line .tag-row:empty { display: none; }
.library-page.nav-frame .course-details-line .tag-row:not(:empty)::before { content: "·"; }
.library-page.nav-frame .course-cta {
  align-self: flex-start !important; width: 120px !important; max-width: 100%;
  height: 40px; min-height: 40px !important; padding: 0 12px !important; margin-top: auto !important;
  border: 4px solid transparent !important; border-radius: 10px !important; background: var(--primary-soft) padding-box !important;
  color: var(--primary-strong) !important; box-shadow: none !important;
}
.library-page.nav-frame .course-card-main-link:is(:hover, :focus-visible) .course-cta { background-color: var(--primary-strong) !important; color: var(--button-primary-text) !important; }
.library-page.nav-frame[data-library-layout="list"] .course-card { --library-cover-width: clamp(128px, 34vw, 280px); }
.library-page.nav-frame[data-library-layout="list"] .course-card-main-link { grid-template-columns: var(--library-cover-width) minmax(0, 1fr); gap: 10px; }
.library-page.nav-frame[data-library-layout="list"] .course-cover-wrap { height: auto !important; aspect-ratio: auto !important; }
.library-page.nav-frame[data-library-layout="list"] .course-cover-wrap img { position: relative; display: block; width: 100%; height: auto !important; max-height: none; object-fit: contain !important; }
.library-page.nav-frame[data-library-layout="list"] .course-title-row > span { position: static; padding: 0; background: transparent; max-width: none; }
.library-page.nav-frame .course-title-row h2 { display: block !important; -webkit-line-clamp: unset !important; overflow: visible; }
.library-page.nav-frame[data-library-layout="list"] .course-favorite-toggle { top: 10px !important; left: calc(8px + var(--library-cover-width) - 46px) !important; right: auto !important; }
.library-page.nav-frame[data-library-layout] .course-cta { margin-top: auto !important; }
.library-page.nav-frame .course-favorite-toggle { border: 6px solid transparent !important; background-clip: padding-box !important; }
.library-page.nav-frame .course-cover-wrap .course-duration-badge { right: 4px !important; bottom: 4px !important; pointer-events: none; }
.library-page.nav-frame .catalog-top-tools { gap: 4px 10px; box-shadow: none !important; }
.library-page.nav-frame .catalog-browse-tools :is(button, a) { border-radius: 8px !important; }
.library-page.nav-frame .catalog-browse-tools .catalog-picker-trigger { border-color: transparent !important; }
.library-page.nav-frame .catalog-browse-tools :is(button, a):is(:hover, [aria-expanded="true"]) { background-color: var(--primary-soft) !important; color: var(--primary-strong) !important; }
.library-page.nav-frame .catalog-browse-tools .catalog-picker-trigger[aria-expanded="true"] { outline: none; }
.library-page.nav-frame .catalog-picker-options { padding: 2px; }
.library-page.nav-frame .catalog-picker-menu [role="option"] { padding-block: 4px; }
.library-page.nav-frame .catalog-picker-group { padding-top: 6px; }
@media (max-width: 859px) {
  .library-page.nav-frame .catalog-top-tools { row-gap: 0; padding-block: 2px !important; padding-top: calc(2px + env(safe-area-inset-top)) !important; margin-bottom: 4px !important; }
  .library-page.nav-frame #searchForm input { height: 36px !important; min-height: 36px !important; padding-block: 4px !important; }
  .library-page.nav-frame .catalog-search .search-icon { top: 8px; }
  .library-page.nav-frame .catalog-browse-tools :is(button, a) { height: 44px; min-height: 44px !important; padding-block: 0 !important; border-block: 6px solid transparent !important; background-clip: padding-box !important; }
  .library-page.nav-frame .catalog-order .catalog-picker-trigger { padding-inline: 4px !important; }
  .library-page.nav-frame .catalog-browse-tools .catalog-view-switch button { min-width: 44px; border-radius: 8px !important; }
  .library-page.nav-frame .course-body { gap: 2px !important; }
  .library-page.nav-frame[data-library-layout="grid"] .course-body { padding: 4px 8px !important; }
  .library-page.nav-frame[data-library-layout="grid"] .course-grid { gap: 8px !important; }
  .library-page.nav-frame .course-cta { height: 44px; min-height: 44px !important; border-block-width: 6px !important; }
  .library-page.nav-frame .course-details-line { gap: 0 4px; }
  .library-page.nav-frame .catalog-picker-menu [role="option"] { height: auto; }
}

/* Library-only supporting text: restore the original ink-blue theme token. */
body[data-theme="eye"] .library-page.nav-frame { --text-muted: #dbe5f6; }
.library-page.nav-frame .catalog-search-feedback { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-muted); font-size: 14px; }
.library-page.nav-frame .catalog-search-feedback button { min-height: 44px; padding: 4px 8px; border-radius: 6px; }
.library-page.nav-frame .catalog-search-feedback button[hidden] { display: none; }

/* Phone list only; desktop/tablet information and grid presentation stay intact. */
.library-page.nav-frame .course-mobile-meta { display: none; }
@media (max-width: 599px) {
  .library-page.nav-frame[data-library-layout="list"] .course-card { --library-cover-width: clamp(142px, calc(45vw - 6px), 258px); }
  .library-page.nav-frame[data-library-layout="list"] .course-title-row h2 { display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical; overflow: hidden; }
  .library-page.nav-frame[data-library-layout="list"] :is(.course-description, .course-details-line) { display: none; }
  .library-page.nav-frame[data-library-layout="list"] .course-mobile-meta { display: block; color: var(--text-muted); font-size: 14px; line-height: 21px; }
  .library-page.nav-frame[data-library-layout="list"] .course-mobile-meta:empty { display: none; }
}


/* Subtitle content layout 20261027: learning-page width and type revision 20261028. */
.lesson-shell {
  width: calc(100% - clamp(24px, 6.6667vw, 128px)) !important;
  max-width: none !important;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 12px;
  padding-bottom: 24px;
}

.lesson-shell #lessonVideo {
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
}

@media (min-width: 1025px) {
  .lesson-shell .learning-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) !important;
  }
}

.lesson-shell .learning-layout,
.lesson-shell .subtitle-panel,
.lesson-shell .subtitle-list,
.lesson-shell .subtitle-item,
.lesson-shell .subtitle-main,
.lesson-shell .subtitle-lines {
  min-width: 0;
  max-width: 100%;
}

.lesson-shell .subtitle-lines {
  width: 100%;
}

.lesson-shell .subtitle-lines .line-en,
.lesson-shell .subtitle-lines .line-zh {
  width: 100%;
  max-width: none;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.6 !important;
}

.lesson-shell .subtitle-lines .line-en {
  font-size: 20px !important;
  font-weight: 600 !important;
}

.lesson-shell .subtitle-lines .line-zh {
  font-size: 18px !important;
  font-weight: 400 !important;
}

/* Ordinary compounds move intact; only a token wider than the whole line wraps. */
.lesson-shell .subtitle-lines .subtitle-compound {
  display: inline-block;
  inline-size: max-content;
  max-inline-size: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: bottom;
}

@media (max-width: 859px) {
  .lesson-shell .learning-layout { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 768px) {
  .lesson-shell .subtitle-lines .line-en { font-size: 18px !important; }
  .lesson-shell .subtitle-lines .line-zh { font-size: 16px !important; }
}

@media (max-width: 480px) {
  .lesson-shell { width: calc(100% - 24px) !important; }
}

@media (max-width: 240px) {
  .lesson-shell { width: calc(100% - 12px) !important; }
  .lesson-shell .subtitle-list .subtitle-item { padding-inline: 2px !important; }
}

/* Learning-page alignment and compact controls, 20261028. */
@media (min-width: 860px) {
  .lesson-shell .learning-layout {
    grid-template-rows: repeat(9, auto) !important;
    gap: 0 16px !important;
  }
  .lesson-shell .player-column { display: contents; }
  .lesson-shell .player-column > .lesson-overview { margin-bottom: 8px !important; }
  .lesson-shell .player-column > .lesson-video-progress { margin: 4px 0 0 !important; }
  .lesson-shell .player-column > .desktop-playback-controls { margin: 0 !important; }
  .lesson-shell .player-column > .resume-learning-prompt { grid-column: 1 !important; grid-row: 5 !important; margin: 4px 0 !important; }
  .lesson-shell .player-column > .info-chips { grid-row: 6 !important; margin: 0 !important; }
  .lesson-shell .player-column > .desktop-tool-strip { grid-row: 7 !important; margin: 0 !important; }
  .lesson-shell .feature-dock { grid-row: 8 !important; margin: 0 !important; }
  .lesson-shell .player-column > .lesson-intro { grid-row: 9 !important; margin: 6px 0 0 !important; }
  .lesson-shell .subtitle-panel {
    display: flex !important;
    flex-direction: column;
    position: static !important;
    inset: auto !important;
    grid-column: 2 !important;
    grid-row: 2 / 10 !important;
    align-self: stretch !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    contain: size;
  }
  .lesson-shell .subtitle-list {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }
}

/* Match the saved candidate's tablet stack without a fixed empty panel height. */
@media (min-width: 860px) and (max-width: 1024px) {
  .lesson-shell .learning-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: repeat(10, auto) !important;
  }
  .lesson-shell .subtitle-panel {
    grid-column: 1 !important;
    grid-row: 10 !important;
    margin-top: 8px;
    max-height: min(70vh, 640px) !important;
    contain: none;
  }
  .lesson-shell .subtitle-list { flex: 1 1 auto !important; }
}

.lesson-shell .desktop-playback-panel:not([hidden]) {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px !important;
}
.lesson-shell .desktop-playback-panel:not([hidden]) {
  width: max-content;
  min-width: 0;
  max-width: 100%;
  margin: 0 !important;
  justify-content: center;
}
@media (min-width: 860px) {
  .lesson-shell .desktop-tool-strip,
  .lesson-shell .feature-dock {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 2px 4px !important;
  }
}
.lesson-shell .desktop-playback-controls { min-width: 0; justify-content: center; }

.lesson-shell :is(
  .desktop-tool-strip > button,
  .desktop-tool-strip > details > summary,
  .desktop-playback-panel > .playback-control-btn:not(.is-primary),
  .desktop-playback-panel > details > summary,
  .desktop-playback-expand,
  .feature-dock > a,
  .segment-actions .ai-score-action
) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 40px;
  min-height: 40px;
  height: auto !important;
  gap: 4px !important;
  padding: 4px 6px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--tool-button-text, var(--text)) !important;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}
.lesson-shell .desktop-playback-panel[hidden],
.lesson-shell .desktop-playback-expand[hidden] { display: none !important; }
.lesson-shell .desktop-playback-expand::after { content: "展开"; }
.lesson-shell .desktop-playback-panel .playback-control-hint { font-size: 12px; font-weight: 600; }
.lesson-shell .feature-dock > a { max-width: 100%; }
.lesson-shell .feature-dock .feature-icon,
.lesson-shell .desktop-playback-panel .sleep-timer-trigger-icon {
  width: 16px;
  height: 16px;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.lesson-shell .info-chips span {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 3px 6px !important;
}
.lesson-shell :is(.desktop-tool-strip, .desktop-playback-controls, .feature-dock, .segment-actions)
  :is(button, summary, a):not(:disabled):not(.is-primary):hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
}
.lesson-shell :is(.desktop-tool-strip, .desktop-playback-controls, .feature-dock, .segment-actions)
  :is(button, summary, a):focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
}
.lesson-shell :is(.desktop-tool-strip, .desktop-playback-controls)
  :is(.is-active, [aria-pressed="true"], details[open] > summary):not(.is-primary) {
  color: var(--accent-strong, var(--accent)) !important;
  background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lesson-shell .desktop-playback-controls button:disabled { opacity: .35; cursor: not-allowed; }
.lesson-shell .desktop-playback-controls .is-primary { box-shadow: none !important; }

@media (pointer: coarse), (max-width: 1024px) {
  .lesson-shell :is(.desktop-tool-strip > button, .desktop-tool-strip > details > summary,
    .desktop-playback-panel > .playback-control-btn, .desktop-playback-panel > details > summary,
    .desktop-playback-expand, .feature-dock > a, .segment-actions .ai-score-action) { min-width: 44px !important; min-height: 44px !important; }
}

/* Learning-page viewport height budget, 20261028. */
@media (min-width: 1025px) {
  .lesson-shell .player-column > .lesson-overview {
    margin-bottom: 6px !important;
    padding-bottom: 0;
  }
  .lesson-shell .lesson-overview > .back { margin-bottom: 4px; }
  .lesson-shell .lesson-title.compact {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 8px;
  }
  .lesson-shell .lesson-title.compact > img {
    width: 48px !important;
    height: 48px !important;
    max-height: 48px !important;
    object-fit: contain;
  }
  .lesson-shell .lesson-title.compact > div { min-width: 0; }
  .lesson-shell .lesson-title .title-line { flex-wrap: wrap; }
  .lesson-shell .lesson-title h1 { margin-bottom: 4px; }
  .lesson-shell .lesson-title .meta-line { margin-bottom: 0; }
  .lesson-shell .lesson-intro { padding: 6px 10px; }
  .lesson-shell .lesson-intro h2 { margin-bottom: 4px; }
  .lesson-shell .lesson-intro dl { row-gap: 4px; }
}

/* A real banner remains an auto-sized flex sibling; no assumed banner height. */
@media (min-width: 1025px) and (min-height: 640px) {
  body:has(> #app > .lesson-shell) {
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }
  body:has(> #app > .lesson-shell) > :not(#app) { flex: none; }
  #app:has(> .lesson-shell) { flex: 1 1 0; min-height: 0; }
  #app > .lesson-shell {
    height: 100%;
    min-height: 0;
    padding-top: 4px;
    padding-bottom: 8px;
    grid-template-rows: minmax(0, 1fr);
  }
  .lesson-shell .learning-layout {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(180px, 1fr) repeat(7, auto) !important;
  }
  .lesson-shell #lessonVideo {
    height: 100% !important;
    min-height: 0;
    object-fit: contain !important;
  }
}

/* Integration: the text theme trigger needs its own width throughout the mobile header range. */
@media (min-width: 721px) and (max-width: 859px) {
  .lesson-shell .mobile-learn-topbar {
    grid-template-columns: 32px minmax(0, 1fr) 32px 32px max-content;
  }
}

/* Learning workspace: keep accepted geometry/type; remove the nested glossy panel layers. */
.lesson-shell {
  --shadow: none;
  --panel-shadow: none;
  --card-shadow: none;
  --surface-gloss: transparent;
  --surface-highlight: transparent;
}
.lesson-shell .learning-workbench {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.lesson-shell .learning-workbench > .panel-title { flex: none; }
.lesson-shell :is(.workbench-tabs, .workbench-practice-tabs) {
  display: flex;
  flex: none;
  gap: 4px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--border-soft, var(--line));
}
.lesson-shell :is(.workbench-tabs, .workbench-practice-tabs) > button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text-main, var(--text));
  line-height: 1.4;
}
.lesson-shell :is(.workbench-tabs, .workbench-practice-tabs) > button:is(:hover, [aria-selected="true"]) {
  color: var(--primary-strong, var(--accent));
  background: var(--primary-soft, var(--paper-soft));
}
.lesson-shell .learning-workbench :is(button, select, input):focus-visible {
  outline: 2px solid var(--primary-strong, var(--accent));
  outline-offset: 2px;
}
.lesson-shell .workbench-pane {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-top: 8px;
  color: var(--text-main, var(--text));
  scrollbar-gutter: stable;
}
.lesson-shell .workbench-pane[hidden],
.lesson-shell .workbench-practice-pane[hidden] { display: none; }
.lesson-shell .workbench-subtitles:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; padding-top: 6px; }
.lesson-shell .workbench-subtitles > .subtitle-list { min-height: 0; flex: 1 1 auto; }
.lesson-shell .workbench-practice:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.lesson-shell .workbench-practice-pane { flex: 1 1 0; min-height: 0; overflow: auto; padding-top: 8px; }
.lesson-shell .workbench-pane :is(.small-grid, .fill-question-pane, .dictation-question-pane) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.lesson-shell .workbench-pane :is(.study-card, .practice-card) { min-width: 0; }
.lesson-shell .workbench-reading-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 12px; }
.lesson-shell .workbench-reading-controls label { flex: 1 1 180px; min-width: 0; }
.lesson-shell .workbench-reading-controls select { width: 100%; max-width: 100%; min-height: 44px; }
.lesson-shell .workbench-reading-controls button { min-height: 44px; }
.lesson-shell .workbench-reading { padding: 0 2px 12px; }
.lesson-shell .workbench-reading :is(h2, p, dd) { overflow-wrap: anywhere; }
.lesson-shell .workbench-reading .intensive-list { margin-inline: 0; }
.lesson-shell .workbench-practice-pane input { max-width: 100%; color: var(--text-main, var(--text)); background: var(--input-bg, var(--paper)); }
@media (max-width: 1024px) {
  .lesson-shell .learning-workbench { max-height: min(75dvh, 720px) !important; }
  .lesson-shell .workbench-pane { flex-basis: auto; }
  .lesson-shell .workbench-practice-pane { flex-basis: auto; }
}

/* Embedded vocabulary inherits theme ink, not the standalone card's fixed green. */
.lesson-shell .workbench-pane.cards-shell { width: auto; }
.lesson-shell .workbench-pane .study-card :is(p, blockquote, small) { color: var(--text-muted, var(--muted)); }
.lesson-shell .workbench-pane .study-card .card-meaning { color: var(--text-main, var(--text)) !important; }
/* The legacy mobile content-stack rule uses visible overflow; embedded panes scroll inside their workspace. */
.lesson-shell .learning-workbench { overflow: hidden !important; }
.lesson-shell .workbench-pane,
.lesson-shell .workbench-practice-pane { overflow-y: auto !important; overflow-x: hidden !important; }
.lesson-shell :is(.workbench-subtitles, .workbench-practice) { overflow: hidden !important; }
.lesson-shell .workbench-pane .study-card h2 { color: var(--primary-strong, var(--accent)); }
/* Account coverage display: confined to library cards and the lesson video area. */
:is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#236d53; --study-track:#bdcfc3; --study-ink:#20513d; }
body[data-theme="rose"] :is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#c52d68; --study-track:#e9b9cd; --study-ink:#92224e; }
body[data-theme="glacier"] :is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#0672d8; --study-track:#b0cee5; --study-ink:#07528a; }
body[data-theme="almond"] :is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#825322; --study-track:#dcbf9b; --study-ink:#65401d; }
body[data-theme="eye"] :is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#94f3ef; --study-track:#47627e; --study-ink:#b8fffa; }
body[data-theme="night"] :is(.library-page, .lesson-shell, .favorites-page) { --study-fill:#97f3ee; --study-track:#546674; --study-ink:#c1fffb; }
:is(.library-page, .lesson-shell, .favorites-page) .account-progress-track { display:block; height:4px; min-height:4px; width:100%; background:var(--study-track); border-radius:4px; overflow:hidden; }
:is(.library-page, .lesson-shell, .favorites-page) .account-progress-track > span { display:block; height:4px; background:var(--study-fill); border-radius:4px; }
:is(.library-page, .lesson-shell, .favorites-page) .account-progress-text { display:flex; align-items:center; justify-content:flex-end; gap:6px; color:var(--study-ink); font-size:12px; line-height:18px; white-space:nowrap; }
:is(.library-page, .lesson-shell, .favorites-page) .account-progress-percent { font-variant-numeric:tabular-nums; font-weight:650; }
.library-page.nav-frame .course-body { gap:4px !important; container-type:inline-size; }
.library-page.nav-frame .course-study-footer { display:grid; grid-template-columns:minmax(86px,120px) minmax(0,1fr); grid-template-rows:4px 40px; column-gap:8px; width:100%; margin-top:auto; align-items:center; }
.library-page.nav-frame .course-study-footer .course-cta { grid-column:1; grid-row:2; margin:0 !important; width:100% !important; }
.library-page.nav-frame .course-study-footer .account-course-progress { display:contents; }
.library-page.nav-frame .course-study-footer .account-progress-track { grid-column:1/-1; grid-row:1; }
.library-page.nav-frame .course-study-footer .account-progress-text { grid-column:2; grid-row:2; }
.lesson-shell .account-lesson-progress { display:flex; align-items:center; gap:12px; margin:2px 0 6px; min-height:24px; width:100%; }
.lesson-shell .account-lesson-progress .account-progress-text { flex-shrink:0; }
.lesson-shell .account-lesson-progress .account-progress-track { flex:1; min-width:40px; }
@media(max-width:859px) {
 .library-page.nav-frame .course-body { gap:2px !important; }
 .library-page.nav-frame .course-study-footer { grid-template-rows:4px 44px; }
}
@media(min-width:860px) {
 .library-page.nav-frame[data-library-layout="grid"] .course-body { gap:3px !important; padding-block:8px !important; }
 .library-page.nav-frame[data-library-layout="list"] .course-study-footer { grid-template-columns:160px minmax(0,1fr); }
 /* The existing desktop player uses explicit grid rows; reserve one compact line
    in its progress row without moving or resizing the video/subtitle columns. */
 .lesson-shell .player-column > .account-lesson-progress { grid-column:1; grid-row:3; align-self:end; margin:0; }
 .lesson-shell .player-column > .lesson-video-progress { margin-bottom:24px !important; }
}
/* Enough inline space: a single small track to the right of the existing action. */
@container (min-width:235px) {
 @media(max-width:859px) {
  .library-page.nav-frame .course-study-footer { display:flex; gap:12px; height:44px; }
  .library-page.nav-frame .course-study-footer .course-cta { flex:0 0 120px; }
  .library-page.nav-frame .course-study-footer .account-course-progress { display:flex; flex:1; flex-direction:column; gap:4px; min-width:0; }
 }
}
/* Narrow list: keep the bar above the action, with percentage alongside it. */
@container (max-width:185px) {
 .library-page.nav-frame .course-study-footer { position:relative; grid-template-columns:minmax(0,1fr); grid-template-rows:4px 40px; gap:0; }
 .library-page.nav-frame .course-mobile-meta { padding-inline-end:42px; }
 .library-page.nav-frame .course-study-footer .account-progress-status { display:none; }
 .library-page.nav-frame .course-study-footer .course-cta { width:120px !important; height:40px; min-height:40px !important; border-block-width:4px !important; }
 .library-page.nav-frame .course-study-footer .account-progress-text { position:absolute; right:0; top:-23px; gap:0; }
}
@media(prefers-reduced-motion:reduce) { :is(.library-page, .lesson-shell, .favorites-page) .account-progress-track > span { transition:none; } }

/* Reserve the same video box before metadata, during loading, and after play. */
.lesson-shell :is(#lessonVideo,[data-lesson-video-placeholder]) {
  display:block; width:100%; aspect-ratio:16/9; min-height:180px;
  background:#101511; border-radius:8px; box-sizing:border-box;
}
@media(min-width:860px){.lesson-shell [data-lesson-video-placeholder]{grid-column:1!important;grid-row:2!important;margin:0}}
@media(min-width:1025px) and (min-height:640px){
  .lesson-shell .learning-layout{align-items:stretch!important;align-content:stretch!important}
  .lesson-shell :is(#lessonVideo,[data-lesson-video-placeholder]){height:100%!important;min-height:180px}
}
@media(max-width:859px){.lesson-shell :is(#lessonVideo,[data-lesson-video-placeholder]){height:auto!important;min-height:0}}

/* Saved learning fills desktop/tablet content width, retaining a modest gutter. */
@media (min-width: 600px) {
  .favorites-page.nav-frame > .learning-home-shell {
    width: 100% !important; max-width: none !important;
    margin: 0 !important; padding: 24px 20px !important; box-sizing: border-box;
  }
}
.saved-vocabulary-card { min-width: 0; overflow-wrap: anywhere; }
.saved-vocabulary-card h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.saved-vocabulary-card [data-saved-word-say] { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; min-height: 36px; flex-shrink: 0; }
.saved-vocabulary-card .vocabulary-example { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.saved-vocabulary-card .source-line { display: block; margin-top: 14px; }
.saved-vocabulary-card .vocabulary-phonetic { color: var(--muted); }
.saved-vocabulary-card .collection-compact-title-row { align-items: flex-start; gap: 8px; }
.saved-vocabulary-card .collection-compact-title-row h2 { margin: 0; min-width: 0; }
.saved-vocabulary-card .saved-state { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; min-height: 30px; width: auto; padding: 5px 8px; font-size: 12px; line-height: 1.2; flex: 0 0 auto; white-space: nowrap; border-radius: 999px; }
.saved-vocabulary-card .saved-state svg { width: 14px; height: 14px; flex: 0 0 14px; }

/* Compact review cards: full content, small controls, six columns on wide screens. */
.favorites-page .collection-panel[data-active-collection="words"] .small-grid,
.favorites-page .collection-panel[data-active-collection="phrases"] .small-grid {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); align-items: start; gap: 12px;
}
.favorites-page .saved-vocabulary-card {
  display:flex; flex-direction:column; gap:6px; padding:12px; min-height:0; height:auto;
  border:1px solid var(--line); border-radius:10px; background:var(--paper); box-shadow:none;
}
.favorites-page .saved-vocabulary-card p { margin:0; font-size:13px; line-height:1.5; }
.favorites-page .saved-vocabulary-card .collection-compact-title-row { align-items:flex-start; gap:6px; }
.favorites-page .saved-vocabulary-card .collection-compact-title-row h2 { margin:0; font-size:17px; line-height:1.35; font-weight:650; gap:4px; }
.favorites-page .saved-vocabulary-card .saved-state {
  width:auto; height:26px; min-height:26px; padding:3px 6px; gap:3px;
  font-size:11px; font-weight:500; border:0; border-radius:6px; background:var(--accent-soft); color:var(--accent);
}
.favorites-page .saved-vocabulary-card .saved-state svg { width:12px; height:12px; min-width:12px; min-height:12px; flex:0 0 12px; margin:0; }
.favorites-page .saved-vocabulary-card [data-saved-word-say] {
  width:28px; height:28px; min-width:28px; min-height:28px; padding:4px; border:0; border-radius:50%;
  vertical-align:middle; color:var(--accent); background:transparent;
}
.favorites-page .saved-vocabulary-card [data-saved-word-say] svg { width:14px; height:14px; min-height:14px; margin:0; }
.favorites-page .saved-vocabulary-card button:hover { background:var(--accent-soft); }
.favorites-page .saved-vocabulary-card button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.favorites-page .saved-vocabulary-card .vocabulary-example { margin:2px 0 0; padding-top:8px; }
.favorites-page .saved-vocabulary-card .vocabulary-example strong { font-size:11px; font-weight:500; color:var(--muted); }
.favorites-page .saved-vocabulary-card .vocabulary-example p + p { margin-top:4px; color:var(--muted); }
.favorites-page .saved-vocabulary-card .source-line { margin-top:4px; font-size:11px; line-height:1.4; color:var(--muted); }
.favorites-page .saved-vocabulary-card [role="status"]:empty { display:none; }
.favorites-page [data-vocabulary-notice][hidden] { display:none; }
/* Stable collapsed slots; expansion reveals the original, unabridged text. */
.favorites-page .saved-vocabulary-card[data-expanded="false"] {
 display:grid; grid-template-rows:46px 141px 16px 28px; gap:6px; align-content:start;
}
.favorites-page .saved-vocabulary-card .collection-compact-title-row h2 { flex:1; align-items:flex-start; }
.favorites-page .saved-vocabulary-card .saved-vocabulary-term { min-width:0; overflow-wrap:anywhere; }
.favorites-page .saved-vocabulary-content { min-width:0; display:grid; gap:4px; }
.favorites-page [data-expanded="false"] .saved-vocabulary-content { grid-template-rows:20px 39px 74px; }
.favorites-page [data-expanded="false"] :is(.saved-vocabulary-term,.vocabulary-meaning) {
 display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
}
.favorites-page [data-expanded="false"] :is(.vocabulary-phonetic,.saved-example-english,.saved-example-chinese,.source-line) {
 display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.favorites-page [data-expanded="false"] .saved-vocabulary-credit { display:none; }
.favorites-page .saved-vocabulary-card .vocabulary-example { margin:0; padding-top:3px; min-width:0; }
.favorites-page .saved-example-heading { display:flex; align-items:center; justify-content:space-between; height:24px; }
.favorites-page .saved-vocabulary-card .saved-example-chinese { color:var(--muted); }
.favorites-page .saved-vocabulary-card .source-line { margin:0; }
.favorites-page .saved-vocabulary-expand {
 display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:28px;
 padding:3px 8px; border:0; border-top:1px solid var(--line); border-radius:0;
 font:inherit; font-size:12px; color:var(--accent); background:transparent;
}
.favorites-page .saved-vocabulary-expand span { font-size:15px; line-height:1; }
.favorites-page [data-expanded="true"] .saved-vocabulary-content { gap:8px; }
.favorites-page [data-expanded="true"] :is(.vocabulary-phonetic,.vocabulary-meaning,.saved-example-english,.saved-example-chinese,.source-line) {
 white-space:normal; overflow:visible; overflow-wrap:anywhere; -webkit-line-clamp:unset;
}
.favorites-page .collection-sentence-meta { min-width:0; overflow:hidden; }
.favorites-page .collection-sentence-meta .time { overflow-wrap:anywhere; word-break:normal; }
.favorites-page .learning-course-card .course-body { min-width:0; }
.favorites-page .saved-course-study-footer { display:flex; flex-direction:column; gap:6px; margin-top:4px; min-width:0; }
.favorites-page .saved-course-study-footer .account-course-progress { display:flex; flex-direction:column-reverse; gap:4px; width:100%; }
.favorites-page .saved-course-study-footer .account-progress-text { justify-content:space-between; font-size:11px; gap:4px; }
.favorites-page .saved-course-study-footer .course-cta { order:2; align-self:flex-start; }
@media(min-width:1750px) {
 .favorites-page .collection-panel[data-active-collection="words"] .small-grid,
 .favorites-page .collection-panel[data-active-collection="phrases"] .small-grid { grid-template-columns:repeat(6,minmax(0,1fr)); }
}
@media(max-width:599px) {
 .favorites-page .collection-panel[data-active-collection="words"] .small-grid,
 .favorites-page .collection-panel[data-active-collection="phrases"] .small-grid { grid-template-columns:minmax(0,1fr); }
 .favorites-page .saved-vocabulary-card [data-saved-word-say] { min-width:36px; min-height:36px; }
 .favorites-page .saved-vocabulary-card .saved-state { min-height:36px; padding:6px 9px; }
 .favorites-page .saved-vocabulary-card[data-expanded="false"] { grid-template-rows:46px 153px 16px 36px; }
 .favorites-page [data-expanded="false"] .saved-vocabulary-content { grid-template-rows:20px 39px 86px; }
 .favorites-page .saved-example-heading { height:36px; }
 .favorites-page .saved-vocabulary-expand { min-height:36px; }
}

/* Three-review workbench layout. Scoped to this lesson surface, not library/AI dialogs. */
.lesson-shell .desktop-tool-strip { justify-content: center !important; }
.lesson-shell .desktop-tool-strip > a { display: inline-flex; align-items: center; gap: 4px; padding: 6px; min-height: 40px; color: var(--text); text-decoration: none; }
.lesson-shell .desktop-tool-strip > a svg { width: 16px; height: 16px; }
.lesson-shell .learning-workbench { padding-top: 6px; }
.lesson-shell .workbench-tabs { gap: 2px; flex: none; overflow-x: auto; scrollbar-width: thin; }
.lesson-shell .workbench-tabs > button { min-height: 44px; border-radius: 5px; }
.lesson-shell .workbench-tabs > button[aria-selected=true] { background: transparent; box-shadow: inset 0 -2px var(--primary); }
.learning-tool-popover { position: fixed !important; inset: auto; margin: 0 !important; box-sizing: border-box; z-index: 1200; width: max-content; min-width: min(210px,calc(100vw - 16px)); padding: 10px; overflow: auto; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface-elevated); color: var(--text); box-shadow: 0 5px 18px #0002; }
.learning-tool-popover :is(button, input, select) { color: var(--text); background: var(--surface-elevated); border: 1px solid var(--border-soft); border-radius: 18px; }
.learning-tool-popover button { min-height: 36px; padding: 6px 10px; font-family:inherit; font-size:13px; font-weight:500; line-height:1.3; }
.learning-tool-popover :is(button, input, select):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.learning-tool-popover :is([aria-pressed=true], .is-active) { color: var(--primary-strong); background: var(--primary-soft); }
.learning-tool-popover .playback-rate-options { display: grid; grid-template-columns: repeat(4,minmax(44px,1fr)); gap: 4px; }
.learning-tool-popover.highlight-panel { width: 292px; display:grid; gap:8px; }
.learning-tool-popover .highlight-style-options { display: flex; gap: 4px; margin-block: 8px; }
.learning-tool-popover.export-panel { display: grid; gap: 4px; }
/* Preserve display text and word indices; only the existing dynamic class is styled. */
/* Atomic foreground/background changes avoid low-contrast intermediate colors. */
.lesson-shell .timed-word { transition: none; }
.lesson-shell :is(.subtitle-lines,.current-lines) .timed-word.passed-word { background: transparent !important; color: inherit !important; box-shadow: none !important; text-shadow: none !important; }
body[data-highlight-enabled=true] .lesson-shell .timed-word.current-word { color: var(--word-highlight-text) !important; background: var(--word-highlight-bg) !important; box-shadow: none !important; text-shadow: none !important; border-radius: 2px; }
body[data-highlight-enabled=true][data-highlight-style=underline] .lesson-shell .timed-word.current-word { color: inherit !important; background: transparent !important; text-decoration: underline var(--word-underline-color,var(--word-highlight-bg)) 3px !important; text-underline-offset: .18em; }
body[data-highlight-enabled=true][data-highlight-style=combined] .lesson-shell .timed-word.current-word { text-decoration: underline var(--word-underline-color,var(--word-highlight-bg)) 3px !important; text-underline-offset: .18em; }
body[data-highlight-enabled=false] .lesson-shell .timed-word { text-decoration: none !important; }
/* Reserve the video ratio before its poster or metadata arrives, so startup cannot collapse the grid. */
/* Grid rows correspond to actual visible controls; no phantom progress/metadata rows. */
@media (min-width: 1025px) and (orientation: landscape) {
  .lesson-shell .learning-layout { grid-template-columns: minmax(0,1.85fr) minmax(360px,1fr) !important; grid-template-rows: auto minmax(0,auto) auto auto auto auto !important; height: auto; align-content: start; }
  .lesson-shell .player-column > .lesson-overview { grid-row: 1 !important; grid-column: 1 / -1 !important; }
  .lesson-shell #lessonVideo { grid-row: 2 !important; height: auto !important; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
  .lesson-shell .player-column > .desktop-playback-controls { grid-row: 3 !important; }
  .lesson-shell .player-column > .resume-learning-prompt { grid-row: 4 !important; }
  .lesson-shell .player-column > .desktop-tool-strip { grid-row: 5 !important; }
  .lesson-shell .player-column > .lesson-intro { grid-row: 6 !important; }
  .lesson-shell .learning-workbench { grid-row: 2 / 7 !important; max-height: calc(100dvh - 132px) !important; }
}
@media (orientation: portrait), (max-width: 1024px) {
  body:has(> #app > .lesson-shell) { display: block; height: auto; }
  #app > .lesson-shell { height: auto; padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .lesson-shell .learning-layout { display: flex !important; flex-direction: column; height: auto; gap: 10px !important; }
  .lesson-shell .player-column { display: flex; flex-direction: column; min-width: 0; }
  .lesson-shell #lessonVideo { height: auto !important; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; flex: none; }
  .lesson-shell .desktop-playback-controls, .lesson-shell .desktop-tool-strip { display: none !important; }
  .lesson-shell .lesson-intro { display: none; }
  .lesson-shell .learning-workbench { contain: none; width: 100%; box-sizing: border-box; max-height: min(75dvh,900px) !important; min-height: 0; overflow: hidden; }
  .lesson-shell .subtitle-list { max-height: none !important; flex: 1 1 auto !important; }
  .lesson-shell .workbench-pane { padding-bottom: 16px; scroll-padding-bottom: 40px; }
  .mobile-bottom-tools { display: block !important; position: fixed; bottom: var(--learning-keyboard-inset,0px); left: 12px; right: 12px; width: auto; padding-bottom: env(safe-area-inset-bottom); z-index: 100; }
  .mobile-bottom-tools .mobile-learning-tools { display: flex; overflow-x: auto; gap: 2px; scrollbar-width: thin; }
  .mobile-bottom-tools .mobile-learning-tools > * { flex: 1 0 44px; min-width: 44px; min-height: 50px; }
  .mobile-bottom-tools .mobile-learning-tools[hidden] { display: none; }
  .lesson-shell .mobile-learn-topbar { display: grid !important; grid-template-columns: 32px minmax(0,1fr) 32px 32px max-content; }
  .lesson-shell .lesson-overview { display: block !important; }
  .lesson-shell .lesson-overview :is(.back,img,.title-line) { display: none !important; }
  .lesson-shell .lesson-title.compact { display: block; border: 0; padding: 2px 0; margin: 0; background: transparent; }
  .lesson-shell .lesson-title .meta-line { font-size: 12px; margin: 0 0 5px; }
}
@media (orientation: portrait), (max-width: 1024px) {
  .lesson-shell .player-column { max-width: none !important; width: 100%; }
  .lesson-shell .learning-workbench > .workbench-pane { flex: 0 1 auto; }
  .lesson-shell .learning-workbench .subtitle-list { flex: 0 1 auto !important; }
}
/* The legacy compact toolbar skin stops at 720px. Portrait tablets use the
   same toolbar, so provide its component dimensions without touching phone rules. */
@media (min-width:721px) and (orientation:portrait), (min-width:721px) and (max-width:1024px) {
 #app > .lesson-shell + .mobile-bottom-tools { box-sizing:border-box; max-width:960px; margin-inline:auto; min-height:64px; padding:6px 10px; border:1px solid var(--border-soft); border-radius:16px; background:var(--surface-elevated); box-shadow:0 4px 14px var(--shadow-soft); }
 #app > .lesson-shell + .mobile-bottom-tools :is(.mobile-learning-tools,.mobile-playback-tools) { display:flex; align-items:center; justify-content:space-between; gap:4px; width:100%; overflow-x:auto; }
 #app > .lesson-shell + .mobile-bottom-tools :is(.mobile-learning-tools,.mobile-playback-tools)[hidden] { display:none; }
 #app > .lesson-shell + .mobile-bottom-tools :is(button,a,summary) { box-sizing:border-box; min-width:44px; min-height:50px; padding:4px 6px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; border:0; border-radius:8px; background:transparent; color:var(--text-main); font-weight:500; font-family:inherit; font-size:12px; line-height:1.2; box-shadow:none; }
 #app > .lesson-shell + .mobile-bottom-tools :is(button,a,summary):focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }
 #app > .lesson-shell + .mobile-bottom-tools :is(button,a,summary):hover,
 #app > .lesson-shell + .mobile-bottom-tools :is(button,a,summary):active,
 #app > .lesson-shell + .mobile-bottom-tools .is-active { background:var(--primary-soft); color:var(--primary-strong); }
 #app > .lesson-shell + .mobile-bottom-tools svg { display:block; width:19px; height:19px; flex:none; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-playback-tools > * { flex:1 0 44px; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-primary-play-circle { width:46px; height:46px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; border-radius:50%; background:var(--primary-strong); color:var(--button-primary-text); }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-primary-play-circle svg { width:17px; height:17px; }
 #app > .lesson-shell + .mobile-bottom-tools :is(.mobile-primary-play-circle,.playback-control-btn.is-primary) svg { color:var(--button-primary-text) !important; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-primary-play-label { font-size:11px; }
 #app > .lesson-shell + .mobile-bottom-tools .playback-control-btn.is-primary { flex:0 0 46px; width:46px; min-width:46px; min-height:46px; border-radius:50%; background:var(--primary-strong); color:var(--button-primary-text); }
 #app > .lesson-shell + .mobile-bottom-tools .playback-control-hint { font-size:11px; }
}
/* Scoped content tools, account notes and word cards. */
.learning-tool-popover.workbench-search-tool { width: 352px; display:flex; flex-direction:column; gap:6px; }
.workbench-search-tool .tool-heading { display:flex; justify-content:space-between; align-items:center; flex:none; gap:8px; }
.workbench-search-tool form { display:flex; gap:6px; flex:none; }
.workbench-search-tool input { min-width:0; flex:1; box-sizing:border-box; height:34px; padding:5px 8px; font-size:16px; border-radius:5px; box-shadow:none; }
.workbench-search-tool .tool-results { min-height:0; max-height:300px; overflow:auto; overscroll-behavior:contain; font-size:14px; line-height:1.5; }
.workbench-search-tool > [role=status] { font-size:12px; margin:0; color:var(--text-muted); flex:none; }
.workbench-search-tool .course-search-result { display:block; width:100%; text-align:left; border:0; border-bottom:1px solid var(--border-soft); background:transparent; }
.workbench-search-tool :is(h3,p,blockquote) { margin:8px 0; overflow-wrap:anywhere; }
.subtitle-selection-tools { position:fixed; z-index:1201; padding:3px; border:1px solid var(--border-soft); border-radius:8px; background:var(--surface-elevated); box-shadow:0 3px 10px #0002; }
.subtitle-selection-tools[hidden] { display:none; }
.subtitle-selection-tools button { min-height:36px; padding:4px 8px; background:transparent; color:var(--text-main); border:0; }
.lesson-shell .subtitle-lines { user-select:text; -webkit-user-select:text; }
.lesson-shell :is(.word-hit,.core-mark) { text-decoration:none !important; background:transparent !important; box-shadow:none !important; color:inherit !important; }
body[data-core-mark=true] .lesson-shell .core-mark:not(.current-word) { background:color-mix(in srgb,var(--primary) 18%,transparent) !important; box-shadow:inset 0 -1px var(--primary) !important; border-radius:2px; }
body[data-core-mark=false] .lesson-shell :is(.core-term-row,.word-row) { display:none !important; }
body[data-core-mark=true] .lesson-shell .core-term-row { display:flex !important; }
body[data-highlight-enabled=true] .lesson-shell .timed-word.current-word { color:var(--word-highlight-text) !important; background:var(--word-highlight-bg) !important; }
body[data-highlight-enabled=true][data-highlight-style=underline] .lesson-shell .timed-word.current-word { color:inherit !important; background:transparent !important; }
.lesson-shell .workbench-vocabulary { container-type:inline-size; }
.lesson-shell .vocabulary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.lesson-shell .vocabulary-card { min-width:0; border:1px solid var(--border-soft); border-radius:10px; padding:8px; color:var(--text-main); background:var(--surface-elevated); }
.lesson-shell .vocabulary-card :is(h3,p,blockquote) { margin:6px 0; overflow-wrap:anywhere; }
.lesson-shell .vocabulary-card h3 { display:flex; align-items:center; justify-content:flex-start; gap:4px; flex-wrap:wrap; font-size:16px; }
.lesson-shell .vocabulary-card :is(p,summary) { font-size:14px; line-height:1.6; }
.lesson-shell .vocabulary-card button { min-height:36px; padding:5px 9px; border:1px solid var(--border-soft); border-radius:8px; color:var(--primary-strong); background:var(--surface-soft); }
.lesson-shell .vocabulary-card blockquote { border-left:2px solid var(--border-soft); padding-left:8px; }
@container (max-width:650px) { .lesson-shell .vocabulary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@container (max-width:240px) { .lesson-shell .vocabulary-grid { grid-template-columns:1fr; } }
.lesson-shell .workbench-reading-controls :is(button,select) { min-height:40px; color:var(--text-main); background:var(--surface-elevated); border:1px solid var(--border-soft); border-radius:7px; padding:6px; }
.lesson-shell .workbench-reading h2 { font-size:20px; line-height:1.5; margin:12px 0; }
.lesson-shell .workbench-reading :is(p,h3) { margin:10px 0; line-height:1.6; }
.lesson-shell .dictation-question-item h2 { font-size:16px; font-weight:500; }
.lesson-shell .learning-notes { color:var(--text-main); }
.learning-notes :is(.notes-scope,.notes-toolbar,.notes-status) { display:flex; gap:4px; align-items:center; flex-wrap:wrap; margin-block:6px; }
.learning-notes :is(button,select,summary,.notes-file) { min-height:36px; padding:6px 8px; border:1px solid var(--border-soft); border-radius:6px; background:var(--surface-elevated); color:var(--text-main); font:inherit; cursor:pointer; }
.learning-notes .notes-toolbar label { display:flex; align-items:center; gap:2px; font-size:13px; }
.learning-notes input[type=color] { width:24px; padding:0; border:0; background:none; }
.learning-notes .notes-file input { display:none; }
.learning-notes .notes-status { font-size:13px; justify-content:space-between; }
.learning-notes [data-note-editor] { border:1px solid var(--border-soft); border-radius:10px; background:var(--surface-elevated); }
.learning-notes .tiptap { min-height:250px; padding:14px; line-height:1.7; font-size:16px; overflow-wrap:anywhere; scroll-margin-bottom:110px; }
.learning-notes .tiptap :is(p,h1,h2,h3) { color:inherit; margin:6px 0; }
.learning-notes .tiptap h1 {font-size:28px}.learning-notes .tiptap h2 {font-size:24px}.learning-notes .tiptap h3 {font-size:20px}
.learning-notes .tiptap img { max-width:100%; height:auto; }
.learning-notes .tiptap blockquote { margin:12px 0; padding:6px 10px; border-left:3px solid var(--primary); background:var(--surface-soft); }
.learning-notes .tiptap:focus {outline:2px solid var(--primary);outline-offset:2px}
.lesson-shell .workbench-compact-tools { display:none; }
@media (orientation:portrait),(max-width:1024px) {
 .lesson-shell .learning-workbench { display:grid !important; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
 .lesson-shell .workbench-compact-tools { display:flex; justify-content:flex-end; gap:6px; }
 .lesson-shell .workbench-compact-tools summary { min-height:36px; padding:5px 8px; border:0; font-size:13px; color:var(--text-main); }
 .mobile-bottom-tools a { display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--text-main); text-decoration:none; font-size:12px; }
 .mobile-bottom-tools a svg { width:16px; height:16px; }
 .lesson-shell .learning-workbench .workbench-pane:not([hidden]) { min-height:0; max-height:65dvh; overflow-y:auto !important; }
 .lesson-shell .learning-workbench .workbench-subtitles:not([hidden]) { display:flex; flex-direction:column; overflow:hidden !important; }
 .lesson-shell .workbench-subtitles .subtitle-list { overflow-y:auto !important; max-height:65dvh !important; min-height:0; }
 .lesson-shell .learning-workbench .workbench-practice-pane:not([hidden]) { min-height:0; overflow-y:auto; }
 .learning-notes .notes-toolbar { flex-wrap:wrap; overflow:visible; padding-bottom:4px; }
 .learning-notes .notes-toolbar > * { flex:none; }
}

.lesson-shell .workbench-entry-row { display:flex; min-width:0; flex:none; gap:6px; }
.lesson-shell .workbench-entry-row .workbench-tabs { flex:1; }
@media (orientation:portrait),(max-width:1024px) {
 .lesson-shell .workbench-entry-row { overflow-x:auto; align-items:center; }
 .lesson-shell .workbench-entry-row .workbench-tabs { overflow:visible; flex:none; }
 .lesson-shell .workbench-entry-row .workbench-tabs button { min-width:44px; padding:5px; }
 .lesson-shell .workbench-compact-tools { flex:none; }
 .lesson-shell .workbench-compact-tools summary { white-space:nowrap; }
}

.lesson-shell .workbench-compact-tools summary { display:inline-flex; align-items:center; justify-content:center; gap:4px; height:44px; box-sizing:border-box; }
.lesson-shell .workbench-compact-tools summary svg { width:14px; height:14px; flex:none; }
.lesson-shell .workbench-compact-tools { align-items:center; }
.learning-notes [aria-pressed=true] {background:var(--primary-soft);color:var(--primary-strong)}
.learning-notes button:disabled {cursor:default;color:var(--text-muted);background:var(--surface-soft)}
/* Legacy rate panels used translateX(-50%); the shared positioner already centers them. */
.learning-tool-popover { transform:none !important; }
.lesson-shell .workbench-entry-row { scrollbar-width:thin; }
.lesson-shell .workbench-entry-row .workbench-tabs { padding-bottom:0; border-bottom:0; }
.lesson-shell .workbench-entry-row::-webkit-scrollbar {height:4px}
.mobile-bottom-tools .mobile-learning-tools::-webkit-scrollbar {height:4px}

/* Notes share the existing anchored tool layer; the editor toolbar may scroll. */
.notes-more-panel.learning-tool-popover { display:grid; gap:5px; min-width:200px; }
.notes-more-panel .notes-file { display:flex; align-items:center; }

/* Regression: component controls only; subtitle font sizes remain owned by the accepted layout. */
#app > .lesson-shell .lesson-overview { background:transparent !important; }
#app > .lesson-shell .lesson-overview > .back { font-size:15px; line-height:1.5; background:transparent !important; }
#app > .lesson-shell .lesson-title.compact { grid-template-columns:72px minmax(0,1fr); }
#app > .lesson-shell .lesson-title.compact > img { width:72px !important; height:auto !important; max-height:none !important; border:0; padding:0; object-fit:contain; }
#app > .lesson-shell .desktop-tool-strip :is(button,summary),
#app > .lesson-shell .segment-actions .ai-score-action {
 display:inline-flex; align-items:center; justify-content:center; gap:5px;
 min-height:36px !important; padding:5px 10px !important; border:1px solid var(--border-soft) !important;
 border-radius:999px !important; color:var(--text-main) !important; background:var(--surface-elevated) !important;
 font-family:inherit; font-size:13px !important; font-weight:500 !important; line-height:1.3; box-shadow:none !important;
}
#app > .lesson-shell .desktop-tool-strip { gap:6px !important; padding-block:5px !important; }
#app > .lesson-shell .desktop-tool-strip :is(button,summary):is(:hover,:active),
#app > .lesson-shell .desktop-tool-strip details[open]>summary { background:var(--primary-soft) !important; color:var(--primary-strong) !important; text-decoration:none; }
#app > .lesson-shell .segment-actions { gap:4px; flex-wrap:wrap; }
#app > .lesson-shell .segment-actions .segment-action-btn:not(.ai-score-action) { --icon-size:18px !important; min-width:40px !important; min-height:40px !important; width:40px !important; padding:8px; border-radius:50%; }
#app > .lesson-shell .segment-actions .segment-action-icon svg { width:18px; height:18px; }
#app > .lesson-shell .segment-actions .speech-score-action-icon svg { width:16px; height:16px; }
#app > .lesson-shell .segment-actions button:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
#app > .lesson-shell .desktop-playback-expand { width:auto !important; min-width:80px; border-radius:999px !important; padding:6px 12px !important; }
.learning-tool-popover.export-panel { min-width:180px; width:200px; }
.learning-tool-popover.export-panel button { display:flex; align-items:center; gap:8px; justify-content:flex-start; border:0; border-radius:8px; }
.learning-tool-popover svg { width:16px; height:16px; flex:none; }
.learning-tool-popover .highlight-style-options { margin:0; display:grid; grid-template-columns:1fr 1fr 1fr; }
.learning-tool-popover .highlight-style-options button { padding-inline:4px; }
.learning-tool-popover .highlight-colors { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; }
.highlight-colors button { display:flex; align-items:center; gap:5px; justify-content:center; }
.highlight-swatch { width:13px; height:13px; display:inline-block; border:1px solid #41544a88; border-radius:50%; flex:none; }
.swatch-yellow {background:#f7e59a}.swatch-green{background:#bfe5ca}.swatch-pink{background:#f4c9dc}.swatch-orange{background:#f7d19d}.swatch-purple{background:#d8cef5}.swatch-red{background:#f2beb9}
.learning-tool-popover [aria-pressed=true] { border-color:var(--primary); box-shadow:inset 0 -2px var(--primary); }
.learning-tool-popover .dictionary-sense { display:flex; gap:8px; align-items:baseline; }
.learning-tool-popover .dictionary-pos { font-weight:600; color:var(--primary-strong); min-width:28px; }
.learning-tool-popover .dictionary-example { margin:8px 0 0; padding:8px; border:1px solid var(--border-soft); border-radius:9px; background:var(--surface-soft); }
.learning-tool-popover .dictionary-source { font-size:12px; color:var(--text-muted); }

/* Hue comes from the selected palette below, never from a theme/text blend. */
@media (orientation:portrait),(max-width:1024px) {
 #app > .lesson-shell + .mobile-bottom-tools { box-sizing:border-box; width:calc(100% - 16px) !important; max-width:960px; left:50% !important; right:auto !important; transform:translateX(-50%) !important; margin-inline:0; padding:4px !important; bottom:0 !important; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-learning-tools { display:flex; gap:0; overflow-x:hidden; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-learning-tools > * { flex:1 1 0; min-width:0; min-height:48px; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-learning-tools :is(button,summary,a) { padding:3px 2px; font-size:12px; font-weight:500; line-height:1.25; color:var(--text-main); }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-learning-tools[hidden] { display:none; }
 #app > .lesson-shell + .mobile-bottom-tools .mobile-playback-tools { overflow-x:auto; }
 .lesson-shell .workbench-entry-row { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)) repeat(2,minmax(0,2fr)); gap:0; overflow:visible; align-items:center; }
 .lesson-shell .workbench-entry-row :is(.workbench-tabs,.workbench-compact-tools) { display:contents; }
 .lesson-shell .workbench-entry-row .workbench-tabs button { min-width:0; padding:4px 1px; font-size:clamp(11px,2.8vw,14px); white-space:nowrap; height:38px; min-height:38px; }
 .lesson-shell .workbench-compact-tools { justify-content:flex-start; }
 .lesson-shell .workbench-compact-tools summary { display:flex; width:100%; min-width:0; box-sizing:border-box; gap:2px; padding:4px 0; border:0; border-radius:0; font-size:clamp(11px,2.8vw,14px); min-height:38px; height:38px; background:transparent; box-shadow:none; }
 .lesson-shell .workbench-compact-tools summary svg {width:11px;height:11px;}
 .lesson-shell .workbench-pane { scroll-padding-bottom:80px; }
 .learning-tool-popover.workbench-search-tool { min-height:0; }
 .workbench-search-tool input { height:34px; }
 .workbench-search-tool .tool-heading button { min-height:32px; width:32px; padding:4px; }
 .workbench-search-tool > [role=status] { max-height:36px; overflow:auto; }
}

#app > .lesson-shell .desktop-playback-expand::after { content:none; }

/* Existing medium-width library header: the later three-column rule placed
   Reset in the expanding column. Keep the search field flexible instead. */
@media (min-width:860px) and (max-width:1199px) {
 .library-page.nav-frame .catalog-top-tools { grid-template-columns:minmax(0,1fr) auto; }
 .library-page.nav-frame #searchForm { grid-column:1; grid-row:2; }
 .library-page.nav-frame .catalog-reset-filter { grid-column:2; grid-row:2; justify-self:end; }
}

.learning-tool-popover .learning-tool-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.learning-tool-popover .learning-tool-heading button { min-height:28px; width:28px; padding:2px; flex:none; }
#app > .lesson-shell .desktop-tool-strip :is(.export-menu,.highlight-menu) summary>span[aria-hidden=true] { display:inline-flex; width:16px; height:16px; }
#app > .lesson-shell .desktop-tool-strip :is(.export-menu,.highlight-menu) summary svg { display:block; width:16px; height:16px; }
@media (orientation:portrait),(max-width:1024px) {
}

/* Review 2: editor controls occupy their own row, never cover the document. */
.lesson-shell .learning-notes:not([hidden]) { display:flex; flex-direction:column; min-height:100%; }
.learning-notes .notes-scope { gap:6px; margin:0 0 4px; }
.learning-notes .notes-scope [data-note-scope] { border:0; background:transparent; border-radius:0; padding:5px 2px; }
.learning-notes .notes-scope [data-note-scope][aria-pressed=true] { box-shadow:inset 0 -2px var(--primary); color:var(--primary-strong); }
.learning-notes .notes-save-state { margin-left:auto; font-size:12px; color:var(--text-muted); max-width:240px; }
.learning-notes .notes-sentence-tools { display:flex; gap:4px; }
.learning-notes .notes-sentence-tools[hidden] { display:none; }
.learning-notes .notes-sentence-tools select { min-width:0; flex:1; font-size:13px; }
.learning-notes .notes-toolbar { gap:1px; padding:3px 0; border-bottom:1px solid var(--border-soft); }
.learning-notes .notes-toolbar > :is(button,select),.learning-notes .notes-toolbar summary { border:0; background:transparent; padding:5px 7px; min-height:36px; font-size:13px; border-radius:5px; }
.learning-notes .notes-toolbar summary { list-style:none; display:flex; align-items:center; }
.learning-notes .notes-toolbar summary::-webkit-details-marker { display:none; }
.learning-notes .notes-toolbar :is(button,summary):hover { background:var(--primary-soft); }
.learning-notes .notes-status:empty { display:none; }
.learning-notes .notes-status { margin:0; }
.learning-notes [data-note-editor] { flex:1; min-height:260px; display:flex; flex-direction:column; }
.learning-notes .tiptap { flex:1; min-height:260px; box-sizing:border-box; }
.learning-notes.notes-menu-panel { width:210px; padding:8px; display:flex; gap:3px; flex-direction:column; }
.learning-notes.notes-menu-panel :is(button,label) { border:0; text-align:left; min-height:36px; padding:7px; display:flex; align-items:center; gap:10px; border-radius:4px; }
.learning-notes.notes-menu-panel button:hover { background:var(--primary-soft); }
@media(max-width:480px) { .learning-notes .notes-save-state { flex:1; min-width:0; max-width:none; margin:0; text-align:right; } .learning-notes .notes-scope [data-note-save] {margin-left:auto} .learning-notes .notes-toolbar > :is(button,select),.learning-notes .notes-toolbar summary { padding-inline:5px; } }

/* Review 2: compact controls retain 36px hit areas and unambiguous selected state. */
.learning-tool-popover.highlight-panel { width:280px; gap:6px; }
.learning-tool-popover .highlight-switches { display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.learning-tool-popover.highlight-panel button { border:0; border-radius:5px; min-height:36px; padding:5px; font-size:13px; white-space:nowrap; }
.learning-tool-popover.highlight-panel button[aria-pressed=true] { background:var(--primary-soft); box-shadow:inset 0 -2px var(--primary); }
.learning-tool-popover .playback-rate-options button { border:0; border-radius:5px; background:transparent; }
.learning-tool-popover .playback-rate-options button.active { background:var(--primary-soft); }
.lesson-shell .workbench-practice-tabs > button:not([aria-selected=true]):hover {background:transparent;box-shadow:inset 0 -1px var(--border-soft)}
.lesson-shell .dictation-card h2 {font-size:15px;line-height:1.5;font-weight:500;margin:8px 0}
.lesson-shell .practice-advance { display:flex;gap:5px;align-items:center;font-size:13px;margin-top:10px; }
.lesson-shell .practice-advance button,.lesson-shell .workbench-practice .toolbar button {min-height:36px;padding:5px 10px;border:1px solid var(--border-soft);border-radius:999px;background:var(--surface-elevated);color:var(--text-main);font-size:13px}
.lesson-shell .practice-advance button[aria-pressed=true],.lesson-shell #practiceLoop[aria-pressed=true] {background:var(--primary-soft);color:var(--primary-strong);border-color:var(--primary)}
.lesson-shell .workbench-practice button:disabled {opacity:.6;cursor:default}
body[data-highlight=yellow] .lesson-shell {--word-underline-color:#9b7310}
body[data-highlight=green] .lesson-shell {--word-underline-color:#23764a}
body[data-highlight=pink] .lesson-shell {--word-underline-color:#b93675}
body[data-highlight=orange] .lesson-shell {--word-underline-color:#b85e13}
body[data-highlight=purple] .lesson-shell {--word-underline-color:#8256b4}
body[data-highlight=red] .lesson-shell {--word-underline-color:#b83f3c}
body:is([data-theme=eye],[data-theme=night])[data-highlight-style=underline] .lesson-shell {--word-underline-color:var(--word-highlight-bg)}

/* Review 3: bounded content scroll; one scroll owner per practice pane. */
.lesson-shell .workbench-practice:not([hidden]) { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.lesson-shell .workbench-practice-tabs { flex:none; }
.lesson-shell .workbench-practice-pane:not([hidden]) { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-bottom:16px; scroll-padding-bottom:20px; }
.lesson-shell .workbench-practice-pane > :is(.fill-question-pane,.dictation-question-pane) {height:auto;max-height:none;overflow:visible;}
.lesson-shell [data-workbench-exercise=shadowing] h2 {font-size:20px;line-height:1.45;margin:6px 0;}
.lesson-shell .practice-advance {margin-top:5px; flex-wrap:wrap;}
.lesson-shell .workbench-practice .practice-card {padding:10px;}
.lesson-shell .dictation-card .toolbar {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;}
.lesson-shell .dictation-card .toolbar button {min-width:0;min-height:36px;padding:4px 1px;border-radius:5px;font-size:12px;white-space:nowrap;}
.lesson-shell .dictation-feedback {font-size:14px;line-height:1.55;margin-top:6px;overflow-wrap:anywhere;}
.lesson-shell .dictation-feedback:empty {display:none;}
.lesson-shell .dictation-issue {border-left:2px solid var(--primary);padding-left:6px;margin-top:3px;}
.lesson-shell .dictation-save-row {display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px;font-size:12px;color:var(--text-muted);margin-top:5px;}
.lesson-shell .dictation-save-row button[hidden] {display:none;}
.learning-tool-popover.workbench-search-tool form {align-items:center;gap:4px;}
.learning-tool-popover.workbench-search-tool form>button {border:0;background:transparent;border-radius:4px;min-width:40px;min-height:36px;padding:4px;box-shadow:none;}
.learning-tool-popover.workbench-search-tool input:focus {outline:1px solid var(--primary);outline-offset:0;box-shadow:none;border-color:var(--primary);}
.learning-tool-popover.workbench-search-tool .course-search-result {border-radius:0;padding:7px 3px;box-shadow:none;}
.learning-tool-popover.workbench-search-tool .dictionary-example {background:transparent;border:0;border-top:1px solid var(--border-soft);padding:6px 0;}
.lesson-shell .vocabulary-card :is([data-word-say],[data-word-favorite]) {display:inline-flex;align-items:center;min-width:28px;min-height:32px;padding:3px;border:0;background:transparent;box-shadow:none;font-size:12px;}
.lesson-shell .vocabulary-example p {font-size:14px;line-height:1.5;}
.lesson-shell .vocabulary-card small {font-size:11px;}
.lesson-shell .vocabulary-example>p:first-of-type {display:inline;}
.learning-notes .notes-scope [data-note-save] {padding:3px 6px;min-height:30px;font-size:12px;}
.learning-notes .notes-scope {margin:0;flex-wrap:nowrap;}
.learning-notes .notes-scope [data-note-scope] {font-size:13px;white-space:nowrap;}
@media (orientation:portrait),(max-width:1024px) {
 .lesson-shell .learning-workbench {height:min(75dvh,900px) !important;max-height:none !important;}
 .lesson-shell .learning-workbench .workbench-pane:not([hidden]) {max-height:none;}
 .lesson-shell .learning-workbench .workbench-subtitles .subtitle-list {max-height:none !important;flex:1 1 auto !important;}
 .lesson-shell .learning-workbench .workbench-practice:not([hidden]) {overflow:hidden !important;}
 /* Let a gesture at the practice boundary reveal content below the fixed dock. */
 .lesson-shell :is(.workbench-practice:not([hidden]),.workbench-practice-pane:not([hidden])) {overscroll-behavior-y:auto;}
 .lesson-shell .lesson-overview {display:none !important;}
 .lesson-shell .mobile-learn-topbar {gap:4px;align-items:start;}
 .lesson-shell .mobile-title-stack {min-width:0;padding-top:5px;}
 .lesson-shell .mobile-title-stack strong {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
 .lesson-shell .mobile-title-stack strong:focus {white-space:normal;}
 .lesson-shell .mobile-title-stack .meta-line {font-size:11px;line-height:1.4;margin:3px 0 0;white-space:normal;}
 .lesson-shell .mobile-learn-topbar :is(a[aria-label=首页],button[data-course-favorite]) {box-sizing:border-box;width:32px;min-width:32px;height:32px;min-height:32px;padding:4px;border-radius:50%;display:flex;align-items:center;justify-content:center;}
 .lesson-shell .mobile-learn-topbar button[data-course-favorite] svg {width:16px;height:16px;}
 .lesson-shell .subtitle-item {padding:8px;}
 .lesson-shell .subtitle-item .line-zh {margin-block:5px;}
 .lesson-shell .subtitle-item :is(.core-term-row,.word-row) {margin-block:4px;}
 .lesson-shell .subtitle-item .segment-actions {margin-top:4px;}
 .lesson-shell .subtitle-lines .timed-word {display:inline;white-space:normal;}
 .lesson-shell .subtitle-lines .word-hit {display:inline;white-space:normal;}
 #app > .lesson-shell + .mobile-bottom-tools .playback-rate-summary {display:flex;flex-direction:column;justify-content:center;gap:3px;background:transparent;box-shadow:none;border:0;}
 #app > .lesson-shell + .mobile-bottom-tools .playback-rate-summary:after {content:none;}
 #app > .lesson-shell + .mobile-bottom-tools #mobileRateBadge {font-size:15px;font-weight:500;line-height:18px;}
 #app > .lesson-shell + .mobile-bottom-tools .rate-caption {font-size:12px;line-height:15px;}
}

/* Account save feedback for fill and shadowing; no player ownership. */
.extra-practice-save {display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:6px;font-size:12px;color:var(--text-muted);}
.extra-practice-save [data-extra-save] {margin-left:auto;}
.extra-practice-save button,.practice-self-review button {min-height:32px;padding:3px 7px;background:transparent;border:1px solid var(--border-soft);border-radius:5px;}
.extra-practice-save button[hidden] {display:none;}
.practice-self-review {display:flex;gap:6px;margin-top:5px;}

.learning-search-input {display:block;position:relative;flex:1;min-width:0;}
.learning-tool-popover .learning-search-input input {width:100%;box-sizing:border-box;padding-right:27px;}
.learning-tool-popover .learning-search-input [data-clear-search] {position:absolute;right:1px;top:1px;min-width:27px;min-height:32px;height:32px;padding:0;border:0;border-radius:3px;background:transparent;}
.learning-search-input [data-clear-search][hidden] {display:none;}
.example-credit {font-size:11px;border:0;padding:0;color:var(--text-muted);}
.example-credit summary {cursor:pointer;}
.example-credit a {color:var(--primary-strong);}
[data-learning-account-status] {display:block;font-size:11px;color:var(--text-muted);}

/* Keep the independent-example label separate from the first English word. */
.lesson-shell .vocabulary-example > strong {display:block;font-size:12px;line-height:1.4;font-weight:500;color:var(--text-muted);margin:0 0 2px;}

/* Review 4: light anchored surfaces. These variables never reach subtitle nodes. */
.learning-tool-popover {
 --tool-surface:color-mix(in srgb,var(--surface-elevated) 92%,var(--text-main) 8%);
 --tool-border:color-mix(in srgb,var(--border-soft) 65%,var(--text-main) 35%);
 background:var(--tool-surface);border-color:var(--tool-border);border-radius:8px;
 box-shadow:0 3px 12px #0002;color:var(--text-main);overscroll-behavior:contain;
}
.learning-tool-popover :is(.learning-tool-heading,.tool-heading) {position:sticky;top:-10px;z-index:2;background:var(--tool-surface);min-height:30px;}
.learning-tool-popover [data-close-tool] {width:30px;min-width:30px;height:30px;min-height:30px;border:0;border-radius:4px;background:transparent;padding:3px;}
.learning-tool-popover :is(button,summary):hover {background:var(--primary-soft);}
.learning-tool-popover :is(button,input,select,summary):focus-visible {outline:2px solid var(--primary-strong);outline-offset:1px;}
.learning-tool-popover .theme-mode-option {border-radius:5px;border:1px solid var(--tool-border);background:var(--surface-elevated);}
.learning-tool-popover .theme-mode-option.is-active {border-color:var(--primary-strong);box-shadow:inset 0 -2px var(--primary);font-weight:650;}
.learning-tool-popover button:disabled {opacity:.5;cursor:not-allowed;}
@media (orientation:portrait),(max-width:1024px) {
 .lesson-shell .learning-layout {gap:6px !important;}
 .lesson-shell .learning-workbench {padding-top:4px;}
 .lesson-shell .workbench-entry-row .workbench-tabs button,
 .lesson-shell .workbench-compact-tools summary {font-size:clamp(12px,calc(2.8vw + 1px),15px);min-height:36px;height:36px;padding-block:3px;}
}

.learning-tool-popover .highlight-help,.learning-tool-popover .highlight-example {margin:0;font-size:12px;line-height:1.5;}
.learning-tool-popover .highlight-style-options {grid-template-columns:1fr 1.2fr 1.8fr;}
.learning-tool-popover [data-highlight-example] {color:var(--example-ink);background:var(--example-bg);padding:0 2px;border-radius:2px;}
.learning-tool-popover [data-highlight-example][data-style=underline] {color:var(--text-main);background:transparent;}
.learning-tool-popover [data-highlight-example]:is([data-style=underline],[data-style=combined]) {text-decoration:underline var(--example-line) 3px;text-underline-offset:.18em;}
/* Existing theme skins mark menu surfaces important; override only portaled tools. */
body > .learning-tool-popover {background:var(--tool-surface) !important;border-color:var(--tool-border) !important;box-shadow:0 3px 12px #0002 !important;}
.learning-tool-popover .theme-mode-option {background:var(--surface-elevated) !important;border-color:var(--tool-border) !important;}
.learning-tool-popover .theme-mode-option.is-active {border-color:var(--primary-strong) !important;box-shadow:inset 0 -2px var(--primary) !important;}

/* Success creates no progress row. Pending/error feedback stays out of layout. */
.learning-progress-feedback {position:fixed;z-index:150;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);padding:5px 9px;border:1px solid var(--border-soft);border-radius:5px;background:var(--surface-elevated);color:var(--text-main);font-size:12px;}
.learning-progress-feedback button {border:0;background:transparent;color:var(--primary-strong);text-decoration:underline;min-height:32px;padding:3px 8px;}
.learning-tool-popover .dictionary-credit {font-size:12px;color:var(--text-muted);border-top:1px solid var(--border-soft);padding-top:5px;}
.learning-tool-popover .dictionary-credit small {display:block;}
.learning-tool-popover .dictionary-credit a {color:var(--primary-strong);}
.learning-tool-popover.workbench-search-tool input {height:34px;min-height:34px;box-sizing:border-box;padding-block:4px;line-height:24px;font-size:16px;border:1px solid var(--tool-border);border-radius:4px;background:var(--surface-elevated);}
.learning-tool-popover.workbench-search-tool input:focus {outline:0;box-shadow:none;border-color:var(--primary-strong);}
.library-page.nav-frame #searchForm {position:relative;margin-block:6px;}
.library-page.nav-frame #searchForm input {box-sizing:border-box;height:36px;min-height:36px;line-height:24px;padding-block:5px;padding-right:34px;font-size:16px;border:1px solid var(--border-soft);border-radius:4px;transform:none;box-shadow:none;}
.library-page.nav-frame #searchForm input:is(:focus,:focus-visible) {outline:0 !important;box-shadow:none !important;border-width:1px;border-color:var(--primary-strong);transform:none;}
.library-page.nav-frame #searchForm [data-library-clear-query] {position:absolute;right:1px;top:1px;width:32px;min-width:32px;height:34px;min-height:34px;padding:0;border:0;border-radius:3px;background:transparent;color:var(--text-main);}
.library-page.nav-frame #searchForm [data-library-clear-query][hidden] {display:none;}

/* Reviewed teaching cards live in the existing scrollable pane. */
.lesson-shell .learning-intensive > h2 {font-size:17px;margin:4px 0 9px;}
.lesson-shell .intensive-card {border:1px solid var(--border-soft);border-radius:6px;margin:0 0 8px;background:var(--surface-elevated);}
.lesson-shell .intensive-card > summary {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:9px 10px;cursor:pointer;font-size:14px;line-height:1.45;}
.lesson-shell .intensive-card > summary strong {grid-column:1;font-size:16px;overflow-wrap:anywhere;}
.lesson-shell .intensive-card > summary span {grid-column:1;color:var(--text-muted);}
.lesson-shell .intensive-card > summary time {grid-column:2;grid-row:1 / 3;align-self:center;font-size:12px;color:var(--text-muted);}
.lesson-shell .intensive-card > summary::after {content:'＋';grid-column:2;text-align:right;font-size:12px;}
.lesson-shell .intensive-card[open] > summary::after {content:'−';}
.lesson-shell .intensive-body {padding:0 10px 10px;font-size:15px;line-height:1.65;overflow-wrap:anywhere;}
.lesson-shell .intensive-body p {margin:8px 0;}
.lesson-shell .intensive-source blockquote {margin:0 0 6px;padding:0 0 0 8px;border-left:2px solid var(--primary);}
.lesson-shell .intensive-source blockquote p {margin:4px 0;}
.lesson-shell .intensive-example {border-block:1px solid var(--border-soft);padding:6px 0;}
.lesson-shell .intensive-example h3 {font-size:13px;color:var(--text-muted);margin:0;}
.lesson-shell .intensive-body button {min-height:34px;padding:4px 8px;border:1px solid var(--border-soft);border-radius:4px;background:transparent;color:var(--text-main);font-size:13px;}
.lesson-shell .intensive-body button:hover {background:var(--primary-soft);}
.lesson-shell .intensive-card :is(button,summary):focus-visible {outline:2px solid var(--primary);outline-offset:1px;}
.lesson-shell .intensive-actions {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.lesson-shell .intensive-actions small,.lesson-shell .intensive-body [role=status] {font-size:12px;color:var(--text-muted);}
.lesson-shell .intensive-body [role=status]:empty {display:none;}
/* The library's existing compact rules are important; keep the override local. */
.library-page.nav-frame #searchForm {margin-block:6px !important;}
.library-page.nav-frame #searchForm input {height:36px !important;min-height:36px !important;font-size:16px !important;padding:5px 34px 5px 30px !important;border-radius:4px !important;}
.library-page.nav-frame #searchForm input:is(:focus,:focus-visible) {border-color:var(--primary-strong) !important;}
@media (orientation:portrait),(max-width:1024px) {
 .lesson-shell .learning-intensive {overscroll-behavior-y:auto;}
}

/* Compact navigation only; desktop retains the accepted five main tabs. */
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row {display:flex;align-items:center;gap:0;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;container-type:inline-size;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row :is(.workbench-tabs,.workbench-compact-tools) {display:contents;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-tabs > button,
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-compact-tools > details {flex:1 0 max-content;min-width:32px;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-tabs > button,
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-compact-tools summary {box-sizing:border-box;height:36px;min-height:36px;min-width:32px;width:auto;padding:3px 2px;font-size:clamp(12px,3.6cqw,14px);line-height:1.3;white-space:nowrap;letter-spacing:normal;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-tabs > button[hidden] {display:none;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-compact-tools summary {display:flex;align-items:center;justify-content:center;gap:2px;border:0;border-radius:4px;background:transparent;box-shadow:none;color:var(--text-main);}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-compact-tools summary svg {width:11px;height:11px;}
.lesson-shell [data-compact-navigation=true] .workbench-entry-row .entry-tool-long {display:none;}
.lesson-shell [data-compact-navigation=true] .workbench-entry-row .entry-tool-short {display:inline;}
.lesson-shell .learning-workbench[data-compact-navigation=true] .workbench-entry-row .workbench-tabs > button[aria-selected=true] {font-weight:650;background:var(--primary-soft);color:var(--primary-strong);box-shadow:inset 0 -2px var(--primary);}
#app > .lesson-shell + .mobile-bottom-tools #mobileIntensive[aria-pressed=true] {font-weight:650;background:var(--primary-soft);color:var(--primary-strong);box-shadow:inset 0 -2px var(--primary);border-radius:5px;}

.lesson-shell .workbench-entry-row .workbench-tabs > button[hidden],
.lesson-shell .workbench-practice-tabs[hidden] {display:none;}
.lesson-shell .learning-workbench[data-compact-navigation=false] .workbench-entry-row {gap:6px;overflow-x:auto;align-items:stretch;}
.lesson-shell .learning-workbench[data-compact-navigation=false] .workbench-entry-row .workbench-tabs {display:flex;flex:1;gap:2px;}
.lesson-shell .learning-workbench[data-compact-navigation=false] .workbench-tabs > button {height:44px;min-height:44px;padding:6px 8px;font-size:16px;line-height:1.4;flex:1 1 0;}
.lesson-shell .learning-workbench[data-compact-navigation=false] .workbench-tabs > button[aria-selected=true] {font-weight:500;background:transparent;box-shadow:inset 0 -2px var(--primary);}
.lesson-shell .learning-workbench[data-compact-navigation=false] .workbench-compact-tools {display:none;}
#app > .lesson-shell .desktop-tool-strip summary > .entry-tool-short {display:none;}
#app > .lesson-shell .desktop-tool-strip summary > .entry-tool-long {display:inline;width:auto;height:auto;color:inherit;font-weight:inherit;}

.learning-tool-popover:has([data-note-format]) {min-width:145px;width:170px;}
.learning-tool-popover [role=menu][aria-label="段落或标题"] {display:grid;gap:3px;}
.learning-tool-popover [data-note-format] {display:flex;justify-content:space-between;align-items:center;text-align:left;width:100%;min-height:36px;border:0;border-radius:4px;background:transparent;color:var(--text-main);}
.learning-tool-popover [data-note-format][aria-checked=true] {font-weight:650;background:var(--primary-soft);color:var(--primary-strong);box-shadow:inset 2px 0 var(--primary);}
.learning-tool-popover [data-note-format][aria-checked=true]::after {content:'✓';}
.learning-notes [data-notes-menu=format] > summary {white-space:nowrap;}


/* Review 4 timer: custom duration stays inside the anchored panel. */
body > .sleep-timer-panel.learning-tool-popover { width:260px; padding:8px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-panel-head { margin:0 0 6px; justify-content:flex-end; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-panel-head strong { display:none; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-options { gap:4px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-options button { min-height:32px; padding:3px 6px; border-radius:5px !important; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom { gap:6px; padding-top:6px; margin-top:6px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom-field { display:flex; justify-content:space-between; gap:8px; font-size:13px; color:var(--text-main); }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom-field input { width:104px; min-width:80px; max-width:50%; height:34px; padding:4px 6px; font-size:16px; line-height:1.3; border-radius:5px; text-align:left; background:var(--surface-elevated) !important; border:1px solid var(--line) !important; color:var(--text-main) !important; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom-field input:focus { border-color:var(--primary) !important; outline:1px solid var(--primary); outline-offset:1px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom-actions { display:flex; justify-content:flex-end; gap:8px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom-actions button { min-height:32px; min-width:48px; padding:4px 8px; border-radius:5px !important; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-validation { margin:0; font-size:12px; }
body > .sleep-timer-panel.learning-tool-popover .sleep-timer-custom small { font-size:11px; color:var(--text-muted); }

/* One learning viewport; long subtitles, vocabulary and exercises scroll inside. */
@media (orientation:portrait), (max-width:1024px) {
 body:has(> #app > .lesson-shell) {padding-bottom:0!important;}
 #app:has(> .lesson-shell) {height:100dvh;min-height:0!important;}
 #app > .lesson-shell {box-sizing:border-box;height:calc(100dvh - 76px - env(safe-area-inset-bottom))!important;min-height:0!important;padding:6px 0 0!important;width:calc(100% - 16px)!important;max-width:none!important;display:flex!important;flex-direction:column;gap:6px!important;}
 .lesson-shell .mobile-learn-topbar {flex:none;margin:0;padding-block:3px;min-height:32px;}
 .lesson-shell .learning-layout {flex:1;min-height:0!important;height:0!important;gap:6px!important;}
 .lesson-shell .player-column {flex:none;gap:4px;}
 .lesson-shell #lessonVideo {max-height:none!important;aspect-ratio:16/9;object-fit:contain;background:#000;}
 .lesson-shell .learning-workbench {display:flex!important;flex-direction:column;flex:1;min-height:0!important;max-height:none!important;height:0!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;}
 .lesson-shell .learning-workbench > .workbench-pane,.lesson-shell .learning-workbench .subtitle-list {flex:1 1 0!important;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;background:transparent!important;padding:0!important;}
 .lesson-shell .workbench-entry-row {flex:none;}
 .lesson-shell .learning-workbench .subtitle-list {padding-bottom:0!important;background:transparent!important;}
 .lesson-shell .workbench-practice-pane {min-height:0;}
 .lesson-shell .fill-card .toolbar {display:flex;flex-wrap:wrap;gap:6px;}
 .lesson-shell .fill-card .toolbar button {min-height:36px;font-size:13px;padding:5px 8px;}
}
.fill-card .inline-cloze-field {display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:3px;max-width:100%;vertical-align:baseline;}
.fill-card [data-blank-feedback] {display:block;font-size:12px;line-height:1.4;overflow-wrap:anywhere;}
.fill-card [data-blank-feedback][hidden] {display:none;}
.fill-card .inline-blank-input[data-answer-state=wrong] {border-color:#b94b4b;}
.fill-card .inline-blank-input[data-answer-state=correct] {border-color:#287b57;}
.fill-card [data-fill-feedback] {font-size:13px;line-height:1.5;margin-top:8px;}
.workbench-vocabulary [data-word-favorite] {touch-action:manipulation;min-height:36px;min-width:60px;}
.lesson-poster-placeholder {box-sizing:border-box;aspect-ratio:16/9;min-height:0;padding:0!important;overflow:hidden;background:var(--surface-soft);}
.lesson-poster-placeholder img {width:100%;height:100%;object-fit:contain;}
[data-first-lesson-loading-shell] .subtitle-panel {min-height:0;display:flex;flex-direction:column;padding:10px;}
[data-first-lesson-loading-shell] .workbench-tabs {display:flex;justify-content:space-around;min-height:36px;align-items:center;}
[data-first-lesson-loading-message]:empty {display:none;}
.lesson-pending-lines {display:grid;gap:18px;padding:18px 0;}
.lesson-pending-lines i {display:block;background:var(--border-soft);height:10px;border-radius:3px;opacity:.35;}
.lesson-pending-lines i:nth-child(2n) {width:70%;}
@media (orientation:portrait), (max-width:1024px) {
 [data-first-lesson-loading-shell] .lesson-poster-placeholder {max-height:30dvh;}
 [data-first-lesson-loading-shell] .subtitle-panel {flex:1;}
}

/* Course transitions keep the current screen until real lesson data is ready. */
.course-opening-status{position:fixed;z-index:1200;left:50%;bottom:calc(92px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);max-width:calc(100vw - 32px);padding:8px 14px;border-radius:10px;background:var(--panel,#fff);color:var(--text,#16354b);box-shadow:0 2px 14px #0002;font-size:13px;pointer-events:none}
[data-first-lesson-loading-shell] .learning-layout{display:block!important}
[data-first-lesson-loading-shell] .lesson-poster-placeholder{max-width:640px;min-height:0;margin-inline:auto}
[data-first-lesson-loading-shell] .lesson-intro{display:none}
.lesson-opening-feedback{padding:0 8px;min-height:0;background:transparent}

/* Direct note palettes stay open while a range is formatted. */
.learning-notes .notes-color-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; padding:4px; }
.learning-notes .notes-color-grid button { padding:4px; min-width:0; min-height:40px; border:2px solid transparent; justify-content:center; background:transparent; }
.learning-notes .notes-color-grid button span { display:block; width:22px; height:22px; border-radius:4px; background:var(--note-swatch); border:1px solid #0003; }
.learning-notes .notes-color-grid button[aria-pressed=true] { border-color:var(--text-primary,#25313a); box-shadow:0 0 0 1px white inset; }
.learning-notes .notes-color-grid button:focus-visible { outline:2px solid var(--primary,#205a47); outline-offset:2px; }
.learning-notes .notes-palette-hint { margin:4px 7px; font-size:12px; line-height:1.5; }

/* The note document scrolls independently; scope and format controls stay put. */
.lesson-shell .learning-workbench > .learning-notes:not([hidden]) {
 display:flex!important;flex-direction:column;min-height:0;overflow:hidden!important;
}
.learning-notes > :is(.notes-scope,.notes-sentence-tools,.notes-toolbar,.notes-status) {flex:none;}
.learning-notes > [data-note-editor] {flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding:12px;}
.learning-notes [data-note-editor] .tiptap {min-height:100%;box-sizing:border-box;scroll-margin:12px;}

@media (pointer:coarse) {
.learning-notes .notes-toolbar {flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;}
.core-term-chip {touch-action:manipulation;-webkit-user-select:none;user-select:none;}
@media (orientation:portrait), (max-width:1024px) {
 #app:has(> .lesson-shell) {position:fixed;inset-inline:0;top:var(--learning-visible-top,0px);height:var(--learning-visible-height,100dvh)!important;overflow:hidden;}
 #app > .lesson-shell {height:calc(var(--learning-visible-height,100dvh) - 76px - env(safe-area-inset-bottom))!important;}
 #app > .lesson-shell + .mobile-bottom-tools {position:absolute!important;top:auto!important;bottom:0!important;}
 .lesson-shell .learning-workbench > .learning-notes:not([hidden]) {max-height:none!important;}
 .lesson-shell:has([data-workbench-pane=notes]:not([hidden])) #lessonVideo {height:auto!important;max-height:min(26dvh,220px)!important;}
 .learning-notes .notes-toolbar {flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;margin-block:2px;}
 .learning-notes .notes-scope {flex-wrap:nowrap;margin-block:3px;}
 .learning-notes .notes-scope button {white-space:nowrap;padding-inline:5px;font-size:13px;}
 .learning-notes .notes-save-state {overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0;}
 .notes-keyboard .lesson-shell .player-column {display:none!important;}
 .notes-keyboard .lesson-shell .mobile-learn-topbar {min-height:30px;padding-block:0;}
 .notes-keyboard .learning-notes .tiptap {padding:8px;font-size:16px;}
}

.video-load-status {position:fixed!important;z-index:8;min-height:0!important;margin:0!important;padding:0!important;background:transparent!important;}
.video-load-status [data-video-load-retry] {width:38px;height:38px;min-width:38px;padding:0;border-radius:50%;font-size:24px;background:#ffffffdc;color:#205a47;}
#app > .lesson-shell + .mobile-bottom-tools .mobile-learning-tools {overflow-y:hidden!important;}
}

/* Keep the existing six rows and column proportions inside one available viewport.
   The video row absorbs height changes from continue-learning and other controls. */
@media (min-width:1025px) and (orientation:landscape) and (min-height:640px) {
 #app > .lesson-shell .learning-layout {
  height:100%!important;
  min-height:0!important;
  grid-template-rows:auto minmax(0,1fr) auto auto auto auto!important;
 }
 #app > .lesson-shell #lessonVideo {
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
 }
 #app > .lesson-shell .learning-workbench {
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
 }
}

.yd-video-controls{position:absolute;pointer-events:none;z-index:3;color:white;box-sizing:border-box}
.yd-video-controls[hidden],.yd-video-controls [hidden]{display:none!important}
.yd-video-controls .yd-control-strip{position:absolute;bottom:0;left:0;right:0;padding:8px 12px 5px;background:linear-gradient(transparent,rgba(0,0,0,.8));pointer-events:auto;border-radius:0 0 7px 7px}
.yd-video-controls .yd-control-row{display:flex;align-items:center;gap:4px;height:36px}
.yd-video-controls button,.yd-video-controls a{font-family:Arial,system-ui,sans-serif;box-sizing:border-box;cursor:pointer;box-shadow:none;transform:none;transition:none;margin:0;text-decoration:none;letter-spacing:normal}
.yd-video-controls .yd-control-row button{width:36px;height:36px;min-width:36px;min-height:36px;background:none;color:white;border:0;border-radius:3px;padding:8px;display:grid;place-items:center}
.yd-video-controls svg{width:20px;height:20px;fill:currentColor;flex:none}
.yd-video-controls button:focus-visible,.yd-video-controls a:focus-visible,.yd-video-controls input:focus-visible{outline:2px solid #82bdff;outline-offset:-2px}
.yd-video-controls .yd-video-time{font:13px/1.2 Arial,sans-serif;white-space:nowrap;font-variant-numeric:tabular-nums}
.yd-video-controls .yd-control-space{flex:1}
.yd-video-controls .yd-seek{display:block;width:100%;height:14px;padding:0;margin:0 0 1px;accent-color:white;cursor:pointer;min-height:0;border:0;background:transparent}
.yd-video-controls .yd-seek{-webkit-appearance:none;appearance:none}
.yd-video-controls .yd-seek::-webkit-slider-runnable-track{height:3px;background:#ffffff80;border:0;border-radius:2px}
.yd-video-controls .yd-seek::-webkit-slider-thumb{-webkit-appearance:none;width:8px;height:8px;margin-top:-2.5px;background:white;border:0;border-radius:50%}
.yd-video-controls .yd-seek::-moz-range-track{height:3px;background:#ffffff80;border:0;border-radius:2px}
.yd-video-controls .yd-seek::-moz-range-thumb{width:8px;height:8px;background:white;border:0;border-radius:50%}
.yd-video-controls .yd-video-menu,.yd-video-controls .yd-video-rates{box-sizing:border-box;position:absolute;right:12px;bottom:var(--yd-menu-bottom,62px);width:200px;max-width:calc(100% - 24px);max-height:var(--yd-menu-height);overflow:auto;overscroll-behavior:contain;background:white;color:#111;border:1px solid #ddd;border-radius:2px;box-shadow:0 2px 8px #0004;pointer-events:auto;padding:2px 0}
.yd-video-controls .yd-video-menu>a,.yd-video-controls .yd-video-menu>button,.yd-video-controls .yd-video-rates>button{width:100%;min-height:44px;display:flex;align-items:center;gap:18px;padding:10px 16px;border:0;border-radius:0;background:white;color:#171717;text-align:left;font-size:13px;line-height:20px;font-weight:400}
.yd-video-controls .yd-video-menu>a:hover,.yd-video-controls .yd-video-menu>button:hover,.yd-video-controls .yd-video-rates>button:hover,.yd-video-controls .yd-video-rates>[aria-checked=true]{background:#e3e3e3}
.yd-video-controls [aria-disabled=true]{opacity:.6;cursor:wait}
.yd-video-controls [data-current-rate]{margin-left:auto;font-size:12px;color:#5b5b5b}
#lessonVideo[data-android-inline-controls]::-webkit-media-controls{display:none!important}
#lessonVideo[data-android-inline-controls]::-webkit-media-controls-enclosure{display:none!important}
.yd-video-controls .yd-menu-status{font:12px/1.4 system-ui,sans-serif;margin:0;padding:0 12px;color:#7b2b20}
.yd-video-controls .yd-menu-status:empty{display:none}
.yd-video-controls .yd-video-rates>button{min-height:36px;padding:7px 18px}
@media(max-width:480px){.yd-video-controls .yd-video-menu,.yd-video-controls .yd-video-rates{width:190px}.yd-video-controls .yd-control-strip{padding-left:8px;padding-right:8px}.yd-video-controls .yd-control-row{gap:1px}.yd-video-controls .yd-video-time{font-size:12px}}
