/* Topic setup and test library. No global reset or player styling. */
#chapter-studio,
#chapter-test-library {
  --cs-ink: #f1f3f6;
  --cs-copy: #c5ccd5;
  --cs-muted: #9da7b6;
  --cs-line: #343c47;
  --cs-accent: #efa77f;
  --cs-green: #a2d6bd;
  --cs-cyan: #72e5e0;
  color: var(--cs-ink);
  font-family: Inter, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  max-width: 1320px;
  margin: 0 auto;
  padding: 4px 0 34px;
  min-width: 0;
}
#chapter-studio *, #chapter-studio *::before, #chapter-studio *::after,
#chapter-test-library *, #chapter-test-library *::before, #chapter-test-library *::after { box-sizing: border-box; }
#chapter-studio :is(button, input), #chapter-test-library button { font: inherit; }
#chapter-studio :is(button, summary), #chapter-test-library button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#chapter-studio :is(button, summary):not(:disabled), #chapter-test-library button:not(:disabled) { cursor: pointer; }
#chapter-studio :is(a, button, input, summary):focus-visible,
#chapter-test-library :is(a, button):focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 4px; }
#chapter-studio [hidden], #chapter-test-library [hidden] { display: none !important; }
#chapter-studio :is(h1, h2, h3, p), #chapter-test-library :is(h1, h2, h3, p) { overflow-wrap: break-word; }
#chapter-studio svg, #chapter-test-library svg { flex-shrink: 0; }
#chapter-studio .cs-topbar, #chapter-test-library .cs-topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 21px; }
#chapter-studio .cs-back, #chapter-test-library .cs-back { display: inline-flex; align-items: center; flex-shrink: 0; gap: 9px; min-height: 44px; padding: 0; margin: 0; color: #b9c2ce; font-size: 13px; text-decoration: none; }
#chapter-studio .cs-back:hover, #chapter-test-library .cs-back:hover { color: #fff; }
#chapter-studio .cs-back svg, #chapter-test-library .cs-back svg { width: 17px; height: 17px; }
#chapter-studio .cs-flow, #chapter-test-library .cs-flow { display: flex; gap: 27px; align-items: center; margin: 0; padding: 0; list-style: none; }
#chapter-studio .cs-flow li, #chapter-test-library .cs-flow li { display: flex; align-items: center; gap: 8px; position: relative; color: #8f99a8; font-size: 11px; line-height: 1.4; white-space: nowrap; }
#chapter-studio .cs-flow li + li::before, #chapter-test-library .cs-flow li + li::before { content: ''; position: absolute; width: 13px; height: 1px; background: #3f4855; left: -21px; top: 50%; }
#chapter-studio .cs-flow-number, #chapter-test-library .cs-flow-number { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #38414e; border-radius: 50%; font-size: 9px; font-variant-numeric: tabular-nums; }
#chapter-studio .cs-flow [aria-current], #chapter-test-library .cs-flow [aria-current] { color: #eef2f7; }
#chapter-studio .cs-flow [aria-current] .cs-flow-number, #chapter-test-library .cs-flow [aria-current] .cs-flow-number { border-color: #d7dde7; background: #d7dde7; color: #171c24; }
#chapter-test-library .cs-flow a { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; color: #bec7d2; text-decoration: none; }
#chapter-test-library .cs-flow a:hover { color: #fff; }
#chapter-test-library .cs-flow .is-complete .cs-flow-number { color: var(--cs-green); border-color: #455d53; }
#chapter-test-library .cs-flow .cs-flow-number svg { width: 13px; height: 13px; }

/* The original chapter illustration and difficulty slider retain their behavior. */
#chapter-studio .topic-hero.cs-hero { display: grid; grid-template-columns: 88px minmax(0,1fr); align-items: center; gap: 24px; min-height: 148px; padding: 24px 28px; margin: 0; border: 1px solid #46505d; border-radius: 16px; background: linear-gradient(135deg, #3b3f45 0%, #21262d 36%, #0c1117 78%); box-shadow: inset 0 1px 0 #ffffff08; overflow: hidden; }
#chapter-studio .topic-hero-art.cs-art { display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; padding: 0; color: #d7dee8; border: 1px solid #46505e; border-radius: 14px; background: #0d141c; }
#chapter-studio .topic-hero-art.cs-art svg { width: 83px; height: 66px; display: block; }
#chapter-studio .topic-hero-copy.cs-hero-copy { min-width: 0; }
#chapter-studio .topic-hero-copy .eyebrow { display: block; margin: 0 0 9px; color: #b4becb; font-size: 10px; font-weight: 650; letter-spacing: 1.3px; line-height: 1.5; }
#chapter-studio .topic-hero-copy h1 { margin: 0; color: #f3f5f8; font: 730 clamp(26px, 2.7vw, 37px)/1.16 Inter, system-ui, sans-serif; letter-spacing: -1.25px; }
#chapter-studio .topic-hero-copy p { display: block; margin: 10px 0 0; color: #b6c0ce; font-size: 13px; line-height: 1.6; max-width: 74ch; }
#chapter-studio .topic-choice-stage.cs-choice-stage { display: grid; grid-template-columns: minmax(0,.95fr) minmax(0,1.05fr); gap: 0; margin: 20px 0 0; padding: 0; border: 1px solid #3d4652; border-radius: 16px; background: linear-gradient(130deg,#1c242d 0%,#111820 45%,#090e14 100%); overflow: hidden; box-shadow: inset 0 1px 0 #ffffff05; }
#chapter-studio .topic-choice-stage.cs-choice-stage > section { min-width: 0; padding: 28px; }
#chapter-studio .topic-difficulty-section.cs-difficulty-section { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; border-right: 1px solid #343e4a; border-bottom: 0; }
#chapter-studio .cs-section-heading { display: flex; align-items: center; gap: 13px; margin: 0 0 28px; }
#chapter-studio .cs-step-mark { display: grid; place-items: center; width: 37px; height: 37px; flex-shrink: 0; border: 1px solid #58616d; border-radius: 11px; background: #d9e1ec08; color: #b5becb; font-size: 12px; font-variant-numeric: tabular-nums; }
#chapter-studio .cs-eyebrow, #chapter-test-library .cs-eyebrow { display: block; color: #aab5c3; font-size: 10px; font-weight: 650; letter-spacing: 1.45px; line-height: 1.5; text-transform: uppercase; margin: 0 0 5px; }
#chapter-studio .cs-section-heading h2 { color: #eef2f7; font: 650 24px/1.2 Inter, system-ui, sans-serif; letter-spacing: -.75px; margin: 0; }
#chapter-studio .cs-slider-slot { min-width: 0; width: 100%; max-width: 460px !important; padding: 0; margin: 0; }
#chapter-studio .cs-slider-slot .mega-difficulty { width: 100%; max-width: 460px; margin: 0; }
#chapter-studio .cs-difficulty-note { color: #9dabb9; font-size: 12px; line-height: 1.6; margin: 18px 0 0; }
#chapter-studio .cs-selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 18px; }
#chapter-studio .cs-selection-heading .cs-eyebrow { margin: 0; }
#chapter-studio .cs-level-tag, #chapter-test-library .cs-level-tag { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; border: 1px solid #395b61; border-radius: 6px; color: #a0e4e3; background: #16383c48; font-size: 10px; font-weight: 650; line-height: 1.4; }
#chapter-studio .cs-preview { display: grid; grid-template-columns: minmax(0,1fr) minmax(86px,.56fr); gap: 20px; padding: 0 0 20px; }
#chapter-studio .cs-preview-size { display: grid; grid-template-columns: 23px minmax(0,1fr); align-content: start; align-items: center; column-gap: 9px; }
#chapter-studio .cs-preview-icon { display: inline-flex; color: #c7d2dd; }
#chapter-studio .cs-preview-icon svg { width: 22px; height: 22px; }
#chapter-studio .cs-preview-size > strong { min-width: 0; font-size: clamp(23px,2.4vw,31px); font-weight: 700; line-height: 1.15; letter-spacing: -.9px; color: #f3f6fa; overflow-wrap: break-word; }
#chapter-studio .cs-preview-meta { grid-column: 2; color: #a8b5c5; font-size: 11px; line-height: 1.55; margin-top: 7px; }
#chapter-studio .cs-preview-time { min-width: 0; display: grid; grid-template-columns: 18px minmax(0,1fr); align-content: start; align-items: center; gap: 5px 7px; border-left: 1px solid #35404d; padding-left: 18px; }
#chapter-studio .cs-preview-time svg { width: 17px; height: 17px; color: #bcc9d8; }
#chapter-studio .cs-preview-time strong { font-size: 20px; font-weight: 650; line-height: 1.3; color: #e7edf5; letter-spacing: -.6px; overflow-wrap: break-word; }
#chapter-studio .cs-preview-time > span { grid-column: 2; color: #9eabba; font-size: 10px; }
#chapter-studio .cs-inventory { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 14px 0 16px; margin: 0; border-top: 1px solid #2b3541; border-bottom: 1px solid #2b3541; }
#chapter-studio .cs-inventory > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#chapter-studio .cs-inventory strong { color: #dae2ec; font-size: 16px; font-weight: 650; letter-spacing: -.25px; font-variant-numeric: tabular-nums; }
#chapter-studio .cs-inventory span { color: #9faebd; font-size: 10px; line-height: 1.45; }
#chapter-studio .cs-selection-action { display: flex; align-items: center; gap: 17px; margin: 20px 0 0; }
#chapter-studio .cs-primary { display: inline-flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 26px; min-width: 180px; min-height: 46px; padding: 12px 16px; margin: 0; border: 1px solid #dce3ee; border-radius: 9px; color: #141c26; background: linear-gradient(130deg,#f1f4f8,#ccd5e1); font-size: 12px; font-weight: 700; line-height: 1.4; box-shadow: 0 1px 0 #ffffff25; }
#chapter-studio .cs-primary svg { width: 18px; height: 18px; }
#chapter-studio .cs-primary:hover:not(:disabled) { background: #fff; color: #0d1420; border-color: #fff; }
#chapter-studio .cs-primary:disabled { opacity: .5; cursor: default; }
#chapter-studio .cs-action-note { min-width: 0; margin: 0; color: #9eabbc; font-size: 10px; line-height: 1.6; }
#chapter-studio .cs-test-details { margin: 16px 0 0; padding: 0; border: 0; border-top: 1px solid #2b3541; background: none; }
#chapter-studio .cs-test-details > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 44px; margin: 0; color: #aab8c8; font-size: 11px; font-weight: 500; }
#chapter-studio .cs-test-details > summary::-webkit-details-marker { display: none; }
#chapter-studio .cs-test-details > summary svg { width: 14px; height: 14px; transform: rotate(90deg); }
#chapter-studio .cs-test-details[open] > summary svg { transform: rotate(-90deg); }
#chapter-studio .cs-test-details > div { padding: 0 0 5px; }
#chapter-studio .cs-test-details p { margin: 0 0 9px; color: #a7b4c4; font-size: 11px; line-height: 1.65; }
#chapter-studio .cs-test-details p strong { color: #d9e2ed; }
#chapter-studio .preparation-feedback { margin-top: 14px; }

/* Chapter test cards follow a connected sequence, with controls kept in one place. */
#chapter-test-library .cs-library-header { display: flex; align-items: center; gap: 20px; padding: 24px; border: 1px solid #434b58; border-radius: 15px; background: linear-gradient(130deg,#2b3038,#151b23 65%,#0e141c); }
#chapter-test-library .cs-library-art { display: grid; place-items: center; flex: 0 0 76px; width: 76px; height: 76px; background: #0c141d; border: 1px solid #3a4959; border-radius: 12px; color: #cad7e6; }
#chapter-test-library .cs-library-art svg { width: 73px; height: 58px; }
#chapter-test-library .cs-library-copy { flex: 1 1 auto; min-width: 0; }
#chapter-test-library .cs-library-header h1 { margin: 5px 0 12px; color: #f1f4f8; font: 700 clamp(23px,2.5vw,33px)/1.18 Inter,system-ui,sans-serif; letter-spacing: -1px; }
#chapter-test-library .cs-library-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: #a9b5c5; font-size: 11px; }
#chapter-test-library .cs-library-meta > span:last-child { color: #8e9caf; }
#chapter-test-library .cs-library-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 96px; margin-left: 10px; padding-left: 22px; border-left: 1px solid #333d4b; color: #a8b4c4; font-size: 10px; }
#chapter-test-library .cs-library-progress > strong { display: block; color: #e6edf6; font-size: 27px; font-weight: 650; letter-spacing: -.8px; line-height: 1.2; font-variant-numeric: tabular-nums; }
#chapter-test-library .cs-library-progress strong span { color: #8593a5; font-size: 16px; font-weight: 500; }
#chapter-test-library .cs-progress-track { width: 79px; height: 3px; border-radius: 5px; margin: 12px 0 0; background: #2d3a46; overflow: hidden; }
#chapter-test-library .cs-progress-track i { display: block; height: 100%; border-radius: inherit; background: #8dcbb2; }
#chapter-test-library .cs-library-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 22px 0 0; }
#chapter-test-library .cs-filters { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
#chapter-test-library .cs-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 14px; border: 1px solid #323d4b; border-radius: 8px; background: #101720; color: #b6c3d4; font-size: 11px; font-weight: 550; white-space: nowrap; }
#chapter-test-library .cs-filters button > span { color: #8496ad; font-size: 10px; font-weight: 600; }
#chapter-test-library .cs-filters [aria-pressed=true] { background: #dce3ed; border-color: #dce3ed; color: #202a39; }
#chapter-test-library .cs-filters [aria-pressed=true] > span { color: #566477; }
#chapter-test-library .cs-filters button:hover:not([aria-pressed=true]):not(:disabled) { color: #e7eef7; border-color: #738399; }
#chapter-test-library .cs-filters button:disabled { cursor: default; opacity: .6; }
#chapter-test-library .cs-range { margin: 0; color: #9cacbf; font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
#chapter-test-library :is(.preparation-feedback,.topic-prepare-status) { margin: 16px 0 0; padding: 12px 14px; border: 1px solid #405b63; border-radius: 9px; color: #c8e6e9; background: #143039; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#chapter-test-library :is(.preparation-feedback,.topic-prepare-status)[data-state=error] { border-color: #78505a; color: #f0c7ce; background: #301f27; }
#chapter-test-library :is(.preparation-feedback,.topic-prepare-status)[hidden] { display: none; }
#chapter-test-library .cs-library-guide { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; margin: 20px 0 15px; color: #a0b0c2; font-size: 11px; }
#chapter-test-library .cs-library-guide > span:last-child { color: #7f90a7; }
#chapter-test-library .cs-test-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px 16px; list-style: none; margin: 0; padding: 12px 0 0 17px; position: relative; }
#chapter-test-library .cs-test-grid::before { content: ''; position: absolute; left: 0; top: 0; bottom: 80px; width: 1px; background: linear-gradient(#5d6571,#343d4c 75%,transparent); }
#chapter-test-library .cs-test-node { display: flex; position: relative; min-width: 0; padding: 0; margin: 0; }
#chapter-test-library .cs-test-node::before { content: ''; position: absolute; height: 1px; top: -12px; left: -17px; right: -1px; background: #343e4b; }
#chapter-test-library .cs-test-node::after { content: ''; position: absolute; height: 12px; width: 1px; top: -12px; left: 50%; background: #465162; }
#chapter-test-library .cs-test-card { display: flex; flex-direction: column; width: 100%; min-width: 0; min-height: 180px; padding: 17px 18px 13px; border: 1px solid #354152; border-radius: 12px; background: linear-gradient(145deg,#1b2430,#101720); box-shadow: inset 0 1px 0 #ffffff05; }
#chapter-test-library .cs-test-node.is-next .cs-test-card { border-color: #88715b; background: linear-gradient(140deg,#302b28,#181d25 90%); box-shadow: inset 3px 0 0 #d99a73; }
#chapter-test-library .cs-test-node.is-completed .cs-test-card { border-color: #3d5c53; background: linear-gradient(145deg,#1b2c2b,#111a21); }
#chapter-test-library .cs-test-node.is-locked .cs-test-card { background: linear-gradient(145deg,#141d28,#0e151e); border-color: #2b3747; }
#chapter-test-library .cs-test-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#chapter-test-library .cs-test-top h3 { margin: 0; color: #e5ecf6; font: 650 18px/1.35 Inter,system-ui,sans-serif; letter-spacing: -.55px; font-variant-numeric: tabular-nums; }
#chapter-test-library .is-locked .cs-test-top h3 { color: #becbdc; }
#chapter-test-library .cs-access { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 6px; border: 1px solid #45576e; border-radius: 5px; color: #a2b2c8; background: #22314655; font-size: 9px; font-weight: 550; line-height: 1.2; }
#chapter-test-library .cs-access.is-free { border-color: #5d6c7d; color: #dce5f1; background: #42526640; }
#chapter-test-library .cs-test-status { display: flex; align-items: center; gap: 5px; min-height: 28px; margin: 6px 0 11px; color: #97a8bd; font-size: 10px; line-height: 1.45; }
#chapter-test-library .cs-test-status svg { width: 12px; height: 12px; }
#chapter-test-library .cs-state-dot { flex: 0 0 4px; width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
#chapter-test-library .is-next .cs-test-status { color: #dfb28e; }
#chapter-test-library .is-completed .cs-test-status { color: #9ed1ba; }
#chapter-test-library .cs-test-format { display: flex; align-items: flex-start; gap: 7px; color: #b7c5d8; font-size: 11px; line-height: 1.5; }
#chapter-test-library .cs-test-format > svg { width: 14px; height: 14px; margin-top: 1px; color: #8e9fb5; }
#chapter-test-library .cs-test-format small { display: block; margin-top: 3px; color: #8da0b7; font-size: 10px; }
#chapter-test-library .cs-test-action { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin: auto 0 0; padding: 15px 0 0; border: 0; border-radius: 0; background: none; color: #d8e3f3; box-shadow: none; font-size: 11px; font-weight: 650; line-height: 1.4; text-align: left; }
#chapter-test-library .cs-test-action > svg { width: 16px; height: 16px; }
#chapter-test-library .cs-test-action:hover:not(:disabled) { color: #fff; }
#chapter-test-library .is-next .cs-test-action { color: #f0c4a1; }
#chapter-test-library .cs-test-action.is-review { color: #b1ddca; }
#chapter-test-library .cs-test-action:disabled { color: #94a6bd; opacity: 1; cursor: default; }
#chapter-test-library .cs-test-action:focus-visible { outline-offset: 3px; border-radius: 3px; }
/* Each card has one action. Stretch that same button over its card without
   adding a second handler, changing tab order, or activating locked tests. */
#chapter-test-library .cs-test-action { position: static; }
#chapter-test-library .cs-test-action:not(:disabled)::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
#chapter-test-library .cs-test-card:has(.cs-test-action:not(:disabled)) { cursor: pointer; }
#chapter-test-library .cs-test-card:has(.cs-test-action:not(:disabled)):hover { border-color: #8999ad; }
#chapter-test-library .cs-test-card:has(.cs-test-action:focus-visible) { outline: 2px solid var(--cs-accent); outline-offset: 4px; }
@supports selector(:has(*)) {
  #chapter-test-library .cs-test-action:focus-visible { outline: none; }
}
#chapter-test-library .cs-pagination { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 25px 0 0 17px; }
#chapter-test-library .cs-page-numbers { display: flex; align-items: center; gap: 5px; }
#chapter-test-library .cs-pagination button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 40px; min-height: 44px; border: 1px solid #344258; border-radius: 8px; color: #aebfd6; background: #101a27; font-size: 11px; padding: 8px; }
#chapter-test-library .cs-pagination .cs-page-direction { padding: 8px 12px; }
#chapter-test-library .cs-pagination svg { width: 15px; height: 15px; }
#chapter-test-library .cs-pagination [aria-current=page] { background: #dce4ef; border-color: #dce4ef; color: #1b2738; font-weight: 700; }
#chapter-test-library .cs-pagination button:hover:not(:disabled):not([aria-current]) { border-color: #8297b5; color: #e5edf8; }
#chapter-test-library .cs-pagination button:disabled { opacity: .35; cursor: default; }
#chapter-test-library .cs-page-gap { color: #7186a2; font-size: 11px; min-width: 14px; text-align: center; }
#chapter-test-library .cs-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; padding: 30px 18px; border: 1px dashed #3b4b61; border-radius: 13px; background: #101b284d; text-align: center; }
#chapter-test-library .cs-empty > svg { width: 30px; height: 30px; color: #a2b4ce; }
#chapter-test-library .cs-empty h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: -.45px; color: #e3ebf6; }
#chapter-test-library .cs-empty p { margin: 0; color: #9cacc1; font-size: 12px; line-height: 1.6; }
#chapter-test-library .cs-empty-action { min-height: 44px; padding: 8px 14px; border: 1px solid #6f8098; border-radius: 8px; color: #dce7f6; background: #233047; font-size: 12px; font-weight: 600; }
#chapter-test-library .cs-library-footer { margin: 25px 0 0; padding: 17px 0 0; border-top: 1px solid #2b3645; color: #8f9fb5; font-size: 11px; line-height: 1.6; }

@media (max-width: 1160px) {
  #chapter-studio .topic-choice-stage.cs-choice-stage > section { padding: 24px; }
  #chapter-studio .cs-preview { gap: 14px; grid-template-columns: minmax(0,1fr) minmax(80px,.55fr); }
  #chapter-studio .cs-preview-size > strong { font-size: 25px; }
  #chapter-studio .cs-preview-time { padding-left: 13px; }
  #chapter-studio .cs-preview-time strong { font-size: 18px; }
  #chapter-studio .cs-selection-action { flex-direction: column; align-items: stretch; gap: 9px; }
  #chapter-studio .cs-primary { width: 100%; }
  #chapter-test-library .cs-test-card { padding: 15px; }
}
@media (max-width: 950px) {
  #chapter-studio .cs-topbar, #chapter-test-library .cs-topbar { gap: 16px; }
  #chapter-studio .cs-flow, #chapter-test-library .cs-flow { gap: 20px; }
  #chapter-studio .cs-flow li, #chapter-test-library .cs-flow li { font-size: 10px; gap: 6px; }
  #chapter-studio .cs-flow li + li::before, #chapter-test-library .cs-flow li + li::before { width: 9px; left: -15px; }
  #chapter-studio .topic-hero.cs-hero { grid-template-columns: 76px minmax(0,1fr); padding: 22px; gap: 20px; min-height: 132px; }
  #chapter-studio .topic-hero-art.cs-art { width: 76px; height: 76px; }
  #chapter-studio .topic-hero-art.cs-art svg { width: 73px; height: 59px; }
  #chapter-studio .topic-choice-stage.cs-choice-stage { grid-template-columns: 1fr 1fr; }
  #chapter-studio .topic-choice-stage.cs-choice-stage > section { padding: 23px 20px; }
  #chapter-studio .cs-section-heading { gap: 10px; margin-bottom: 22px; }
  #chapter-studio .cs-section-heading h2 { font-size: 22px; }
  #chapter-studio .cs-preview { grid-template-columns: minmax(0,1fr); gap: 14px; padding-bottom: 15px; }
  #chapter-studio .cs-preview-time { grid-template-columns: 18px auto minmax(0,1fr); border: 0; padding-left: 0; gap: 7px; }
  #chapter-studio .cs-preview-time > span { grid-column: 3; margin-left: 3px; }
  #chapter-studio .cs-inventory { gap: 13px; }
  #chapter-studio .cs-inventory > div { flex-direction: column; gap: 2px; }
  #chapter-test-library .cs-library-header { padding: 20px; gap: 16px; }
  #chapter-test-library .cs-library-progress { min-width: 82px; padding-left: 16px; }
}
@media (max-width: 720px) {
  .portal-shell .workspace-main:has(#chapter-test-library) { padding: 12px 16px 28px; }
  #chapter-studio, #chapter-test-library { padding: 0 0 25px; }
  #chapter-studio .cs-topbar, #chapter-test-library .cs-topbar { display: block; margin-bottom: 15px; }
  #chapter-studio .cs-back, #chapter-test-library .cs-back { min-height: 39px; font-size: 12px; }
  #chapter-studio .cs-flow, #chapter-test-library .cs-flow { width: 100%; gap: 12px; justify-content: space-between; margin-top: 8px; }
  #chapter-studio .cs-flow li, #chapter-test-library .cs-flow li { font-size: 9px; gap: 6px; white-space: normal; }
  #chapter-studio .cs-flow li + li::before, #chapter-test-library .cs-flow li + li::before { display: none; }
  #chapter-studio .cs-flow-number, #chapter-test-library .cs-flow-number { width: 20px; height: 20px; flex: 0 0 20px; font-size: 8px; }
  #chapter-studio .topic-hero.cs-hero { grid-template-columns: 62px minmax(0,1fr); min-height: 108px; gap: 14px; padding: 18px 16px; border-radius: 13px; }
  #chapter-studio .topic-hero-art.cs-art { width: 62px; height: 62px; border-radius: 11px; }
  #chapter-studio .topic-hero-art.cs-art svg { width: 61px; height: 49px; }
  #chapter-studio .topic-hero-copy .eyebrow { font-size: 8px; letter-spacing: .8px; margin-bottom: 6px; }
  #chapter-studio .topic-hero-copy h1 { font-size: clamp(21px,4.6vw,27px); line-height: 1.18; letter-spacing: -.65px; }
  #chapter-studio .topic-hero-copy p { display: none; }
  #chapter-studio .topic-choice-stage.cs-choice-stage { grid-template-columns: minmax(0,1fr); margin-top: 14px; border-radius: 13px; }
  #chapter-studio .topic-choice-stage.cs-choice-stage > section { padding: 18px 17px; }
  #chapter-studio .topic-difficulty-section.cs-difficulty-section { border-right: 0; border-bottom: 1px solid #344150; }
  #chapter-studio .cs-section-heading { margin: 0 0 15px; gap: 10px; }
  #chapter-studio .cs-step-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; }
  #chapter-studio .cs-section-heading h2 { font-size: 18px; letter-spacing: -.45px; }
  #chapter-studio .cs-section-heading .cs-eyebrow { display: none; }
  #chapter-studio .cs-slider-slot { max-width: none !important; margin: 0; }
  #chapter-studio .cs-slider-slot .mega-difficulty { max-width: none; }
  #chapter-studio .cs-difficulty-note { display: none; }
  #chapter-studio .cs-selection-heading { margin-bottom: 15px; }
  #chapter-studio .cs-selection-heading .cs-eyebrow { font-size: 9px; letter-spacing: 1px; }
  #chapter-studio .cs-level-tag, #chapter-test-library .cs-level-tag { min-height: 22px; font-size: 9px; padding: 2px 7px; }
  #chapter-studio .cs-preview { grid-template-columns: minmax(0,1fr) minmax(83px,.58fr); gap: 12px; padding-bottom: 15px; }
  #chapter-studio .cs-preview-size { grid-template-columns: 18px minmax(0,1fr); column-gap: 6px; }
  #chapter-studio .cs-preview-icon svg { width: 18px; height: 18px; }
  #chapter-studio .cs-preview-size > strong { font-size: clamp(21px,5.1vw,26px); line-height: 1.18; letter-spacing: -.65px; }
  #chapter-studio .cs-preview-meta { font-size: 10px; margin-top: 5px; }
  #chapter-studio .cs-preview-time { grid-template-columns: 15px minmax(0,1fr); gap: 4px 6px; border-left: 1px solid #344151; padding-left: 12px; }
  #chapter-studio .cs-preview-time > svg { width: 15px; height: 15px; }
  #chapter-studio .cs-preview-time strong { font-size: 17px; line-height: 1.3; letter-spacing: -.35px; }
  #chapter-studio .cs-preview-time > span { grid-column: 2; margin-left: 0; font-size: 9px; }
  #chapter-studio .cs-inventory { padding: 11px 0 12px; gap: 16px; }
  #chapter-studio .cs-inventory > div { flex-direction: row; align-items: baseline; gap: 7px; }
  #chapter-studio .cs-inventory strong { font-size: 15px; }
  #chapter-studio .cs-inventory span { font-size: 9px; }
  #chapter-studio .cs-selection-action { margin-top: 15px; gap: 8px; }
  #chapter-studio .cs-primary { min-height: 46px; padding: 11px 14px; font-size: 12px; border-radius: 8px; }
  #chapter-studio .cs-action-note { font-size: 9px; line-height: 1.5; }
  #chapter-studio .cs-test-details { margin-top: 12px; }
  #chapter-studio .cs-test-details > summary { font-size: 10px; min-height: 44px; }
  #chapter-studio .cs-test-details p { font-size: 10px; }
  #chapter-test-library .cs-library-header { padding: 17px 15px; gap: 12px; border-radius: 13px; align-items: flex-start; flex-wrap: wrap; }
  #chapter-test-library .cs-library-art { width: 55px; height: 55px; flex-basis: 55px; border-radius: 10px; }
  #chapter-test-library .cs-library-art svg { width: 53px; height: 43px; }
  #chapter-test-library .cs-library-copy { flex: 1 1 calc(100% - 70px); }
  #chapter-test-library .cs-library-header h1 { font-size: 22px; letter-spacing: -.7px; margin: 4px 0 11px; }
  #chapter-test-library .cs-library-header .cs-eyebrow { font-size: 8px; letter-spacing: .9px; margin-bottom: 3px; }
  #chapter-test-library .cs-library-meta { gap: 8px; font-size: 9px; }
  #chapter-test-library .cs-library-progress { flex: 1 1 100%; flex-direction: row; align-items: center; gap: 7px; padding: 12px 0 0; margin: 0; border-left: 0; border-top: 1px solid #344051; min-width: 0; font-size: 9px; }
  #chapter-test-library .cs-library-progress > strong { font-size: 15px; line-height: 1.4; letter-spacing: -.35px; }
  #chapter-test-library .cs-library-progress strong span { font-size: 13px; }
  #chapter-test-library .cs-progress-track { margin: 0 0 0 auto; width: 72px; }
  #chapter-test-library .cs-library-controls { flex-wrap: wrap; gap: 11px; margin-top: 16px; }
  #chapter-test-library .cs-filters { gap: 5px; }
  #chapter-test-library .cs-filters button { min-height: 44px; padding: 9px 10px; font-size: 11px; gap: 6px; }
  #chapter-test-library .cs-filters button > span { font-size: 10px; }
  #chapter-test-library .cs-range { font-size: 9px; }
  #chapter-test-library .cs-library-guide { margin: 13px 0 13px; font-size: 9px; }
  #chapter-test-library .cs-library-guide > span:last-child { display: none; }
  #chapter-test-library .cs-test-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 19px 10px; padding-left: 10px; padding-top: 10px; }
  #chapter-test-library .cs-test-node::before { top: -10px; left: -10px; }
  #chapter-test-library .cs-test-node::after { top: -10px; height: 10px; }
  #chapter-test-library .cs-test-card { min-height: 188px; padding: 13px 12px 10px; border-radius: 10px; }
  #chapter-test-library .cs-test-top h3 { font-size: 16px; letter-spacing: -.5px; }
  #chapter-test-library .cs-access { font-size: 8px; min-height: 18px; padding: 2px 5px; }
  #chapter-test-library .cs-test-status { font-size: 10px; gap: 4px; margin: 5px 0 10px; min-height: 29px; }
  #chapter-test-library .cs-test-status svg { width: 11px; height: 11px; }
  #chapter-test-library .cs-test-format { font-size: 11px; gap: 5px; }
  #chapter-test-library .cs-test-format > svg { width: 12px; height: 12px; }
  #chapter-test-library .cs-test-format small { font-size: 10px; }
  #chapter-test-library .cs-test-action { font-size: 11px; min-height: 44px; padding-top: 12px; gap: 6px; }
  #chapter-test-library .cs-test-action > svg { width: 14px; height: 14px; }
  #chapter-test-library .cs-pagination { flex-wrap: wrap; gap: 10px; margin: 21px 0 0 10px; }
  #chapter-test-library .cs-page-numbers { order: -1; flex: 1 1 100%; justify-content: center; }
  #chapter-test-library .cs-pagination button { min-width: 36px; font-size: 10px; }
  #chapter-test-library .cs-page-direction { flex: 0 1 auto; }
  #chapter-test-library .cs-library-footer { font-size: 10px; margin-top: 20px; padding-top: 14px; }
}
@media (max-width: 370px) {
  #chapter-studio .topic-hero.cs-hero { grid-template-columns: 51px minmax(0,1fr); gap: 11px; padding: 15px 13px; }
  #chapter-studio .topic-hero-art.cs-art { width: 51px; height: 54px; }
  #chapter-studio .topic-hero-art.cs-art svg { width: 51px; height: 42px; }
  #chapter-studio .topic-hero-copy h1 { font-size: 21px; }
  #chapter-studio .topic-choice-stage.cs-choice-stage > section { padding: 16px 13px; }
  #chapter-studio .cs-flow, #chapter-test-library .cs-flow { gap: 8px; }
  #chapter-studio .cs-flow li, #chapter-test-library .cs-flow li { font-size: 8px; gap: 4px; }
  #chapter-studio .cs-flow-number, #chapter-test-library .cs-flow-number { flex-basis: 18px; width: 18px; height: 18px; }
  #chapter-studio .cs-preview-size > strong { font-size: 21px; }
  #chapter-studio .cs-preview-time { padding-left: 10px; }
  #chapter-studio .cs-preview-time strong { font-size: 15px; }
  #chapter-test-library .cs-library-header { padding: 15px 13px; gap: 10px; }
  #chapter-test-library .cs-library-art { width: 46px; height: 48px; flex-basis: 46px; }
  #chapter-test-library .cs-library-art svg { width: 45px; height: 36px; }
  #chapter-test-library .cs-library-copy { flex-basis: calc(100% - 60px); }
  #chapter-test-library .cs-library-header h1 { font-size: 21px; }
  #chapter-test-library .cs-library-meta { gap: 7px; }
  #chapter-test-library .cs-filters { gap: 4px; }
  #chapter-test-library .cs-filters button { padding: 9px 8px; font-size: 11px; gap: 5px; }
  #chapter-test-library .cs-test-card { padding: 12px 10px 9px; min-height: 190px; }
  #chapter-test-library .cs-test-top { gap: 4px; }
  #chapter-test-library .cs-test-top h3 { font-size: 16px; }
  #chapter-test-library .cs-test-status { font-size: 10px; }
  #chapter-test-library .cs-test-format { font-size: 11px; }
  #chapter-test-library .cs-test-action { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #chapter-studio *, #chapter-studio *::before, #chapter-studio *::after,
  #chapter-test-library *, #chapter-test-library *::before, #chapter-test-library *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  #chapter-studio, #chapter-test-library { color: CanvasText; }
  #chapter-studio :is(.cs-hero,.cs-choice-stage,.cs-primary,.cs-level-tag),
  #chapter-test-library :is(.cs-library-header,.cs-test-card,.cs-filters button,.cs-pagination button,.cs-access) { background: Canvas; color: CanvasText; border-color: ButtonText; box-shadow: none; }
  #chapter-test-library .cs-filters [aria-pressed=true], #chapter-test-library .cs-pagination [aria-current=page] { outline: 2px solid Highlight; outline-offset: -3px; }
  #chapter-studio :is(button,a,summary):focus-visible, #chapter-test-library :is(button,a):focus-visible { outline-color: Highlight; }
  #chapter-test-library .cs-test-grid::before, #chapter-test-library .cs-test-node::before, #chapter-test-library .cs-test-node::after { background: GrayText; }
}
