/* Library refinements only. Standalone chapter HTML is deliberately untouched. */
:root { --muted:#61746a; }
:root[data-theme=dark] { --muted:#aec0b2; }
body:has(dialog[open]) { overflow:hidden; }
.mobile-dock { display:none; }
.header-tools .icon-button { width:44px; height:44px; }
.search-trigger { min-height:44px; }
.button, .bookmark-btn { min-height:44px; }
.bookmark-btn { width:44px; height:44px; }
.filter-btn { min-height:44px; font-size:11px; }
.button svg, .text-link svg, .subject-card-bottom svg { transition:transform 180ms ease; }
.button:hover svg, .text-link:hover svg, .subject-card:hover .subject-card-bottom svg { transform:translateX(3px); }
.button:active, .icon-button:active, .bookmark-btn:active { transform:scale(.96); }
.hero { padding:43px 0 37px; }
.hero-copy { min-width:0; }
.hero h1 { margin-top:18px; }
.hero-copy>p { font-size:14px; line-height:1.85; max-width:400px; }
.study-modes { display:inline-flex; gap:4px; padding:5px; border:1px solid var(--line); background:var(--surface); border-radius:13px; margin-top:23px; }
.study-modes button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; min-width:91px; border-radius:9px; padding:8px 13px; background:transparent; color:var(--muted); font-size:12px; transition:background 180ms,color 180ms,transform 180ms; }
.study-modes button svg { width:15px; height:15px; }
.study-modes button[aria-pressed=true] { background:var(--light-green); color:var(--green); }
.study-modes button:active { transform:scale(.95); }
.hero-actions { margin-top:20px; }
.hero-meta { font-size:11px; margin-top:19px; }
.hero-art { height:432px; }
.study-paper { width:325px; padding:25px 24px 19px; transform:perspective(900px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) rotate(-4deg); transition:transform 180ms ease-out; margin:0 24px 12px 0; }
.paper-top { font-size:9px; letter-spacing:1px; margin-left:6px; }
.preview-read { min-height:249px; padding:1px 0 0; }
.hero .paper-text { font-size:12px; line-height:1.8; margin:0 0 18px 7px; max-width:none; }
.paper-title { font-size:37px; margin:19px 0 15px 7px; }
.paper-schedules { margin-top:19px; }
.paper-schedules span { font-size:21px; }
.paper-schedules small { font-size:8px; }
.preview-launch { position:relative; display:flex; align-items:center; justify-content:space-between; min-height:44px; gap:10px; margin:11px 0 0 7px; border-top:1px solid var(--line); padding:12px 0 0; font-size:12px; font-weight:600; color:var(--green); }
.preview-launch svg { width:17px; height:17px; transition:transform 180ms; }
.preview-launch:hover svg { transform:translateX(4px); }
.art-sticker { width:99px; height:99px; right:0; bottom:18px; font-size:16px; pointer-events:none; }
.art-label { top:14px; left:2px; }
.art-ring { top:9%; }
.preview-flip { display:block; width:100%; height:249px; padding:0; background:transparent; text-align:center; perspective:1000px; margin:0 0 0 3px; border-radius:10px; }
.preview-flip-inner { display:block; width:100%; height:100%; position:relative; transform-style:preserve-3d; transition:transform 420ms cubic-bezier(.2,.7,.25,1); }
.preview-flip[aria-pressed=true] .preview-flip-inner { transform:rotateY(180deg); }
.preview-face { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:22px 12px 16px; backface-visibility:hidden; -webkit-backface-visibility:hidden; border-radius:10px; }
.preview-back { transform:rotateY(180deg); background:var(--light-green); }
.preview-cue { font-size:9px; font-weight:650; letter-spacing:1.4px; color:var(--green); }
.preview-question { font:27px/1.25 var(--serif); margin:21px 0 23px; letter-spacing:-.5px; }
.preview-answer { font:24px/1.35 var(--serif); margin:19px 0 20px; }
.preview-flip-hint { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:11px; margin-top:auto; }
.preview-flip-hint svg { width:14px; height:14px; }
.hero-art[data-preview=practice] .preview-question { font-size:24px; }
.subject-description { font-size:12px; }
.subject-card-bottom { font-size:10px; }
.subject-card { min-width:0; }
.subject-card:hover .subject-icon { transform:rotate(-7deg); }
.subject-icon { transition:transform 220ms ease; }
.chapter-info>p { font-size:13px; }
.chapter-meta, .chapter-stats { font-size:11px; }
.chapter-actions .button { font-size:12px; min-height:46px; }
.download-link { display:inline-flex; align-items:center; min-height:44px; font-size:12px; }
.offline-note { font-size:10px!important; }
.about-point h3 { font-size:12px; }
.about-point p { font-size:12px; line-height:1.85; }
.search-item { min-height:64px; }
.search-item b { font-size:14px; }
.search-item small { font-size:11px; }
.search-top input { font-size:16px; }
.search-top .icon-button { width:44px; height:44px; }
.search-category, .search-foot { font-size:10px; }
#search-dialog[open] { animation:dialog-arrive 180ms ease-out; }
#nav-dialog[open] { animation:dialog-arrive 180ms ease-out; }
@keyframes dialog-arrive { from { opacity:.3; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.toast { font-size:13px; }
.subject-footnote, .desk-privacy { font-size:12px; }
.empty-notebook p { font-size:14px; }
.subject-hero p, .page-heading p { font-size:14px; }
.footer-links a { min-height:36px; display:flex; align-items:center; }
.footer-links { gap:0; font-size:11px; }
.footer-bottom { font-size:11px; }
.footer-bottom a { text-decoration:underline; text-underline-offset:3px; }

@media (max-width:1100px) and (min-width:741px) {
 .hero { grid-template-columns:1.1fr 1fr; gap:20px; }
 .study-paper { width:285px; padding:23px 18px 16px; margin-right:10px; }
 .hero-art { height:410px; }
 .hero h1 { font-size:57px; }
 .preview-read, .preview-flip { min-height:238px; height:238px; }
 .hero .paper-text { font-size:11px; }
 .paper-title { font-size:32px; }
 .art-sticker { width:80px; height:80px; font-size:13px; right:-8px; }
 .hero-meta { font-size:10px; gap:7px; }
 .hero-meta span+span:before { margin-right:7px; }
 .main-nav { gap:20px; }
}

@media (max-width:740px) {
 html { scroll-padding-top:93px; }
 .site-header { height:74px; }
 .header-inner, .container { padding-left:20px; padding-right:20px; }
 .header-inner { gap:7px; }
 .header-tools { gap:1px; }
 .header-tools .icon-button, .search-trigger { width:44px; height:44px; padding:10px; flex:none; }
 .search-trigger { display:grid; place-items:center; border:0; background:none; }
 .search-trigger span, .search-trigger kbd { display:none; }
 .search-trigger svg { width:19px; height:19px; }
 .icon-button svg { width:20px; height:20px; }
 .wordmark { font-size:16px; gap:9px; }
 .brand-icon { width:33px; height:36px; }
 .brand-sub { font-size:7px; letter-spacing:1.5px; }
 .mobile-dock { position:fixed; z-index:45; left:50%; bottom:max(12px,env(safe-area-inset-bottom)); transform:translateX(-50%); display:grid; grid-template-columns:repeat(3,1fr); width:min(430px,calc(100% - 32px)); padding:6px; border:1px solid var(--line); background:var(--surface); border-radius:21px; box-shadow:0 8px 35px #163c3326; }
 .mobile-dock a { position:relative; min-height:52px; border-radius:15px; display:flex; flex-direction:column; gap:4px; align-items:center; justify-content:center; color:var(--muted); font-size:10px; line-height:1.3; font-weight:600; }
 .mobile-dock a svg { width:19px; height:19px; }
 .mobile-dock a.active { background:var(--light-green); color:var(--green); }
 .mobile-dock a:active { transform:scale(.96); }
 .saved-count { position:absolute; top:5px; left:calc(50% + 7px); min-width:15px; height:15px; padding:0 4px; border-radius:10px; background:var(--yellow); color:#344434; font-size:9px; font-style:normal; line-height:15px; text-align:center; }
 .site-footer { padding-bottom:104px; }
 .toast { bottom:92px; width:max-content; max-width:calc(100% - 36px); }
 .reader-mode .mobile-dock { display:none; }
 .hero { padding:31px 0 27px; grid-template-columns:1fr 1fr; gap:18px; }
 .hero h1 { font-size:48px; letter-spacing:-2px; }
 .hero-copy>p { font-size:13px; line-height:1.75; }
 .study-modes { width:100%; margin-top:18px; gap:2px; padding:4px; }
 .study-modes button { flex:1; min-width:0; padding:8px 6px; font-size:12px; gap:6px; }
 .study-modes button svg { width:14px; height:14px; }
 .hero-actions { gap:14px; margin-top:17px; }
 .hero-actions .button { min-height:46px; font-size:12px; padding:11px 15px; }
 .hero-actions .text-link { min-height:44px; font-size:12px; }
 .hero-meta { display:none; }
 .hero-art { height:345px; max-width:none; margin:0; transform:none; }
 .study-paper { width:245px; padding:21px 18px 12px; margin:0 8px 0 0; }
 .preview-read, .preview-flip { min-height:221px; height:221px; }
 .paper-title { font-size:30px; margin:17px 0 12px 7px; }
 .hero .paper-text { font-size:11px; line-height:1.65; }
 .paper-schedules small { font-size:7px; }
 .paper-schedules span { padding:7px; }
 .preview-launch { font-size:11px; }
 .preview-question { font-size:24px; }
 .preview-answer { font-size:21px; }
 .art-sticker { width:72px; height:72px; font-size:12px; right:-7px; bottom:9px; }
 .art-label { font-size:12px; top:-3px; left:-5px; }
 .art-star { font-size:40px; right:0; top:2px; }
 .art-ring { width:250px; height:250px; left:0; top:10%; }
 .art-book { left:4px; bottom:0; width:215px; }
 .art-book.second { left:14px; bottom:20px; width:212px; }
 .benefit-strip { padding:14px 0; font-size:11px; gap:10px; justify-content:space-between; }
 .benefit-strip span:nth-child(2), .benefit-strip span:nth-child(4) { display:none; }
 .benefit-strip svg { width:14px; height:14px; }
 .subjects-section { padding:29px 0; scroll-margin-top:91px; }
 .section-top { display:block; margin-bottom:19px; }
 .section-title h2 { font-size:32px; margin-bottom:8px; }
 .section-title p { font-size:13px; line-height:1.7; max-width:none; }
 .filters { display:flex; width:100%; margin-top:17px; border-radius:12px; padding:4px; gap:3px; }
 .filter-btn { flex:1; min-height:44px; padding:7px 8px; font-size:12px; border-radius:8px; }
 .subject-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
 .subject-card { padding:20px; min-height:235px; border-radius:15px; }
 .subject-paper { font-size:9px; }
 .subject-card h3 { font-size:19px; }
 .subject-description { font-size:13px; }
 .subject-card-bottom { font-size:11px; }
 .subject-icon { width:44px; height:44px; }
 .subject-icon svg { width:22px; height:22px; }
 .section-kicker { font-size:10px; letter-spacing:1px; }
 .section-kicker a { min-height:44px; font-size:12px; }
 .chapter-feature, .subject-catalog .chapter-feature { grid-template-columns:190px 1fr; }
 .chapter-info { padding:22px; }
 .chapter-info h3 { font-size:29px; }
 .chapter-info>p { font-size:14px; line-height:1.8; }
 .chapter-meta, .chapter-stats { font-size:12px; }
 .chapter-actions { flex-wrap:wrap; gap:8px 16px; }
 .chapter-actions .button { font-size:13px; }
 .download-link { font-size:13px; }
 .chapter-cover { min-height:230px; }
 .offline-note { font-size:11px!important; line-height:1.75!important; }
 .about-band { gap:27px; padding:33px 0; }
 .about-band h2 { font-size:32px; }
 .about-points { gap:25px; }
 .about-point h3 { font-size:13px; }
 .about-point p { font-size:13px; }
 .footer-top>p { font-size:14px; }
 .footer-links { font-size:12px; gap:0 20px; flex-wrap:wrap; }
 .footer-links a { min-height:44px; }
 .footer-bottom { font-size:11px; line-height:1.8; }
 .subject-hero { padding:29px 0 28px; }
 .subject-hero h1 { font-size:44px; margin-top:20px; }
 .subject-hero .eyebrow { font-size:10px; flex-wrap:wrap; }
 .subject-hero p { font-size:14px; }
 .breadcrumb { font-size:12px; line-height:1.7; flex-wrap:wrap; padding-top:22px; }
 .breadcrumb a { display:inline-flex; align-items:center; min-height:44px; }
 .subject-footnote, .desk-privacy { font-size:12px; line-height:1.8; }
 .pill { font-size:11px; padding:6px 10px; }
 .subject-catalog .section-top .pill { font-size:11px; }
 .empty-notebook p, .page-heading p { font-size:14px; }
 .empty-notebook .button { min-height:46px; font-size:13px; }
 .page-heading h1 { font-size:45px; }
 .desk-label { font-size:12px; }
 .log-date { font-size:11px; }
 .log-body p, .log-body ul { font-size:14px; line-height:1.85; }
 .log-body .button { font-size:13px; }
 #nav-dialog { width:calc(100% - 24px); padding:17px; border-radius:19px; }
 #nav-dialog>.icon-button { width:44px; height:44px; }
 #nav-dialog>a { min-height:56px; font-size:18px; }
 .reader-bar { padding:0 12px; }
 .reader-back, .reader-actions .download-link { min-height:44px; display:inline-flex; align-items:center; font-size:11px; }
 .reader-actions .text-link { display:inline-flex; align-items:center; justify-content:center; width:44px; min-height:44px; font-size:0; }
 .reader-actions .text-link svg { width:18px; height:18px; }
}

@media (max-width:600px) {
 .hero { display:block; padding:26px 0 22px; }
 .hero .eyebrow { font-size:9px; letter-spacing:1.35px; }
 .hero h1 { font-size:clamp(43px,11.7vw,57px); letter-spacing:-2px; line-height:1.06; margin:16px 0 14px; }
 .hero-copy>p { font-size:14px; line-height:1.7; max-width:430px; }
 .study-modes { width:100%; max-width:430px; margin-top:18px; }
 .study-modes button { font-size:13px; gap:8px; }
 .hero-actions { margin-top:15px; gap:18px; flex-wrap:nowrap; }
 .hero-actions .button { flex:none; }
 .hero-actions .text-link { font-size:12px; }
 .hero-art { height:187px; margin:19px 0 0; width:100%; max-width:none; }
 .art-ring, .art-label, .art-book, .art-star, .art-sticker, .art-grid { display:none; }
 .study-paper { width:100%; max-width:none; height:187px; transform:none!important; margin:0; border-radius:14px; padding:14px 17px 10px; box-shadow:5px 6px 0 -2px var(--wash),5px 6px 0 -1px var(--line); }
 .study-paper:before { display:none; }
 .paper-top { font-size:8px; letter-spacing:1px; margin:0; padding:0; }
 #preview-content { height:110px; }
 .preview-read { display:grid; grid-template-columns:minmax(0,1fr) 1fr; align-items:center; min-height:110px; height:110px; gap:6px 16px; }
 .paper-title { font-size:28px; margin:0; line-height:1.05; grid-row:1 / 3; }
 .hero .paper-text { font-size:11px; line-height:1.6; margin:0; grid-column:2; align-self:end; }
 .hero .paper-text br { display:none; }
 .paper-schedules { margin:0; gap:6px; grid-column:2; align-self:start; }
 .paper-schedules span { padding:6px 5px; font-size:17px; }
 .paper-schedules small { display:none; }
 .preview-launch { margin:0; min-height:38px; padding:8px 0 0; font-size:12px; }
 .preview-flip { min-height:110px; height:110px; margin:0; }
 .preview-face { padding:10px 8px 6px; }
 .preview-cue { font-size:8px; letter-spacing:1px; }
 .preview-question { font-size:22px; margin:8px 0; max-width:310px; }
 .preview-answer { font-size:20px; margin:8px 0; max-width:310px; }
 .hero-art[data-preview=practice] .preview-question { font-size:20px; }
 .preview-flip-hint { font-size:10px; }
 .preview-flip-hint svg { width:12px; height:12px; }
 .subject-grid { grid-template-columns:1fr; gap:12px; }
 .subject-card { display:grid; grid-template-columns:46px minmax(0,1fr) 22px; column-gap:13px; row-gap:0; min-height:0; padding:17px; border-radius:15px; }
 .subject-card-top, .subject-card-bottom { display:contents; }
 .subject-card .subject-icon { grid-column:1; grid-row:1 / 5; width:46px; height:46px; border-radius:13px; align-self:center; }
 .subject-paper { grid-column:2; grid-row:1; display:flex; gap:6px; font-size:9px; letter-spacing:.65px; }
 .subject-paper span { display:inline; text-align:left; }
 .subject-paper span+span { margin-top:0; }
 .subject-paper span+span:before { display:inline; margin-right:6px; }
 .subject-card h3 { grid-column:2; grid-row:2; margin:6px 0; font-size:18px; line-height:1.2; letter-spacing:-.3px; }
 .subject-description { grid-column:2; grid-row:3; font-size:12px; line-height:1.6; margin:0; padding:0; }
 .subject-card-bottom>span { grid-column:2; grid-row:4; margin-top:8px; font-size:10px; line-height:1.5; }
 .subject-card-bottom>svg { grid-column:3; grid-row:1 / 5; align-self:center; width:18px; height:18px; }
 .subject-card.available .subject-card-bottom>span { display:flex; }
 .subject-card:active { transform:scale(.985); }
 .filter-btn { font-size:12px; padding:7px 5px; }
 .chapter-feature, .subject-catalog .chapter-feature { grid-template-columns:1fr; }
 .chapter-cover { display:grid; grid-template-columns:68px minmax(0,1fr); min-height:124px; padding:19px 21px; gap:10px 17px; }
 .chapter-cover-label { grid-column:1 / -1; font-size:9px; }
 .chapter-cover .big-one { font-size:61px; margin:0; }
 .chapter-cover h3 { font-size:28px; line-height:1.1; max-width:220px; }
 .chapter-cover .mini-schedules { display:none; }
 .chapter-info { padding:20px; }
 .chapter-info h3 { font-size:30px; }
 .chapter-meta { font-size:11px; flex-wrap:wrap; gap:7px; }
 .chapter-stats { font-size:11px; gap:10px 15px; margin:17px 0; }
 .chapter-stats svg { width:15px; height:15px; }
 .chapter-actions { display:grid; grid-template-columns:1fr; gap:8px; }
 .chapter-actions .button { min-height:48px; font-size:14px; }
 .chapter-actions .download-link { justify-content:center; min-height:46px; border:1px solid var(--line); border-radius:10px; font-size:13px; }
 .chapter-actions .download-link svg { width:15px; height:15px; margin-right:8px; }
 .chapter-info-top { align-items:flex-start; }
 .bookmark-btn { width:44px; height:44px; }
 .offline-note { margin-top:13px!important; }
 .about-points { grid-template-columns:1fr; gap:24px; }
 .about-point h3 { font-size:14px; }
 .about-point h3 svg { width:16px; height:16px; }
 .about-point p { font-size:13px; }
 .footer-top { display:block; }
 .footer-top>p { margin:22px 0 15px; font-size:16px; max-width:none; }
 .footer-links { display:flex; gap:0; margin:0; }
 .footer-links a { width:100%; min-height:44px; font-size:13px; }
 .footer-bottom { padding-top:18px; }
 .subject-hero h1 { font-size:clamp(35px,9.8vw,45px); line-height:1.1; max-width:calc(100% - 10px); }
 .subject-hero .eyebrow { padding-right:54px; gap:10px; }
 .subject-hero>.subject-icon { width:44px; height:44px; top:25px; right:0; }
 .subject-hero .pill { font-size:10px; }
 .subject-catalog .section-top { display:flex; align-items:start; gap:12px; }
 .subject-catalog .section-title h2 { font-size:28px; }
 .subject-catalog .section-title p { font-size:13px; }
 .subject-catalog .section-top .pill { white-space:nowrap; margin-top:3px; }
 .page-heading h1 { font-size:43px; }
 #search-dialog { position:fixed; inset:auto 0 0; margin:0; width:100%; max-width:none; max-height:calc(100dvh - 20px); border-radius:22px 22px 0 0; padding-bottom:env(safe-area-inset-bottom); }
 #search-dialog[open] { animation:sheet-arrive 240ms cubic-bezier(.2,.7,.25,1); }
 .search-top { padding:12px 15px; gap:10px; }
 .search-top input { min-height:44px; font-size:16px; }
 .search-top .icon-button { width:44px; height:44px; flex:none; }
 .search-results { max-height:52dvh; padding:10px; }
 .search-item { min-height:72px; padding:13px 11px; }
 .search-item b { font-size:14px; line-height:1.4; }
 .search-item small { font-size:11px; line-height:1.6; }
 .search-category { font-size:10px; padding:9px 12px; }
 .search-foot { padding:13px 20px; font-size:11px; }
 .search-foot>span:last-child { display:none; }
 #nav-dialog { position:fixed; inset:auto 0 12px; width:calc(100% - 24px); margin:0 auto max(0px,env(safe-area-inset-bottom)); max-width:none; }
 @keyframes sheet-arrive { from { opacity:.4; transform:translateY(25px); } to { opacity:1; transform:translateY(0); } }
}

@media (max-width:360px) {
 .header-inner, .container { padding-left:16px; padding-right:16px; }
 .header-inner .wordmark { font-size:14px; gap:7px; }
 .header-inner .brand-icon { width:28px; height:32px; border-radius:9px; }
 .header-inner .brand-sub { font-size:6px; letter-spacing:1.4px; }
 .header-tools { gap:0; }
 .hero h1 { font-size:43px; }
 .hero-actions { gap:11px; }
 .hero-actions .button { padding:11px 12px; font-size:11px; }
 .hero-actions .text-link { font-size:11px; gap:6px; }
 .study-modes button { gap:6px; font-size:12px; }
 .subject-card { grid-template-columns:39px minmax(0,1fr) 17px; padding:15px; column-gap:11px; }
 .subject-card .subject-icon { width:39px; height:42px; }
 .subject-card h3 { font-size:17px; }
 .subject-description { font-size:12px; }
 .subject-paper { font-size:8px; }
 .filter-btn { font-size:11px; padding:7px 4px; }
 .preview-read { gap:6px 11px; }
 .hero .paper-text { font-size:10px; }
 .paper-title { font-size:26px; }
 .preview-question { font-size:21px; }
 .hero-art[data-preview=practice] .preview-question { font-size:18px; }
 .preview-answer { font-size:18px; }
 .benefit-strip { font-size:10px; gap:7px; }
 .chapter-info { padding:18px; }
}

@media (max-width:600px) {
 .hero { padding-top:22px; }
 .benefit-strip { display:none; }
 .hero-art[data-preview=read], .hero-art[data-preview=read] .study-paper { height:170px; }
 .hero-art[data-preview=read] #preview-content, .hero-art[data-preview=read] .preview-read { min-height:93px; height:93px; }
 .hero-art[data-preview=practice], .hero-art[data-preview=practice] .study-paper { height:231px; }
 .hero-art[data-preview=practice] #preview-content, .hero-art[data-preview=practice] .preview-flip { min-height:154px; height:154px; }
 .hero-art[data-preview=practice] .preview-answer { font-size:19px; line-height:1.3; }
}
@media (max-width:360px) {
 .hero-art[data-preview=practice] .preview-answer { font-size:17px; line-height:1.3; }
}

@media (prefers-reduced-motion:reduce) {
 *, *::before, *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
 .preview-flip-inner { transition:none!important; }
}
@media print {
 .mobile-dock, .study-modes, .hero-art { display:none!important; }
 .site-footer { padding-bottom:0; }
}
