.book-flow-modal .wb-modal-card{max-height:88dvh;overflow:auto;width:min(600px,100%)}
.book-flow-modal label{display:block;margin:14px 0}
.book-flow-modal input:not([type=checkbox]),.book-flow-modal select{width:100%;box-sizing:border-box;min-height:46px;margin-top:7px}
.book-flow-modal [type=checkbox]{width:22px;height:22px;vertical-align:middle;margin-right:10px}
.book-flow-modal [data-error]{color:#b91c1c;white-space:pre-wrap}
.book-flow-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.book-flow-quick{display:flex;flex-wrap:wrap;gap:8px}.book-flow-quick button{min-width:44px;min-height:44px}
.book-flow-test-choices{max-height:240px;overflow:auto;border:1px solid currentColor;border-radius:12px;padding:10px}
.book-flow-test-choices label{padding:8px}.book-flow-test-choices [hidden]{display:none}
.book-flow-topic-actions{padding:14px;display:flex;flex-wrap:wrap;gap:10px}.book-flow-topic-actions p{width:100%;margin:0}
.book-flow-history{padding:16px}.book-flow-history p{line-height:1.6}.book-flow-history summary{cursor:pointer;font-weight:700}
.book-flow-notice{border:1px solid #dfc578}.book-flow-modal fieldset{border-radius:12px;margin:12px 0}

summary.book-topic-head{cursor:pointer;list-style:none}summary.book-topic-head::after{content:"＋";font-weight:700}details[open]>summary.book-topic-head::after{content:"−"}

.book-unit-topics{padding:0 14px 12px}.book-unit-topics>.book-topic-card{margin:12px 0;border:1px solid #b5bdc8;border-radius:16px}.book-unit-topics .book-topic-head{gap:10px;padding:16px}.book-unit-test-label{margin:18px 20px 10px}.book-topic-head>strong{min-width:0;overflow-wrap:anywhere}.book-topic-head>small{flex:0 1 40%;font-size:.85em;line-height:1.35}

.book-test-question-field{display:grid!important;grid-template-columns:minmax(0,1fr) 110px;gap:12px;align-items:center}.book-test-question-field input{margin-top:0!important}.book-flow-modal [data-test-question-fields] summary{font-weight:700;cursor:pointer}.book-test-row{width:100%;min-height:80px;text-align:left;display:flex;align-items:center;gap:14px}.book-test-row>span:nth-child(2){flex:1;min-width:0}.book-test-row b,.book-test-row small{display:block;overflow-wrap:anywhere}.book-test-row small{margin-top:6px}

/* Selection remains visible across themes and on narrow phone screens. */
.book-flow-modal [hidden]{display:none!important}
.book-flow-modal .book-flow-quick{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.book-flow-modal .book-flow-quick button{width:auto!important;min-width:0;min-height:48px;padding:10px 8px;border:3px solid transparent!important;margin:0;box-shadow:none}
.book-flow-modal .book-flow-quick [data-more]{grid-column:1/-1}
.book-flow-modal .book-flow-quick button[aria-pressed="true"]{background:#166534!important;color:#fff!important;border-color:#fff!important;box-shadow:0 0 0 2px #166534!important;font-weight:800}
.book-flow-modal .book-flow-quick button:focus-visible{outline:3px solid currentColor;outline-offset:4px}
.book-flow-selection-summary{font-weight:700;line-height:1.5;padding:10px 12px;border:1px solid currentColor;border-radius:10px;overflow-wrap:anywhere}
.book-flow-test-choices label.is-selected{font-weight:700;border-left:4px solid currentColor;padding-left:10px}

/* Book, chapter and test use the same readable gold badge in every student theme. */
.study-practice-source .study-source-badge{display:flex!important;align-items:center;gap:10px;width:100%;max-width:100%;box-sizing:border-box;margin:12px 0;padding:12px 14px;border:2px solid #ffe49a!important;border-radius:14px;background:linear-gradient(115deg,#ffe493 0%,#f4c65f 100%)!important;color:#153e46!important;box-shadow:0 3px 10px rgba(0,0,0,.12);text-align:left;line-height:1.4}
.study-practice-source .study-source-badge-icon{display:block!important;flex:0 0 26px;width:26px;height:26px;color:#194e59!important}
.study-practice-source .study-source-badge-label{display:block!important;flex:1;min-width:0;margin:0!important;color:#153e46!important;font-size:14px;font-weight:750;line-height:1.45;overflow-wrap:anywhere}
.study-practice-source .study-source-badge-test{display:block!important;flex:0 1 auto;max-width:40%;margin:0!important;padding:7px 10px;border-radius:11px;background:#d9a43b!important;color:#172c30!important;font-size:14px;font-weight:800;line-height:1.4;text-align:center;overflow-wrap:anywhere}
.study-practice-source .study-source-note{display:block;margin-top:7px}
@media(max-width:380px){.study-practice-source .study-source-badge{gap:8px;padding:10px}.study-practice-source .study-source-badge-icon{flex-basis:22px;width:22px;height:22px}.study-practice-source .study-source-badge-label,.study-practice-source .study-source-badge-test{font-size:13px}}
