.practice-studio {
    --practice-ink: #20242b;
    --practice-muted: #6d747d;
    --practice-line: #e4e8ec;
    --practice-surface: #f4f7fb;
    --practice-soft: #edf3f8;
    --practice-accent: #244d70;
    width: min(980px, calc(100% - 40px));
    margin: 28px auto 56px;
    color: var(--practice-ink);
}

#practiceStudioWorkspace:not([hidden]) {
    display: block;
    min-height: 100%;
}

.atlas-questions-workspace {
    min-height: 100%;
}

.atlas-filter-bar {
    display: flex;
    gap: 5px;
    width: max-content;
    margin: 14px 0 0;
    align-items: end;
}

.atlas-filter {
    position: relative;
    display: grid;
    gap: 6px;
    width: 108px;
    min-width: 0;
    color: #30363d;
    font-size: 11px;
}

.atlas-filter__control {
    position: relative;
}

.atlas-filter__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 34px;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 0 10px;
    color: var(--practice-ink);
    background: var(--surface);
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.atlas-filter-more {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #dfe3e8;
    border-radius: 10px;
    padding: 0;
    color: #747b84;
    background: var(--surface);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.atlas-filter-more:hover,
.atlas-filter-more:focus-visible {
    border-color: #b9c9d8;
    color: var(--practice-ink);
    outline: 0;
}

.atlas-filter__trigger:hover,
.atlas-filter__trigger[aria-expanded="true"],
.atlas-filter__trigger:focus-visible {
    border-color: #b9c9d8;
    background: var(--surface);
}

.atlas-filter__trigger:focus-visible {
    outline: 2px solid rgba(40, 121, 191, .25);
    outline-offset: 1px;
}

.atlas-filter__trigger svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.atlas-filter__menu {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 108px;
    max-width: min(280px, calc(100vw - 32px));
    padding: 5px;
    border: 1px solid #dfe4e9;
    border-radius: 11px;
    background: var(--surface);
    box-shadow: 0 9px 20px rgba(26, 39, 54, .15), 0 2px 4px rgba(26, 39, 54, .08);
}

.atlas-filter__option {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    gap: 7px;
    align-items: center;
    width: 100%;
    min-height: 31px;
    border: 0;
    border-radius: 7px;
    padding: 0 7px;
    color: var(--practice-ink);
    background: transparent;
    font: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.atlas-filter__option:hover,
.atlas-filter__option:focus-visible {
    background: var(--practice-soft);
    outline: 0;
}

.atlas-filter__option:disabled {
    color: #b2b7bd;
    cursor: default;
}

.atlas-filter__option:disabled:hover { background: transparent; }

.atlas-filter__check {
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    color: var(--practice-ink);
}

.atlas-filter__check svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.atlas-filter__count {
    color: var(--practice-muted);
    font-size: 11px;
}

[data-theme="dark"] .atlas-filter__trigger { border-color: #354352; color: var(--practice-ink); background: var(--surface); }
[data-theme="dark"] .atlas-filter__menu { border-color: #354352; box-shadow: 0 9px 20px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .25); }
[data-theme="dark"] .atlas-filter { color: var(--practice-muted); }
[data-theme="dark"] .atlas-filter-more { border-color: #354352; color: var(--practice-muted); background: var(--surface); }
[data-theme="dark"] .practice-tag--difficulty { color: #bcd8eb; background: #203849; }

/* The shared topical stylesheet hides Aurora headers outside topic selection;
   Atlas keeps the same header visible while a question session is open. */
.topical-workspace.atlas-question-session:not(.topic-selection-open) > .topical-aurora-header {
    display: grid;
    min-height: 174px;
    height: auto;
    padding: 18px clamp(24px, 6vw, 72px) 16px;
}

.atlas-topic-progress {
    width: 20px;
    height: 20px;
    overflow: visible;
    transform: rotate(-90deg);
}

.atlas-questions-workspace .topical-topic-icon {
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border: 0;
    border-radius: 0;
}

.atlas-topic-progress circle {
    fill: none;
    stroke-width: 2;
}

.atlas-topic-progress__track { stroke: #dbe3ed; }

.atlas-topic-progress__value {
    stroke: #2879bf;
    stroke-linecap: round;
    transition: stroke-dashoffset 220ms ease;
}

.atlas-questions-workspace .topical-topic-info__copy {
    color: #2879bf;
}

.atlas-questions-info-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.practice-studio__setup,
.practice-card,
.practice-empty {
    border: 1px solid var(--practice-line);
    border-radius: 12px;
    background: var(--practice-surface);
    box-shadow: 0 1px 2px rgba(26, 55, 80, .04);
}

.practice-studio__setup { padding: 28px; }
.practice-studio__heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.practice-studio__heading h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; font-weight: 600; }
.practice-studio__heading p { max-width: 600px; margin: 0; color: var(--practice-muted); line-height: 1.5; }
.practice-studio__subject-note { margin: 0; color: var(--practice-muted); font-size: 13px; text-align: right; }
.practice-studio__form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.practice-studio__field { display: grid; gap: 6px; min-width: 0; color: var(--practice-muted); font-size: 13px; }
.practice-studio__field select { width: 100%; min-height: 40px; border: 1px solid var(--practice-line); border-radius: 8px; padding: 0 10px; color: var(--practice-ink); background: #fff; }
.practice-studio__start { min-height: 40px; border: 0; border-radius: 8px; padding: 0 15px; color: #fff; background: var(--practice-accent); font: inherit; font-weight: 600; cursor: pointer; }
.practice-studio__start:disabled { opacity: .55; cursor: wait; }
.practice-studio__catalog { margin: 16px 0 0; color: var(--practice-muted); font-size: 13px; }
.practice-studio__status { min-height: 20px; margin: 16px 0 0; color: var(--practice-muted); font-size: 13px; }
.practice-studio__status.is-error { color: #aa4052; }
.practice-studio__session-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin: 0 4px 14px; }
.practice-studio__session-head p { margin: 0; color: var(--practice-muted); font-size: 13px; }
.practice-studio__back { border: 0; padding: 7px 0; color: var(--practice-accent); background: transparent; font: inherit; cursor: pointer; }
.atlas-question-session .practice-studio { margin-top: 42px; }
.atlas-question-session .atlas-session-head { justify-content: flex-start; margin-bottom: 18px; }
.atlas-question-session .atlas-session-head > div { order: 2; }
.atlas-practice-set-button { min-height: 34px; padding: 0 12px; border: 1px solid #cfd7df; border-radius: 8px; color: var(--practice-ink); background: #fff; font-size: 13px; font-weight: 600; }
.atlas-practice-set-button:hover { border-color: #9fb4c5; background: #f7fafc; }
.practice-card { margin: 16px 0; padding: 24px 26px; }
.practice-card__header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.practice-card__title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.practice-card__title h2 { margin: 0 2px 0 0; font-size: 15px; font-weight: 600; }
.practice-tag { border-radius: 999px; padding: 4px 8px; color: #69717a; background: #f1f2f3; font-size: 11px; }
.practice-tag--difficulty { color: #496478; background: #edf4f8; }
.practice-tag--hard { color: #b22942; background: #fff0f2; }
.practice-card__actions { display: flex; gap: 8px; align-items: center; }
.practice-icon-button,
.practice-explanation-toggle,
.practice-ask { min-height: 32px; border: 0; border-radius: 8px; font: inherit; cursor: pointer; }
.practice-icon-button { width: 32px; display: grid; place-items: center; color: #707781; background: #f3f4f5; }
.practice-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.practice-explanation-toggle { padding: 0 11px; color: #244d70; background: #e3edf6; font-size: 13px; font-weight: 600; }
.practice-explanation-toggle:disabled { opacity: .55; cursor: not-allowed; }
.practice-card__context,
.practice-card__stem { max-width: 800px; line-height: 1.55; }
.practice-card__context { margin: 21px 0 10px; color: #555d66; }
.practice-card__stem { margin: 0 0 20px; white-space: pre-wrap; }
.practice-choice-list { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.practice-choice { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; padding: 8px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.practice-choice:hover { background: var(--practice-soft); }
.practice-choice:has(input:checked),
.practice-choice:has(input:checked):hover { border-color: transparent; background: transparent; }
.practice-choice input { position: absolute; opacity: 0; }
.practice-choice__letter { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #dfe3e6; border-radius: 50%; color: #737a83; font-size: 14px; }
.practice-choice:has(input:checked) .practice-choice__letter { border-color: var(--practice-accent); color: var(--practice-accent); background: #e7f5fc; box-shadow: 0 0 0 2px rgba(22, 131, 197, .12); }
.practice-choice:has(input:checked).practice-choice--correct,
.practice-choice:has(input:checked).practice-choice--correct:hover { border-color: #80bc91; background: #eef8f0; }
.practice-choice:has(input:checked).practice-choice--correct .practice-choice__letter { border-color: #258445; color: #fff; background: #258445; box-shadow: none; }
.practice-choice:has(input:checked).practice-choice--incorrect,
.practice-choice:has(input:checked).practice-choice--incorrect:hover { border-color: #df9298; background: #fff1f2; }
.practice-choice:has(input:checked).practice-choice--incorrect .practice-choice__letter { border-color: #bd3945; color: #fff; background: #bd3945; box-shadow: none; }
.practice-choice:has(input:disabled) { cursor: default; }
.practice-choice__text { line-height: 1.45; }
.practice-choice-feedback { margin: 6px 0 0; font-size: 13px; font-weight: 600; }
.practice-choice-feedback--correct { color: #21783d; }
.practice-choice-feedback--incorrect { color: #ad303e; }
.practice-submit { min-height: 38px; margin-top: 18px; border: 0; border-radius: 8px; padding: 0 14px; color: #fff; background: #283039; font: inherit; font-weight: 600; cursor: pointer; }
.practice-submit:disabled { opacity: .5; cursor: not-allowed; }
.practice-part { margin-top: 20px; }
.practice-part__context { margin: 0 0 9px; color: var(--practice-muted); line-height: 1.5; }
.practice-part__prompt { margin: 0 0 9px; line-height: 1.5; }
.practice-part__mark { float: right; color: var(--practice-muted); font-size: 12px; }
.practice-answer { width: 100%; min-height: 48px; resize: vertical; border: 0; border-radius: 10px; padding: 14px; color: var(--practice-ink); background: var(--practice-soft); font: inherit; }
.practice-visual { margin: 20px 0; overflow: hidden; border: 1px solid var(--practice-line); border-radius: 8px; }
.practice-visual table { width: 100%; border-collapse: collapse; font-size: 14px; }
.practice-visual th,.practice-visual td { padding: 10px 12px; border-bottom: 1px solid var(--practice-line); text-align: left; }
.practice-visual th { color: #4d545d; background: #fafafa; font-weight: 600; }
.practice-visual img { display: block; width: 100%; height: auto; }
.practice-graph { display: block; width: min(520px, 100%); height: auto; margin: 14px auto; }
.practice-graph-shell { position: relative; width: min(520px, 100%); margin: 14px auto; padding: 0 0 22px 26px; }
.practice-graph-shell .practice-graph { width: 100%; margin: 0; }
.practice-graph-axis-x { position: absolute; right: 2px; bottom: 0; color: #555555; font-size: 13px; }
.practice-graph-axis-y { position: absolute; left: 0; top: 50%; color: #555555; font-size: 13px; transform: translateY(-50%) rotate(-90deg); transform-origin: center; white-space: nowrap; }
.practice-feedback { margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--practice-accent); border-radius: 0 8px 8px 0; background: #f3f9fc; line-height: 1.5; }
.practice-feedback--incorrect { border-left-color: #b44456; background: #fff6f7; }
.practice-explanation { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--practice-line); }
.practice-explanation--focused { animation: practice-explanation-focus 1.2s ease-out; }
@keyframes practice-explanation-focus { 0% { background: #e8f6fd; } 100% { background: transparent; } }
.practice-explanation__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.practice-explanation__header h3 { margin: 0; color: var(--practice-ink); font-size: 14px; font-weight: 600; }
.practice-explanation__overview { margin-bottom: 12px; }
.practice-explanation-detail { margin-top: 16px; }
.practice-explanation-detail h3 { margin: 0 0 9px; color: var(--practice-ink); font-size: 13px; font-weight: 600; }
.practice-explanation__empty { margin: 0; color: var(--practice-muted); font-size: 13px; }
.practice-explanation-dialog { width: min(760px, calc(100% - 32px)); max-width: none; max-height: min(82vh, 800px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--practice-line); border-radius: 14px; color: var(--practice-ink); background: #fff; box-shadow: 0 24px 80px rgb(14 24 36 / 24%); }
.practice-explanation-dialog::backdrop { background: rgb(15 23 32 / 56%); backdrop-filter: blur(2px); }
.practice-explanation-dialog__header { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--practice-line); background: #fff; }
.practice-explanation-dialog__header h2 { margin: 0; color: var(--practice-ink); font-size: 17px; font-weight: 650; }
.practice-explanation-dialog__close { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 8px; color: var(--practice-muted); background: var(--practice-soft); cursor: pointer; }
.practice-explanation-dialog__close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.practice-explanation-dialog__content { padding: 0 22px 22px; }
.practice-explanation-dialog__content .practice-explanation { margin-top: 0; padding-top: 18px; border-top: 0; }
.practice-card__footer { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--practice-line); }
.practice-inline-chat { display: grid; gap: 10px; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; }
.practice-inline-chat__messages { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; }
.practice-inline-chat__message { max-width: 82%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.practice-inline-chat__message--user { justify-self: end; color: #244d70; background: #e1ebf4; }
.practice-inline-chat__message--assistant { justify-self: start; color: var(--practice-ink); background: var(--practice-soft); }
.practice-inline-chat__composer { display: flex; gap: 8px; align-items: center; }
.practice-inline-chat__input { flex: 1; min-width: 0; min-height: 38px; border: 1px solid var(--practice-line); border-radius: 8px; padding: 0 12px; color: var(--practice-ink); background: var(--practice-soft); font: inherit; }
.practice-inline-chat__input:focus { outline: 2px solid rgba(20, 131, 197, .22); outline-offset: 1px; }
.practice-inline-chat__send { min-height: 38px; border: 0; border-radius: 8px; padding: 0 14px; color: #fff; background: var(--practice-accent); font: inherit; font-weight: 600; cursor: pointer; }
.practice-inline-chat__send:disabled { opacity: .55; cursor: wait; }
.practice-inline-chat__row { display: flex; gap: 8px; align-items: flex-start; }
.practice-inline-chat__row--user { justify-content: flex-end; }
.practice-inline-chat__row .avatar { flex: 0 0 30px; width: 30px; height: 30px; margin-top: 3px; border-radius: 8px; }
.practice-inline-chat__row--user .avatar { overflow: hidden; border: 1px solid #dfe3e8; border-radius: 50%; background: #f3f4f6; }
.practice-inline-chat__row--user .avatar-art { display: block; width: 100%; height: 100%; }
.practice-inline-chat__message { max-width: 82%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.practice-inline-chat__message--user { color: #155c84; background: #e8f5fc; }
.practice-inline-chat__message--assistant { padding: 4px 0 8px; color: var(--practice-ink); background: transparent; }
.practice-inline-chat__composer.composer { align-items: center; width: 100%; margin: 0; padding: 5px 6px 5px 12px; border-color: var(--practice-line); border-radius: 8px; background: var(--practice-soft); }
.practice-inline-chat__composer .composer-tool-button { position: static; width: 32px; height: 32px; flex: 0 0 32px; padding: 0; border-radius: 7px; }
.practice-inline-chat__composer .math-palette { left: 0; bottom: calc(100% + 8px); }
.practice-inline-chat__composer .composer-input-wrap { flex: 1; min-width: 0; }
.practice-inline-chat__composer .math-editor { min-height: 28px; max-height: 96px; padding: 5px 2px; font-size: 13px; }
.practice-inline-chat__composer .practice-inline-chat__send { min-height: 34px; padding: 0 12px; border-radius: 8px; background: #75b5d8; }
.practice-inline-chat__composer .practice-inline-chat__send:hover { background: #5da5cf; }

[data-theme="dark"] .practice-inline-chat__row--user .avatar { border-color: #383838; background: #242424; }
[data-theme="dark"] .practice-inline-chat__message--user { color: #d8efff; background: #17384b; }
[data-theme="dark"] .practice-inline-chat__composer .practice-inline-chat__send { background: #3f8fbd; }
.practice-ask { padding: 0 11px; color: #5c4fd2; background: #f1efff; font-size: 13px; font-weight: 600; }
.practice-empty { padding: 42px 28px; color: var(--practice-muted); text-align: center; }

@media (max-width: 760px) {
    .practice-studio { width: min(100% - 24px, 980px); margin-top: 16px; }
    .practice-studio__setup,.practice-card { padding: 20px; }
    .practice-studio__heading,.practice-card__header { display: block; }
    .practice-studio__subject-note { margin-top: 12px; text-align: left; }
    .practice-studio__form { grid-template-columns: 1fr 1fr; }
    .practice-studio__start { grid-column: 1 / -1; }
    .practice-card__actions { margin-top: 14px; }
    .atlas-filter-bar { width: 100%; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
    .atlas-filter { flex: 0 0 108px; }
}

.library-filter-bar { margin: 0; --practice-ink: var(--text); flex-wrap: wrap; max-width: 100%; }
.library-filter-bar .atlas-filter { color: var(--text); }
.library-filter-bar .atlas-filter__menu[hidden] { display: none; }
.library-filter-bar .atlas-filter__option { font: inherit; }
.library-filter-unavailable { display: block; padding: 8px 12px; font-size: 12px; color: var(--muted); }

.atlas-mark-scheme-scroll{overflow-x:auto}.atlas-mark-scheme-table{width:100%;min-width:640px;border-collapse:collapse;table-layout:fixed;font-family:"Times New Roman",Times,serif;font-size:12pt;line-height:1.35;color:#222}.atlas-mark-scheme-table th,.atlas-mark-scheme-table td{padding:5px 6px;vertical-align:top;border-left:1px solid #999;border-right:1px solid #999;overflow-wrap:anywhere}.atlas-mark-scheme-table thead th{border-top:1px solid #999;border-bottom:1px solid #999;text-align:left;font-weight:bold}.atlas-mark-scheme-table tbody th{text-align:center;border-bottom:1px solid #999}.atlas-mark-scheme-table .atlas-mark-code{font-weight:bold;text-align:center}.atlas-mark-scheme-table .atlas-mark-total td{border-bottom:1px solid #999}.atlas-native-mark-scheme h2{text-align:center;font-family:"Times New Roman",Times,serif;font-size:14pt;font-weight:normal}

.atlas-mark-scheme-table{min-width:740px;font-size:11pt}.atlas-mark-scheme-table thead th{white-space:nowrap}.atlas-native-reader .atlas-native-mark-scheme h2{font-size:14pt;font-weight:normal}
