#article-open { font-size: 13px; padding: 8px 12px; white-space: nowrap; }
#article-tools { width: min(1100px, calc(100vw - 48px)); height: min(860px, 92dvh); max-height: 92dvh; padding: 0; border: 1px solid #dce2d8; border-radius: 24px; color: #293e34; background: #fafbf7; box-shadow: 0 24px 80px #1d352c30; }
#article-tools[open] { display: flex; flex-direction: column; }
#article-tools::backdrop { background: #263e3666; backdrop-filter: blur(5px); }
#article-tools .article-header { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 28px 36px 20px; background: #fffefa; flex: none; }
.article-eyebrow { color: #687e6d; font-size: 12px; letter-spacing: 1.8px; margin: 0 0 8px; }
#article-title { font-size: 27px; letter-spacing: -.7px; line-height: 1.3; margin: 0; }
#article-close { width: 42px; height: 42px; border: 1px solid #e5e8df; border-radius: 50%; padding: 0; line-height: 1; font-size: 26px; background: transparent; color: #718173; }
.article-tabs { display: flex; align-items: center; gap: 8px; padding: 0 36px 18px; border-bottom: 1px solid #e4e8df; background: #fffefa; flex: none; }
.article-tabs button { min-height: 42px; padding: 8px 18px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; color: #647768; }
.article-tabs button span { font-size: 11px; margin-left: 6px; padding: 2px 6px; border-radius: 5px; background: #edf0e7; }
.article-tabs [aria-pressed=true] { background: #365e4e; color: white; }
.article-tabs [aria-pressed=true] span { background: #ffffff20; }
#article-word-count { margin-left: auto; color: #7d877a; font-size: 12px; }
.article-layout { display: flex; min-height: 0; flex: 1; overflow: hidden; }
#article-content { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 36px; line-height: 1.75; font-size: 17px; }
.article-paper { background: #fff; padding: 36px 42px; border: 1px solid #e6e9e1; box-shadow: 0 4px 16px #374c3e04; border-radius: 4px; }
.article-kicker { color: #7a886f; font-size: 10px; font-weight: 600; letter-spacing: 2px; margin-bottom: 14px; }
#article-content .article-paper-title { font-size: 30px; line-height: 1.25; letter-spacing: -.7px; margin: 0 0 26px; font-family: Georgia, serif; color: #2f4939; }
.article-paper p { margin: 0 0 20px; }
.article-paper p:last-child { margin-bottom: 0; }
.article-paper h4 { margin: 24px 0 10px; font-size: 20px; }
.article-caption { font-size: 15px; font-style: italic; color: #596653; }
.article-verse { white-space: pre-line; }
#article-status { margin: 0; padding: 10px 36px; color: #895c31; font-size: 14px; background: #fff7e7; }
#article-status:empty { display: none; }
#article-downloads { flex: 0 0 252px; align-self: stretch; padding: 32px 26px 24px; border-left: 1px solid #e4e8df; background: #f3f5ee; overflow-y: auto; }
#article-downloads[hidden] { display: none; }
.article-print-symbol { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #cad4bf; border-radius: 12px; color: #64795c; font-size: 26px; margin-bottom: 22px; }
#article-downloads h3 { font-size: 17px; margin: 0 0 10px; }
#article-downloads p { font-size: 14px; line-height: 1.8; color: #6b7965; margin: 0 0 22px; }
#article-downloads a { display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 12px 10px; border: 1px solid #d4ddcc; border-radius: 10px; color: #345b45; font-size: 13px; min-height: 44px; }
#article-downloads #article-print { justify-content: space-between; padding: 12px 18px; background: #365f4e; border-color: #365f4e; color: white; font-weight: 600; font-size: 15px; }
.article-export-links { display: flex; gap: 8px; margin: 10px 0 16px; }
.article-export-links a { flex: 1; background: #fffefa; white-space: nowrap; }
#article-downloads small { font-size: 11px; line-height: 1.9; color: #7b8473; display: block; }
.article-quiz-note { border-top: 1px solid #dce3d3; margin-top: 30px; padding-top: 22px; }
.article-quiz-note strong { font-size: 13px; font-weight: 600; }
#article-downloads .article-quiz-note p { font-size: 12px; margin: 8px 0 0; }
.quiz-workspace, .quiz-results { max-width: 760px; margin: 0 auto; }
.quiz-progress-heading { display: flex; justify-content: space-between; font-size: 13px; color: #4c6957; }
.quiz-count { color: #82907d; }
.quiz-steps { display: flex; gap: 10px; margin: 12px 0 28px; }
.quiz-steps button { flex: 1; min-height: 36px; padding: 4px; border: 1px solid #dce3d5; background: #f0f3e9; border-radius: 7px; color: #7d8875; font-size: 12px; }
.quiz-steps [data-answered] { background: #dce8d8; color: #365e4e; }
.quiz-steps [aria-current] { background: #365e4e; border-color: #365e4e; color: white; }
.quiz-question { border: 0; padding: 0; margin: 0; min-width: 0; }
.quiz-question legend { font-weight: 600; line-height: 1.5; font-size: 23px; padding: 0; margin-bottom: 24px; width: 100%; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quiz-option { display: flex; align-items: center; gap: 14px; border: 1px solid #dce3d7; border-radius: 12px; padding: 18px; cursor: pointer; min-height: 100px; background: #fffefa; font-size: 16px; line-height: 1.5; position: relative; }
.quiz-option:hover { border-color: #96ad92; }
.quiz-option:has(input:checked) { background: #e9f0e4; border-color: #648266; box-shadow: inset 0 0 0 1px #648266; }
.quiz-option:has(input:focus-visible) { outline: 3px solid #ddb761; outline-offset: 3px; }
.quiz-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.quiz-letter { width: 32px; height: 32px; display: grid; place-items: center; flex: none; border: 1px solid #dfe5d9; border-radius: 9px; color: #718468; font-size: 13px; background: #f6f7f0; }
.quiz-option:has(input:checked) .quiz-letter { background: #365e4e; color: white; border-color: #365e4e; }
.quiz-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid #e2e7da; }
.quiz-controls button { min-height: 46px; font-size: 14px; padding: 10px 22px; border-radius: 10px; border: 1px solid #d6e0cf; background: #fffefa; white-space: nowrap; }
#article-tools .article-primary { background: #365f4e; color: white; border-color: #365f4e; }
.quiz-control-note { color: #85907d; font-size: 12px; }
.quiz-result-hero { text-align: center; background: #eef3e7; border-radius: 16px; padding: 26px 20px; margin-bottom: 24px; }
.quiz-score { font: 42px/1.2 Georgia, serif; color: #365f4e; }
.quiz-result-hero h3 { font-size: 19px; margin: 12px 0 6px; }
.quiz-result-hero p { color: #6f7f67; font-size: 13px; margin: 0; }
.quiz-review-card { padding: 22px 26px; background: #fffefa; border: 1px solid #dfe5d8; border-radius: 12px; margin-bottom: 14px; font-size: 15px; }
.quiz-review-heading { display: flex; align-items: center; justify-content: space-between; color: #597849; font-size: 12px; }
.quiz-number { color: #8c9a80; letter-spacing: 1px; }
.quiz-review-card[data-result=incorrect] .quiz-review-heading strong { color: #9a6b35; }
.quiz-review-card h4 { font-size: 17px; line-height: 1.5; margin: 12px 0; }
.quiz-review-card p { margin: 8px 0; }
.quiz-your-answer { color: #99724e; font-size: 13px; }
.quiz-correct-answer { color: #3f674d; font-weight: 600; }
.quiz-review-card details { border-top: 1px solid #edf0e7; padding-top: 12px; margin-top: 16px; font-size: 13px; color: #6c7b60; }
.quiz-review-card summary { cursor: pointer; }
.quiz-review-card blockquote { margin: 12px 0 0; padding-left: 14px; border-left: 2px solid #a6b995; font-style: italic; }
#article-tools button:focus-visible, #article-tools a:focus-visible { outline: 3px solid #ddb761; outline-offset: 3px; }
@media(max-width: 760px) {
 #article-tools { width: calc(100vw - 20px); max-height: 96dvh; height: 96dvh; border-radius: 18px; }
 #article-tools .article-header { padding: 20px 20px 16px; }
 #article-title { font-size: 22px; } .article-eyebrow { font-size: 10px; }
 .article-tabs { padding: 0 20px 14px; } .article-tabs button { padding: 8px 12px; } #article-word-count { display: none; }
 .article-layout { display: block; overflow-y: auto; } #article-content { overflow: visible; padding: 20px; font-size: 16px; }
 .article-paper { padding: 26px 22px; } #article-content .article-paper-title { font-size: 26px; }
 #article-downloads { border-left: 0; border-top: 1px solid #dce3d3; padding: 24px; }
 .article-print-symbol, #article-downloads > p, .article-quiz-note { display: none; }
 #article-downloads h3 { margin-bottom: 16px; } #article-downloads small br { display: none; }
 .quiz-options { grid-template-columns: 1fr; gap: 10px; } .quiz-option { min-height: 70px; padding: 14px; font-size: 15px; }
 .quiz-question legend { font-size: 20px; margin-bottom: 18px; } .quiz-steps { margin-bottom: 22px; }
 .quiz-control-note { display: none; } .quiz-controls { margin-top: 24px; padding-top: 20px; }
 .quiz-review-card { padding: 18px; } #article-status { padding-inline: 20px; }
}
/* Scope reading typography so the application's compact dialog hints cannot shrink it. */
#article-tools { overflow: hidden; }
#article-tools .article-paper p { font-size: 18px; line-height: 1.8; color: #34483b; }
#article-tools .article-paper .article-caption { font-size: 16px; color: #68765e; }
@media(max-width: 760px) { #article-tools .article-paper p { font-size: 17px; } }
#article-tools .phrase-mark { color: #b04438; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; text-decoration-color: #cb8b82; font-weight: 600; }
#article-tools .phrase-mark:hover { color: #863227; text-decoration-style: solid; }
#article-tools .article-paper .phrase-reading-note { font-size: 12px; color: #8d7569; background: #faf4ee; padding: 10px 14px; border-radius: 8px; margin: -6px 0 26px; }
#article-tools .phrase-appendix { margin-top: 28px; border-top: 1px solid #e4e7de; padding-top: 22px; }
#article-tools .phrase-appendix > h3 { font-size: 21px; margin: 0 0 6px; }
#article-tools .phrase-entry { border: 0; border-bottom: 1px solid #eceee7; border-radius: 0; padding: 10px 0; margin: 0; scroll-margin-top: 16px; }
#article-tools .phrase-entry:last-child { border-bottom: 0; padding-bottom: 0; }
#article-tools .phrase-entry:focus { outline: none; }
#article-tools .phrase-entry:focus-visible { outline: 2px solid #d9b788; outline-offset: 4px; }
.phrase-entry-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; position: relative; padding-right: 28px; margin-bottom: 3px; }
.phrase-number { font-size: 14px; color: #899080; }
#article-tools .phrase-entry h4 { color: #b04438; margin: 0; font-size: 18px; line-height: 1.5; }
#article-tools .phrase-entry .phrase-meaning { font-size: 14px; color: #43523e; font-weight: 500; }
#article-tools .article-paper .phrase-explanation { font-size: 14px; color: #64705d; line-height: 1.5; margin: 0 0 2px; }
.phrase-kind { color: #7c8772; font-size: 12px; }
#article-tools .article-paper .phrase-example { background: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.5; }
.phrase-example-label { color: #7c8772; font-size: 12px; }
.phrase-example-en { color: #34483b; }
.phrase-example-zh { color: #718069; font-size: 14px; margin-left: 6px; }
#article-tools .phrase-back { position: absolute; right: 0; top: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; min-height: 28px; font-size: 16px; color: #687f59; text-decoration: none; }
@media(max-width: 760px) { #article-tools .phrase-entry h4 { font-size: 17px; overflow-wrap: anywhere; } .phrase-example-zh { display: block; margin-left: 0; } }
.quiz-progress-heading { align-items: center; gap: 12px; }
.quiz-progress-heading .quiz-count { margin-left: auto; }
#article-tools .quiz-sound-toggle { background: transparent; border: 1px solid #dce3d5; border-radius: 7px; padding: 5px 9px; font-size: 12px; color: #617558; min-height: 32px; }
.quiz-option[data-result=correct], .quiz-option[data-result=correct]:has(input:checked) { background: #eaf2e4; border-color: #6a8b5c; box-shadow: inset 0 0 0 1px #6a8b5c; }
.quiz-option[data-result=incorrect], .quiz-option[data-result=incorrect]:has(input:checked) { background: #fbefeb; border-color: #c78e7e; box-shadow: inset 0 0 0 1px #c78e7e; }
.quiz-option[data-result=correct] .quiz-letter { background: #456f3b; color: white; border-color: #456f3b; }
.quiz-option[data-result=incorrect]:has(input:checked) .quiz-letter { background: #a85c49; color: white; border-color: #a85c49; }
.quiz-option:has(input:disabled) { cursor: default; }
.quiz-instant-feedback { border-left: 3px solid #86a878; padding: 14px 18px; margin-top: 20px; background: #eff4e9; border-radius: 0 8px 8px 0; font-size: 14px; }
.quiz-instant-feedback[data-result=incorrect] { border-color: #c08a67; background: #faf2e9; }
.quiz-instant-feedback strong { font-size: 16px; color: #43623c; }
.quiz-instant-feedback[data-result=incorrect] strong { color: #986343; }
#article-tools .quiz-instant-feedback p { font-size: 14px; margin: 6px 0; line-height: 1.65; color: #4c6049; }
.quiz-instant-feedback summary { cursor: pointer; font-size: 12px; color: #6e8060; margin-top: 10px; }
.quiz-instant-feedback blockquote { margin: 8px 0; border-left: 2px solid #b7c5ac; padding-left: 12px; }
#article-status[data-result=correct] { background: #edf3e6; color: #43623c; }
.quiz-steps [data-result=incorrect]:not([aria-current]) { background: #f6e9df; border-color: #d7b79f; color: #936344; }
/* The inline explanation carries the visual result; keep the live announcement for assistive technology. */
#article-status[data-result] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media(min-width: 761px) { .quiz-workspace:has(.quiz-instant-feedback) .quiz-option { min-height: 80px; } }
#article-tools .quiz-translate { border: 0; background: transparent; color: #687f59; padding: 4px 0; font-size: 12px; line-height: 1.5; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.quiz-question > .quiz-translation-control { margin: -16px 0 18px; }
#article-tools .quiz-translation { margin: 5px 0 10px; font-size: 14px; line-height: 1.7; color: #68745e; }
#article-tools .quiz-translation[hidden] { display: none; }
.quiz-instant-feedback .quiz-translation-control { margin-top: 2px; }
.quiz-review-card .quiz-translation-control { margin-bottom: 8px; }
@media(max-width: 760px) { .quiz-question > .quiz-translation-control { margin-top: -10px; } }

/* Keep quiz navigation visible; spend the viewport on the question and feedback. */
#article-tools[data-mode=quiz] .article-header { padding: 16px 28px 8px; align-items: center; }
#article-tools[data-mode=quiz] .article-eyebrow { display: none; }
#article-tools[data-mode=quiz] #article-title { font-size: 24px; }
#article-tools[data-mode=quiz] .article-tabs { padding: 0 28px 10px; }
#article-tools[data-mode=quiz] .article-tabs button { min-height: 36px; padding: 6px 14px; }
#article-tools[data-mode=quiz] .article-layout { display: flex; overflow: hidden; }
#article-tools[data-mode=quiz] #article-content { display: flex; min-height: 0; overflow: auto; padding: 16px 28px; }
.quiz-workspace { display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 900px; }
.quiz-toolbar { display: flex; align-items: center; gap: 20px; flex: none; margin-bottom: 14px; }
.quiz-toolbar .quiz-progress-heading { display: contents; }
.quiz-toolbar .quiz-progress-heading > span:first-child { white-space: nowrap; font-size: 13px; }
.quiz-toolbar .quiz-count { display: none; }
.quiz-toolbar .quiz-sound-toggle { order: 3; margin-left: auto; white-space: nowrap; }
.quiz-toolbar .quiz-steps { margin: 0; gap: 6px; }
.quiz-toolbar .quiz-steps button { flex: none; width: 36px; min-height: 32px; }
.quiz-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 3px 5px 8px; margin: 0 -5px; position: relative; scrollbar-gutter: stable; }
.quiz-workspace .quiz-question legend { font-size: 22px; line-height: 1.35; margin-bottom: 4px; }
.quiz-workspace .quiz-question > .quiz-translation-control { margin: 0 0 10px; }
.quiz-workspace .quiz-options { gap: 10px; }
#article-tools .quiz-workspace .quiz-option { min-height: 64px; padding: 12px 14px; gap: 12px; }
.quiz-workspace .quiz-instant-feedback { margin-top: 12px; padding: 10px 14px; }
#article-tools .quiz-workspace .quiz-instant-feedback p { margin: 4px 0; line-height: 1.5; }
.quiz-workspace .quiz-instant-feedback strong { font-size: 14px; }
.quiz-workspace .quiz-instant-feedback summary { margin-top: 4px; }
#article-tools .quiz-workspace .quiz-translation { line-height: 1.5; margin: 3px 0 6px; }
.quiz-workspace .quiz-controls { flex: none; margin-top: auto; padding-top: 10px; }
.quiz-workspace .quiz-controls button { min-height: 40px; padding: 8px 18px; }
@media(max-width: 760px) {
 #article-tools[data-mode=quiz] .article-header { padding: 12px 18px 6px; }
 #article-tools[data-mode=quiz] #article-title { font-size: 21px; }
 #article-tools[data-mode=quiz] .article-tabs { padding: 0 18px 8px; }
 #article-tools[data-mode=quiz] #article-content { padding: 12px 18px; }
 .quiz-toolbar { gap: 10px; margin-bottom: 10px; }
 .quiz-toolbar .quiz-progress-heading > span:first-child { display: none; }
 .quiz-toolbar .quiz-steps { gap: 5px; }
 .quiz-toolbar .quiz-steps button { width: 32px; }
 .quiz-workspace .quiz-question legend { font-size: 19px; }
 .quiz-workspace .quiz-options { gap: 8px; }
 #article-tools .quiz-workspace .quiz-option { min-height: 52px; padding: 9px 12px; font-size: 15px; }
 .quiz-workspace .quiz-controls { padding-top: 8px; }
}
@media(min-width: 761px) and (max-height: 760px) {
 #article-tools[data-mode=quiz] { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
 #article-tools[data-mode=quiz] .article-header { padding-top: 10px; }
 #article-tools[data-mode=quiz] #article-content { padding-top: 12px; padding-bottom: 12px; }
 .quiz-toolbar { margin-bottom: 10px; }
}

/* A single reading surface: one title, a compact export row, and the article. */
#article-tools[data-mode=text] .article-header { padding: 16px 28px 8px; align-items: center; }
#article-tools[data-mode=text] .article-eyebrow { display: none; }
#article-tools[data-mode=text] #article-title { font-size: 24px; }
#article-tools[data-mode=text] .article-tabs { padding: 0 28px 10px; }
#article-tools[data-mode=text] .article-tabs button { min-height: 36px; padding: 6px 14px; }
#article-tools[data-mode=text] .article-layout { flex-direction: column; display: flex; overflow: hidden; background: #fffefa; }
#article-tools #article-downloads { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 28px 0; border: 0; background: transparent; overflow: visible; }
#article-tools #article-downloads[hidden] { display: none; }
#article-tools #article-downloads a { min-height: 34px; padding: 6px 12px; font-size: 12px; border-radius: 7px; background: transparent; }
#article-tools #article-downloads #article-print { background: #365f4e; color: white; border-color: #365f4e; font-size: 12px; font-weight: 500; }
#article-tools #article-downloads a[aria-disabled="true"] { opacity: .65; cursor: wait; }
#article-tools[data-mode=text] #article-content { padding: 12px 28px 24px; overflow-y: auto; }
#article-tools .article-paper { max-width: 850px; margin: 0 auto; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#article-tools .article-paper > p { font-size: 18px; line-height: 1.6; margin: 0 0 8px; }
#article-tools .article-paper .phrase-reading-note { font-size: 12px; line-height: 1.4; margin: 0 0 12px; padding: 0; background: transparent; border-radius: 0; color: #887569; }
#article-tools .phrase-appendix { margin-top: 20px; padding-top: 16px; }
#article-tools .phrase-appendix > h3 { font-size: 18px; }
@media(max-width: 760px) {
 #article-tools[data-mode=text] .article-header { padding: 12px 18px 6px; }
 #article-tools[data-mode=text] #article-title { font-size: 21px; }
 #article-tools[data-mode=text] .article-tabs { padding: 0 18px 8px; }
 #article-tools #article-downloads { justify-content: flex-start; padding: 8px 18px 0; }
 #article-tools #article-downloads a { min-height: 40px; }
 #article-tools[data-mode=text] #article-content { padding: 12px 18px 20px; }
 #article-tools .article-paper > p { font-size: 17px; }
}
