/* Set detail: title and study controls first, secondary tools in a disclosure.
   Page scope outranks legacy shared and inline template layout declarations. */
body.is-workbook-detail .main-wrapper > .container { max-width: 1040px; }
body.is-workbook-detail .workbook-detail-header {
    margin: 0 0 28px; padding: 28px; border-radius: 18px;
    position: relative; overflow: visible; box-shadow: none !important;
}
body.is-workbook-detail .workbook-detail-header::before { display: none; }
body.is-workbook-detail .header-top {
    display: flex; flex-direction: row !important; align-items: flex-start;
    gap: 16px; margin-bottom: 20px; flex-wrap: nowrap;
}
body.is-workbook-detail .header-top-left { display: block; flex: 1; min-width: 0; width: auto; }
body.is-workbook-detail .header-top-right { flex: 0 0 auto; width: auto; }
body.is-workbook-detail .detail-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: .78rem; color: var(--wq-text-muted); }
body.is-workbook-detail .visibility-badge { margin: 0; font-size: .7rem; padding: 3px 8px; border-radius: 6px; }
body.is-workbook-detail .workbook-title {
    margin: 0; font-size: clamp(1.3rem, 2.5vw, 1.75rem); line-height: 1.45;
    letter-spacing: -.035em; font-weight: 600; white-space: normal;
    overflow: visible; word-break: keep-all; overflow-wrap: anywhere;
}
body.is-workbook-detail .detail-menu { position: relative; }
body.is-workbook-detail .detail-menu > summary {
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    width: 44px; height: 44px; border: 1px solid var(--wq-border); border-radius: 10px;
    background: var(--wq-surface-2); color: var(--wq-text-soft); list-style: none; letter-spacing: 2px;
}
body.is-workbook-detail .detail-menu > summary::-webkit-details-marker { display: none; }
body.is-workbook-detail .detail-menu .header-actions {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
    display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    width: 216px; max-width: calc(100vw - 56px); gap: 4px; padding: 8px;
    border: 1px solid var(--wq-border-strong); border-radius: 12px;
    background: var(--wq-surface); box-shadow: 0 10px 32px #0005;
}
body.is-workbook-detail .detail-menu .header-actions > :is(a, button) {
    display: flex; align-items: center; justify-content: flex-start; gap: 8px;
    width: 100%; box-sizing: border-box; min-height: 44px !important; height: auto !important;
    margin: 0; padding: 10px 12px !important; border: 0 !important; border-radius: 7px;
    background: transparent !important; color: var(--wq-text-soft); font: inherit;
    font-size: .85rem !important; text-decoration: none; white-space: normal;
}
body.is-workbook-detail .detail-menu .header-actions > :is(a, button):hover { background: var(--wq-surface-2) !important; }
body.is-workbook-detail .detail-menu .header-actions > .delete { color: #f4a09a !important; }
body.is-workbook-detail .workbook-meta-info {
    display: flex; flex-direction: column; align-items: stretch; gap: 18px;
    margin: 0; padding: 0; border: 0;
}
body.is-workbook-detail .meta-content-left { display: block; }
body.is-workbook-detail .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: .8rem; }
body.is-workbook-detail .meta-divider { display: none; }
body.is-workbook-detail .meta-content-right,
body.is-workbook-detail .practice-buttons { width: 100%; }
body.is-workbook-detail .wkb-dual-actions { display: flex; width: 100%; gap: 10px; }
body.is-workbook-detail .wkb-action-btn {
    flex: 1; min-width: 0; min-height: 48px !important; justify-content: center;
    border-radius: 11px; font-size: .94rem; padding: 10px 16px;
}
body.is-workbook-detail .progress-section { margin: 16px 0 0; padding: 0; border: 0; background: transparent; }
body.is-workbook-detail .progress-info { margin-bottom: 8px; }
body.is-workbook-detail .progress-section .progress-bar-bg { height: 6px !important; border: 0 !important; }
body.is-workbook-detail .header-controls-row {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px;
    margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--wq-border);
}
body.is-workbook-detail .description-wrapper { flex: 1 1 260px; min-width: 0; width: auto; }
body.is-workbook-detail .workbook-description-details {
    border: 1px solid var(--wq-border); border-radius: 12px; background: var(--wq-surface-2); overflow: hidden;
}
body.is-workbook-detail .workbook-description-details > summary {
    display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer;
    list-style: none; color: var(--wq-text-soft); line-height: 1.5;
}
body.is-workbook-detail .workbook-description-details > summary::-webkit-details-marker { display: none; }
body.is-workbook-detail .set-intro-icon { display: flex; flex: 0 0 auto; color: var(--wq-accent); }
body.is-workbook-detail .set-intro-heading { display: grid; gap: 4px; flex: 1; min-width: 0; }
body.is-workbook-detail .set-intro-heading strong { font-size: .9rem; font-weight: 600; }
body.is-workbook-detail .set-intro-heading > span { font-size: .76rem; color: var(--wq-text-muted); word-break: keep-all; }
body.is-workbook-detail .set-intro-chevron { flex: 0 0 auto; color: var(--wq-text-muted); transition: transform .15s; }
body.is-workbook-detail .workbook-description-details[open] .set-intro-chevron { transform: rotate(180deg); }
body.is-workbook-detail .set-intro-body { margin: 0 16px; padding: 16px 0; border-top: 1px solid var(--wq-border); }
body.is-workbook-detail .workbook-description { margin: 0; white-space: normal; font-size: .9rem; line-height: 1.85; color: var(--wq-text-soft); overflow-wrap: anywhere; }
body.is-workbook-detail .workbook-description p { margin: 0 0 12px; }
body.is-workbook-detail .workbook-description p:last-child { margin-bottom: 0; }
body.is-workbook-detail .set-intro-summary { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--wq-border); }
body.is-workbook-detail .set-intro-summary:first-child { margin: 0; padding: 0; border: 0; }
body.is-workbook-detail .set-intro-summary h2 { font-size: .78rem; font-weight: 600; color: var(--wq-accent); margin: 0 0 8px; }
body.is-workbook-detail .detail-menu .study-settings-trigger { flex-wrap: wrap; }
body.is-workbook-detail .detail-menu .study-settings-trigger__state { flex: 1 1 100%; max-width: none; padding-left: 24px; font-size: .7rem; text-align: left; color: var(--wq-text-muted); }
body.is-workbook-detail .tags-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
body.is-workbook-detail .text-tag { padding: 3px 7px; font-size: .72rem; text-decoration: none; border-radius: 5px; }
body.is-workbook-detail .header-toggles { width: auto; margin: 0; padding: 0; flex: 0 1 auto; }
body.is-workbook-detail .study-settings-trigger { height: auto; min-height: 44px; max-width: 100%; font-size: .8rem; white-space: normal; }
body.is-workbook-detail .study-settings-trigger__state { max-width: 180px; }
body.is-workbook-detail .guest-free-notice { background: transparent; border: 0; margin: 12px 0 0; padding: 4px 0; min-height: 44px; font-size: .85rem; width: auto; }
body.is-workbook-detail .workbook-content-section { padding: 0; margin: 0; }
body.is-workbook-detail .wb-list-header { display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; gap: 16px; margin-bottom: 14px; padding: 0; }
body.is-workbook-detail .content-title { font-size: 1.1rem; font-weight: 600; margin: 0; gap: 8px; }
body.is-workbook-detail .problem-count { font-size: .75rem; padding: 3px 8px; border-radius: 6px; }
body.is-workbook-detail .header-right.wb-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: 1; gap: 10px; width: auto; min-width: 0; }
body.is-workbook-detail .wb-toolbar-search { display: flex; flex: 1 1 180px; order: 0; max-width: 280px; min-width: 0; height: 44px; padding: 0 4px 0 12px; border-radius: 10px; }
html.dark body.is-workbook-detail .wb-toolbar-search input.wb-toolbar-search__input { min-width: 0; width: 100%; padding: 0 8px; background: transparent !important; border: 0 !important; font-size: .85rem; box-shadow: none; }
body.is-workbook-detail .detail-search-submit { min-height: 36px; padding: 0 10px; border: 0; border-left: 1px solid var(--wq-border); background: transparent; color: var(--wq-text-soft); font-size: .78rem; cursor: pointer; }
body.is-workbook-detail .wb-toolbar-select { height: 44px; border-radius: 10px; }
body.is-workbook-detail .wb-toolbar-select select { min-height: 44px; }
body.is-workbook-detail .wb-toolbar-perpage { gap: 8px; }
body.is-workbook-detail .wb-toolbar-btn { min-height: 44px !important; height: auto; padding: 8px 12px; font-size: .8rem; }
/* Filters belong to the list: quiet tabs on one shared baseline. */
body.is-workbook-detail .detail-list-tools {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: 0 0 16px; border-bottom: 1px solid var(--wq-border);
}
body.is-workbook-detail nav.detail-filters {
    display: flex; align-items: stretch; gap: 24px; margin: 0 0 -1px; padding: 0;
    width: auto; min-width: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
body.is-workbook-detail .detail-filter {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; box-sizing: border-box; padding: 10px 2px 12px;
    border: 0; border-bottom: 2px solid transparent; border-radius: 0;
    background: transparent; color: var(--wq-text-muted); font-size: .85rem;
    font-weight: 500; text-decoration: none;
}
html.dark body.is-workbook-detail .detail-filter.is-active {
    background: transparent; border-color: var(--wq-accent); color: var(--wq-text); font-weight: 600;
}
body.is-workbook-detail .detail-filter:hover { color: var(--wq-text); }
body.is-workbook-detail .detail-list-tools .wb-toolbar-perpage { gap: 4px; flex-shrink: 0; }
html.dark body.is-workbook-detail .detail-list-tools .wb-toolbar-select {
    height: 44px; border: 0; border-radius: 0; background: transparent !important; box-shadow: none; position: relative;
}
html.dark body.is-workbook-detail .detail-list-tools .wb-toolbar-select select {
    min-height: 44px !important; background-color: transparent !important;
    color: var(--wq-text-muted); font-size: .78rem !important; font-weight: 400;
    padding-left: 4px !important; padding-right: 22px !important; background-image: none !important;
}
body.is-workbook-detail .detail-list-tools .wb-toolbar-select::after {
    content: ''; position: absolute; right: 4px; top: 17px; width: 6px; height: 6px;
    border-right: 1.5px solid var(--wq-text-muted); border-bottom: 1.5px solid var(--wq-text-muted);
    transform: rotate(45deg); pointer-events: none;
}
body.is-workbook-detail .detail-filter:focus-visible,
body.is-workbook-detail .detail-list-tools select:focus-visible { outline: 2px solid var(--wq-accent); outline-offset: 3px; }
body.is-workbook-detail .problem-list { display: grid; gap: 12px; }
body.is-workbook-detail .problem-card { padding: 20px; border-radius: 14px; }
body.is-workbook-detail .problem-header { align-items: flex-start; gap: 10px; }
body.is-workbook-detail .problem-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
body.is-workbook-detail .problem-type { margin: 0; padding: 3px 8px; font-size: .68rem; line-height: 1.4; }
body.is-workbook-detail .problem-text { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; font-size: 1rem; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
body.is-workbook-detail .problem-details { margin-top: 14px; padding-top: 12px; border-top-style: solid; }
body.is-workbook-detail .stats-actions-row { display: flex; align-items: center !important; flex-wrap: wrap !important; margin: 0 !important; gap: 8px 16px !important; }
body.is-workbook-detail .stats-actions-row > .stats-preview { flex: 1 1 260px; }
body.is-workbook-detail .stats-preview { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 8px 16px !important; }
body.is-workbook-detail .stats-preview .stat-item { padding: 0; gap: 5px; background: transparent !important; border: 0 !important; border-radius: 0; min-height: 24px; }
html.dark body.is-workbook-detail .stats-preview .detail-label { display: inline !important; margin: 0; font-size: .73rem; font-weight: 400; color: var(--wq-text-muted) !important; }
html.dark body.is-workbook-detail .stats-preview :is(.stat-value, .answer-value) { background: transparent !important; color: var(--wq-text-soft) !important; border: 0 !important; padding: 0; border-radius: 0; font-size: .76rem; font-weight: 500; }
body.is-workbook-detail .stats-preview .stat-count { font-size: .7rem; }
body.is-workbook-detail .stats-actions-row .problem-actions-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
body.is-workbook-detail .stats-actions-row .bookmark-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 !important; border-radius: 9px; filter: none; }
html.dark body.is-workbook-detail .stats-actions-row .bookmark-btn.is-on { color: var(--wq-accent) !important; background: var(--wq-accent-soft) !important; }
body.is-workbook-detail .bookmark-btn.is-on svg { fill: currentColor; }
body.is-workbook-detail .stats-actions-row .prob-action { height: auto !important; min-height: 44px !important; padding: 8px 10px !important; font-size: .76rem !important; border-radius: 8px; }
body.is-workbook-detail .pagination-container { margin-top: 24px; }
body.is-workbook-detail .pagination { flex-wrap: wrap; gap: 6px; padding: 8px; }
body.is-workbook-detail :is(.page-link, .page-num) { min-height: 44px; min-width: 36px; display: inline-flex; align-items: center; justify-content: center; }
body.is-workbook-detail #bulkActionBar { flex-wrap: wrap; }
/* Folder/PDF modals are secondary tools, sharing the same quiet materials. */
html.dark body.is-workbook-detail :is(.atc-modal-panel, #printModal .modal-container) { background: var(--wq-surface); color: var(--wq-text); border-color: var(--wq-border); }
@media (max-width: 768px) {
    body.is-workbook-detail .workbook-detail-header { padding: 18px 16px; margin: 0 0 24px; border-radius: 16px; }
    body.is-workbook-detail .header-top { margin-bottom: 14px; gap: 10px; }
    body.is-workbook-detail .detail-eyebrow { margin-bottom: 8px; }
    body.is-workbook-detail .workbook-title { font-size: 1.25rem; }
    body.is-workbook-detail .meta-row { font-size: .75rem; gap: 6px 10px; }
    body.is-workbook-detail .meta-row .meta-item:last-child { display: none; }
    body.is-workbook-detail .workbook-meta-info { gap: 16px; }
    body.is-workbook-detail .header-controls-row { gap: 12px; margin-top: 16px; padding-top: 12px; }
    body.is-workbook-detail .description-wrapper { flex: 1 1 140px; }
    body.is-workbook-detail .tags-inline { display: none; }
    body.is-workbook-detail .study-settings-trigger { justify-content: flex-start; }
    body.is-workbook-detail .header-right.wb-toolbar { flex: 1 1 100%; justify-content: space-between; gap: 10px; }
    body.is-workbook-detail .wb-toolbar-search { flex: 1 1 100%; max-width: none; order: -1; }
    body.is-workbook-detail .wb-toolbar-actions { flex: 1; justify-content: flex-end; flex-wrap: wrap; }
    body.is-workbook-detail .wb-toolbar-perpage__label { display: none; }
    body.is-workbook-detail .wb-toolbar-perpage select { font-size: .8rem; }
    body.is-workbook-detail .problem-card { padding: 16px; }
    body.is-workbook-detail .stats-actions-row > .stats-preview { flex: 1 1 180px; }
    body.is-workbook-detail .stats-preview { gap: 6px 12px !important; }
    body.is-workbook-detail .problem-text { font-size: .95rem; }
    body.is-workbook-detail .page-link { padding: 0 10px; font-size: .78rem; }
    body.is-workbook-detail .page-numbers { gap: 2px; }
}

/* Short landscape screens keep the PDF dialog header and close control in view. */
body.is-workbook-detail #printModal { z-index: 2100; padding: 16px; box-sizing: border-box; }
body.is-workbook-detail #printModal .modal-container {
    box-sizing: border-box; width: min(440px, 100%); max-width: 440px;
    max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column; padding: 18px; overflow: hidden;
}
body.is-workbook-detail #printModal .modal-header { flex-shrink: 0; margin-bottom: 12px; gap: 12px; }
body.is-workbook-detail #printModal .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.is-workbook-detail #printModal .close-btn { min-width: 44px; min-height: 44px; color: var(--wq-text-muted); }

/* PDF and study settings share the paper surface and walnut selection tone. */
body.is-workbook-detail :is(#printModal, .study-settings-overlay) {
    z-index: 2100; padding: 16px; box-sizing: border-box;
    background: #11110fe0; backdrop-filter: blur(5px);
}
html.dark body.is-workbook-detail :is(#printModal .modal-container, .study-settings-dialog) {
    box-sizing: border-box; width: min(520px, 100%); max-width: 520px;
    max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column; padding: 0; overflow: hidden;
    border: 1px solid var(--wq-border-strong); border-radius: 18px;
    background: var(--wq-surface); color: var(--wq-text); box-shadow: 0 24px 80px #0006;
}
body.is-workbook-detail :is(#printModal .modal-header, .study-settings-head) {
    flex-shrink: 0; align-items: flex-start; padding: 20px 20px 16px; margin: 0;
    border-bottom: 1px solid var(--wq-border); gap: 12px;
}
body.is-workbook-detail :is(#printDialogTitle, .study-settings-head h2) { margin: 0; font-size: 1.1rem; font-weight: 600; line-height: 1.5; color: var(--wq-text); }
body.is-workbook-detail #printDialogDescription { margin: 6px 0 0; font-size: .8rem; color: var(--wq-text-muted); line-height: 1.6; word-break: keep-all; }
body.is-workbook-detail :is(#printModal .close-btn, .study-settings-close) { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin: -6px -8px 0 0; border-radius: 8px; color: var(--wq-text-muted); }
body.is-workbook-detail #printModal .modal-body { display: flex; min-height: 0; overflow: hidden; }
body.is-workbook-detail #printForm { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0; }
body.is-workbook-detail .pdf-options-content { overflow-y: auto; min-height: 0; padding: 20px; overscroll-behavior: contain; }
body.is-workbook-detail .pdf-option-section { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
body.is-workbook-detail .pdf-option-section:last-child { margin-bottom: 0; }
body.is-workbook-detail .pdf-option-section legend { float: none; width: auto; padding: 0; margin: 0 0 10px; color: var(--wq-text-soft); font-size: .83rem; font-weight: 600; }
body.is-workbook-detail .pdf-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.is-workbook-detail .pdf-choice { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 12px; box-sizing: border-box; border: 1px solid var(--wq-border); border-radius: 10px; color: var(--wq-text-soft); cursor: pointer; font-size: .85rem; background: transparent; }
body.is-workbook-detail .pdf-choice:has(input:checked) { background: var(--wq-accent-soft); border-color: var(--wq-accent); color: var(--wq-text); }
body.is-workbook-detail .pdf-choice:has(input:focus-visible) { outline: 2px solid var(--wq-accent); outline-offset: 2px; }
body.is-workbook-detail .pdf-choice input { width: 16px; height: 16px; flex-shrink: 0; margin: 0; accent-color: var(--wq-accent); }
body.is-workbook-detail .pdf-choice > span { min-width: 0; line-height: 1.5; }
body.is-workbook-detail .pdf-choice strong { display: block; font-weight: 500; font-size: .85rem; }
body.is-workbook-detail .pdf-choice small { display: block; margin-top: 3px; color: var(--wq-text-muted); font-size: .72rem; line-height: 1.6; word-break: keep-all; }
body.is-workbook-detail #customInputWrapper { margin-top: 12px; }
body.is-workbook-detail #customInputWrapper :is(label, span) { color: var(--wq-text-muted); font-size: .8rem; }
html.dark body.is-workbook-detail #customCountInput { width: 100px; min-height: 44px; padding: 8px 10px; margin: 0 8px; background: var(--wq-bg) !important; border: 1px solid var(--wq-border-strong); color: var(--wq-text); border-radius: 8px; }
body.is-workbook-detail #pdfPickerWrapper { margin: -8px 0 24px; }
body.is-workbook-detail .pdf-picker-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: .78rem; color: var(--wq-text-muted); }
body.is-workbook-detail #pdfPickerCount { color: var(--wq-accent); font-weight: 600; }
body.is-workbook-detail #pdfPickerList { max-height: 240px; overflow-y: auto; border: 1px solid var(--wq-border); border-radius: 10px; background: var(--wq-bg); }
body.is-workbook-detail .pdf-picker-item { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 12px; cursor: pointer; border-bottom: 1px solid var(--wq-border); }
body.is-workbook-detail .pdf-picker-item:last-child { border: 0; }
body.is-workbook-detail .pdf-picker-item:has(input:checked) { background: var(--wq-accent-soft); }
body.is-workbook-detail .pdf-picker-cb { width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; accent-color: var(--wq-accent); }
body.is-workbook-detail :is(#pdfPickerLoading, #pdfPickerError) { padding: 16px; font-size: .8rem; line-height: 1.6; color: var(--wq-text-muted); }
body.is-workbook-detail #pdfPickerRetry { display: block; min-height: 44px; margin: 8px auto 0; padding: 8px 12px; color: var(--wq-text); background: transparent; border: 1px solid var(--wq-border-strong); border-radius: 8px; }
body.is-workbook-detail .pdf-footer { flex-shrink: 0; padding: 14px 20px 20px; border-top: 1px solid var(--wq-border); }
body.is-workbook-detail .pdf-footer p { margin: 0 0 12px; font-size: .74rem; color: var(--wq-text-muted); line-height: 1.6; }
body.is-workbook-detail #printModal .modal-actions { display: flex; gap: 10px; margin: 0; padding: 0; }
html.dark body.is-workbook-detail #printModal :is(.submit-btn, .cancel-btn) { min-height: 46px; border-radius: 10px; padding: 10px 16px; font-size: .86rem; font-weight: 500; box-shadow: none; }
html.dark body.is-workbook-detail #printModal .submit-btn { flex: 1; background: var(--wq-wood-fill) !important; border: 1px solid var(--wq-accent); color: var(--wq-on-wood) !important; }
html.dark body.is-workbook-detail #printModal .cancel-btn { flex: 0 0 auto; background: transparent !important; border: 1px solid var(--wq-border-strong); color: var(--wq-text-soft); }
body.is-workbook-detail .study-settings-list { overflow-y: auto; min-height: 0; padding: 4px 20px 12px; gap: 0; }
html.dark body.is-workbook-detail .study-setting-item,
html.dark body.is-workbook-detail .study-setting-item:is(.is-on, :has(input:checked)):hover {
    padding: 16px 0; min-height: 64px; border: 0; border-bottom: 1px solid var(--wq-border);
    border-radius: 0; background: transparent; box-shadow: none; gap: 16px;
}
body.is-workbook-detail .study-setting-item:last-child { border-bottom: 0; }
html.dark body.is-workbook-detail .study-setting-copy strong,
html.dark body.is-workbook-detail .study-setting-item:is(.is-on, :has(input:checked)) .study-setting-copy strong { color: var(--wq-text); font-size: .9rem; font-weight: 500; line-height: 1.5; }
body.is-workbook-detail .study-setting-copy small { color: var(--wq-text-muted); font-size: .75rem; line-height: 1.65; margin-top: 4px; }
body.is-workbook-detail .study-setting-item .toggle-switch { flex: 0 0 40px; width: 40px; height: 24px; }
html.dark body.is-workbook-detail .study-setting-item .slider { background: var(--wq-border-strong); }
html.dark body.is-workbook-detail .study-setting-item input:checked + .slider { background: var(--wq-accent); }
html.dark body.is-workbook-detail .study-setting-item .slider::before { background: var(--wq-text); width: 18px; height: 18px; left: 3px; bottom: 3px; }
body.is-workbook-detail .study-setting-item input:checked + .slider::before { transform: translateX(16px); }
body.is-workbook-detail .study-setting-item input:focus-visible + .slider { outline: 2px solid var(--wq-accent); outline-offset: 3px; box-shadow: none; }
@media (max-width: 360px) {
    body.is-workbook-detail .pdf-choice-grid { grid-template-columns: 1fr; }
}

body.is-workbook-detail .study-setting-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-width: 0; }
/* Legacy global modal colors use !important; keep both dialogs on paper. */
html.dark body.is-workbook-detail #printModal .modal-container {
    background: var(--wq-surface) !important; color: var(--wq-text) !important;
    border-color: var(--wq-border-strong) !important;
}
html.dark body.is-workbook-detail #printDialogTitle { color: var(--wq-text) !important; }
html.dark body.is-workbook-detail .study-setting-item .slider { background: var(--wq-border-strong) !important; }
html.dark body.is-workbook-detail .study-setting-item input:checked + .slider { background: var(--wq-accent) !important; }
html.dark body.is-workbook-detail #printModal .modal-header { border-bottom-color: var(--wq-border) !important; }
