/* Confirmed compact phone reader: toolbar + selected word + mode row. */
.mobile-word-card-slot{display:none}
@media(max-width:767px) and (orientation:portrait){
 .shared-reader .shared-reader-toolbar.reader-toolbar{gap:6px;padding:6px;margin-bottom:8px}
 .shared-reader-toolbar .shared-reader-toggle{display:none!important}
 .shared-reader-toolbar .mobile-word-card-slot:not(:empty){display:block;flex:0 0 100%;order:99;min-width:0}
 .shared-reader-toolbar .mobile-word-card-slot:empty{display:none}
 .mobile-word-card{overflow:hidden;animation:reader-card-open 180ms ease-out both}
 .mobile-word-card-content{animation:reader-word-change 120ms ease-out both}
 .mobile-word-card .word-card{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto 44px;grid-template-rows:auto 40px;gap:2px 6px;margin:0!important;padding:8px 10px!important;border:1px solid var(--line,#e5d5c0);border-radius:10px;box-shadow:none!important;background:var(--bg2,#faf5eb);min-width:0;max-width:100%;box-sizing:border-box}
 .mobile-word-card .word-card-head,.mobile-word-card .word-card-head>div,.mobile-word-card .word-card-pronunciation{display:contents!important}
 .mobile-word-card .word-card-head h2{grid-row:1;grid-column:1;margin:0!important;font-size:20px!important;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
 .mobile-word-card .word-card-pronunciation>span{grid-row:1;grid-column:2/4;align-self:center;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
 .mobile-word-card .word-card-close{grid-row:1;grid-column:4;width:44px!important;height:32px!important;min-height:32px!important;padding:0!important;border:0!important;background:transparent!important;font-size:24px!important}
 .mobile-word-card .word-card-pronunciation>button{grid-row:2;font-size:12px!important;min-height:36px!important;height:36px!important;padding:4px 6px!important}
 .mobile-word-card .word-card-pronunciation>button:first-of-type{grid-column:2}
 .mobile-word-card .word-card-pronunciation>button:last-of-type{grid-column:3}
 .mobile-word-card .word-card-meaning{grid-row:2;grid-column:1;min-width:0;align-self:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0!important;font-size:14px!important;line-height:1.5!important}
 .mobile-word-card .word-card-notebook{grid-row:2;grid-column:4;font-size:0!important;padding:0!important;width:44px;height:38px!important;min-height:38px!important;margin:0!important;border:1px solid var(--line)!important;border-radius:8px!important;background:var(--card)!important;color:var(--reader-accent)!important;transition:transform 140ms ease}
 .mobile-word-card .word-card-notebook:before{content:"☆";font-size:26px;line-height:1}
 .mobile-word-card .word-card-notebook.on:before{content:"★"}
 .mobile-word-card .word-card-notebook:active{transform:scale(.9)}
 .mobile-word-card .word-card-count,.mobile-word-card .word-repeat-control,.mobile-word-card .word-card-context,.mobile-word-card .word-card-state,.mobile-word-card .word-card-nav{display:none!important}
 .shared-reader-body>.story>.tabs{position:sticky;top:calc(var(--reader-scroll-top,200px) - 12px);z-index:18;background:var(--bg,#faf6ee);padding:6px 0;margin-top:0;margin-bottom:10px;gap:6px}
 .shared-reader-body>.story>.tabs button{min-height:42px;padding:6px 2px;font-size:13px}
 .shared-reader-toolbar .reader-font{margin-left:auto}
 .shared-reader-toolbar .reader-font button,.shared-reader-toolbar .reader-directory-trigger{padding:6px 8px!important}
}
@keyframes reader-card-open{from{max-height:0;opacity:0;transform:translateY(-4px)}to{max-height:112px;opacity:1;transform:translateY(0)}}
@keyframes reader-word-change{from{opacity:.4}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.mobile-word-card,.mobile-word-card-content{animation:none!important}.mobile-word-card .word-card-notebook{transition:none!important}}

@media(max-width:767px) and (orientation:portrait){
 .shared-reader-toolbar>.vocab-audio{display:contents!important}
 .shared-reader-toolbar>.vocab-audio>.va-btn:not(.va-stop){display:none!important}
 .shared-reader-toolbar>.vocab-audio>.va-stop{order:3;font-size:0!important;width:40px;min-width:40px;padding:0!important}
 .shared-reader-toolbar>.vocab-audio>.va-stop:before{content:"⏹";font-size:18px}
 .mobile-word-card.is-closing{animation:reader-card-close 160ms ease-in both}
}
@keyframes reader-card-close{from{max-height:112px;opacity:1}to{max-height:0;opacity:0}}
@media(max-width:767px) and (orientation:portrait){
 .mobile-word-card .word-repeat,.mobile-word-card .word-all-meanings,.mobile-word-card .word-reading-note{display:none!important}
 .mobile-word-card .word-context-meaning br{display:none}
 .mobile-word-card .word-card-meaning{display:block;max-height:21px}
 .mobile-word-card .word-context-meaning{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media(max-width:767px) and (orientation:portrait){
 .shared-reader>.story-hero{display:none!important}
 .mobile-word-card .word-card-head h2{font-family:inherit}
}

@media(max-width:767px) and (orientation:portrait){
 .shared-reader-layout>.shared-word-sidebar{display:none!important}
}

/* Reader notebook entry uses the shared toolbar control shape, size and course palette. */
.reader-app .course-topbar .topbar-tools > .notebook-link,
.reader-app.kaoyan-preview .course-topbar .topbar-tools > .topbar-syllabus {
 box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:4px;
 height:44px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;
 background:var(--card);color:var(--fg);font-family:inherit;font-size:14px;font-weight:750;line-height:1.2;white-space:nowrap;
}
.reader-app .course-topbar .notebook-link b {margin-left:0;border-radius:4px;background:var(--bg2,var(--card));color:var(--fg);font-size:12px;}

.reader-app.kaoyan-preview .course-topbar .topbar-tools > .topbar-syllabus {color:var(--pink-deep);font-weight:800;}

/* Match the existing CET directory control variant. */
.reader-app.cet-library .course-topbar .topbar-tools > .topbar-syllabus {color:#ef7900;border-color:#ffb25b;background:#fff7eb;}

.reader-app .course-topbar .topbar-tools > .notebook-link.topbar-syllabus {color:var(--pink-deep);font-weight:800;}
