/* Focused chapters, questions and drawers: one style owner. */
.exercise-progress {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px;margin:0 0 12px;padding:4px 0 8px;border-bottom:1px solid var(--line);}
.exercise-progress>p {margin:0;font-size:14px;color:var(--muted);}
.exercise-progress>button {min-height:44px;padding:8px;font-size:14px;}
.exercise-progress>[data-run-confirm] {width:100%;padding:12px;background:var(--soft);border-radius:8px;}
.exercise-progress>[data-run-confirm] p {font-size:15px;margin:0 0 8px;}
.exercise-progress>[data-run-confirm] button {min-height:var(--control-height);}
.exercise-progress>[data-exercise-save-error] {width:100%;padding:12px;background:#fff4e5;border-radius:8px;font-size:15px;}
.exercise-entry-progress {display:block;margin-top:4px;font-size:13px;font-weight:400;}
.reader-modal { overflow: hidden; }
.shelf-previous { margin: 32px 0; font-size: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.shelf-previous summary { cursor: pointer; min-height: 44px; color: var(--muted); }
.book-shell { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 32px; align-items: start; }
.book-toc { position: sticky; top: calc(var(--header-height) + var(--reader-toolbar-height) + 22px); max-height: calc(100dvh - var(--header-height) - var(--reader-toolbar-height) - 44px); overflow-y: auto; padding: 24px 12px 24px 0; scrollbar-width: thin; }
.book-toc-title { font-weight: 700; margin: 0 0 18px; font-size: 15px; }
.toc-part { font-size: 13px; letter-spacing: .04em; color: var(--muted); margin: 24px 0 6px; }
.book-toc ol,
.contents-drawer ol { list-style: none; padding: 0; margin: 0; }
[data-chapter-link] { display: flex; align-items: baseline; gap: 12px; color: var(--muted); text-decoration: none; padding: 9px 10px; font-size: 14px; border-radius: 6px; min-height: 44px; line-height: 1.5; }
[data-chapter-link] span { font-size: 13px; min-width: 18px; color: var(--muted); }
[data-chapter-link][aria-current="location"] { color: var(--accent-strong); background: var(--soft); font-weight: 650; }
[data-chapter-link]:hover { color: var(--accent-strong); background: var(--soft); }
.book-reading { min-width: 0; padding: 28px 32px 0; background: white; border: 1px solid var(--line); border-radius: var(--radius); font-size: 17px; }
.book-location { display: flex; justify-content: space-between; gap: 8px 16px; align-items: center; font-size: 13px; color: var(--muted); padding: 0 0 6px; flex-wrap: wrap; }
.book-chapter { padding: 8px 0 32px; margin-bottom: 24px; border-bottom: 2px solid var(--line); }
body[data-reader-ready] .book-chapter { margin-bottom: 0; border-bottom: 0; }
.book-chapter-heading h1 { font-size: 30px; line-height: 1.4; margin: 6px 0 10px; max-width: 24em; letter-spacing: -.04em; font-weight: 650; }
.book-chapter-heading>p:not(.eyebrow) { max-width: 44em; }
.chapter-task { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 4px 0 0; }
.chapter-task p { margin: 0; font-size: 14px; }
.chapter-task-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 650; }
.chapter-core { font-size: 18px; font-weight: 650; line-height: 1.75; border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 8px 0; color: var(--accent-strong); }
.book-reading p,
.book-reading li { line-height: 1.85; }
.book-thinking { margin: 28px 0; padding: 20px; background: var(--soft); border-radius: 12px; border: 1px solid var(--line); }
.book-thinking summary,.book-outline summary { min-height: 44px; padding: 8px 0; cursor: pointer; font-size: 15px; font-weight: 650; }
.book-outline { margin-bottom: 8px; }
.book-outline nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; padding: 8px 0 16px; }
.book-outline a { min-height: 44px; display: flex; align-items: center; font-size: 15px; }
.book-thinking ol { margin: 0; padding-left: 22px; }
.book-thinking li { margin: 10px 0; font-size: 16px; }
.book-terms { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
.book-terms>div { display: grid; grid-template-columns: minmax(80px,120px) minmax(0,1fr); gap: 16px; margin: 12px 0; font-size: 15px; }
.book-terms dt { font-weight: 700; }
.book-terms dd { margin: 0; }
.book-concept { margin: 0; padding: 28px 0; border-top: 1px solid var(--line); }
.concept-number { font-size: 13px; color: var(--accent-strong); letter-spacing: .06em; margin: 0 0 5px; }
.book-concept>h2 { font-size: 22px; margin: 0 0 16px; line-height: 1.5; letter-spacing: -.025em; }
.book-rule { max-width: var(--measure); font-size: 18px; font-weight: 450; }
.book-points { max-width: var(--measure); padding-left: 22px; margin: 16px 0; }
.book-points li { padding-left: 3px; margin: 8px 0; }
.book-diagram { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 24px; align-items: start; margin: 24px 0; padding: 20px 0; border-top: 1px dashed var(--line); }
.book-diagram h3 { margin: 0 0 10px; font-size: 18px; }
.book-diagram p { font-size: 16px; margin: 10px 0; }
.book-diagram p>b { color: var(--accent-strong); }
.book-images { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(120px,100%),1fr)); gap: 12px; }
.book-images figure { min-width: 0; margin: 0; }
.book-images .picture { width: 100%; height: 198px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 10px; }
.book-images img { width: 100%; height: 176px; object-fit: contain; }
.book-images figcaption { font-size: 13px; line-height: 1.6; color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.diagram-trap { color: var(--muted); }
.book-example { padding: 16px 20px; border-left: 2px solid var(--line); background: var(--green-soft); margin: 16px 0 14px; border-left-color: var(--line); }
.book-example summary { min-height: 44px; padding: 8px 0; font-size: 15px; color: var(--green-text); font-weight: 650; cursor: pointer; }
.book-example p { margin: 7px 0; font-size: 16px; }
.book-boundary { font-size: 15px; color: var(--muted); }
.book-checks { margin: 28px 0; }
.book-checks>h2,
.book-drill>h2 { font-size: 21px; }
.book-checks details { padding: 12px 0; border-top: 1px solid var(--line); }
.book-checks summary { font-size: 16px; cursor: pointer; line-height: 1.8; min-height: 44px; }
.book-checks details p { padding-left: 18px; font-size: 16px; }
.book-drill { margin: 28px 0; border: 1px solid var(--line); padding: 22px; background: var(--surface); border-radius: 12px; border-color: var(--line); }
.book-drill>h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; color: var(--accent-strong); }
.drill-reading-return { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; font-size: 14px; }
.book-drill>.muted { font-size: 14px; margin: 9px 0 20px; }
.book-chapter-end { display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 20px 0 10px; font-size: 13px; }
.book-chapter-navigation { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; width: 100%; }
.book-next { font-weight: 650; font-size: 14px; min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; overflow-wrap: anywhere; }
.book-next small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-bottom: 4px; }
.book-next[rel="next"] { grid-column: 2; justify-content: space-between; background: var(--soft); border-color: var(--line); }
.book-next:hover { background: var(--soft); }
.book-references { font-size: 13px; color: var(--muted); margin: 20px 0 0; }
.book-references summary { min-height: 44px; cursor: pointer; }
.book-finish { margin: 30px 0 50px; }
.book-finish .book-chapter-navigation { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.book-finish h1 { font-size: 28px; line-height: 1.5; margin-bottom: 24px; }
.finish-step { padding: 24px 0; border-top: 1px solid var(--line); }
.finish-step h2 { font-size: 20px; }
.finish-step>p { max-width: 48em; }
.finish-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-width:332px; align-items:stretch; gap:12px; margin-top:16px; }
.finish-actions>button,.finish-actions>.button { width:100%; min-width:0; margin:0; }
.finish-actions+p { margin-top: 16px; }
.finish-step>p:last-child { margin-bottom: 0; }
.reader-drawer { width: min(760px,100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; padding: 0; margin: 0 0 0 auto; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--text); overflow: auto; overscroll-behavior: contain; scroll-padding-top: calc(var(--drawer-header-height, 68px) + 20px); scroll-padding-bottom: calc(var(--attempt-navigation-height, 0px) + 20px); }
.reader-drawer::backdrop { background: #14203566; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 2; padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-header h2 { font-size: 19px; margin: 0; }
.drawer-header button { width:auto; min-width:44px; min-height:44px; white-space:nowrap; font-size: 14px; border-radius: 7px; }
#drawer-body,
#contents-copy { padding: 24px 24px 32px; }
.drawer-menu { display: grid; gap: 0; }
.drawer-menu>button,
.drawer-menu>a { width:100%; max-width:none; padding: 16px 4px; color: var(--text); text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; display:block; min-height:88px; text-decoration:none; font-size:16px; font-weight:600; line-height:1.65; }
.drawer-menu small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 5px; }
.drawer-menu>button:hover,
.drawer-menu>a:hover { color: var(--accent-strong); background: var(--soft); }
.drawer-search { display: block; font-size: 13px; }
.drawer-search input { margin-top: 6px; width: 100%; }
.drawer-question-list { list-style: none; padding: 0; margin: 16px 0; }
.drawer-question-list li { border-top: 1px solid var(--line); }
.drawer-question-list button { display:block; width:100%; max-width:none; padding: 14px 4px; border: 0; border-radius: 0; background: none; text-align: left; line-height: 1.65; font-size: 16px; font-weight: 450; scroll-margin-block: 90px 20px; }
.drawer-question-list small { display: block; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.reader-question { min-width: 0; max-width: 720px; margin: 0 auto; }
.reader-question h2 { font-size: 20px; line-height: 1.7; margin: 12px 0 16px; }
.reader-question .question-meta { font-size: 13px; gap: 6px; }
.reader-question .negative { font-size: 13px; }
.reader-question .question-pictures { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(200px,100%),1fr)); gap: 12px; margin: 14px 0; }
.reader-question .question-pictures figure { margin: 0; }
.reader-question .question-pictures .picture { width: 100%; height: 230px; background: white; }
.reader-question .question-pictures img { width: 100%; height: 210px; object-fit: contain; }
.reader-question .options { gap: 8px; }
.reader-question .option { padding: 12px 14px; min-height: 52px; border-radius: var(--radius-control); font-size: 16px; }
.reader-question .image-options { gap: 8px; }
.reader-question .option img { height: 120px; max-height: 120px; width: 100%; object-fit: contain; }
.reader-question .note-box { font-size: 14px; margin: 16px 0; }
.reader-question .note-box summary { padding: 6px 0; min-height: 44px; }
.reader-question .question-actions { margin:16px 0; display:flex; align-items:stretch; gap:12px; flex-wrap:wrap; }
.reader-question .question-actions>a { font-size: 13px; }
.reader-question .feedback:empty { display: none; }
.reader-question .feedback { margin: 16px 0; font-size: 16px; }
.reader-question .answer-feedback { margin-top: 0; }
.reader-question .feedback p { margin: 8px 0; line-height: 1.8; }
.reader-question .teaching-feedback { padding: 0; background: none; border: 0; }
.reader-question .teaching-feedback>a { display: inline-block; font-size: 14px; min-height: 44px; padding-top: 8px; }
.reader-question .feedback-example summary { font-size: 14px; }
.reader-question .practice-navigation { font-size: 13px; }
.contents-drawer { width: min(420px,100vw); margin: 0 auto 0 0; }
.reader-drawer .empty-review { padding: 12px 0; }
.reader-drawer .empty-review h3 { font-size: 20px; }
.book-chapter-heading .eyebrow { font-size: 13px; margin: 0 0 6px; }
.book-images .picture { background: var(--surface-subtle); border-color: var(--line); }
.toc-supplement { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; color: var(--accent-strong); font-size: 13px; text-decoration: none; }
.toc-supplement .ui-icon { width: 18px; height: 18px; margin-left: auto; }
@media(max-width:1100px) {
.book-shell { grid-template-columns: 190px minmax(0,1fr); gap: 24px; }
.book-reading { padding: 20px 24px 0; }
}
@media(max-width:1050px) {
.book-diagram { grid-template-columns: minmax(130px,.7fr) minmax(0,1.3fr); gap: 18px; }
}
@media(max-width:850px) {
.book-toc { display: none; }
.book-shell { display: block; }
.book-reading { border: 0; padding: 0; background: transparent; }
}
@media(max-width:560px) {
.book-finish h1 { font-size: 24px; }
.finish-actions { grid-template-columns:1fr; }
.finish-actions>button,.finish-actions>.button { width: 100%; }
.book-location { font-size: 13px; gap: 8px; }
.book-chapter-heading h1 { font-size: 26px; }
.chapter-task { gap: 8px; padding: 0 0 10px; }
.chapter-core { font-size: 18px; padding-left: 14px; }
.book-thinking { padding: 19px; margin: 24px 0; }
.book-thinking li { font-size: 16px; }
.book-terms>div { grid-template-columns: 85px minmax(0,1fr); gap: 10px; }
.book-outline nav { grid-template-columns: 1fr; }
.book-concept>h2 { font-size: 21px; }
.book-concept { padding-top: 24px; }
.book-diagram { grid-template-columns: 1fr; gap: 16px; margin: 18px 0; }
.book-images { max-width: 360px; width: 100%; margin: auto; }
.book-images .picture { height: 190px; }
.book-images img { height: 168px; }
.book-reading p,
.book-reading li { line-height: 1.85; }
.book-example { padding: 14px 16px; }
.book-drill { padding: 18px; margin-left: -4px; margin-right: -4px; }
.reader-question h2 { font-size: 20px; }
.drawer-header { padding: 14px 18px; gap: 12px; }
.drawer-header h2 { font-size: 17px; }
#drawer-body,
#contents-copy { padding: 20px 18px 32px; }
.reader-question .image-options { grid-template-columns: 1fr; }
.book-next { max-width: 100%; }
.book-chapter-navigation { grid-template-columns: minmax(0,1fr); }
.book-next[rel="next"] { grid-column: auto; }
.book-reading { padding: 0; }
.book-chapter-heading .eyebrow { font-size: 13px; }
}
@media print {
.book-toc,
.book-location,
.chapter-task,
.book-drill,
.book-chapter-end,
.book-concept>button { display: none!important; }
.book-shell { display: block; }
.book-reading { max-width: none; border: 0; padding: 0; }
.book-chapter { break-before: page; }
.book-chapter[hidden],
.book-finish[hidden] { display: block!important; }
.book-images img { max-height: 180px; }
}
