/* Compact chapter cards; one independent, complete topic list at a time. */
html{scrollbar-gutter:stable}
html.qb-chapter-open{overflow:hidden}
#grid{align-items:start}
#grid .qb-ch{cursor:default;padding:14px 16px 10px;border-radius:14px;box-shadow:-2px 4px 10px #0b4a3d12}
#grid .qb-ch:hover{transform:none;box-shadow:-3px 5px 13px #0b4a3d1c}
#grid .qb-ch .top{position:static;display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px;padding:0;border:0;background:transparent;min-height:0}
#grid .qb-ch .num{white-space:nowrap;font:600 10px/1.4 Arial,Helvetica,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:#0b4a3d}
#grid .qb-ch .cnt{font:11px/1.4 Arial,Helvetica,sans-serif;letter-spacing:0;color:#617469;text-align:right}
#grid .qb-ch h3{margin:7px 0 10px;font-size:18px;line-height:1.22}
#grid .qb-ch-actions{display:flex;flex-wrap:nowrap;gap:8px;margin:0}
#grid .qb-ch-btn{flex:0 1 auto;min-width:0;min-height:34px;padding:6px 12px;border-radius:8px;font:700 12px/1.3 Arial,Helvetica,sans-serif;white-space:nowrap;touch-action:manipulation}
#grid .qb-ch-btn:focus-visible{outline:2px solid #0b4a3d;outline-offset:3px}
#grid .qb-ch-browse{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;margin-top:9px;padding:7px 0 0;border:0;border-top:1px solid #dae3dc;background:transparent;color:#0b4a3d;cursor:pointer;font:600 12px/1.4 Arial,Helvetica,sans-serif;text-align:left;min-height:32px}
#grid .qb-ch-browse>span:last-child{font-size:19px;line-height:1}
#grid .qb-ch-browse:hover{color:#176b56}
#grid .qb-ch-browse:focus-visible{outline:2px solid #0b4a3d;outline-offset:4px;border-radius:4px}
.qb-chapter-dialog{box-sizing:border-box;width:min(960px,calc(100vw - 40px));max-width:none;max-height:min(800px,calc(100dvh - 48px));padding:0;border:1px solid #c7d6ce;border-left:3px solid #0b4a3d;border-radius:18px;background:#fffdf8;color:#143b30;box-shadow:-5px 10px 30px #0b4a3d26;overflow:hidden;font-family:Arial,Helvetica,sans-serif}
.qb-chapter-dialog[open]{display:flex;flex-direction:column}
.qb-chapter-dialog::backdrop{background:#193a3247;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.qb-chapter-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:none;padding:16px 20px 12px;background:#fffdf8;border-bottom:1px solid #dce5df}
.qb-chapter-dialog>header>div{min-width:0}
.qb-chapter-dialog #chapterTopicsEyebrow{margin:0 0 5px;color:#4c6b5f;font:600 10px/1.4 Arial;letter-spacing:.1em;text-transform:uppercase}
.qb-chapter-dialog #chapterTopicsTitle{margin:0;color:#0b4a3d;font:600 clamp(20px,2.2vw,25px)/1.18 Georgia,'Times New Roman',serif;overflow-wrap:anywhere}
.qb-chapter-dialog #closeChapterTopics{flex:none;display:grid;place-items:center;width:44px;height:44px;min-width:44px;border:1px solid #c7d6cd;border-radius:50%;background:white;color:#0b4a3d;font:24px/1 Arial;cursor:pointer;padding:0}
.qb-chapter-search{display:flex;align-items:center;gap:10px;padding:10px 20px;background:#fff;flex:none;border-bottom:1px solid #e0e8e2}
.qb-chapter-search input{box-sizing:border-box;flex:1;min-width:0;height:40px;border:1px solid #cbd9cf;border-radius:8px;padding:8px 11px;background:#fbfcfa;font:14px/1.35 Arial;color:#143b30}
.qb-chapter-search button{min-height:40px;border:0;background:none;color:#0b4a3d;font:600 12px Arial;cursor:pointer;padding:0 4px}
.qb-chapter-search #chapterTopicsCount{flex:none;white-space:nowrap;color:#546f61;font:12px Arial}
.qb-chapter-dialog #chapterTopicsList{list-style:none;margin:0;padding:0 20px;overflow:auto;min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y pinch-zoom;scrollbar-width:thin;scrollbar-color:#809c8d #f5f7f4;background:#fff}
.qb-chapter-topic{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:12px 0;border-bottom:1px solid #e2e9e3}
.qb-chapter-topic:last-child{border-bottom:0}
.qb-chapter-topic-copy{min-width:0}
.qb-chapter-topic h3{margin:0 0 5px;font:600 15px/1.35 Arial;color:#183e31;overflow-wrap:anywhere}
.qb-chapter-topic p{margin:0;font:11px/1.4 Arial;color:#5c7165;overflow-wrap:anywhere}
.qb-chapter-topic p>span{margin-inline:3px;color:#a4b4aa}
.qb-chapter-topic-actions{display:flex;align-items:center;gap:6px;flex:none}
.qb-chapter-topic-actions :is(button,a){box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 10px;border:1px solid #c6d9cd;border-radius:8px;background:#fff;color:#0b4a3d;text-decoration:none;white-space:nowrap;font:600 12px/1.25 Arial;cursor:pointer;touch-action:manipulation}
.qb-chapter-topic-actions .qb-topic-tutor{background:#0b4a3d;border-color:#0b4a3d;color:white}
.qb-chapter-topic-actions :is(button,a):hover{box-shadow:0 2px 5px #0b4a3d1a;filter:brightness(.98)}
.qb-chapter-dialog :is(button,a,input):focus-visible{outline:2px solid #0b4a3d;outline-offset:2px}
.qb-chapter-topic.is-highlighted{background:#eff7f2}
.qb-chapter-empty{padding:26px 0;color:#546f61;font:14px/1.5 Arial}
.qb-chapter-sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(pointer:coarse){#grid .qb-ch-browse,#grid .qb-ch-btn,.qb-chapter-topic-actions :is(button,a),.qb-chapter-search button{min-height:44px}.qb-chapter-search input{height:44px;font-size:16px}}
@media(max-width:700px){.qb-chapter-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 32px);border-radius:14px}.qb-chapter-dialog>header{padding:12px 14px;gap:12px}.qb-chapter-search{padding:8px 14px;gap:8px}.qb-chapter-search input{font-size:16px}.qb-chapter-dialog #chapterTopicsList{padding:0 14px}.qb-chapter-topic{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 0}.qb-chapter-topic-actions{flex-wrap:wrap;gap:6px}.qb-chapter-topic-actions :is(button,a){min-height:44px;padding-inline:10px}.qb-chapter-topic h3{font-size:14px}.qb-chapter-search #chapterTopicsCount{font-size:11px}}
@media(max-width:360px){.qb-chapter-search{flex-wrap:wrap}.qb-chapter-search input{flex-basis:70%}.qb-chapter-search #chapterTopicsCount{margin-left:auto}.qb-chapter-topic-actions :is(button,a){padding-inline:8px;font-size:11px}}
@media(max-height:500px) and (min-width:701px){.qb-chapter-dialog{max-height:calc(100dvh - 16px)}.qb-chapter-dialog>header{padding:8px 16px}.qb-chapter-dialog #chapterTopicsTitle{font-size:20px}.qb-chapter-search{padding:6px 16px}.qb-chapter-topic{padding:8px 0}}
@media(prefers-reduced-motion:no-preference){.qb-chapter-dialog[open]{animation:qb-chapter-reveal .16s ease-out}@keyframes qb-chapter-reveal{from{opacity:0;transform:translateY(6px) scale(.99)}to{opacity:1;transform:none}}}
