/* Page-level textbook surfaces. Interactive controls and lesson cards are scoped out. */
/* Ordinary hover help shares one surface; positioning and warning notices stay component-specific. */
:is(.site-floating-tooltip,.practice-debug-floating-tooltip,.applet-device-floating-tooltip,
    .applet-tooltip-layer,.practice-hint-tooltip,.exercise-solution-tooltip,.theory-step-marker-tooltip) {
    padding:8px 10px;border:var(--tooltip-border);border-radius:var(--tooltip-radius);
    background:var(--tooltip-background);color:var(--tooltip-color);box-shadow:var(--tooltip-shadow);
    font-family:var(--font-sans);font-size:.78rem;font-weight:600;line-height:1.35;
}
.teacher-lesson-review.material-detail-card {
    padding: 0;
    gap: 0;
    background: var(--palette-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
}
.teacher-lesson-review > .teacher-lesson-review-header {padding:20px 22px}
.teacher-lesson-review > .teacher-lesson-progress {
    margin:0;padding:12px 22px;background:var(--palette-surface-muted);border-block:1px solid var(--color-border);
}
.teacher-lesson-review .teacher-lesson-review-layout {gap:0;align-items:stretch}
.teacher-lesson-review .teacher-lesson-review-layout.has-attempts {
    grid-template-columns:minmax(0,calc(var(--review-statement-share,60%) - 4px)) 7px minmax(0,1fr);
}
.teacher-lesson-review .teacher-lesson-review-main {padding:18px 22px;align-content:start}
.teacher-lesson-review .teacher-error-review-statement {
    padding:0;border:0;border-radius:0;box-shadow:none;min-height:130px;
}
.teacher-lesson-review .teacher-lesson-review-attempts {
    position:relative;top:auto;margin:0;padding:18px 20px;
    border:0;border-radius:0;max-height:calc(100vh - 170px);overflow:auto;
}
.teacher-lesson-review > .teacher-error-review-prev-next {
    margin:0;padding:12px 22px;border-top:1px solid var(--color-border);background:var(--palette-surface-muted);
    border-radius:0 0 var(--radius-md) var(--radius-md);
}
.review-column-resizer {position:relative;cursor:col-resize;touch-action:none;background:var(--palette-surface-soft)}
.review-column-resizer::before {content:"";position:absolute;inset:0 3px;background:var(--color-border)}
.review-column-resizer:is(:hover,:focus-visible,.is-resizing)::before {background:var(--palette-primary)}
.review-column-resizer:focus-visible {outline:2px solid var(--palette-primary);outline-offset:-2px}
.session-metric-summary {margin:18px 0;padding-top:12px;border-top:1px solid var(--color-border)}
.session-metric-summary h2 {font-size:1rem;font-weight:550;margin:0 0 10px}
.session-metric-row {display:grid;grid-template-columns:minmax(160px,1fr) 3fr;gap:12px;padding:7px 0;font-size:.82rem}
.session-metric-row > strong {font-weight:500}
.session-metric-row > div {display:flex;gap:8px 20px;flex-wrap:wrap}
.session-metric-row .is-positive {color:var(--palette-success-deep)}
.session-metric-row .is-negative {color:var(--palette-danger)}
.teacher-panel .skills-sort-switch {--segment-count:4;width:29rem}
.teacher-panel .skills-detail-switch {--segment-count:3;width:19rem}
.teacher-student-table-row,.teacher-table-header {display:none}
.teacher-student-move-controls {display:flex;align-items:center;gap:3px;flex:none}
.teacher-student-edge-buttons {display:flex;flex-direction:column;gap:1px}
.teacher-student-move-controls .teacher-student-edge-buttons button {height:14px;min-height:0}
.teacher-student-edge-buttons svg {width:20px;height:10px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.teacher-student-move-controls button,.teacher-student-drag-handle {
    display:inline-flex;align-items:center;justify-content:center;width:24px;height:26px;min-width:0;padding:0;
    border:0;background:transparent;color:var(--color-text-muted);font:inherit;cursor:pointer;
}
.teacher-student-drag-handle {cursor:grab;font-size:1.1rem}
.teacher-student-move-controls button:hover,.teacher-student-drag-handle:hover {background:var(--palette-surface-hover);color:var(--color-heading)}
.teacher-student-header > div:not(.teacher-student-move-controls) {margin-right:auto}
.teacher-student-card.is-dragging {opacity:.5}
.teacher-student-card.is-drop-before {box-shadow:0 -3px 0 var(--palette-primary)}
.teacher-student-card.is-drop-after {box-shadow:0 3px 0 var(--palette-primary)}
.teacher-order-save-status {color:var(--palette-danger);font-size:.8rem}
.teacher-order-save-status:empty {display:none}
.teacher-table-columns {grid-template-columns:24px minmax(0,.8fr) 140px minmax(0,1.2fr) minmax(0,1.2fr) 85px 80px;align-items:center;gap:10px}
.teacher-table-columns > * {min-width:0}
.teacher-cell-text {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.teacher-table-link {padding:0;border:0;background:none;box-shadow:none;font:inherit;color:var(--palette-primary);cursor:pointer;text-decoration:none;white-space:nowrap}
.teacher-panel .teacher-table-link:is(:hover,:focus-visible) {color:var(--palette-primary-deep);text-decoration:underline;background:transparent;box-shadow:none;transform:none}
.teacher-panel .teacher-table-link {justify-self:start;min-height:0;border-radius:0}
.teacher-panel .teacher-lesson-credit {box-sizing:border-box;width:12px;height:12px;min-width:12px;min-height:12px;max-width:12px;max-height:12px;padding:0;aspect-ratio:1;border-radius:50%;font-size:9px;line-height:1;flex:none}
.teacher-panel [data-teacher-sort-switch] .is-active::after {content:"↑";display:inline-block;margin-left:4px}
.teacher-panel[data-current-sort="activity"] [data-teacher-sort-switch] .is-active::after,
.teacher-panel[data-sort-reversed="true"] [data-teacher-sort-switch] .is-active::after {transform:rotate(180deg)}
.teacher-panel[data-current-sort="activity"][data-sort-reversed="true"] [data-teacher-sort-switch] .is-active::after {transform:none}
.review-attempt-order {display:flex;align-items:center;gap:8px;font-size:.8rem;margin-bottom:12px}
.review-attempt-order select {width:auto;font:inherit;padding:4px 8px}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-list {display:block;max-height:calc(100vh - 210px);overflow:auto;border:1px solid var(--color-border);background:var(--palette-white)}
.teacher-panel[data-skills-view-mode="table"] .teacher-table-header {display:grid;position:sticky;top:0;z-index:5;background:var(--palette-surface-muted);font-size:.78rem;font-weight:500;padding:10px 14px;min-width:900px;border-bottom:1px solid var(--color-border);box-sizing:border-box}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card {min-width:900px;padding:0;margin:0;border:0;border-bottom:1px solid var(--color-border);border-radius:0;box-shadow:none}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-table-row {display:grid;padding:4px 14px;font-size:.8rem}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-table-row .button {padding:6px 8px;min-height:30px;font-size:.76rem}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-table-row > strong {font-weight:550}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card > .teacher-student-header,
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card > .teacher-student-brief,
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card:not(.is-table-expanded) > :not(.teacher-student-table-row) {display:none}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card.is-table-expanded > .teacher-student-detailed {display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,300px);grid-template-areas:"counters chart" "summary chart" "previews chart";column-gap:18px;align-items:start;padding:18px}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card.is-table-expanded > .teacher-student-tab-row {padding:0 18px 12px}
.teacher-panel[data-skills-view-mode="table"] .teacher-student-card.is-table-expanded > .teacher-student-tab-panel {margin-inline:18px}
.teacher-refresh-period {display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin:8px 0 12px;font-size:.75rem;font-weight:400;white-space:nowrap}
.teacher-refresh-period label {display:flex;align-items:center;gap:6px;font:inherit;white-space:nowrap}
.teacher-refresh-period input {font:inherit;border:1px solid var(--color-border);border-radius:4px;padding:4px 6px}
.teacher-refresh-period .button {font:inherit;padding:5px 9px;min-height:30px;white-space:nowrap}
.teacher-refresh-period-error {color:var(--palette-danger)}
.teacher-refresh-session {border-left:3px solid var(--palette-danger);padding-left:10px}
.teacher-refresh-session.is-completed {border-left-color:var(--palette-success)}
.teacher-refresh-session.is-active {border-left-color:var(--palette-primary)}
.teacher-refresh-themes .material-chip {font-weight:400;cursor:help}
.teacher-refresh-themes .is-fulfilled {color:var(--palette-success-deep);border-color:var(--palette-success)}
.teacher-recommendation-entry {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;column-gap:10px;border-bottom:1px solid var(--color-border)}
.teacher-recommendation-entry > :is(.teacher-recommendation-row,.teacher-recommendation-expand) {min-width:0;border-bottom:0}
.teacher-recommendation-entry .teacher-recommendation-row {grid-template-columns:40px minmax(85px,170px) minmax(0,125px) minmax(0,1fr);gap:8px}
.teacher-recommendation-controls {display:flex;gap:5px;align-self:center;white-space:nowrap}
.teacher-recommendation-controls .button,.teacher-recommendation-form .button {font-size:.73rem;font-weight:400;min-height:29px;padding:5px 8px}
.teacher-recommendation-form {grid-column:1/-1;display:flex;justify-content:flex-end;align-items:center;gap:8px;margin:0;padding:6px 0 10px;font-size:.76rem}
.teacher-recommendation-form[hidden] {display:none}
.teacher-recommendation-form label {display:flex;align-items:center;gap:7px;font:inherit}
.teacher-recommendation-form input {width:65px;padding:5px;border:1px solid var(--color-border);border-radius:4px;font:inherit}
.teacher-recommendation-feedback {grid-column:1/-1;margin:0 0 8px;color:var(--palette-success-deep);font-size:.76rem;text-align:right}
.teacher-recommendation-feedback:empty {display:none}
.teacher-recommendation-feedback.is-error {color:var(--palette-danger)}
.teacher-recommendation-entry.is-adjusted > :first-child {opacity:.65}
@media(max-width:1000px) {
    .teacher-recommendation-entry .teacher-recommendation-row {grid-template-columns:40px minmax(0,1fr)}
    .teacher-recommendation-entry .teacher-recommendation-title {grid-column:2;grid-row:1}
    .teacher-recommendation-entry .teacher-recommendation-detail {grid-column:2;grid-row:2}
    .teacher-recommendation-entry .teacher-recommendation-deadline {grid-column:2;grid-row:3}
}
@media(max-width:820px) {
    .teacher-lesson-review .teacher-lesson-review-layout.has-attempts {grid-template-columns:minmax(0,1fr)}
    .review-column-resizer {display:none}
    .teacher-lesson-review .teacher-lesson-review-attempts {max-height:none;border-top:1px solid var(--color-border)}
    .session-metric-row {grid-template-columns:1fr;gap:5px}
}

.material-detail-card[data-applet-material-card] {
    padding: 0;
    gap: 0;
    background: var(--palette-white);
    box-shadow: none;
}

.material-detail-card[data-applet-material-card] > .material-detail-header {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(var(--palette-border-strong-rgb), .88);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--palette-white);
}

.material-detail-card[data-applet-material-card] .applet-detail-layout {
    gap: 0;
    background: var(--palette-white);
}

.material-detail-card[data-applet-material-card] .applet-detail-main,
.material-detail-card[data-applet-material-card] .applet-material-body,
.material-detail-card[data-applet-material-card] .applet-figure,
.material-detail-card[data-applet-material-card] .applet-frame-shell {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.material-detail-card[data-applet-material-card] :is(.applet-theory-panel, .applet-device-panel) {
    position: relative;
    top: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.material-detail-card[data-applet-material-card] :is(.applet-theory-header, .applet-device-panel-header) {
    border-radius: 0;
}

.material-detail-card[data-applet-material-card] :is(.applet-theory-navigation, .applet-theory-usage) {
    padding: 10px 0;
    border: 0;
    border-block: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.material-detail-card[data-applet-material-card] :is(.applet-theory-resizer, .applet-device-resizer) {
    /* Keep the existing generous pointer/keyboard target, without a gutter. */
    background: var(--palette-surface-soft);
}

.material-detail-card[data-applet-material-card] :is(.applet-theory-resizer, .applet-device-resizer)::before {
    top: 0;
    bottom: 0;
    border-radius: 0;
}

.material-detail-card[data-applet-material-card] > .material-detail-footer {
    margin: 0;
    padding: 12px 22px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--palette-surface-muted);
}

.material-detail-card[data-applet-material-card] .applet-report-panel,
.material-detail-card[data-applet-material-card] .applet-report-feedback:not(:empty) {
    margin: 0;
    padding: 12px 22px;
}

.material-detail-card[data-applet-material-card]:has(.applet-report-panel:not([hidden])) > .material-detail-footer {
    border-radius: 0;
}

/* The learning map is one atlas sheet, with its notes alongside it. */
.textbook-tree .learning-tree-card {
    padding: 0;
    gap: 0;
    overflow: hidden;
    box-shadow: none;
}

.textbook-tree .learning-tree-layout {
    gap: 0;
}

.textbook-tree .learning-tree-stage {
    border: 0;
    border-radius: 0;
    background: var(--palette-white);
}

.textbook-tree .learning-tree-details {
    padding: 20px;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--palette-surface-soft);
}

.textbook-tree .learning-tree-legend {
    margin: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--palette-surface-muted);
}

.textbook-tree .learning-tree-mini-tree-selection,
.textbook-tree .learning-tree-details-step-stats {
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.textbook-tree .compact-skills-card {
    padding: 20px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.textbook-tree .compact-skills-card > .home-eyebrow {
    display: none;
}

/* Catalog entries read as an index, not cards inside cards. */
.textbook-materials {
    row-gap: 0;
}

.textbook-materials > :not(.hero, .materials-filter-strip) {
    margin-top: 24px;
}

.textbook-materials .top-panel-actions {
    border-left: 1px solid var(--color-border);
    padding-left: 20px;
}

.textbook-materials .hero-panel {
    padding: 20px 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--palette-white);
    box-shadow: none;
}

.textbook-materials .top-panel {
    align-items: center;
    gap: 20px;
}

.textbook-materials .top-panel-main h1 {
    margin-bottom: 8px;
}

.textbook-materials .top-panel-main .lead {
    margin: 0;
    font-size: .94rem;
}

.textbook-materials .top-panel-actions .section-link {
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.textbook-materials .top-panel-actions .section-link.is-active {
    border-bottom-color: var(--palette-primary);
    color: var(--palette-primary);
    background: var(--palette-primary-soft);
}

.textbook-materials .top-panel-actions .section-link:hover,
.textbook-materials .top-panel-actions .section-link:focus-visible {
    background: var(--palette-surface-muted);
}

.textbook-materials .materials-filter-strip {
    padding: 14px 0;
    border: 0;
    border-block: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.textbook-materials :is(.material-bank-group, .lesson-grade-section) {
    display: grid;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.textbook-materials .section-grid-2 {
    column-gap: 32px;
    row-gap: 0;
}

.textbook-materials .material-bank-column {
    display: grid;
    gap: 28px;
}

.textbook-materials .material-bank-group {
    gap: 0;
}

.textbook-materials .material-bank-group > div:first-child {
    padding-bottom: 14px;
}

.textbook-materials .material-bank-group > div:first-child h2 {
    margin-bottom: 8px;
}

.textbook-materials :is(.material-card-link, .material-item-link) {
    padding: 18px 12px;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

.textbook-materials :is(.material-card-link, .material-item-link):hover,
.textbook-materials :is(.material-card-link, .material-item-link):focus-visible {
    background: var(--palette-white);
    border-color: var(--color-border);
}

.textbook-materials :is(.material-card-link, .material-item-link):focus-visible,
.textbook-materials .section-link:focus-visible {
    outline: 2px solid var(--palette-primary);
    outline-offset: -2px;
}

.textbook-materials :is(.material-card-link, .material-item-link):hover :is(h2, strong) {
    color: var(--palette-primary-hover);
}

.textbook-materials .material-bank-group > a:last-child:not(.material-item-link) {
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.textbook-materials .lesson-grade-kicker {
    display: none;
}

@media (min-width: 1024px) {
    .textbook-tree .learning-tree-details {
        border-bottom: 0;
        border-left: 1px solid var(--color-border);
    }
}

.material-detail-card[data-applet-panel-layout="stacked"] .applet-theory-resizer::before,
.material-detail-card[data-applet-panel-layout="stacked"] .applet-detail-layout:not(.has-theory-panel) .applet-device-resizer::before {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
}

/* Lesson pages: a reading sheet with full-width exercise and action bands. */
.theory-block-tabs {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-width: 0;
    margin: 0 14px calc(-1 * var(--grid-gap) - 1px);
    padding-top: 3px;
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.theory-block-tab {
    position: relative;
    z-index: var(--tab-stack-order, 1);
    box-sizing: border-box;
    display: block;
    flex: 0 1 auto;
    min-width: 88px;
    max-width: 190px;
    padding: 8px 12px 7px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-bottom-color: var(--palette-border-strong);
    border-radius: 9px 9px 0 0;
    background: var(--palette-surface-muted);
    color: var(--palette-slate);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.theory-block-tab:is(:hover, :focus-visible) {
    background: var(--palette-surface-hover);
    color: var(--palette-ink);
    text-decoration: none;
}
.theory-block-tab-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.theory-block-tab.is-current {
    border-color: var(--color-border);
    border-bottom-color: var(--palette-white);
    background: var(--palette-white);
    color: var(--color-heading);
    font-weight: 650;
}
.theory-block-tab.is-practice {
    background-color: var(--palette-surface-soft);
    background-image: repeating-linear-gradient(135deg,
        rgba(var(--palette-ink-rgb), .06) 0 3px,
        rgba(var(--palette-ink-rgb), .015) 3px 6px);
}
.theory-block-tab.is-practice:is(:hover, :focus-visible) {
    background-color: var(--palette-surface-hover);
}
.theory-block-tab.is-practice.is-current {
    background-color: var(--palette-white);
}
.theory-block-tabs.is-crowded {
    overflow: visible;
}
.theory-block-tabs.is-crowded .theory-block-tab {
    flex: 0 0 auto;
    max-width: none;
    overflow: visible;
    position: relative;
    box-shadow: -1px 0 0 var(--color-border);
    padding-inline: 0;
}
.theory-block-tabs.is-crowded .theory-block-tab-label {
    box-sizing: border-box;
    width: var(--tab-label-width, 100%);
    margin-left: var(--tab-label-left, 0px);
    padding-inline: var(--tab-label-padding, 8px);
    text-align: left;
}
.theory-block-tabs.is-crowded .theory-block-tab + .theory-block-tab {
    margin-left: calc(-1 * var(--tab-overlap));
}
.theory-block-tab:is(:hover, :focus-visible) { z-index: var(--tab-hover-order, 100); }
.theory-block-tabs.is-crowded .theory-block-tab:is(:hover, :focus-visible)::after {
    content: attr(data-full-title);
    position: absolute;
    top: -1px;
    left: var(--tab-reveal-left, -1px);
    box-sizing: border-box;
    width: var(--tab-reveal-width, max-content);
    max-width: var(--tab-reveal-max, min(340px, calc(100vw - 24px)));
    padding: 8px 12px 7px;
    border: 1px solid var(--color-border);
    border-bottom-color: var(--palette-border-strong);
    border-radius: 9px 9px 0 0;
    background: var(--palette-surface-hover);
    color: var(--palette-ink);
    white-space: normal;
}
.lesson-teacher-credit-note{margin:6px 0 0;color:var(--color-text-muted);font-size:.73rem}
body.is-lesson-zen .lesson-teacher-credit-note{display:none}
.textbook-lesson {
    --lesson-sheet-gutter: 22px;
    padding-inline: var(--lesson-sheet-gutter);
    position: relative;
    width: calc(100% - 58px);
    margin-right: 58px;
}
.textbook-lesson > .material-detail-header > .material-status-stack {
    position: absolute;
    top: 23px;
    right: -58px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 58px;
    min-width: 0;
    gap: 5px;
}
.textbook-lesson .material-status-badge {
    display: grid;
    align-items: center;
    justify-items: center;
    align-content: center;
    gap: 4px;
    width: 58px;
    min-width: 0;
    min-height: 66px;
    padding: 6px 3px;
    border: 1px solid var(--color-border);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: var(--color-surface-muted);
    box-sizing: border-box;
    cursor: help;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.textbook-lesson .material-status-badge:hover,
.textbook-lesson .material-status-badge:focus-visible {
    border-color: var(--color-border-strong);
    border-left: 0;
    background: var(--palette-surface-hover);
    color: var(--color-heading);
    transform: none;
    box-shadow: none;
}
.textbook-lesson .material-status-badge:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}
.textbook-lesson a.material-status-link {
    color: var(--color-heading);
    text-decoration: none;
}
.textbook-lesson .material-status-pictogram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    color: var(--color-link-hover);
}
.textbook-lesson .material-status-pictogram svg {
    display: block;
    width: 25px;
    height: 25px;
}
.textbook-lesson .material-status-pictogram svg circle,
.textbook-lesson .material-status-pictogram svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.textbook-lesson .material-status-value {
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.textbook-lesson .material-status-sublevel {
    margin-left: 2px;
    font-family: var(--font-serif);
    font-size: 0.72rem;
    font-weight: 700;
}
.textbook-lesson .material-zen-toggle {
    color: var(--color-heading);
    font: inherit;
    cursor: pointer;
}
.textbook-lesson .material-zen-toggle .material-status-pictogram svg path {
    stroke-width: 1.4;
}
.lesson-zen-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 2147483646;
    padding: 10px 16px;
    border: 1px solid var(--palette-border);
    border-radius: 8px;
    background: var(--color-heading);
    color: var(--palette-white);
    box-shadow: 0 10px 24px rgba(var(--palette-shadow-rgb), .15);
    font-size: .85rem;
    width: max-content;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    text-align: center;
    transform: translateX(-50%);
}
.lesson-zen-notice[hidden] { display: none; }
body.is-lesson-zen .site-header,
body.is-lesson-zen .site-footer,
body.is-lesson-zen .theory-block-tabs,
body.is-lesson-zen .experience-help-rail,
body.is-lesson-zen .experience-help-connectors,
body.is-lesson-zen .theory-shortcuts-toggle,
body.is-lesson-zen .theory-shortcuts-backdrop,
body.is-lesson-zen .textbook-lesson :is(.material-status-stack, .lesson-meta-row-inline, .material-step-tags, .lesson-readiness-editor, .readiness-warning, .fast-edit-button, .theory-step-summary-link, .theory-step-reset-progress, .theory-lesson-boundary-link, .practice-progress-reset-form, .practice-mode-switch, .debug-card, .lesson-layout-controls, .lesson-overview-card, .practice-footer-links, .exercise-flow-links, .material-detail-footer) {
    display: none !important;
}
body.is-lesson-zen .is-experience-help-pointed { outline: 0; }
body.is-lesson-zen .textbook-lesson {
    width: 100%;
    margin-right: 0;
}
body.is-lesson-zen .textbook-lesson .practice-report-button,
body.is-lesson-zen .textbook-lesson .practice-question-button {
    min-width: 42px;
    width: 42px;
    padding-inline: 0;
    text-align: center;
}
@media (max-width: 880px) {
    .textbook-lesson {
        width: 100%;
        margin-right: 0;
    }
    .textbook-lesson > .material-detail-header > .material-status-stack {
        display: none;
    }
}
@media (max-width: 620px) {
    .textbook-lesson > .material-detail-header .lesson-meta-row-inline {
        display: none;
    }
}
.textbook-lesson > .debug-card,
.textbook-lesson > .material-detail-content > :is(.practice-card, .lesson-actions-card) {
    width: calc(100% + 2 * var(--lesson-sheet-gutter));
    max-width: none;
    margin-inline: calc(-1 * var(--lesson-sheet-gutter));
    padding-inline: var(--lesson-sheet-gutter);
    border-inline: 0;
    border-radius: 0;
    box-shadow: none;
}
.textbook-lesson > .debug-card {
    margin-bottom: 0;
    border-block: 1px solid var(--color-border);
}
/* Overview cards use their shared style, including the author's left rule. */
.textbook-lesson .practice-actions :is(.practice-report-button, .practice-question-button,
    .practice-hint-button, .practice-side-link, .practice-skip-button):not(.is-active):not(:disabled) {
    color: var(--palette-primary-hover);
    background: var(--palette-primary-soft);
    border-color: var(--palette-primary);
    font-weight: 500;
    box-shadow: none;
}
.textbook-lesson .practice-actions :is(.practice-report-button, .practice-question-button,
    .practice-hint-button, .practice-side-link, .practice-skip-button):not(:disabled):is(:hover, :focus-visible) {
    color: var(--palette-primary);
    border-color: var(--palette-primary);
    background: var(--palette-primary-highlight);
}
.material-detail-card[data-applet-panel-layout="side"] .applet-theory-header {
    box-sizing: border-box;
    height: var(--applet-toolbar-height, 58px);
    min-height: var(--applet-toolbar-height, 58px);
    padding: 4px 12px;
    align-items: center;
}
.material-detail-card[data-applet-panel-layout="side"] .applet-theory-header > div {
    min-width: 0;
}
.material-detail-card[data-applet-material-card] .applet-theory-header h2 {
    margin: 0;
    line-height: 1.3;
}

/* Only the outside ends of each action strip are rounded. Hidden controls do
   not count, so skip/reveal/completion states keep the same outline. */
.textbook-lesson :is(.practice-actions, .theory-lesson-complete-actions) > :is(button, a) {
    border-radius: 0;
}
.textbook-lesson :is(.practice-actions, .theory-lesson-complete-actions) > :is(button, a):nth-child(1 of :not([hidden], .is-force-hidden)) {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}
.textbook-lesson :is(.practice-actions, .theory-lesson-complete-actions) > :is(button, a):nth-last-child(1 of :not([hidden], .is-force-hidden)) {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}
.textbook-lesson .practice-actions > .theory-lesson-complete-actions:not(:nth-child(1 of :not([hidden], .is-force-hidden))) > :first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.schedule-page :is(.schedule-list, .schedule-suspended-list) {
    gap: 0;
}
.schedule-page .schedule-item {
    border-radius: 0;
    box-shadow: none;
    transition: background-color .15s ease;
}
.schedule-page .schedule-item + .schedule-item {
    border-top: 0;
}
.schedule-page .schedule-item:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}
.schedule-page .schedule-item:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}
.schedule-page .schedule-item:not(.is-suspended):is(:hover, :focus-within) {
    background: var(--palette-primary-soft);
    box-shadow: none;
}

.textbook-materials .materials-filter-strip {
    border-top: 0;
}
.textbook-tree .learning-tree-legend {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.textbook-tree .learning-tree-legend-item {
    font-weight: 500;
    transition: background-color .15s ease;
    box-shadow: none;
}
.textbook-tree .learning-tree-legend-item:is(:hover, :focus-visible) {
    background: var(--palette-primary-soft);
    transform: none;
    box-shadow: none;
}
.textbook-tree .learning-tree-legend-item:focus-visible {
    outline: 2px solid var(--palette-primary);
    outline-offset: 2px;
}

.rating-button {
    display: inline-grid;
    place-items: center;
    position: relative;
    cursor: pointer;
    color: var(--palette-slate);
}
.rating-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}
.rating-button:is(.is-active, .is-preview) svg {
    fill: currentColor;
}
.rating-row:has(.is-preview) .rating-button:not(.is-preview) svg {
    fill: none;
}
.rating-button:focus-visible {
    outline: 2px solid var(--palette-primary);
    outline-offset: 2px;
}

/* Portalled iframe tooltips use the same palette and geometry as applet help. */
.applet-tooltip-layer {
    position: fixed;
    z-index: 2147483647;
    width: max-content;
    max-width: min(250px, calc(100vw - 16px));
    padding: 7px 9px;
    border: 1px solid rgba(var(--palette-border-rgb), .18);
    border-radius: 7px;
    background: rgba(var(--palette-ink-rgb), .96);
    color: var(--palette-surface-soft);
    box-shadow: 0 12px 26px rgba(var(--palette-shadow-rgb), .16);
    font: 500 .78rem/1.35 Inter, system-ui, sans-serif;
    pointer-events: none;
    opacity: 0;
}
.applet-tooltip-layer.is-visible { opacity: 1; }
.applet-tooltip-layer[hidden] { display: none; }

@media (max-width: 760px) {
    .textbook-materials .top-panel-actions {
        border-left: 0;
        border-top: 1px solid var(--color-border);
        padding: 12px 0 0;
    }
}
