/* Palette based on the user's Guang Hai Ming Yue reference screenshot. */
:root{--ink:#28241f;--muted:#736a59;--green:#776648;--pale:#eee7d9;--line:#c9beaa;--paper:#f4efe5;--gold:#8b7041}
body{background:var(--paper);color:var(--ink)}
header{max-width:none;background:#2d2d2d;border-bottom:4px solid #b1a386;color:#fff;padding-left:max(24px,calc((100vw - 1072px)/2));padding-right:max(24px,calc((100vw - 1072px)/2))}
header a,.brand{color:#f5eee0}.brand-sub{border-color:#9c8c6c;color:#e1d5bf}.seal{background:#ad9d7c;color:#fff9ed;border:1px solid #c6b593;border-radius:3px}.quiet{color:#e6dbc8}
.intro:after{color:#b0a080;border-color:#c9bda7}.eyebrow{color:#927138}.chips span{color:#776647;border-color:#c4b699;background:#eee6d6}
.workspace{background:#faf6ed;border:1px solid #c6b99f;border-radius:5px;box-shadow:0 4px 18px #53442e0c}.step{color:#a48d5f;border-color:#cfc2a9}
.course-picker{background:#eee7d9;border:1px solid #b8a786;border-radius:3px}input,textarea,select{background:#fffdf8;color:#2b251d;border-color:#c7baa1;border-radius:3px}input:focus,textarea:focus,select:focus{outline-color:#a5926a}
.tabs{border-color:#c9bca3}.tabs button[aria-selected=true]{color:#6e5730;border-color:#a88c51}.tabs button:hover{background:#efe7d7}
.primary,.play{background:#a49473;color:#fff;border-radius:3px}.primary:hover,.play:hover{background:#877551}.secondary{background:#e7dfcf;color:#5b4b31;border:1px solid #bbaa88;border-radius:3px}.secondary:hover{background:#dbceb5}
.example{color:#85652d}.action-row,.edit-panel,.transcript,.links-heading{border-color:#cdbfa5}
.original{background:#f0eadf;border:1px solid #c3b69e;border-radius:2px}.context{background:#eee7da;border-radius:2px;color:#393126}.notice{background:#f4ecd9;border-left-color:#b38b39;color:#5a4728}
.link-card{background:#f4efe5;border:1px solid #b6a581;border-radius:3px}.link-url{color:#705a33;background:#e9e0cc}.lesson-badge{color:#fff;background:#ad9d7c;border-radius:3px}
.paragraph{border-color:#d9cfbc}.paragraph .time{color:#8a6c32}.paragraph blockquote{border-color:#a37138;color:#382d1e}.paragraph p{color:#2c2821}
.about details,footer{border-color:#c8bba1}.about .eyebrow,.three>div>span{color:#8b7041}footer{color:#786b54}.unmapped-link{color:#7c5d27}#toast{background:#3b352c;color:#fff5df}#error,#edit-error{background:#f5e7df;color:#8c382b}
@media(max-width:700px){header{padding-left:16px;padding-right:16px}.workspace{border-radius:4px}.link-card{padding:14px}.course-picker select{font-size:16px}}
.primary,.play{background:#86734f}.primary:hover,.play:hover{background:#705e3d}.lesson-badge{color:#332b1d}

footer{flex-wrap:wrap;gap:12px}.maker-credit{margin-left:auto;text-align:right;white-space:nowrap}
@media(max-width:700px){.maker-credit{flex-basis:100%;margin-left:0;text-align:right}}
.maker-credit{font-size:14px;line-height:1.6;color:#786b54;font-weight:400}

.header-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.header-right .maker-credit{font-size:13px;color:#e1d5bf;line-height:1.5;margin:0;white-space:nowrap}.header-right .quiet{font-size:13px}@media(max-width:700px){header{gap:12px}.header-right .maker-credit{font-size:12px}}
@media(max-width:700px){.brand{font-size:18px;flex-shrink:0}.brand-sub{display:block;border-left:0;padding-left:0;margin-left:0;font-size:11px}.header-right .maker-credit{font-size:11px}}

.intro h1{overflow-wrap:anywhere}.title-divider{margin:0 .15em}@media(max-width:700px){.intro h1{font-size:32px}}

.paragraph .time{white-space:pre-line}

/* Latest publication is separate from furthest mapped book progress. */
.teacher-progress{margin:20px 0 24px}.teacher-progress>h3{font-size:18px;margin:0 0 8px}.progress-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.progress-card{border:1px solid #c8b99c;background:#f4efe5;padding:16px;min-width:0}.progress-card.selected{border-color:#8a7851;box-shadow:inset 0 3px #a59370}.progress-card h4{margin:0 0 10px;font-size:17px}.progress-latest{font-weight:700;text-underline-offset:4px}.progress-title{font-size:14px;line-height:1.7;margin:8px 0}.progress-card .hint{line-height:1.8;margin:8px 0}.progress-furthest{font-size:13px;line-height:1.8;padding-top:10px;border-top:1px solid #d6cab5;margin-bottom:0}@media(max-width:760px){.progress-grid{grid-template-columns:1fr}.progress-card{padding:14px}}

.header-right{min-width:0}.header-right .maker-credit{white-space:normal;overflow-wrap:anywhere}@media(max-width:700px){.header-right{flex:1}.header-right .maker-credit{max-width:210px}}

.header-right{gap:7px}.header-right .maker-credit{display:grid;gap:2px;font-size:12px;line-height:1.5;text-align:right}.maker-room{color:#d4bd8f;font-size:12px;letter-spacing:.12em}.maker-byline{color:#ede4d3;white-space:nowrap;font-size:11px;letter-spacing:.02em}.maker-divider{color:#8b806c;padding:0 4px}.header-right .quiet{font-size:11px;color:#c5bba8}@media(max-width:700px){.header-right{gap:4px}.maker-room{font-size:11px;letter-spacing:.06em}.maker-byline{font-size:10px}.maker-divider{padding:0 2px}}

#teacher-result .progress-grid{grid-template-columns:1fr}#teacher-result .teacher-progress{margin-top:24px;padding-top:20px;border-top:1px solid #d6cab5}

.batch-mode-bar,.batch-actions{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 20px}.batch-workspace>label{display:block;font-weight:600;margin:20px 0 8px}.batch-workspace select,.batch-workspace input,.batch-workspace textarea{width:100%;margin-top:8px;padding:12px;border:1px solid #c8b99c;background:#fffdfa;color:#2d2d2d;border-radius:4px;font:inherit}.batch-workspace textarea{resize:vertical}.batch-guide{margin:20px 0;padding:16px;background:#eee7d8;border:1px solid #c8b99c}.batch-guide summary{cursor:pointer;font-weight:600}.batch-example{border-collapse:collapse;width:100%;margin:16px 0;font-size:14px}.batch-example th,.batch-example td{border:1px solid #c8b99c;padding:10px;text-align:left;white-space:pre-line;line-height:1.8}.batch-review-row{display:grid;grid-template-columns:60px 2fr repeat(4,1fr) auto;align-items:end;gap:8px;padding:14px 0;border-bottom:1px solid #d6cab5}.batch-review-row label{font-size:12px;min-width:0}.batch-review-row input{padding:8px}.batch-review-row button{padding:10px}.batch-image{max-width:100%;max-height:300px;object-fit:contain;display:block}.batch-result-link{display:block;padding:12px 0;overflow-wrap:anywhere}.batch-workspace #batch-results{margin-top:24px}.batch-actions button{min-height:44px}@media(max-width:700px){.batch-mode-bar button{flex:1}.batch-review-row{grid-template-columns:repeat(2,minmax(0,1fr))}.batch-review-row>strong,.batch-review-row>label:first-of-type{grid-column:1/-1}.batch-example{font-size:12px}.batch-example td,.batch-example th{padding:8px}.batch-actions button{flex:1 1 140px}}

.batch-example-image{display:block;width:100%;height:auto;margin:18px 0;border:1px solid #c8b99c;background:white}

.batch-row-warning{grid-column:1/-1;margin:4px 0;white-space:pre-line}

.batch-mode-bar button[aria-pressed=true]{background:#8a7851;color:white;border-color:#8a7851}

.batch-drop-zone{display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-height:130px;margin:14px 0;padding:22px;border:2px dashed #ad986b;border-radius:8px;background:#f4efe4;color:#594b32;text-align:center;cursor:pointer;overflow-wrap:anywhere}.batch-drop-zone span{font-size:14px;color:#786b54}.batch-drop-zone:hover,.batch-drop-zone.is-dragging{background:#eae0cb;border-color:#80693b}.batch-drop-zone:focus-visible{outline:3px solid #80693b;outline-offset:3px}

#result .edit-panel>h3,#result>.links-heading>h3{font-size:clamp(1.35rem,2.5vw,1.6rem);font-weight:800;line-height:1.45;color:#2d2d2d;}

#result>.links-heading:first-child{margin-top:0;}#result>.links-heading:first-child>h3{margin:0;}

#nv-result>.links-heading:first-child,#teacher-result>.links-heading:first-child{margin-top:0;}#nv-result>.links-heading:first-child>h3,#teacher-result>.links-heading:first-child>h3{margin:0;font-size:clamp(1.35rem,2.5vw,1.6rem);font-weight:800;}

#nv-page-lines{max-height:300px;overflow:auto;}#nv-result .nv-playback>h3,#nv-result .nv-time-editor>h3{font-size:clamp(1.35rem,2.5vw,1.6rem);font-weight:800;}

header{height:auto;min-height:100px;padding-top:16px;padding-bottom:16px;}.header-links{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:5px 14px;}.header-right .header-links a{font-size:12px;color:#e1d0ae;text-decoration:none;white-space:nowrap;}.header-links a:hover{text-decoration:underline;text-underline-offset:4px;}@media(max-width:700px){header{min-height:100px;}.header-links{gap:4px 10px;}.header-right .header-links a{font-size:11px;}}

#original-text,#nv-original,#teacher-original,#nv-page-lines .context{white-space:pre-wrap;line-height:2.1;font-family:serif;font-size:18px;}#original-text,#nv-original,#teacher-original{max-height:300px;overflow:auto;}@media(max-width:700px){#original-text,#nv-original,#teacher-original,#nv-page-lines .context{font-size:17px;}}

.feature-link{display:inline-flex;align-items:center;justify-content:center;padding:11px 17px;font-size:14px;text-decoration:none;min-height:44px}

.batch-time-editor{margin-top:20px;padding-top:15px;border-top:1px solid var(--line)}.batch-time-editor summary{cursor:pointer;font-weight:700}.batch-time-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0}.batch-time-fields label{font-size:14px}.batch-time-fields input{width:100%;padding:12px;margin-top:8px}@media(max-width:650px){.batch-time-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}

.paper-reference{font-size:15px;font-weight:400;line-height:1.85;color:#655437;white-space:pre-line;overflow-wrap:anywhere;border-left:3px solid #ad9360;border-radius:0 5px 5px 0;background:rgba(173,147,96,.08);padding:9px 13px;margin:12px 0;}

.paper-reference strong{font-weight:700;color:#25231f;}

/* Keep initial course metadata stable while the live status refreshes. */
.sync-row{min-height:4.4em;align-items:center;}#sync-status{line-height:1.8;}

/* Fixed independent rows: network status never changes the surrounding layout. */
#sync-status{display:grid;grid-template-rows:26px 52px;flex:1;min-width:0;line-height:26px;}
#sync-progress,#sync-detail{display:block;overflow:auto;overflow-wrap:anywhere;scrollbar-width:thin;}
.sync-row{min-height:78px;}
@media(max-width:700px){#sync-status{width:100%;flex:none;grid-template-rows:52px 78px;}.sync-row{min-height:186px;}}

#original-search-form,section.workspace{scroll-margin-top:16px;}

/* Readable narrow-screen schedule; all columns stack without horizontal scrolling. */
@media(max-width:1024px){.batch-guide>.batch-example-image{display:none;}.batch-guide>.batch-example[hidden]{display:block!important;width:100%;font-size:17px;margin:16px 0;}.batch-example tr{display:block;background:#fffdf8;border:1px solid #c8b99c;border-radius:5px;margin-bottom:16px;overflow:hidden;}.batch-example tr:first-child{display:none;}.batch-example td{display:block;border:0;padding:10px 14px;white-space:pre-line;overflow-wrap:anywhere;line-height:1.9;}.batch-example td+td{border-top:1px solid #e2d8c6;}.batch-example td:before{content:attr(data-label);display:block;font-size:14px;color:#786b54;line-height:1.6;margin-bottom:3px;}.batch-example td:first-child{background:#eee7d9;font-weight:700;font-size:18px;}}

.return-search{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:50;min-height:48px;padding:12px 18px;border:1px solid #685735;border-radius:999px;background:#796741;color:#fff;font-size:16px;font-weight:700;box-shadow:0 3px 12px #0003;cursor:pointer;}.return-search:hover{background:#645330;}.return-search:focus-visible{outline:3px solid #bda36c;outline-offset:3px;}

.batch-row-warning,.batch-result-error,#error,#edit-error,#nv-edit-error{font-weight:900;color:#000;font-size:clamp(18px,2vw,21px);line-height:1.8;background:#fff0d8;border-left:5px solid #302514;padding:16px;}

.url-updated-status{margin:0 0 16px;padding:16px 18px;background:#fff0c2;border:1px solid #cda343;border-left:6px solid #9b741e;border-radius:5px;color:#302309;}.url-updated-status>strong{display:block;font-size:clamp(20px,3vw,25px);font-weight:900;line-height:1.5;}.url-updated-status>p{font-size:17px;font-weight:700;line-height:1.75;margin:7px 0 0;overflow-wrap:anywhere;}.link-card{transition:background-color .8s,border-color .8s,box-shadow .8s;}.link-card.url-update-flash{background:#fff0c2!important;border-color:#a67b1b!important;box-shadow:0 0 0 3px #d4af5470;}@media(prefers-reduced-motion:reduce){.link-card{transition:none;}}

/* Keep result actions together on desktop; stack title above equal mobile actions. */
#result>.links-heading,#nv-result>.links-heading,#teacher-result>.links-heading{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;}
#result>.links-heading>button,#nv-result>.links-heading>button,#teacher-result>.links-heading>button{margin:0;min-height:44px;white-space:normal;}
@media(max-width:1024px){#result>.links-heading,#nv-result>.links-heading,#teacher-result>.links-heading{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}#result>.links-heading>h3,#nv-result>.links-heading>h3,#teacher-result>.links-heading>h3{grid-column:1/-1;margin:0 0 2px;}#result>.links-heading>button,#nv-result>.links-heading>button,#teacher-result>.links-heading>button{width:100%;height:100%;min-height:46px;padding:10px 12px;}}

/* Wider result links without increasing their vertical padding or font size. */
.link-card .play,.search-result .play{min-width:min(240px,100%);max-width:100%;text-align:center;font-weight:700;}
.link-actions .play{flex:1 1 240px;}
.link-card .link-url{width:100%;font-weight:700;color:#493713;background:#e8dcc0;box-shadow:inset 0 0 0 1px #b6a17a;text-decoration-thickness:1.5px;text-underline-offset:3px;}
.batch-result-link{width:100%;font-weight:700;color:#493713;text-decoration-thickness:1.5px;text-underline-offset:3px;}
.search-time-link{font-weight:700;text-decoration-thickness:1.5px;}
.link-card a:focus-visible{outline:3px solid #9b7c38;outline-offset:3px;}
@media(max-width:600px){.link-card .play,.search-result .play{width:100%;}.link-actions .play{flex-basis:100%;}}

/* Match the transcript count heading to the playback count heading. */
#nv-result .transcript-group-heading{font-size:clamp(1.35rem,2.5vw,1.6rem);font-weight:800;}

.jump-red{background:#fbefed!important;color:#8b4138!important;border:1px solid #c89188!important;border-left:4px solid #b56960!important;padding:14px 16px;border-radius:8px;white-space:pre-line;line-height:1.75}.jump-red h3,.jump-red h4,.jump-red p{color:#8b4138!important}.jump-red h3,.jump-red h4{font-size:20px;margin:0 0 10px}.jump-red p{margin:6px 0;font-size:18px}

#error.book-mismatch{color:#934f46;background:#fbefec;border:1px solid #dfb9b0;border-left:4px solid #b77669;border-radius:10px;padding:16px 20px;font-size:clamp(17px,2vw,19px);font-weight:700;line-height:1.8;box-shadow:none}

.intro h1 .title-version{display:inline-block;font-size:.48em;font-weight:500;letter-spacing:.03em;white-space:nowrap;vertical-align:middle;color:#88764e}

/* Keep the introduction close to the visible announcement. */
.site-announcement:not([hidden]) + .intro{padding-top:8px}
.site-announcement:not([hidden]) + .intro:after{top:8px}
@media(max-width:600px){.site-announcement:not([hidden]) + .intro{padding-top:2px}}

/* Completed course status: natural height, no loading placeholder space. */
#sync-status{display:block;line-height:1.8}#sync-progress,#sync-detail{display:block;overflow:visible}#sync-detail:empty{display:none}.sync-row{min-height:0;align-items:flex-start}@media(max-width:700px){#sync-status{display:block;width:100%;flex:none}.sync-row{min-height:0}}

.hero-brief{max-width:42em;margin-bottom:16px!important}.hero-courses{margin:0 0 14px;color:#756750;font-size:14px;line-height:1.8}.hero-courses p{margin:5px 0}.hero-courses span{color:#9a835c;font-size:12px;margin-right:12px;white-space:nowrap}.hero-more{max-width:650px;margin:0 0 8px;color:#807157;font-size:13px;line-height:1.9}.hero-more summary{cursor:pointer;display:list-item;width:fit-content;padding:5px 0;color:#8a7045}.hero-more>div{padding:6px 0 0 14px;border-left:1px solid #d9c9a7;margin-top:8px}.hero-more p{margin:8px 0}@media(max-width:600px){.hero-brief{font-size:16px!important;line-height:1.8!important;margin-bottom:14px!important}.hero-courses{font-size:13px;line-height:1.9}.hero-courses span{font-size:11px;margin-right:8px}.hero-more{font-size:13px;margin-bottom:0}}

.hero-course-tags{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0;color:#78664b}.hero-course-tags>span{display:inline-block;padding:6px 15px;border:1px solid #c9b996;border-radius:999px;background:#eee7d8;font-size:13px;line-height:1.6;white-space:nowrap}@media(max-width:600px){.hero-course-tags{gap:9px 10px;margin:16px 0}.hero-course-tags>span{padding:6px 12px;font-size:12px}}

.hero-course-tags>span{color:#a3332c}

.intro h1 .title-subline{display:inline-flex;align-items:center;gap:8px;white-space:nowrap}.intro h1 .title-version{font-size:12px;line-height:1.4;border:1px solid #cabb9e;border-radius:6px;padding:3px 7px;letter-spacing:0}.intro h1{line-height:1.35}@media(max-width:700px){.intro h1{font-size:30px!important;margin:12px 0 18px!important;line-height:1.3!important}.intro h1 .title-subline{display:flex;margin-top:6px;font-size:24px;gap:10px}.intro h1 .title-divider{display:none}.intro h1 .title-version{font-size:11px}.intro{padding-top:24px!important;padding-bottom:24px!important}.hero-course-tags{margin-bottom:0}}

.hero-course-tags>span{border:2px solid #b7352a;border-radius:8px;background:#fffaf4;color:#a3332c;padding:6px 13px}@media(max-width:600px){.hero-course-tags>span{padding:6px 11px}}

@media(max-width:700px){
.site-announcement{margin-bottom:14px!important}
.intro{padding-top:4px!important;padding-bottom:16px!important}
.intro>.eyebrow{margin:4px 0 8px;font-size:11px;letter-spacing:2px}
.intro h1{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:clamp(21px,5.6vw,26px)!important;line-height:1.35!important;margin:8px 0 12px!important;letter-spacing:0}
.intro h1 .title-subline{display:inline-flex;font-size:clamp(16px,4.3vw,20px);gap:6px;margin-top:0}
.intro h1 .title-version{font-size:10px;padding:2px 5px}
.intro .hero-brief{margin:0 0 12px!important;font-size:15px!important;line-height:1.75!important}
.hero-course-tags{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0!important;width:100%}
.hero-course-tags>span{display:flex;align-items:center;justify-content:center;min-width:0;padding:7px 5px;font-size:12px;line-height:1.5;white-space:normal;text-align:center;border-width:1px;border-radius:8px}
#main-mode-bar{gap:8px;margin-bottom:16px}
#main-mode-bar>button{padding:10px 5px;font-size:13px}
}

.hero-course-tags>span{border-radius:999px}

.intro h1 .title-subline{font-size:inherit}.intro h1 em{font-size:inherit}@media(max-width:700px){.intro h1{font-size:clamp(24px,6.3vw,30px)!important;gap:5px;margin-top:6px!important;letter-spacing:-.035em}.intro h1 .title-subline{font-size:inherit;gap:5px;letter-spacing:inherit}.intro h1 .title-version{font-size:9px;padding:2px 4px;letter-spacing:0;flex-shrink:0}}

.intro h1{font-size:52px}@media(max-width:700px){.intro h1{font-size:clamp(27px,7vw,34px)!important;gap:4px;letter-spacing:-.045em}.intro h1 .title-subline{font-size:inherit;gap:4px}.intro h1 .title-version{font-size:9px;padding:2px 3px}}@media(max-width:350px){.intro h1{font-size:25px!important}.intro h1 .title-version{font-size:8px}}

.intro h1{font-size:58px}@media(max-width:700px){.intro h1{font-size:clamp(30px,8vw,38px)!important;display:block;white-space:normal;line-height:1.3!important;letter-spacing:0}.intro h1 .title-subline{display:flex;font-size:inherit;align-items:center;gap:8px;margin-top:3px;white-space:nowrap}.intro h1 .title-version{font-size:11px;padding:3px 5px}}

@media(max-width:700px){.intro h1{display:flex;align-items:center;justify-content:space-between;width:100%;white-space:nowrap;gap:5px;font-size:var(--fit-title-size,27px)!important;letter-spacing:0;line-height:1.35!important}.intro h1 .title-name{flex-shrink:0}.intro h1 .title-subline{display:inline-flex;align-items:center;font-size:inherit;gap:5px;margin-top:0;flex-shrink:0}.intro h1 .title-version{font-size:10px;padding:2px 4px;flex-shrink:0}.intro h1 .title-divider{display:none}}

.hero-course-tags>span{color:#171717;font-weight:700;border-color:#70685a}
@media(max-width:700px){
.intro{padding-top:16px!important;padding-bottom:28px!important}
.intro h1{margin:12px 0 24px!important}
.intro .hero-brief{margin:0 0 22px!important;line-height:1.9!important}
.hero-course-tags{gap:12px 10px;margin:0!important}
.hero-course-tags>span{padding:10px 7px;font-size:13px;font-weight:700;color:#171717;border-color:#70685a}
#main-mode-bar{margin-bottom:24px}
}

.intro h1 .title-name,.intro h1 .title-subline em{font-weight:700}

/* Six balanced course labels: desktop 3 × 2, mobile 2 × 3. */
.hero-course-tags{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-width:780px}
.hero-course-tags>span{display:flex;align-items:center;justify-content:center;text-align:center;white-space:normal;min-width:0;padding:10px 12px}
@media(max-width:700px){.hero-course-tags{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.hero-course-tags>span{padding:10px 6px}}
