/* Shared visual structure for the practice and vocabulary pages. */
:root { --bg:#f5f7fb; --card-bg:#fff; --text:#263449; --text-secondary:#6b778b; --primary:#263449; --accent:#3768d4; --accent-light:#edf3ff; --border:#e3e8f0; --radius:14px; }
html { -webkit-text-size-adjust:100%; }
body { font-family:Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif; }
button, input, select, textarea { font-family:inherit; }
button, a, select, [data-memory-word] { touch-action:manipulation; }
button { transition:background .15s, border-color .15s, color .15s; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.lucide { width:18px; height:18px; flex-shrink:0; display:inline-block; vertical-align:middle; }
.site-header { height:76px; flex-shrink:0; width:100%; display:flex; align-items:center; padding:0 32px; gap:32px; background:var(--card-bg); border-bottom:1px solid var(--border); z-index:50; }
.site-brand { display:flex; gap:11px; align-items:center; text-decoration:none; color:var(--text); min-width:190px; }
.brand-mark { display:flex; align-items:center; justify-content:center; width:38px; height:38px; background:var(--accent-light); color:var(--accent); border-radius:11px; }
.brand-mark .lucide { width:22px; height:22px; }
.site-brand strong { display:block; font-size:16px; letter-spacing:.02em; }
.site-brand small { display:block; color:var(--text-secondary); font-size:9px; letter-spacing:.12em; margin-top:2px; }
.site-nav { display:flex; align-items:center; gap:6px; }
.site-nav a { display:flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; border-radius:9px; color:var(--text-secondary); font-size:14px; font-weight:600; text-decoration:none; min-height:42px; }
.site-nav a:hover { background:var(--bg); }
.site-nav a[aria-current] { background:var(--accent-light); color:var(--accent); }
.header-tools { margin-left:auto; display:flex; align-items:center; gap:8px; }
.site-header .sidebar-toggle, .site-header .dark-toggle, .site-header .brush-toggle { position:static; display:flex; align-items:center; justify-content:center; gap:7px; width:auto; height:38px; min-height:38px; border:1px solid var(--border); border-radius:9px; background:transparent; color:var(--text-secondary); padding:0 12px; font-size:13px; box-shadow:none; }
.site-header .dark-toggle { width:38px; padding:0; }
.site-header .brush-toggle:hover { transform:none; background:var(--bg); }
.page-intro { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.eyebrow { font-size:10px; line-height:1.4; font-weight:650; letter-spacing:.16em; color:#8190a5; margin-bottom:6px; }
.page-intro h1 { font-size:27px; font-weight:700; line-height:1.4; color:var(--text); margin:0; background:none; -webkit-text-fill-color:currentColor; text-align:left; }
.intro-note, .chapter-count { font-size:13px; color:var(--text-secondary); }

/* Practice: one task area, one quiet rail for saved learning. */
.practice-page { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; padding:0; min-height:100dvh; }
.practice-page .site-header { position:sticky; top:0; }
.practice-page .container { max-width:1180px; width:calc(100% - 64px); margin:30px auto 20px; padding:0; display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:22px; overflow:visible; border-radius:0; background:none; backdrop-filter:none; box-shadow:none; }
.practice-workspace > .page-intro { grid-column:1 / -1; margin-bottom:2px; }
.practice-main { min-width:0; background:var(--card-bg); border:1px solid var(--border); border-radius:16px; padding:26px; display:flex; flex-direction:column; gap:18px; }
.practice-toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:18px; }
.chapter-control { display:flex; flex-direction:column; gap:7px; min-width:130px; }
.chapter-control > span { color:var(--text-secondary); font-size:12px; }
.practice-page .select-style { border-radius:8px; min-height:42px; padding:8px 12px; box-shadow:none; font-size:14px; background:var(--card-bg); width:150px; }
.practice-page .mode-group { gap:2px; background:var(--bg); padding:4px; border-radius:10px; box-shadow:none; width:auto; }
.practice-page .mode-btn { display:flex; align-items:center; justify-content:center; gap:6px; padding:9px 12px; font-size:13px; min-height:36px; border-radius:7px; }
.practice-page .mode-btn .lucide { width:15px; height:15px; }
.practice-page .mode-btn.active { background:var(--card-bg); color:var(--accent); box-shadow:0 1px 4px rgba(25,45,80,.09); }
.practice-progress { display:flex; flex-direction:column; gap:10px; padding-top:14px; border-top:1px solid var(--border); }
.practice-page .stats { justify-content:flex-start; gap:22px; padding:0; border-radius:0; background:none; box-shadow:none; font-size:12px; font-weight:400; }
.practice-page .stats strong { color:var(--text); font-weight:650; margin-left:5px; }
.practice-page .progress-bar { height:4px; background:var(--border); }
.practice-page .progress-fill { background:var(--accent); }
.question-area { display:flex; flex-direction:column; gap:14px; min-width:0; padding:20px 0 12px; }
.practice-page .mode-indicator { width:auto; align-self:center; display:flex; align-items:center; justify-content:center; gap:7px; padding:0; background:none; box-shadow:none; font-size:13px; color:var(--text-secondary); }
#modeIcon, .speech-status { display:inline-flex; align-items:center; }
#modeIcon .lucide { width:15px; height:15px; }
.practice-page .chinese-meaning { font-size:32px; font-weight:650; line-height:1.4; min-height:100px; padding:8px 12px; overflow-wrap:anywhere; }
.practice-page .chinese-meaning:empty::after { content:'听发音，写出单词'; font-size:26px; color:var(--text); }
.practice-page .letter-slots { gap:8px; margin:0 0 8px; }
.practice-page .slot { width:36px; height:48px; font-size:26px; border-bottom-width:2px; }
.practice-page .slot.word-separator { width:12px; }
.practice-page .native-answer-input { display:none; border-radius:9px; box-shadow:none; min-height:48px; font-size:16px; }
.practice-page .answer-format-hint { width:100%; margin:0; padding:0; background:none; color:var(--text-secondary); font-size:12px; line-height:1.5; }
.practice-page .result-area { font-size:14px; min-height:0; line-height:1.6; }
.practice-page .result-area:empty { display:none; }
.practice-page .example-box { margin-top:4px; border:1px solid var(--border); border-left:3px solid var(--accent); background:var(--bg); box-shadow:none; border-radius:8px; padding:14px 16px; font-size:14px; line-height:1.65; max-height:none; overflow-wrap:anywhere; }
.practice-bottom { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.practice-page .tool-group { width:auto; display:flex; gap:6px; padding:0; background:none; box-shadow:none; border-radius:0; }
.practice-page .tool-btn { display:flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--border); padding:7px 10px; border-radius:8px; min-height:34px; font-size:12px; }
.practice-page .tool-btn .lucide { width:15px; height:15px; }
.practice-page .tool-btn.active { background:var(--accent-light); color:var(--accent); border-color:#cbdcff; box-shadow:none; }
.practice-page .text-button { padding:4px 0; border:0; background:none; border-radius:0; color:var(--text-secondary); font-size:12px; min-height:30px; }
.practice-bottom #restartBtn { margin-left:auto; gap:5px; }
.practice-bottom #restartBtn .lucide { width:14px; height:14px; }
.practice-page .actions { position:static; display:grid; grid-template-columns:auto auto auto minmax(160px,1fr); gap:8px; padding:0; background:none; border:0; border-radius:0; box-shadow:none; width:100%; }
.practice-page .actions button { display:flex; justify-content:center; align-items:center; gap:7px; padding:10px 12px; min-height:44px; border-radius:9px; border:1px solid var(--border); background:var(--card-bg); color:var(--text-secondary); font-size:13px; white-space:nowrap; }
.practice-page .actions button:hover { background:var(--bg); }
.practice-page .actions button.primary { background:var(--accent); border-color:var(--accent); color:white; }
.practice-page .actions button.primary:hover { filter:brightness(.96); }
.practice-page .footer-note { display:block; font-size:11px; color:#8b98aa; margin-top:-7px; }
.practice-rail { display:flex; flex-direction:column; gap:14px; min-width:0; }
.practice-page .rail-panel, .practice-page .book-panel { min-width:0; width:100%; background:var(--card-bg); border:1px solid var(--border); border-radius:14px; padding:18px; box-shadow:none; }
.rail-panel h2 { font-size:14px; font-weight:650; margin-bottom:15px; }
.practice-page .goal-progress { background:none; box-shadow:none; display:grid; grid-template-columns:1fr auto auto; gap:10px; width:100%; padding:0; border-radius:0; align-items:center; font-size:12px; }
.practice-page .goal-progress strong { color:var(--accent); font-size:18px; font-weight:650; }
.practice-page #setGoalBtn { padding:0; width:30px; height:30px; min-height:30px; justify-content:center; border-radius:7px; border:0; background:var(--bg); }
.practice-page .goal-bar { grid-column:1 / -1; width:100%; height:5px; background:var(--border); }
.practice-page .goal-fill { background:var(--accent); }
.practice-page .book-header { width:100%; padding:0; min-height:26px; border:0; background:none; border-radius:0; color:var(--text); text-align:left; margin-bottom:12px; justify-content:space-between; }
.practice-page .book-header h3 { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:650; }
.book-header h3 span { padding:2px 7px; color:var(--text-secondary); background:var(--bg); font-size:11px; border-radius:5px; }
.book-chevron { font-size:18px; color:var(--text-secondary); }
.practice-page .book-list { gap:8px; font-size:12px; line-height:1.5; max-height:180px; }
.practice-page .word-chip { border-radius:7px; padding:7px 9px; font-size:12px; }
.practice-page .book-panel > .text-button { margin-top:10px; font-size:11px; }
.practice-page .review-button { justify-content:space-between; width:100%; font-size:13px; border-radius:10px; padding:12px 16px; min-height:44px; background:var(--accent-light); border-color:#d6e2fb; color:var(--accent); }
.site-credit { grid-column:1 / -1; font-size:11px; color:#8b98aa; text-align:center; padding:4px 0; }
.practice-page .sidebar { height:100dvh; border-left:1px solid var(--border); box-shadow:-12px 0 30px rgba(20,35,60,.08); }
.sidebar-header h3 { display:flex; align-items:center; gap:8px; }
.sidebar-header button { min-width:38px; min-height:38px; justify-content:center; }
.practice-page .sidebar-search { font-size:16px; border-radius:9px; }
.practice-page .sidebar-item { border-radius:9px; min-height:44px; }
.practice-page .sidebar-item .word-text { min-width:0; overflow-wrap:anywhere; }
.practice-page .modal-content { max-height:calc(100dvh - 40px); overflow:auto; }
.practice-page .modal-content p { margin:12px 0; }

/* Handout: consistent card anatomy and chapter navigation. */
.handout-page { flex-direction:column; height:100dvh; overflow:hidden; }
.handout-workspace { display:flex; flex:1; min-height:0; }
.handout-page .sidebar { width:212px; padding:26px 16px; gap:4px; background:var(--card-bg); border-right:1px solid var(--border); box-shadow:none; }
.handout-page .sidebar h2 { font-size:11px; color:#8793a5; font-weight:600; letter-spacing:.08em; margin-bottom:12px; padding-left:12px; }
.handout-page .sidebar button { padding:11px 12px; border-radius:8px; background:none; color:var(--text-secondary); font-size:13px; min-height:40px; }
.handout-page .sidebar button:hover { background:var(--bg); }
.handout-page .sidebar button.active { background:var(--accent-light); color:var(--accent); box-shadow:none; }
.handout-page .main { min-width:0; padding:30px 32px 40px; background:var(--bg); }
.handout-page .main > * { max-width:1200px; margin-left:auto; margin-right:auto; }
.handout-page .main h1 { font-size:26px; margin:0; }
.handout-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:22px; margin-bottom:22px; }
.handout-search { display:flex; align-items:center; gap:9px; width:310px; padding:0 12px; height:42px; background:var(--card-bg); border:1px solid var(--border); border-radius:9px; color:#8b98aa; }
.handout-search input { min-width:0; width:100%; height:100%; font-size:13px; background:none; color:var(--text); border:0; outline:none; }
.handout-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-light); }
.memory-hint { font-size:12px; color:#8b98aa; }
.mobile-hint { display:none; }
.handout-page .mobile-chapter-nav { display:none; }
.handout-page .card-grid { grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; }
.handout-page .card { align-items:stretch; text-align:left; min-width:0; min-height:214px; padding:20px 18px 12px; border:1px solid var(--border); border-radius:12px; box-shadow:0 2px 5px rgba(25,45,80,.025); }
.handout-page .card:hover { transform:none; border-color:#b7caed; box-shadow:0 4px 14px rgba(25,45,80,.05); }
.handout-page .card .word { font-size:21px; line-height:1.3; margin:0 0 4px; color:var(--text); overflow-wrap:anywhere; }
.handout-page .card .phonetic { font-size:13px; line-height:1.5; margin:0 0 10px; color:#8793a5; width:100%; overflow-wrap:anywhere; }
.handout-page [data-memory-word] { display:inline; cursor:help; }
.card-meta { display:flex; align-items:center; gap:7px; }
.handout-page .card .pos, .handout-page .card .tag { margin:0; font-size:10px; padding:3px 7px; font-weight:550; border-radius:5px; background:var(--bg); color:#7a8799; }
.handout-page .card .tag-core, .handout-page .tag-badge.tag-core { background:#fdf0ee; color:#bd695b; }
.handout-page .card .tag-high, .handout-page .tag-badge.tag-high { background:#faf4e7; color:#a6843d; }
.handout-page .card .tag-low, .handout-page .tag-badge.tag-low { background:#f0f3f7; color:#8190a4; }
.handout-page .card .tag-recog, .handout-page .tag-badge.tag-recog { background:#edf6f1; color:#588a71; }
.handout-page .card .meaning { font-size:13px; font-weight:400; line-height:1.65; color:#58677c; margin:14px 0 16px; min-height:42px; }
.handout-page .card-actions { width:100%; gap:8px; padding-top:9px; border-top:1px solid #edf0f5; justify-content:space-between; }
.handout-page .btn-icon, .handout-page .upload-icon-sm { position:static; display:flex; align-items:center; justify-content:center; gap:6px; width:auto; min-width:0; height:34px; min-height:34px; padding:4px 5px; background:none; border:0; border-radius:6px; font-size:11px; font-weight:400; line-height:1.5; color:#8491a4; }
.handout-page .btn-icon .lucide, .handout-page .upload-icon-sm .lucide { width:15px; height:15px; }
.handout-page .btn-icon:hover, .handout-page .upload-icon-sm:hover { background:var(--accent-light); color:var(--accent); }
.handout-credit { margin-top:24px; font-size:11px; color:#8b98aa; }
.empty-state { grid-column:1 / -1; padding:60px 20px; text-align:center; color:var(--text-secondary); font-size:14px; border:1px dashed var(--border); border-radius:12px; }
.handout-page .overlay-content { width:760px; max-width:calc(100vw - 48px); max-height:calc(100dvh - 64px); aspect-ratio:auto; min-height:450px; border-radius:18px; box-shadow:0 24px 80px rgba(20,30,50,.18); }
.handout-page .overlay-scroll { min-height:0; padding:70px 30px 24px; }
.handout-page .word-main { gap:12px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.handout-page .word-main h2 { color:var(--text); font-size:30px; line-height:1.3; overflow-wrap:anywhere; }
.handout-page .word-main .phonetic { font-size:16px; color:#8b98aa; }
.handout-page .word-main .btn-icon { font-size:12px; min-height:38px; padding:6px 10px; background:var(--bg); }
.handout-page .pos-badge, .handout-page .tag-badge { font-size:11px; padding:4px 9px; border-radius:6px; font-weight:500; }
.handout-page .pos-badge { background:var(--bg); color:var(--text-secondary); }
.handout-page .meaning-large { font-size:20px; line-height:1.5; margin:6px 0 20px; }
.handout-page .example-box { border-left-width:2px; padding:16px 18px; font-size:14px; line-height:1.75; background:#f6f8fc; border-radius:0 8px 8px 0; margin-bottom:18px; overflow-wrap:anywhere; }
.handout-page .root-box { background:#f8f9fc; color:#657187; padding:14px 18px; font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.detail-label { display:block; font-size:11px; font-weight:600; color:#94a0b1; margin-bottom:7px; }
.handout-page .extra-box { font-size:13px; color:var(--text-secondary); line-height:1.7; overflow-wrap:anywhere; }
.handout-page .extra-box:empty { display:none; }
.handout-page .overlay-note-area { padding:18px 30px 24px; background:#fff; }
.handout-page .lecture-note { min-height:64px; max-height:22dvh; overflow:auto; font-size:14px; font-weight:400; padding:12px; background:#fafbfe; border-color:var(--border); }
.handout-page .close-btn { top:16px; right:20px; display:flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:8px; color:var(--text-secondary); }
.handout-page .toggle-draw-btn { display:flex; align-items:center; gap:6px; top:16px; left:26px; right:auto; padding:7px 10px; min-height:36px; border:1px solid var(--border); border-radius:8px; font-size:12px; color:var(--text-secondary); background:#fff; }
.handout-page .brush-toolbar { top:16px; right:20px; border-radius:10px; }
body:has(.overlay.active) .site-header .brush-toggle { visibility:hidden; }
.phonetic-memory-tooltip { border-radius:10px; border-color:var(--border); box-shadow:0 8px 30px rgba(30,48,75,.12); }

@media (max-width:1000px) and (min-width:769px) {
    .practice-page .container { width:calc(100% - 40px); grid-template-columns:minmax(0,1fr) 240px; gap:16px; }
    .practice-main { padding:22px; }
    .practice-toolbar { flex-wrap:wrap; }
    .practice-page .actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .practice-page .actions .primary { grid-column:1 / -1; }
    .handout-page .sidebar { width:186px; }
    .handout-page .main { padding:26px 24px; }
}
@media (max-width:768px) {
    .site-header { height:calc(108px + env(safe-area-inset-top)); padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left)); gap:8px; display:grid; grid-template-columns:1fr auto; grid-template-rows:38px 42px; }
    .site-brand { min-width:0; gap:8px; }
    .brand-mark { width:32px; height:32px; border-radius:9px; }
    .brand-mark .lucide { width:18px; height:18px; }
    .site-brand strong { font-size:14px; }
    .site-brand small { font-size:8px; }
    .header-tools { grid-column:2; grid-row:1; gap:6px; }
    .site-header .sidebar-toggle, .site-header .dark-toggle, .site-header .brush-toggle { min-height:36px; height:36px; padding:0 9px; }
    .site-header .dark-toggle { width:36px; padding:0; }
    .site-nav { grid-row:2; grid-column:1 / -1; width:100%; gap:8px; }
    .site-nav a { flex:1; padding:10px; font-size:13px; min-height:42px; }
    .site-nav .lucide { width:16px; height:16px; }
    .page-intro { gap:10px; align-items:flex-start; }
    .page-intro h1 { font-size:23px; }
    .eyebrow { font-size:9px; margin-bottom:4px; }
    .intro-note { display:none; }
    .practice-page { padding:0; align-items:stretch; }
    .practice-page .container { display:flex; flex-direction:column; width:auto; margin:20px max(12px,env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); gap:16px; padding:0; }
    .practice-main { padding:18px 16px; gap:16px; border-radius:12px; }
    .practice-toolbar { display:grid; grid-template-columns:1fr; gap:12px; }
    .chapter-control { flex-direction:row; align-items:center; justify-content:space-between; width:100%; }
    .practice-page .select-style { width:calc(100% - 80px); font-size:16px; min-height:44px; padding:8px 12px; }
    .practice-page .mode-group { width:100%; }
    .practice-page .mode-btn { flex:1; padding:7px 5px; min-height:40px; font-size:12px; }
    .practice-page .stats { justify-content:space-between; flex-wrap:wrap; gap:6px; font-size:11px; }
    .question-area { padding:10px 0; gap:12px; }
    .practice-page .chinese-meaning { font-size:25px; min-height:84px; padding:8px 0; }
    .practice-page .chinese-meaning:empty::after { font-size:23px; }
    .practice-page .letter-slots { gap:5px; margin-bottom:2px; }
    .practice-page .slot { width:clamp(20px,7vw,30px); height:38px; font-size:23px; }
    .practice-page .native-answer-input { display:block; width:100%; min-height:46px; scroll-margin:140px; }
    .practice-page .mobile-keyboard { display:none; }
    .practice-page .answer-format-hint { font-size:11px; }
    .practice-page .tool-group { width:auto; }
    .practice-page .tool-btn { flex:none; min-height:38px; padding:6px 9px; }
    .practice-page .text-button { min-height:38px; }
    .practice-page .actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .practice-page .actions button { min-width:0; min-height:44px; padding:8px 4px; font-size:12px; gap:5px; }
    .practice-page .actions .lucide { width:16px; height:16px; }
    .practice-page .actions .primary { grid-column:1 / -1; font-size:14px; min-height:48px; }
    .practice-page .footer-note { display:none; }
    .practice-rail { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
    .practice-page .rail-panel, .practice-page .review-button { grid-column:1 / -1; }
    .practice-page .rail-panel, .practice-page .book-panel { padding:16px; min-width:0; }
    .practice-page .rail-panel { display:flex; align-items:center; gap:24px; }
    .rail-panel h2 { margin:0; font-size:13px; flex-shrink:0; }
    .practice-page .goal-progress { flex:1; }
    .practice-page .goal-progress > span { display:none; }
    .practice-page .goal-progress strong { grid-column:1; }
    .practice-page #setGoalBtn { grid-column:3; }
    .practice-page .book-header { min-height:32px; }
    .practice-page .book-header h3 { font-size:13px; gap:5px; }
    .practice-page .book-list { max-height:120px; }
    .practice-page .sidebar { width:100%; right:-100%; padding-top:calc(16px + env(safe-area-inset-top)); padding-bottom:calc(16px + env(safe-area-inset-bottom)); }
    .practice-page .sidebar.open { right:0; }
    .practice-page .modal-content { padding:22px; }
    .site-credit { width:100%; font-size:10px; line-height:1.6; }
    .handout-page .sidebar { display:none; }
    .handout-page .main { padding:20px max(12px,env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
    .handout-page .main h1 { font-size:22px; }
    .chapter-count { font-size:11px; white-space:nowrap; padding-top:22px; }
    .handout-toolbar { display:grid; grid-template-columns:1fr; gap:10px; margin-top:18px; margin-bottom:16px; }
    .handout-page .mobile-chapter-nav { position:static; height:auto; display:block; padding:0; background:none; box-shadow:none; }
    .handout-page .mobile-chapter-select { width:100%; height:44px; font-size:16px; font-weight:500; padding:8px 12px; border-color:var(--border); background:var(--card-bg); border-radius:9px; }
    .handout-search { width:100%; height:44px; }
    .handout-search input { font-size:16px; }
    .desktop-hint { display:none; }
    .mobile-hint { display:inline; }
    .memory-hint { text-align:left; font-size:11px; }
    .handout-page .card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .handout-page .card { padding:16px 12px 10px; min-height:214px; border-radius:10px; }
    .handout-page .card .word { font-size:18px; line-height:1.3; }
    .handout-page .card .phonetic { font-size:12px; margin-bottom:6px; }
    .handout-page [data-memory-word] { display:inline-flex; align-items:center; min-height:38px; max-width:100%; overflow-wrap:anywhere; }
    .handout-page .card .meaning { font-size:12px; line-height:1.6; margin:12px 0 14px; min-height:38px; }
    .handout-page .card-actions { gap:4px; padding-top:6px; }
    .handout-page .btn-icon, .handout-page .upload-icon-sm { position:static; min-height:44px; height:44px; width:auto; min-width:0; padding:4px 3px; border-radius:6px; font-size:10px; gap:4px; background:none; }
    .handout-page .overlay { padding-top:env(safe-area-inset-top); align-items:flex-end; }
    .handout-page .overlay-content { min-height:0; width:100%; max-width:100%; height:calc(100dvh - env(safe-area-inset-top) - 10px); max-height:100%; border-radius:16px 16px 0 0; }
    .handout-page .overlay-scroll { padding:66px 20px 20px; overscroll-behavior:contain; }
    .handout-page .word-main h2 { width:100%; font-size:29px; }
    .handout-page .word-main .phonetic { font-size:16px; max-width:calc(100% - 84px); }
    .handout-page .word-main .btn-icon { padding:6px 10px; font-size:12px; }
    .handout-page .meaning-large { font-size:18px; }
    .handout-page .overlay-note-area { padding:14px 20px calc(16px + env(safe-area-inset-bottom)); }
    .handout-page .lecture-note { font-size:16px; max-height:20dvh; min-height:60px; }
    .handout-page .close-btn { top:10px; right:14px; width:44px; height:44px; }
    .handout-page .toggle-draw-btn { top:12px; left:18px; min-height:40px; }
    .handout-page .brush-toolbar { top:calc(10px + env(safe-area-inset-top)); right:12px; }
    .phonetic-memory-tooltip { max-height:min(360px,60dvh); overflow:auto; overscroll-behavior:contain; }
    .phonetic-memory-tooltip[data-touch-open] { pointer-events:auto; }
}
@media (max-width:350px) {
    .site-header { padding-left:12px; padding-right:12px; }
    .handout-page .card-grid { grid-template-columns:minmax(0,1fr); }
    .practice-page .actions button { font-size:11px; }
    .practice-page .actions button:not(.primary) .lucide { display:none; }
    .practice-rail { grid-template-columns:1fr; }
}
@media (max-width:768px) and (orientation:landscape) and (max-height:500px) {
    .site-header { height:60px; display:flex; padding-top:8px; padding-bottom:8px; }
    .site-brand { min-width:140px; }
    .site-nav { width:auto; margin-left:auto; }
    .site-nav a { flex:none; padding:8px 12px; }
    .handout-page .overlay-content { height:100dvh; border-radius:0; }
    .handout-page .overlay-note-area { padding:8px 20px; }
    .handout-page .lecture-note { min-height:42px; max-height:64px; }
}

/* Thin, quiet scrollbars; no repeated instructions split the page. */
* { scrollbar-width:thin; scrollbar-color:#c6ced9 transparent; }
*::-webkit-scrollbar, .main::-webkit-scrollbar, .sidebar::-webkit-scrollbar, .overlay-scroll::-webkit-scrollbar { width:4px; height:4px; }
*::-webkit-scrollbar-track, .main::-webkit-scrollbar-track, .sidebar::-webkit-scrollbar-track, .overlay-scroll::-webkit-scrollbar-track { background:transparent; }
*::-webkit-scrollbar-thumb, .main::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, .overlay-scroll::-webkit-scrollbar-thumb { background:#c6ced9; border-radius:20px; }
*::-webkit-scrollbar-thumb:hover { background:#9daabc; }
.site-brand strong { font-size:16px; }
.practice-workspace > .page-intro { margin-bottom:0; }
.practice-page .goal-progress { grid-template-columns:1fr auto; }
.practice-page .goal-progress strong { grid-column:1; }
.practice-page #setGoalBtn { grid-column:2; }
.question-status:empty { display:none; }
.question-status { display:flex; align-self:center; color:var(--accent); }
.handout-page .card .phonetic, .handout-page .word-main .phonetic { color:#6e7a8f; }
.handout-page .btn-icon, .handout-page .upload-icon-sm { color:#6b778b; }
.handout-page .card .tag-core, .handout-page .tag-badge.tag-core { color:#a7564a; }
.handout-page .card .tag-high, .handout-page .tag-badge.tag-high { color:#876728; }
.handout-page .card .tag-low, .handout-page .tag-badge.tag-low { color:#627085; }
.handout-page .card .tag-recog, .handout-page .tag-badge.tag-recog { color:#46745d; }
@media (max-width:768px) {
    .practice-page .select-style { width:100%; }
    .handout-page .card .meaning { font-size:13px; }
    .handout-page .card .phonetic { font-size:13px; }
    .handout-page .btn-icon, .handout-page .upload-icon-sm { font-size:11px; }
    .chapter-count { padding-top:8px; }
}
.main, .sidebar, .overlay-scroll { scrollbar-color:#c6ced9 transparent; }
@supports selector(::-webkit-scrollbar) {
    * { scrollbar-width:auto; scrollbar-color:auto; }
    .main, .sidebar, .overlay-scroll { scrollbar-width:auto; scrollbar-color:auto; }
}
.book-chevron { display:flex; align-items:center; }
.book-chevron .lucide { width:15px; height:15px; }
.practice-page .book-panel:not(:has(.word-chip)) > .text-button,
.practice-rail:not(:has(.word-chip)) .review-button { display:none; }
.status-icon { display:flex; align-items:center; }
.status-icon .lucide { width:14px; height:14px; }

/* The native text input sits invisibly over the slots, like a verification-code field. */
.answer-entry { position:relative; width:100%; min-height:58px; display:flex; align-items:center; justify-content:center; }
.practice-page .answer-entry .letter-slots { width:100%; margin:0; min-height:58px; align-items:center; }
.practice-page .answer-entry .native-answer-input { position:absolute; inset:0; display:block; width:100%; height:100%; min-height:0; opacity:0; z-index:1; margin:0; padding:0; border:0; border-radius:0; background:transparent; color:transparent; caret-color:transparent; font-size:16px; box-shadow:none; cursor:text; }
.answer-entry:focus-within .active-slot { border-bottom-color:var(--accent); }
@media (max-width:768px) {
    .handout-page .page-intro { display:none; }
    .handout-toolbar { margin-top:0; }
    .handout-page .mobile-chapter-select { height:52px; font-size:18px; font-weight:650; }
}
