:root {
    --v2-bg: var(--bg-primary, #071225);
    --v2-panel: linear-gradient(180deg, rgba(19, 43, 82, .94), rgba(13, 37, 70, .94));
    --v2-panel-soft: linear-gradient(180deg, rgba(38, 61, 91, .86), rgba(18, 42, 72, .9));
    --v2-ink: var(--sg-theme-text, #f7fbff);
    --v2-muted: var(--sg-theme-muted, #cfe0f8);
    --v2-line: var(--sg-theme-line, rgba(148, 180, 220, .34));
    --v2-line-strong: rgba(125, 211, 252, .44);
    --v2-accent: var(--sg-theme-accent, var(--accent, #38bdf8));
    --v2-accent-2: #2563eb;
    --v2-accent-dark: #e6f7ff;
    --v2-good: var(--sg-theme-success, #8ef3d2);
    --v2-warn: #a16207;
    --v2-shadow: 0 22px 54px rgba(2, 8, 23, .34), inset 0 1px 0 rgba(255, 255, 255, .1);
}

* {
    box-sizing: border-box;
}

body.mode-studio-v2-body {
    min-height: 100vh;
    margin: 0;
    color: var(--v2-ink);
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, .16), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(6, 182, 212, .11), transparent 30%),
        linear-gradient(180deg, #071225 0%, #0a1b34 48%, #102a51 100%);
    font-family: "Sarabun", "Plus Jakarta Sans", system-ui, sans-serif;
}

html body.mode-studio-v2-body,
html[data-index-v2-theme] body.mode-studio-v2-body,
body.mode-studio-v2-body.has-site-topbar-v2 {
    color: var(--v2-ink) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, .16), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(6, 182, 212, .11), transparent 30%),
        linear-gradient(180deg, #071225 0%, #0a1b34 48%, #102a51 100%) !important;
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic),
body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic) {
    --sgv2-topbar-bg: rgba(7, 18, 37, .78) !important;
    --sgv2-topbar-text: #f7fbff !important;
    --sgv2-topbar-muted: #bfd0e7 !important;
    --sgv2-topbar-border: rgba(170, 205, 255, .14) !important;
    padding-top: var(--sheetgenie-topbar-offset, 82px);
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic) .sgv2-topbar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)),
        rgba(7, 18, 37, .82) !important;
    border-bottom-color: rgba(170, 205, 255, .14) !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .18);
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic) .sgv2-topbar :where(.sgv2-brand, .sgv2-brand-name, .sgv2-topbar-btn, .sgv2-account-btn, .sgv2-menu-btn) {
    color: #f7fbff;
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic) .sgv2-topbar :where(.sgv2-nav a, .sgv2-brand-tagline, .sgv2-account-plan) {
    color: #bfd0e7;
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2:not(.mode-v2-page--arithmetic) .sgv2-topbar :where(.sgv2-topbar-btn:not(.sgv2-topbar-btn-primary), .sgv2-plan-badge, .sgv2-mobile-cta, .sgv2-menu-btn) {
    border-color: rgba(170, 205, 255, .18);
    background: rgba(255, 255, 255, .07);
}

.mode-v2-shell {
    width: min(1360px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.mode-v2-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--v2-muted);
    font-size: .92rem;
}

.mode-v2-nav a {
    color: var(--v2-accent);
    font-weight: 800;
    text-decoration: none;
}

.mode-v2-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
}

.mode-v2-hub-hero {
    padding: 10px 0 4px;
}

.mode-v2-kicker {
    margin: 0 0 8px;
    color: #8ef3d2;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mode-v2-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3.35vw, 3.35rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.mode-v2-hero p {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--v2-muted);
    font-size: clamp(1rem, 1.18vw, 1.08rem);
    line-height: 1.68;
}

.mode-v2-hub-tools {
    display: grid;
    gap: 10px;
    justify-self: end;
    width: min(420px, 100%);
}

.mode-v2-search {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: var(--v2-muted);
    font-weight: 800;
}

.mode-v2-search input,
.mode-v2-field input,
.mode-v2-field select,
.mode-v2-page-control input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--v2-ink);
    background: rgba(7, 18, 37, .76);
    font: inherit;
    font-weight: 700;
    outline: none;
}

.mode-v2-search input::placeholder {
    color: color-mix(in srgb, var(--v2-muted) 68%, transparent);
}

.mode-v2-search input:focus,
.mode-v2-field input:focus,
.mode-v2-field select:focus,
.mode-v2-page-control input:focus {
    border-color: color-mix(in srgb, var(--v2-accent) 70%, #ffffff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--v2-accent) 22%, transparent);
}

.mode-v2-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 18px;
    padding: 6px;
    overflow-x: auto;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(6, 17, 35, .56);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    scrollbar-width: none;
}

.mode-v2-filter-row::-webkit-scrollbar {
    display: none;
}

.mode-v2-filter-btn {
    flex: 0 0 auto;
    min-height: 44px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 15px;
    background: transparent;
    color: var(--v2-muted);
    font: inherit;
    font-size: .92rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.mode-v2-filter-btn:hover,
.mode-v2-filter-btn:focus-visible,
.mode-v2-filter-btn.is-active {
    border-color: rgba(142, 243, 210, .72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .035) 42%),
        linear-gradient(135deg, rgba(20, 184, 166, .68), rgba(37, 99, 235, .68));
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 26px rgba(20, 184, 166, .18);
}

.mode-v2-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.mode-v2-card,
.mode-v2-panel,
.mode-v2-topic-card,
.mode-v2-grade-btn,
.mode-v2-summary-item {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-panel);
    box-shadow: var(--v2-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.mode-v2-card {
    display: grid;
    gap: 13px;
    grid-template-rows: auto minmax(84px, auto) auto minmax(44px, auto) minmax(38px, auto) auto;
    min-height: 398px;
    padding: 18px;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.mode-v2-hub-card {
    background:
        radial-gradient(circle at 0 0, rgba(59, 130, 246, .18), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025)),
        linear-gradient(180deg, rgba(19, 43, 82, .94), rgba(13, 37, 70, .94));
}

.mode-v2-hub-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, rgba(56, 189, 248, .82), rgba(142, 243, 210, .62), transparent);
    opacity: .68;
    pointer-events: none;
}

.mode-v2-card:hover,
.mode-v2-card:focus-within {
    border-color: color-mix(in srgb, var(--v2-accent) 52%, rgba(255, 255, 255, .18));
    box-shadow: 0 28px 74px rgba(0, 0, 0, .34), 0 0 0 1px rgba(125, 211, 252, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
    transform: translateY(-4px);
}

.mode-v2-card.is-hidden {
    display: none;
}

.mode-v2-card.is-locked {
    opacity: .74;
}

.mode-v2-card__top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.mode-v2-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, .26), rgba(20, 184, 166, .18)),
        rgba(255, 255, 255, .06);
    color: var(--v2-accent-dark);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.mode-v2-card__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.mode-v2-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--v2-accent) 14%, rgba(255, 255, 255, .08));
    color: var(--v2-accent-dark);
    font-size: .76rem;
    font-weight: 900;
    white-space: nowrap;
}

.mode-v2-count-badge {
    justify-self: end;
    min-height: 32px;
    border: 1px solid rgba(125, 211, 252, .22);
    background: rgba(12, 29, 56, .72);
    color: #eaf7ff;
}

.mode-v2-feature-badge {
    background: color-mix(in srgb, var(--v2-accent-2) 18%, rgba(255, 255, 255, .08));
    color: #dbeafe;
}

.mode-v2-readiness--ready {
    border: 1px solid rgba(142, 243, 210, .46);
    background: color-mix(in srgb, var(--v2-good) 24%, rgba(255, 255, 255, .08));
    color: #dcfff4;
}

.mode-v2-readiness--partial {
    background: color-mix(in srgb, var(--v2-accent) 16%, rgba(255, 255, 255, .08));
    color: #dcecff;
}

.mode-v2-readiness--beta {
    background: color-mix(in srgb, var(--v2-accent-2) 24%, rgba(255, 255, 255, .08));
    color: #eee6ff;
}

.mode-v2-readiness--locked {
    background: color-mix(in srgb, #94a3b8 18%, rgba(255, 255, 255, .08));
    color: #e2e8f0;
}

.mode-v2-card h2,
.mode-v2-panel h2,
.mode-v2-panel h3,
.mode-v2-topic-card h3 {
    margin: 0;
    color: var(--v2-ink);
}

.mode-v2-card h2 {
    font-size: clamp(1.2rem, 1.35vw, 1.42rem);
    line-height: 1.24;
    font-weight: 800;
}

.mode-v2-card__body {
    display: grid;
    align-content: start;
    gap: 9px;
}

.mode-v2-card p,
.mode-v2-topic-card p,
.mode-v2-panel p {
    margin: 0;
    color: var(--v2-muted);
    line-height: 1.55;
}

.mode-v2-meta-grid {
    display: grid;
    grid-template-columns: 1.2fr .9fr 1fr;
    gap: 8px;
}

.mode-v2-meta-grid div {
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--v2-line) 72%, transparent);
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, .045);
}

.mode-v2-meta-grid span {
    display: block;
    color: var(--v2-muted);
    font-size: .72rem;
    font-weight: 900;
    line-height: 1.25;
}

.mode-v2-meta-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--v2-ink);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: .86rem;
    font-weight: 900;
    line-height: 1.2;
}

.mode-v2-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-content: start;
}

.mode-v2-chip-row span,
.mode-v2-lock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--v2-accent) 9%, rgba(255, 255, 255, .07));
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 800;
}

.mode-v2-card__note {
    min-height: 38px;
    color: #d9e8fb;
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.5;
}

.mode-v2-card__action,
.mode-v2-primary-btn,
.mode-v2-secondary-btn,
.mode-v2-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 8px;
    border: 1px solid rgba(125, 211, 252, .58);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .16), transparent 44%),
        linear-gradient(135deg, #4f7ff7, #06b6d4);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: filter .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

html[data-index-v2-theme] body.mode-studio-v2-body .mode-v2-card__action,
html[data-index-v2-theme] body.mode-studio-v2-body .mode-v2-primary-btn {
    color: #ffffff !important;
}

.mode-v2-card__action {
    align-self: end;
}

.mode-v2-card__action:hover,
.mode-v2-card__action:focus-visible,
.mode-v2-primary-btn:hover,
.mode-v2-primary-btn:focus-visible {
    filter: brightness(1.08);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--v2-accent) 28%, transparent);
    transform: translateY(-1px);
}

.mode-v2-card__action[disabled],
.mode-v2-card__action.is-disabled {
    border-color: var(--v2-line);
    background: color-mix(in srgb, #64748b 22%, rgba(255, 255, 255, .07));
    color: #cbd5e1 !important;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

.mode-v2-entry-loading {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 28% 22%, color-mix(in srgb, var(--v2-accent) 18%, transparent), transparent 34%),
        rgba(3, 10, 22, .7);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}

.mode-v2-entry-loading.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mode-v2-entry-loading__panel {
    position: relative;
    overflow: hidden;
    width: min(420px, 100%);
    border: 1px solid color-mix(in srgb, var(--v2-accent) 34%, var(--v2-line));
    border-radius: 8px;
    padding: 26px 22px 24px;
    background: var(--v2-panel);
    box-shadow: var(--v2-shadow, 0 28px 80px rgba(0, 0, 0, .42));
    color: var(--v2-ink);
    text-align: center;
}

.mode-v2-entry-loading__panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--v2-accent-2), var(--v2-accent), var(--v2-good));
}

.mode-v2-entry-loading__spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    border-radius: 999px;
    background: conic-gradient(from 0deg, transparent 0 72deg, color-mix(in srgb, var(--v2-ink) 18%, transparent) 78deg 96deg, var(--v2-accent-2) 126deg 248deg, var(--v2-accent) 292deg 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 8px), #000 calc(100% - 7px));
    animation: mode-v2-entry-loading-spin .85s linear infinite;
}

.mode-v2-entry-loading__title {
    margin: 0;
    color: var(--v2-ink) !important;
    font-size: clamp(1.18rem, 3vw, 1.55rem);
    font-weight: 900;
    line-height: 1.32;
}

.mode-v2-entry-loading__desc {
    margin: 8px 0 0;
    color: var(--v2-muted) !important;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2 .mode-v2-entry-loading .mode-v2-entry-loading__title,
body.mode-studio-v2-body .mode-v2-entry-loading .mode-v2-entry-loading__title {
    color: var(--v2-ink) !important;
    -webkit-text-fill-color: var(--v2-ink) !important;
}

html[data-index-v2-theme] body.mode-studio-v2-body.has-site-topbar-v2 .mode-v2-entry-loading .mode-v2-entry-loading__desc,
body.mode-studio-v2-body .mode-v2-entry-loading .mode-v2-entry-loading__desc {
    color: var(--v2-muted) !important;
    -webkit-text-fill-color: var(--v2-muted) !important;
}

body.is-mode-entry-loading {
    cursor: progress;
}

.mode-v2-secondary-btn,
.mode-v2-icon-btn {
    border-color: var(--v2-line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02)),
        linear-gradient(180deg, rgba(38, 61, 91, .86), rgba(18, 42, 72, .9));
    color: #f7fbff;
}

.mode-v2-icon-btn {
    width: 40px;
    padding: 0;
    font-size: 1.22rem;
}

.mode-v2-workspace {
    display: grid;
    grid-template-columns: minmax(310px, 390px) minmax(440px, 1fr) minmax(280px, 330px);
    gap: 16px;
    align-items: start;
    min-width: 0;
}

.mode-v2-panel {
    min-width: 0;
    padding: 16px;
}

.mode-v2-panel-head {
    display: grid;
    gap: 5px;
    margin-bottom: 14px;
}

.mode-v2-grade-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.mode-v2-grade-btn,
.mode-v2-topic-card {
    cursor: pointer;
}

.mode-v2-grade-btn {
    min-height: 46px;
    color: var(--v2-ink);
    font: inherit;
    font-weight: 900;
}

.mode-v2-grade-btn.is-active,
.mode-v2-topic-card.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 58%, rgba(255, 255, 255, .18));
    background: color-mix(in srgb, var(--v2-accent) 18%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
}

.mode-v2-topic-list {
    display: grid;
    gap: 10px;
}

.mode-v2-topic-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    text-align: left;
    font: inherit;
    color: var(--v2-ink);
}

.mode-v2-topic-card[disabled] {
    cursor: not-allowed;
    opacity: .58;
}

.mode-v2-settings {
    display: grid;
    gap: 14px;
}

.mode-v2-settings-group {
    display: grid;
    gap: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 14px;
    background: var(--v2-panel-soft);
}

.mode-v2-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mode-v2-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--v2-muted);
    font-size: .87rem;
    font-weight: 800;
}

.mode-v2-field--wide {
    grid-column: 1 / -1;
}

.mode-v2-check-row,
.mode-v2-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mode-v2-check-row label,
.mode-v2-option-btn {
    min-height: 38px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mode-v2-check-row label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.mode-v2-option-btn.is-active,
.mode-v2-check-row label:has(input:checked) {
    border-color: rgba(142, 243, 210, .72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .035) 42%),
        linear-gradient(135deg, rgba(20, 184, 166, .68), rgba(37, 99, 235, .68));
    color: var(--v2-ink);
}

.mode-v2-settings-group--detailed {
    gap: 12px;
}

.mode-v2-settings-group--detailed h3 {
    margin: 0;
    color: #fff;
    font-size: .98rem;
    line-height: 1.35;
}

.mode-v2-settings-group--detailed .mode-v2-field-grid {
    align-items: start;
}

.mode-v2-field-grid--range {
    grid-column: 1 / -1;
}

.mode-v2-segment,
.mode-v2-chip-grid,
.mode-v2-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.mode-v2-segment-btn,
.mode-v2-operation-chip,
.mode-v2-check-row--setting {
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    font: inherit;
    font-size: .84rem;
    font-weight: 900;
    cursor: pointer;
}

.mode-v2-segment-btn {
    flex: 1 1 92px;
    padding: 0 10px;
}

.mode-v2-operation-chip,
.mode-v2-check-row--setting {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.mode-v2-operation-chip {
    flex: 1 1 104px;
}

.mode-v2-operation-symbol {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1;
}

.mode-v2-segment-btn.is-active,
.mode-v2-operation-chip:has(input:checked),
.mode-v2-check-row--setting:has(input:checked) {
    border-color: rgba(142, 243, 210, .72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .035) 42%),
        linear-gradient(135deg, rgba(20, 184, 166, .68), rgba(37, 99, 235, .68));
    color: #fff;
}

.mode-v2-operation-chip input,
.mode-v2-check-row--setting input {
    accent-color: var(--v2-accent);
}

.mode-v2-preview-head,
.mode-v2-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mode-v2-preview-toolbar {
    margin: 12px 0;
}

.mode-v2-page-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mode-v2-page-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 8px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-muted);
    font-weight: 800;
}

.mode-v2-page-control input {
    width: 52px;
    min-height: 30px;
    border: 0;
    border-bottom: 1px solid var(--v2-line);
    text-align: center;
}

.mode-v2-preview-stage {
    min-width: 0;
    min-height: 710px;
    padding: 18px;
    overflow: auto;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, rgba(5, 15, 30, .74), rgba(9, 22, 42, .56));
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.mode-v2-preview-stage .studio-preview-paper-wrap {
    display: grid;
    justify-content: center;
    min-width: min-content;
}

.mode-v2-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mode-v2-summary-item {
    padding: 10px;
    box-shadow: none;
}

.mode-v2-summary-item--wide {
    grid-column: 1 / -1;
}

.mode-v2-summary-item span {
    display: block;
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 800;
}

.mode-v2-summary-item strong {
    display: block;
    margin-top: 4px;
}

.mode-v2-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.mode-v2-status {
    min-height: 22px;
    color: var(--v2-muted);
    font-weight: 800;
}

.mode-v2-empty {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 36px 22px;
    border: 1px dashed var(--v2-line);
    border-radius: 8px;
    background: rgba(12, 29, 56, .66);
    color: var(--v2-muted);
    font-weight: 700;
    text-align: center;
}

.mode-v2-empty strong {
    color: var(--v2-ink);
    font-size: 1.2rem;
}

.mode-v2-skeleton-card {
    min-height: 428px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent),
        rgba(12, 29, 56, .66);
    background-size: 220% 100%, 100% 100%;
    animation: mode-v2-skeleton 1.4s ease-in-out infinite;
}

@keyframes mode-v2-skeleton {
    0% {
        background-position: 120% 0, 0 0;
    }

    100% {
        background-position: -120% 0, 0 0;
    }
}

@keyframes mode-v2-entry-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mode-v2-card,
    .mode-v2-filter-btn,
    .mode-v2-card__action,
    .mode-v2-entry-loading,
    .mode-v2-entry-loading__spinner,
    .mode-v2-skeleton-card {
        animation: none;
        transition: none;
    }
}

.mode-v2-page--arithmetic .mode-v2-shell {
    width: min(1500px, calc(100% - 32px));
}

html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn:hover,
html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn:focus-visible,
html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn.is-active {
    border-color: rgba(125, 211, 252, .66);
    background: linear-gradient(135deg, rgba(56, 189, 248, .28), rgba(139, 92, 246, .18)) !important;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 10px 26px rgba(56, 189, 248, .12);
}

body.mode-v2-page--arithmetic,
html[data-index-v2-theme] body.mode-v2-page--arithmetic {
    --v2-bg: #eef4fb;
    --v2-panel: rgba(255, 255, 255, .92);
    --v2-panel-soft: #f7faff;
    --v2-ink: #102033;
    --v2-muted: #5e7088;
    --v2-line: rgba(87, 112, 145, .22);
    --v2-shadow: 0 14px 36px rgba(23, 45, 78, .11), inset 0 1px 0 rgba(255, 255, 255, .72);
    --sg-theme-text: #102033;
    --sg-theme-muted: #5e7088;
    --sg-panel-bg: rgba(255, 255, 255, .92);
    --sg-card-bg: rgba(255, 255, 255, .92);
    background:
        linear-gradient(180deg, #f7fbff 0%, #edf4fb 46%, #eaf1f7 100%);
}

html[data-index-v2-theme] body.mode-v2-page--arithmetic.has-site-topbar-v2:not(.index-v2-legacy) {
    background:
        linear-gradient(180deg, #f7fbff 0%, #edf4fb 46%, #eaf1f7 100%);
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-nav {
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-hero {
    align-items: center;
    margin-bottom: 14px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 18px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), color-mix(in srgb, var(--v2-accent) 8%, #ffffff));
    box-shadow: var(--v2-shadow);
}

.mode-v2-page--arithmetic .mode-v2-kicker {
    color: color-mix(in srgb, var(--v2-accent) 78%, #0f172a);
}

.mode-v2-page--arithmetic .mode-v2-hero h1 {
    font-size: clamp(1.85rem, 2.4vw, 2.85rem);
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-hero p {
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-chip-row span {
    background: #ffffff;
    color: var(--v2-ink);
    border: 1px solid var(--v2-line);
}

.mode-v2-arithmetic-grade-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--v2-panel) 82%, rgba(7, 21, 44, .72));
    box-shadow: var(--v2-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mode-v2-panel-head--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin: 0;
}

.mode-v2-muted-label {
    color: var(--v2-muted);
    font-size: .86rem;
    font-weight: 800;
}

.mode-v2-page--arithmetic .mode-v2-workspace {
    grid-template-columns: minmax(620px, 1fr) minmax(340px, 400px);
    grid-template-areas:
        "lesson lesson"
        "template template"
        "preview controls"
        "preview output";
    gap: 14px;
    align-items: start;
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel {
    grid-area: lesson;
}

.mode-v2-page--arithmetic .mode-v2-template-panel {
    grid-area: template;
}

.mode-v2-page--arithmetic .mode-v2-controls-panel,
.mode-v2-page--arithmetic .mode-v2-output-panel,
.mode-v2-page--arithmetic .mode-v2-preview-panel {
    min-width: 0;
}

.mode-v2-page--arithmetic .mode-v2-controls-panel {
    grid-area: controls;
}

.mode-v2-page--arithmetic .mode-v2-preview-panel {
    grid-area: preview;
}

.mode-v2-page--arithmetic .mode-v2-output-panel {
    grid-area: output;
    position: sticky;
    top: 88px;
}

.mode-v2-page--arithmetic .mode-v2-panel,
.mode-v2-page--arithmetic .mode-v2-topic-card,
.mode-v2-page--arithmetic .mode-v2-summary-item {
    background: var(--v2-panel);
    color: var(--v2-ink);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mode-v2-page--arithmetic .mode-v2-panel-head {
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2 {
    color: var(--v2-ink);
    font-size: clamp(1.08rem, 1.4vw, 1.45rem);
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel,
.mode-v2-page--arithmetic .mode-v2-template-panel {
    padding: 14px;
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel .mode-v2-panel-head,
.mode-v2-page--arithmetic .mode-v2-template-panel .mode-v2-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.mode-v2-page--arithmetic .mode-v2-topic-list {
    gap: 0;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic {
    border: 0;
    padding: 0;
    background: transparent;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic__head strong {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.mode-v2-page--arithmetic .mode-v2-topic-pill {
    min-height: 48px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--v2-ink);
    box-shadow: 0 8px 18px rgba(22, 45, 79, .07);
}

.mode-v2-page--arithmetic .mode-v2-topic-pill.is-active,
.mode-v2-page--arithmetic .mode-v2-settings-tab.is-active,
.mode-v2-page--arithmetic .mode-v2-segment-btn.is-active,
.mode-v2-page--arithmetic .mode-v2-operation-chip:has(input:checked),
.mode-v2-page--arithmetic .mode-v2-check-row--setting:has(input:checked) {
    background: linear-gradient(135deg, var(--v2-accent), color-mix(in srgb, var(--v2-accent) 66%, #ee6a5f));
    border-color: color-mix(in srgb, var(--v2-accent) 78%, #ffffff);
    color: #ffffff;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic p {
    margin-top: 10px;
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-template-head {
    margin-top: 0;
}

.mode-v2-page--arithmetic .mode-v2-template-tools {
    max-width: 360px;
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-template-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.mode-v2-page--arithmetic .mode-v2-template-card {
    min-height: 206px;
    border-color: var(--v2-line);
    background: #ffffff;
    color: var(--v2-ink);
    box-shadow: 0 10px 24px rgba(22, 45, 79, .08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mode-v2-page--arithmetic .mode-v2-template-card:hover,
.mode-v2-page--arithmetic .mode-v2-template-card:focus-visible,
.mode-v2-page--arithmetic .mode-v2-template-card.is-active {
    background: #ffffff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--v2-accent) 65%, transparent), 0 14px 30px rgba(31, 111, 178, .16);
}

.mode-v2-page--arithmetic .mode-v2-template-thumb {
    height: 136px;
    background: #f8fbff;
}

.mode-v2-page--arithmetic .mode-v2-template-card__body strong {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-template-card__body span,
.mode-v2-page--arithmetic .mode-v2-template-status,
.mode-v2-page--arithmetic .mode-v2-template-empty {
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-template-capacity {
    background: #f5f8fc;
}

.mode-v2-page--arithmetic .mode-v2-template-capacity.is-warning,
.mode-v2-page--arithmetic .mode-v2-template-status[data-tone="warning"] {
    color: #8a5a00;
}

.mode-v2-page--arithmetic .mode-v2-search input,
.mode-v2-page--arithmetic .mode-v2-field input,
.mode-v2-page--arithmetic .mode-v2-field select,
.mode-v2-page--arithmetic .mode-v2-page-control input {
    background: #ffffff;
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-settings-group {
    background: var(--v2-panel-soft);
}

.mode-v2-page--arithmetic .mode-v2-settings-tab,
.mode-v2-page--arithmetic .mode-v2-segment-btn,
.mode-v2-page--arithmetic .mode-v2-option-btn,
.mode-v2-page--arithmetic .mode-v2-check-row label,
.mode-v2-page--arithmetic .mode-v2-page-control,
.mode-v2-page--arithmetic .mode-v2-zoom-btn,
.mode-v2-page--arithmetic .mode-v2-icon-btn,
.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    background: #ffffff;
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-preview-panel {
    padding: 14px;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage {
    min-height: calc(100vh - 330px);
    padding: 16px;
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, #dfe9f5, #edf3fa);
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.mode-v2-page--arithmetic .mode-v2-preview-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}

.mode-v2-page--arithmetic .mode-v2-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-v2-page--arithmetic .mode-v2-summary-item {
    min-height: 54px;
    display: grid;
    align-content: center;
    background: #ffffff;
}

.mode-v2-page--arithmetic .mode-v2-actions {
    gap: 9px;
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    min-height: 48px;
    font-size: .98rem;
}

.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    order: 2;
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    order: 1;
}

.mode-v2-page--arithmetic .mode-v2-status {
    margin-bottom: 0;
}

.mode-v2-page--arithmetic .mode-v2-grade-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.mode-v2-page--arithmetic .mode-v2-grade-chip {
    flex: 0 0 auto;
    min-width: 68px;
    min-height: 44px;
    padding: 0 12px;
    box-shadow: none;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
}

.mode-v2-page--arithmetic .mode-v2-grade-chip strong {
    display: block;
    white-space: nowrap;
}

.mode-v2-page--arithmetic .mode-v2-panel-head + .mode-v2-topic-list,
.mode-v2-page--arithmetic .mode-v2-topic-list + .mode-v2-panel-head {
    margin-top: 12px;
}

.mode-v2-manual-topic {
    display: grid;
    gap: 10px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 10px;
    background: color-mix(in srgb, var(--v2-accent) 5%, rgba(255, 255, 255, .06));
}

.mode-v2-manual-topic__head {
    display: grid;
    gap: 3px;
}

.mode-v2-manual-topic__head span,
.mode-v2-manual-topic p {
    margin: 0;
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.45;
}

.mode-v2-manual-topic__head strong {
    color: #fff;
    font-size: .96rem;
    line-height: 1.35;
}

.mode-v2-manual-topic-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.mode-v2-topic-pill {
    min-height: 38px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 10px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    font: inherit;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
}

.mode-v2-topic-pill.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 70%, #fff);
    background: color-mix(in srgb, var(--v2-accent) 22%, rgba(255, 255, 255, .1));
    color: #fff;
}

.mode-v2-topic-pill:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.mode-v2-template-head {
    margin-top: 14px;
}

.mode-v2-template-tools {
    margin-bottom: 10px;
}

.mode-v2-template-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.mode-v2-template-card {
    display: grid;
    gap: 9px;
    min-width: 0;
    min-height: 172px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 9px;
    background: color-mix(in srgb, var(--v2-accent) 6%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.mode-v2-template-card:hover,
.mode-v2-template-card:focus-visible,
.mode-v2-template-card.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 72%, #fff);
    background: color-mix(in srgb, var(--v2-accent) 18%, rgba(255, 255, 255, .1));
}

.mode-v2-template-card.is-low-capacity {
    border-color: color-mix(in srgb, #fbbf24 52%, var(--v2-line));
}

.mode-v2-template-thumb {
    position: relative;
    display: grid;
    place-items: center;
    height: 112px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--v2-line) 70%, transparent);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
}

.mode-v2-template-thumb .review-template-page,
.mode-v2-template-thumb .mode-v2-template-thumb-page {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(var(--mode-v2-template-thumb-scale, .12));
    transform-origin: center center;
    pointer-events: none;
}

.mode-v2-template-thumb--auto {
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 16%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 16%, transparent) 1px, transparent 1px),
        rgba(255, 255, 255, .92);
    background-size: 18px 18px;
    color: #0f172a;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 900;
}

.mode-v2-template-thumb-fallback {
    width: 66%;
    height: 72%;
    border: 2px dashed color-mix(in srgb, var(--v2-accent) 42%, #94a3b8);
    border-radius: 8px;
}

.mode-v2-template-card__body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mode-v2-template-card__body strong,
.mode-v2-template-card__body span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mode-v2-template-card__body strong {
    color: #fff;
    font-size: .88rem;
    line-height: 1.25;
}

.mode-v2-template-card__body span,
.mode-v2-template-status,
.mode-v2-template-empty {
    color: var(--v2-muted);
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.4;
}

.mode-v2-template-capacity {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 3px 6px;
    border: 1px solid color-mix(in srgb, var(--v2-line) 78%, transparent);
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
}

.mode-v2-template-capacity.is-warning,
.mode-v2-template-status[data-tone="warning"] {
    color: #fde68a;
}

.mode-v2-template-capacity.is-warning {
    border-color: color-mix(in srgb, #fbbf24 52%, transparent);
    background: rgba(251, 191, 36, .12);
}

.mode-v2-template-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--v2-line);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, .06);
}

.mode-v2-topic-card--preset {
    gap: 10px;
    min-height: 0;
    padding: 13px;
}

.mode-v2-topic-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.mode-v2-topic-card__title {
    color: #fff;
    font-size: .98rem;
    font-weight: 900;
    line-height: 1.35;
}

.mode-v2-topic-card__desc,
.mode-v2-topic-note {
    color: var(--v2-muted);
    font-size: .84rem;
    font-weight: 750;
    line-height: 1.55;
}

.mode-v2-topic-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mode-v2-topic-meta span {
    min-height: 28px;
    border: 1px solid color-mix(in srgb, var(--v2-line) 82%, transparent);
    border-radius: 8px;
    padding: 4px 8px;
    background: color-mix(in srgb, var(--v2-accent) 8%, rgba(255, 255, 255, .07));
    color: color-mix(in srgb, var(--v2-ink) 92%, var(--v2-muted));
    font-size: .78rem;
    font-weight: 900;
}

.mode-v2-topic-note {
    display: block;
    border-left: 2px solid color-mix(in srgb, var(--v2-accent) 70%, #fff);
    padding-left: 8px;
}

.mode-v2-settings-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 10px;
}

.mode-v2-settings-tab {
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-muted);
    font: inherit;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
}

.mode-v2-settings-tab.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 70%, #fff);
    background: color-mix(in srgb, var(--v2-accent) 24%, rgba(255, 255, 255, .08));
    color: #fff;
}

.mode-v2-settings-accordion {
    padding: 0;
    overflow: hidden;
}

.mode-v2-settings-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 14px;
    color: #fff;
    font-size: .98rem;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.mode-v2-settings-accordion > summary::-webkit-details-marker {
    display: none;
}

.mode-v2-settings-accordion > summary::after {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    color: var(--v2-accent);
    background: rgba(255, 255, 255, .06);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.mode-v2-settings-accordion[open] > summary::after {
    content: "-";
}

.mode-v2-settings-accordion > .mode-v2-field-grid,
.mode-v2-settings-accordion > .mode-v2-field,
.mode-v2-settings-accordion > .mode-v2-check-row {
    margin: 0 14px 14px;
}

.mode-v2-settings-accordion .mode-v2-option-grid {
    padding: 0;
}

.mode-v2-page--arithmetic .mode-v2-preview-panel {
    padding: 14px;
}

.mode-v2-placeholder-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: start;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 22px;
    background: var(--v2-panel);
    box-shadow: var(--v2-shadow);
}

.mode-v2-placeholder-panel h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
}

.mode-v2-placeholder-panel p {
    color: var(--v2-muted);
    line-height: 1.68;
}

.mode-v2-placeholder-grid {
    display: grid;
    gap: 10px;
}

.mode-v2-placeholder-grid span {
    min-height: 44px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--v2-accent) 8%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    font-weight: 900;
}

.mode-v2-page--arithmetic .mode-v2-preview-head {
    align-items: flex-start;
}

.mode-v2-preview-tools {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mode-v2-zoom-btn {
    min-height: 40px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 11px;
    background: color-mix(in srgb, var(--v2-accent) 7%, rgba(255, 255, 255, .08));
    color: var(--v2-muted);
    font: inherit;
    font-size: .82rem;
    font-weight: 900;
    cursor: pointer;
}

.mode-v2-zoom-btn:hover,
.mode-v2-zoom-btn:focus-visible,
.mode-v2-zoom-btn.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 68%, #fff);
    color: #fff;
    background: color-mix(in srgb, var(--v2-accent) 20%, rgba(255, 255, 255, .08));
}

.mode-v2-page--arithmetic .mode-v2-preview-toolbar {
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage {
    min-height: calc(100vh - 270px);
    padding: 14px;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage .studio-preview-paper-wrap {
    width: max-content;
    margin: 0 auto;
}

.mode-v2-page--arithmetic .mode-v2-summary {
    grid-template-columns: 1fr;
}

.mode-v2-page--arithmetic .mode-v2-summary-item {
    min-height: 54px;
    display: grid;
    align-content: center;
}

.mode-v2-page--arithmetic .mode-v2-actions {
    gap: 9px;
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    min-height: 48px;
    font-size: .98rem;
}

.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    order: 2;
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    order: 1;
}

.mode-v2-page--arithmetic .mode-v2-status {
    margin-bottom: 0;
}

.mode-v2-page--arithmetic .mode-v2-template-head {
    margin-top: 0;
}

.mode-v2-page--arithmetic .mode-v2-template-tools {
    max-width: 360px;
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-template-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.mode-v2-page--arithmetic .mode-v2-template-card {
    min-height: 206px;
    border-color: var(--v2-line);
    background: #ffffff;
    color: var(--v2-ink);
    box-shadow: 0 10px 24px rgba(22, 45, 79, .08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mode-v2-page--arithmetic .mode-v2-template-card:hover,
.mode-v2-page--arithmetic .mode-v2-template-card:focus-visible,
.mode-v2-page--arithmetic .mode-v2-template-card.is-active {
    background: #ffffff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--v2-accent) 65%, transparent), 0 14px 30px rgba(31, 111, 178, .16);
}

.mode-v2-page--arithmetic .mode-v2-template-thumb {
    height: 136px;
    background: #f8fbff;
}

.mode-v2-page--arithmetic .mode-v2-template-card__body strong,
.mode-v2-page--arithmetic .mode-v2-topic-card__title,
.mode-v2-page--arithmetic .mode-v2-settings-accordion > summary {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-template-card__body span,
.mode-v2-page--arithmetic .mode-v2-template-status,
.mode-v2-page--arithmetic .mode-v2-template-empty {
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-template-capacity {
    background: #f5f8fc;
}

.mode-v2-page--arithmetic .mode-v2-template-capacity.is-warning,
.mode-v2-page--arithmetic .mode-v2-template-status[data-tone="warning"] {
    color: #8a5a00;
}

.mode-v2-page--arithmetic .mode-v2-search input,
.mode-v2-page--arithmetic .mode-v2-field input,
.mode-v2-page--arithmetic .mode-v2-field select,
.mode-v2-page--arithmetic .mode-v2-page-control input {
    background: #ffffff;
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-settings-group {
    background: var(--v2-panel-soft);
}

.mode-v2-page--arithmetic .mode-v2-settings-tab,
.mode-v2-page--arithmetic .mode-v2-segment-btn,
.mode-v2-page--arithmetic .mode-v2-option-btn,
.mode-v2-page--arithmetic .mode-v2-check-row label,
.mode-v2-page--arithmetic .mode-v2-page-control,
.mode-v2-page--arithmetic .mode-v2-zoom-btn,
.mode-v2-page--arithmetic .mode-v2-icon-btn,
.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    background: #ffffff;
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-zoom-btn.is-active,
.mode-v2-page--arithmetic .mode-v2-zoom-btn:hover,
.mode-v2-page--arithmetic .mode-v2-zoom-btn:focus-visible {
    background: linear-gradient(135deg, var(--v2-accent), color-mix(in srgb, var(--v2-accent) 66%, #ee6a5f));
    color: #ffffff;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage {
    min-height: calc(100vh - 330px);
    padding: 16px;
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, #dfe9f5, #edf3fa);
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.mode-v2-page--arithmetic .mode-v2-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-v2-page--arithmetic .mode-v2-summary-item {
    background: #ffffff;
}

.mode-v2-page--arithmetic .mode-v2-workspace {
    grid-template-columns: minmax(640px, 1fr) minmax(340px, 400px);
    grid-template-areas:
        "template lesson"
        "preview controls"
        "preview output";
}

.mode-v2-page--arithmetic .mode-v2-hero {
    margin-bottom: 12px;
    padding: 14px 18px;
}

.mode-v2-page--arithmetic .mode-v2-hero h1 {
    font-size: clamp(1.65rem, 2vw, 2.4rem);
}

.mode-v2-page--arithmetic .mode-v2-hero p {
    margin-top: 6px;
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel,
.mode-v2-page--arithmetic .mode-v2-template-panel {
    padding: 12px 14px;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-v2-page--arithmetic .mode-v2-topic-pill {
    min-height: 42px;
}

.mode-v2-page--arithmetic .mode-v2-template-tools {
    max-width: 320px;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-template-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mode-v2-page--arithmetic .mode-v2-template-card {
    min-height: 168px;
}

.mode-v2-page--arithmetic .mode-v2-template-thumb {
    height: 96px;
}

.mode-v2-page--arithmetic .mode-v2-kicker,
.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head strong {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-muted-label,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head span,
.mode-v2-page--arithmetic .mode-v2-manual-topic p,
.mode-v2-page--arithmetic .mode-v2-field,
.mode-v2-page--arithmetic .mode-v2-status {
    color: var(--v2-muted);
}

@media (max-width: 1180px) {
    .mode-v2-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mode-v2-workspace {
        grid-template-columns: minmax(310px, 390px) minmax(440px, 1fr);
    }

    .mode-v2-output-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .mode-v2-shell {
        width: min(100% - 24px, 1440px);
        padding-top: 22px;
    }

    .mode-v2-hero,
    .mode-v2-preview-head,
    .mode-v2-preview-toolbar,
    .mode-v2-workspace {
        grid-template-columns: 1fr;
        display: grid;
    }

    .mode-v2-hero {
        gap: 18px;
        align-items: start;
    }

    .mode-v2-hub-tools {
        justify-self: stretch;
        width: 100%;
    }

    .mode-v2-count-badge {
        justify-self: start;
    }

    .mode-v2-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-placeholder-panel {
        grid-template-columns: 1fr;
    }

    .mode-v2-preview-stage {
        min-height: 520px;
        padding: 10px;
    }
}

@media (max-width: 560px) {
    .mode-v2-grid,
    .mode-v2-grade-grid,
    .mode-v2-field-grid,
    .mode-v2-summary {
        grid-template-columns: 1fr;
    }

    .mode-v2-card {
        min-height: 0;
        grid-template-rows: none;
    }

    .mode-v2-hero h1 {
        font-size: 2.2rem;
    }

    .mode-v2-template-gallery {
        grid-template-columns: 1fr;
    }

    .mode-v2-meta-grid {
        grid-template-columns: 1fr;
    }

    .mode-v2-filter-btn {
        flex: 0 0 auto;
        padding: 0 10px;
    }

    .mode-v2-filter-row {
        margin-left: -2px;
        margin-right: -2px;
    }

    .mode-v2-card__top {
        align-items: start;
    }
}

html[data-index-v2-theme] body.mode-studio-v2-body .mode-v2-filter-btn,
body.mode-studio-v2-body .mode-v2-filter-btn {
    min-height: 44px !important;
}

html[data-index-v2-theme] body.mode-studio-v2-body .mode-v2-card__action,
body.mode-studio-v2-body .mode-v2-card__action {
    min-height: 44px !important;
}

html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn:hover,
html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn:focus-visible,
html[data-index-v2-theme] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-btn.is-active,
body.mode-studio-v2-body .mode-v2-filter-btn:hover,
body.mode-studio-v2-body .mode-v2-filter-btn:focus-visible,
body.mode-studio-v2-body .mode-v2-filter-btn.is-active {
    border-color: rgba(142, 243, 210, .72) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .035) 42%),
        linear-gradient(135deg, rgba(20, 184, 166, .68), rgba(37, 99, 235, .68)) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 26px rgba(20, 184, 166, .18) !important;
}

/* V1 alignment pass: Arithmetic V2 should feel like Mode Studio V1, not a separate light dashboard. */
body.mode-v2-page--arithmetic,
html[data-index-v2-theme] body.mode-v2-page--arithmetic.has-site-topbar-v2:not(.index-v2-legacy) {
    --studio-v3-topbar-offset: var(--sheetgenie-topbar-offset, 82px);
    --v2-bg: #071b31;
    --v2-panel: rgba(18, 43, 73, .82);
    --v2-panel-soft: rgba(39, 79, 119, .72);
    --v2-ink: #f3f8ff;
    --v2-muted: #c8d9ee;
    --v2-line: rgba(112, 164, 220, .32);
    --v2-shadow: 0 18px 46px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .07);
    --sg-theme-text: #f3f8ff;
    --sg-theme-muted: #c8d9ee;
    --sg-panel-bg: rgba(18, 43, 73, .82);
    --sg-card-bg: rgba(18, 43, 73, .82);
    color: var(--v2-ink);
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 135, 232, .36), transparent 34%),
        radial-gradient(circle at 88% 78%, rgba(238, 106, 95, .18), transparent 28%),
        linear-gradient(140deg, #07162b 0%, #0b2440 48%, #0f315a 100%);
}

.mode-v2-page--arithmetic .mode-v2-shell {
    width: min(1168px, calc(100% - 28px));
    padding: 18px 0 44px;
}

.mode-v2-page--arithmetic .mode-v2-nav {
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-hero {
    min-height: 62px;
    margin-bottom: 10px;
    padding: 14px 18px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(13, 32, 57, .78);
    color: var(--v2-ink);
    box-shadow: var(--v2-shadow);
}

.mode-v2-page--arithmetic .mode-v2-kicker,
.mode-v2-page--arithmetic .mode-v2-hero h1,
.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head strong,
.mode-v2-page--arithmetic .mode-v2-template-card__body strong,
.mode-v2-page--arithmetic .mode-v2-topic-card__title,
.mode-v2-page--arithmetic .mode-v2-settings-accordion > summary {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-hero h1 {
    font-size: clamp(1.45rem, 2.1vw, 2rem);
}

.mode-v2-page--arithmetic .mode-v2-hero p {
    margin-top: 4px;
    color: var(--v2-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.mode-v2-page--arithmetic .mode-v2-chip-row span {
    background: rgba(255, 255, 255, .08);
    color: var(--v2-ink);
    border: 1px solid var(--v2-line);
}

.mode-v2-trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.mode-v2-trust-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    padding: 0 12px;
    background: rgba(38, 76, 118, .62);
    color: var(--v2-muted);
    font-size: .82rem;
    font-weight: 900;
}

.mode-v2-trust-strip span::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 999px;
    background: var(--v2-good);
}

.mode-v2-page--arithmetic .mode-v2-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 330px) minmax(0, 1fr) minmax(270px, 300px);
    grid-template-areas:
        "lesson lesson lesson"
        "template preview output"
        "controls preview output";
    gap: 12px;
    align-items: start;
}

.mode-v2-page--arithmetic .mode-v2-panel,
.mode-v2-page--arithmetic .mode-v2-topic-card,
.mode-v2-page--arithmetic .mode-v2-summary-item,
.mode-v2-page--arithmetic .mode-v2-template-card {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-panel);
    color: var(--v2-ink);
    box-shadow: var(--v2-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel {
    grid-area: lesson;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-template-panel {
    grid-area: template;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-controls-panel {
    grid-area: controls;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-preview-panel {
    grid-area: preview;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-output-panel {
    grid-area: output;
    position: sticky;
    top: 86px;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-panel-head {
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel .mode-v2-panel-head,
.mode-v2-page--arithmetic .mode-v2-template-panel .mode-v2-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.mode-v2-page--arithmetic .mode-v2-muted-label,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head span,
.mode-v2-page--arithmetic .mode-v2-manual-topic p,
.mode-v2-page--arithmetic .mode-v2-field,
.mode-v2-page--arithmetic .mode-v2-status,
.mode-v2-page--arithmetic .mode-v2-template-card__body span,
.mode-v2-page--arithmetic .mode-v2-template-status,
.mode-v2-page--arithmetic .mode-v2-template-empty {
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-manual-topic {
    padding: 0;
    border: 0;
    background: transparent;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.mode-v2-page--arithmetic .mode-v2-topic-pill,
.mode-v2-page--arithmetic .mode-v2-settings-tab,
.mode-v2-page--arithmetic .mode-v2-segment-btn,
.mode-v2-page--arithmetic .mode-v2-option-btn,
.mode-v2-page--arithmetic .mode-v2-check-row label,
.mode-v2-page--arithmetic .mode-v2-page-control,
.mode-v2-page--arithmetic .mode-v2-zoom-btn,
.mode-v2-page--arithmetic .mode-v2-icon-btn,
.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    min-height: 42px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(42, 82, 124, .72);
    color: var(--v2-ink);
    box-shadow: none;
}

.mode-v2-page--arithmetic .mode-v2-topic-pill.is-active,
.mode-v2-page--arithmetic .mode-v2-settings-tab.is-active,
.mode-v2-page--arithmetic .mode-v2-segment-btn.is-active,
.mode-v2-page--arithmetic .mode-v2-operation-chip:has(input:checked),
.mode-v2-page--arithmetic .mode-v2-check-row--setting:has(input:checked),
.mode-v2-page--arithmetic .mode-v2-zoom-btn.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 72%, #ffffff);
    background: linear-gradient(135deg, var(--v2-accent), color-mix(in srgb, var(--v2-accent) 62%, #ee6a5f));
    color: #ffffff;
}

.mode-v2-page--arithmetic .mode-v2-template-tools {
    max-width: none;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-template-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-template-card {
    min-height: 0;
    padding: 10px;
    background: rgba(38, 76, 118, .72);
}

.mode-v2-page--arithmetic .mode-v2-template-thumb {
    height: 86px;
    background: rgba(255, 255, 255, .92);
}

.mode-v2-page--arithmetic .mode-v2-template-card.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 78%, #ffffff);
    background: linear-gradient(165deg, rgba(37, 135, 232, .34), rgba(238, 106, 95, .18));
}

.mode-v2-page--arithmetic .mode-v2-template-capacity {
    background: rgba(255, 255, 255, .08);
    border-color: var(--v2-line);
}

.mode-v2-page--arithmetic .mode-v2-template-capacity.is-warning,
.mode-v2-page--arithmetic .mode-v2-template-status[data-tone="warning"] {
    color: #fde68a;
}

.mode-v2-page--arithmetic .mode-v2-search input,
.mode-v2-page--arithmetic .mode-v2-field input,
.mode-v2-page--arithmetic .mode-v2-field select,
.mode-v2-page--arithmetic .mode-v2-page-control input {
    background: rgba(8, 24, 44, .72);
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-settings-group {
    border-color: var(--v2-line);
    background: rgba(18, 43, 73, .58);
}

.mode-v2-page--arithmetic .mode-v2-preview-head,
.mode-v2-page--arithmetic .mode-v2-preview-toolbar {
    gap: 10px;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage {
    min-height: calc(100vh - 310px);
    padding: 14px;
    border-color: var(--v2-line);
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, rgba(5, 15, 30, .74), rgba(9, 22, 42, .56));
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.mode-v2-page--arithmetic .mode-v2-summary {
    grid-template-columns: 1fr;
}

.mode-v2-page--arithmetic .mode-v2-summary-item {
    min-height: 52px;
    background: rgba(42, 82, 124, .72);
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    min-height: 48px;
}

@media (max-width: 1180px) {
    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(290px, 320px) minmax(0, 1fr);
        grid-template-areas:
            "lesson lesson"
            "template preview"
            "controls preview"
            "output output";
    }

    .mode-v2-page--arithmetic .mode-v2-output-panel {
        position: static;
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .mode-v2-page--arithmetic .mode-v2-shell {
        width: min(100% - 16px, 1168px);
    }

    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: 1fr;
        grid-template-areas:
            "lesson"
            "template"
            "preview"
            "controls"
            "output";
    }

    .mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-template-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .mode-v2-page--arithmetic .mode-v2-template-gallery,
    .mode-v2-page--arithmetic .mode-v2-summary,
    .mode-v2-page--arithmetic .mode-v2-field-grid {
        grid-template-columns: 1fr;
    }

    .mode-v2-page--arithmetic .mode-v2-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1280px) {
    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(600px, 1fr) minmax(320px, 380px);
        grid-template-areas:
            "template lesson"
            "preview controls"
            "preview output";
    }

    .mode-v2-page--arithmetic .mode-v2-output-panel {
        position: sticky;
        grid-column: auto;
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-template-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body.mode-v2-page--arithmetic {
        overflow-x: hidden;
    }

    .mode-v2-page--arithmetic .mode-v2-arithmetic-grade-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "template"
            "lesson"
            "preview"
            "controls"
            "output";
    }

    .mode-v2-page--arithmetic .mode-v2-template-gallery,
    .mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-controls-panel {
        order: 1;
    }

    .mode-v2-page--arithmetic .mode-v2-output-panel {
        order: 2;
        grid-column: auto;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-panel {
        order: 3;
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-preview-head,
    .mode-v2-page--arithmetic .mode-v2-preview-toolbar {
        display: grid;
        justify-items: stretch;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-toolbar,
    .mode-v2-page--arithmetic .mode-v2-preview-tools,
    .mode-v2-page--arithmetic .mode-v2-page-switcher {
        width: 100%;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-tools,
    .mode-v2-page--arithmetic .mode-v2-page-switcher {
        justify-content: space-between;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-stage {
        min-height: 560px;
    }
}

@media (max-width: 560px) {
    .mode-v2-page--arithmetic .mode-v2-shell {
        width: min(100% - 16px, 1440px);
    }

    .mode-v2-page--arithmetic .mode-v2-hero h1 {
        font-size: 2rem;
    }

    .mode-v2-page--arithmetic .mode-v2-summary,
    .mode-v2-page--arithmetic .mode-v2-field-grid {
        grid-template-columns: 1fr;
    }

    .mode-v2-page--arithmetic .mode-v2-grade-chip {
        min-width: 62px;
        padding: 0 10px;
    }

    .mode-v2-page--arithmetic .mode-v2-topic-card__top,
    .mode-v2-page--arithmetic .mode-v2-panel-head--inline {
        display: grid;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-stage {
        min-height: 480px;
        padding: 8px;
    }

    .mode-v2-page--arithmetic .mode-v2-icon-btn,
    .mode-v2-page--arithmetic .mode-v2-zoom-btn,
    .mode-v2-page--arithmetic .mode-v2-page-control {
        min-height: 44px;
    }
}

/* Final V1 parity override. Keep this after older arithmetic layout experiments. */
body.mode-v2-page--arithmetic,
html[data-index-v2-theme] body.mode-v2-page--arithmetic.has-site-topbar-v2:not(.index-v2-legacy) {
    --v2-bg: #071b31;
    --v2-panel: rgba(18, 43, 73, .82);
    --v2-panel-soft: rgba(40, 78, 118, .68);
    --v2-ink: #f3f8ff;
    --v2-muted: #c7d8ec;
    --v2-line: rgba(153, 194, 238, .26);
    --v2-line-strong: rgba(175, 214, 255, .46);
    --v2-accent: var(--sg-theme-accent, #2587e8);
    --v2-good: #31d0aa;
    --v2-shadow: 0 18px 42px rgba(3, 10, 20, .24), inset 0 1px 0 rgba(255, 255, 255, .08);
    --sg-theme-text: #f3f8ff;
    --sg-theme-muted: #c7d8ec;
    --sg-theme-line: rgba(153, 194, 238, .26);
    --sg-panel-bg: rgba(18, 43, 73, .82);
    --sg-card-bg: rgba(18, 43, 73, .82);
    color: var(--v2-ink);
    background:
        radial-gradient(circle at 14% 16%, rgba(37, 135, 232, .34), transparent 34%),
        radial-gradient(circle at 88% 78%, rgba(238, 106, 95, .2), transparent 28%),
        linear-gradient(140deg, #07162b 0%, #0b2440 48%, #0f315a 100%);
}

body.mode-v2-page--arithmetic.has-site-topbar-v2 {
    padding-top: var(--sheetgenie-topbar-offset, 82px);
}

.mode-v2-page--arithmetic .mode-v2-shell {
    width: min(1760px, calc(100% - 28px));
    padding: clamp(12px, 1.4vw, 18px) 0 42px;
}

.mode-v2-page--arithmetic .mode-v2-nav {
    margin-bottom: 10px;
    font-size: .85rem;
}

.mode-v2-page--arithmetic .mode-v2-nav a {
    color: color-mix(in srgb, var(--v2-accent) 76%, #ffffff);
}

.mode-v2-page--arithmetic .mode-v2-hero {
    position: relative;
    min-height: 72px;
    margin-bottom: 12px;
    padding: 16px 18px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)),
        rgba(13, 32, 57, .82);
    box-shadow: var(--v2-shadow);
}

.mode-v2-page--arithmetic .mode-v2-hero > div:first-child {
    position: relative;
    min-height: 48px;
    padding-left: 62px;
}

.mode-v2-page--arithmetic .mode-v2-hero > div:first-child::before {
    content: "+−×÷";
    position: absolute;
    left: 0;
    top: 50%;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--v2-accent), color-mix(in srgb, var(--v2-accent) 58%, #ee6a5f));
    color: #ffffff;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: .78rem;
    font-weight: 900;
    box-shadow: 0 16px 34px color-mix(in srgb, var(--v2-accent) 24%, transparent);
}

.mode-v2-page--arithmetic .mode-v2-kicker {
    margin-bottom: 4px;
    color: color-mix(in srgb, var(--v2-accent) 65%, #ffffff);
    letter-spacing: .04em;
}

.mode-v2-page--arithmetic .mode-v2-hero h1 {
    color: var(--v2-ink);
    font-size: clamp(1.2rem, 1.7vw, 1.72rem);
    line-height: 1.18;
}

.mode-v2-page--arithmetic .mode-v2-hero p {
    max-width: 780px;
    margin-top: 5px;
    color: var(--v2-muted);
    font-size: .92rem;
    line-height: 1.45;
}

.mode-v2-page--arithmetic .mode-v2-chip-row span,
.mode-v2-page--arithmetic .mode-v2-trust-strip span {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--v2-accent) 11%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    box-shadow: 0 10px 20px rgba(3, 10, 20, .14);
}

.mode-v2-page--arithmetic .mode-v2-trust-strip {
    gap: 10px;
    margin: 0 0 12px;
}

.mode-v2-page--arithmetic .mode-v2-trust-strip span {
    min-height: 34px;
    padding: 0 12px;
    font-size: .86rem;
}

.mode-v2-page--arithmetic .mode-v2-trust-strip span::before {
    width: 7px;
    height: 7px;
    background: #31d0aa;
}

.mode-v2-page--arithmetic .mode-v2-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(680px, 720px) minmax(300px, 1fr);
    grid-template-areas:
        "lesson lesson lesson"
        "template preview output"
        "controls preview output";
    justify-content: stretch;
    gap: 14px;
    align-items: start;
    margin-top: 0;
}

.mode-v2-page--arithmetic .mode-v2-panel,
.mode-v2-page--arithmetic .mode-v2-topic-card,
.mode-v2-page--arithmetic .mode-v2-summary-item,
.mode-v2-page--arithmetic .mode-v2-template-card,
.mode-v2-page--arithmetic .mode-v2-settings-group {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: var(--v2-panel);
    color: var(--v2-ink);
    box-shadow: var(--v2-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mode-v2-page--arithmetic .mode-v2-lesson-panel {
    grid-area: lesson;
    padding: 14px;
}

.mode-v2-page--arithmetic .mode-v2-template-panel {
    grid-area: template;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-controls-panel {
    grid-area: controls;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-preview-panel {
    grid-area: preview;
    position: sticky;
    top: calc(var(--studio-v3-topbar-offset, 82px) + 14px);
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-output-panel {
    grid-area: output;
    position: sticky;
    top: calc(var(--studio-v3-topbar-offset, 82px) + 14px);
    max-height: calc(100dvh - var(--studio-v3-topbar-offset, 82px) - 28px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    overflow: hidden;
    padding: 16px;
}

.mode-v2-page--arithmetic .mode-v2-panel-head,
.mode-v2-page--arithmetic .mode-v2-preview-head {
    margin-bottom: 12px;
}

.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head strong,
.mode-v2-page--arithmetic .mode-v2-template-card__body strong,
.mode-v2-page--arithmetic .mode-v2-topic-card__title,
.mode-v2-page--arithmetic .mode-v2-settings-accordion > summary,
.mode-v2-page--arithmetic .mode-v2-summary-item strong {
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-panel-head h2,
.mode-v2-page--arithmetic .mode-v2-preview-head h2 {
    font-size: clamp(1.08rem, 1.45vw, 1.34rem);
}

.mode-v2-page--arithmetic .mode-v2-muted-label,
.mode-v2-page--arithmetic .mode-v2-manual-topic__head span,
.mode-v2-page--arithmetic .mode-v2-manual-topic p,
.mode-v2-page--arithmetic .mode-v2-field,
.mode-v2-page--arithmetic .mode-v2-status,
.mode-v2-page--arithmetic .mode-v2-template-card__body span,
.mode-v2-page--arithmetic .mode-v2-template-status,
.mode-v2-page--arithmetic .mode-v2-template-empty,
.mode-v2-page--arithmetic .mode-v2-summary-item span {
    color: var(--v2-muted);
}

.mode-v2-page--arithmetic .mode-v2-manual-topic {
    padding: 0;
    border: 0;
    background: transparent;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic__head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-manual-topic-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.mode-v2-page--arithmetic .mode-v2-topic-pill,
.mode-v2-page--arithmetic .mode-v2-settings-tab,
.mode-v2-page--arithmetic .mode-v2-segment-btn,
.mode-v2-page--arithmetic .mode-v2-option-btn,
.mode-v2-page--arithmetic .mode-v2-check-row label,
.mode-v2-page--arithmetic .mode-v2-page-control,
.mode-v2-page--arithmetic .mode-v2-zoom-btn,
.mode-v2-page--arithmetic .mode-v2-icon-btn,
.mode-v2-page--arithmetic .mode-v2-secondary-btn {
    min-height: 42px;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02) 52%, rgba(3, 10, 20, .1)),
        color-mix(in srgb, var(--v2-accent) 12%, rgba(255, 255, 255, .08));
    color: var(--v2-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(3, 10, 20, .2), 0 10px 20px rgba(3, 10, 20, .14);
}

.mode-v2-page--arithmetic .mode-v2-topic-pill.is-active,
.mode-v2-page--arithmetic .mode-v2-settings-tab.is-active,
.mode-v2-page--arithmetic .mode-v2-segment-btn.is-active,
.mode-v2-page--arithmetic .mode-v2-operation-chip:has(input:checked),
.mode-v2-page--arithmetic .mode-v2-check-row--setting:has(input:checked),
.mode-v2-page--arithmetic .mode-v2-zoom-btn.is-active,
.mode-v2-page--arithmetic .mode-v2-topic-card.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 58%, rgba(255, 255, 255, .18));
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 44%),
        linear-gradient(135deg, color-mix(in srgb, var(--v2-accent) 72%, rgba(255, 255, 255, .08)), color-mix(in srgb, #ee6a5f 38%, rgba(255, 255, 255, .1)));
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 color-mix(in srgb, var(--v2-accent) 42%, rgba(0, 0, 0, .34)), 0 18px 34px color-mix(in srgb, var(--v2-accent) 24%, transparent);
}

.mode-v2-page--arithmetic .mode-v2-template-tools {
    max-width: none;
    margin-bottom: 10px;
}

.mode-v2-page--arithmetic .mode-v2-template-gallery {
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: clamp(250px, 34dvh, 360px);
    overflow-y: auto;
    padding-right: 6px;
}

.mode-v2-page--arithmetic .mode-v2-template-card {
    min-height: 0;
    padding: 10px;
    background: color-mix(in srgb, var(--v2-accent) 8%, rgba(255, 255, 255, .06));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(3, 10, 20, .2), 0 10px 22px rgba(3, 10, 20, .12);
}

.mode-v2-page--arithmetic .mode-v2-template-card:hover,
.mode-v2-page--arithmetic .mode-v2-template-card:focus-visible {
    border-color: var(--v2-line-strong);
}

.mode-v2-page--arithmetic .mode-v2-template-card.is-active {
    border-color: color-mix(in srgb, var(--v2-accent) 58%, rgba(255, 255, 255, .18));
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .2), transparent 44%),
        linear-gradient(135deg, color-mix(in srgb, var(--v2-accent) 72%, rgba(255, 255, 255, .08)), color-mix(in srgb, #ee6a5f 38%, rgba(255, 255, 255, .1)));
}

.mode-v2-page--arithmetic .mode-v2-template-thumb {
    height: 86px;
    border-radius: 6px;
    background: #f8fbff;
}

.mode-v2-page--arithmetic .mode-v2-template-capacity {
    border-color: var(--v2-line);
    background: rgba(255, 255, 255, .08);
}

.mode-v2-page--arithmetic .mode-v2-template-capacity.is-warning,
.mode-v2-page--arithmetic .mode-v2-template-status[data-tone="warning"] {
    color: #ffe3a3;
}

.mode-v2-page--arithmetic .mode-v2-search input,
.mode-v2-page--arithmetic .mode-v2-field input,
.mode-v2-page--arithmetic .mode-v2-field select,
.mode-v2-page--arithmetic .mode-v2-page-control input {
    border-color: var(--v2-line);
    background: rgba(7, 21, 44, .64);
    color: var(--v2-ink);
}

.mode-v2-page--arithmetic .mode-v2-search input::placeholder,
.mode-v2-page--arithmetic .mode-v2-field input::placeholder {
    color: color-mix(in srgb, var(--v2-muted) 68%, transparent);
}

.mode-v2-page--arithmetic .mode-v2-settings-group {
    gap: 10px;
    padding: 12px;
    background: var(--v2-panel-soft);
    box-shadow: none;
}

.mode-v2-page--arithmetic .mode-v2-preview-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.mode-v2-page--arithmetic .mode-v2-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage {
    min-height: calc(100dvh - var(--studio-v3-topbar-offset, 82px) - 198px);
    padding: 14px;
    overflow: auto;
    border-color: var(--v2-line);
    background:
        linear-gradient(color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--v2-accent) 8%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, rgba(5, 15, 30, .74), rgba(9, 22, 42, .56));
    background-size: 28px 28px, 28px 28px, 100% 100%;
}

.mode-v2-page--arithmetic .mode-v2-preview-stage .studio-preview-paper-wrap {
    display: grid;
    justify-content: center;
    min-width: min-content;
}

.mode-v2-page--arithmetic .mode-v2-summary {
    grid-template-columns: 1fr;
    align-content: start;
    overflow-y: auto;
    padding-right: 4px;
}

.mode-v2-page--arithmetic .mode-v2-summary-item {
    min-height: 52px;
    padding: 10px;
    background: color-mix(in srgb, var(--v2-accent) 10%, rgba(255, 255, 255, .08));
    box-shadow: none;
}

.mode-v2-page--arithmetic .mode-v2-actions {
    align-self: end;
}

.mode-v2-page--arithmetic .mode-v2-primary-btn {
    min-height: 48px;
    border-color: transparent;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), transparent 42%),
        linear-gradient(135deg, var(--v2-accent), color-mix(in srgb, var(--v2-accent) 62%, #ee6a5f));
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -2px 0 color-mix(in srgb, var(--v2-accent) 54%, rgba(0, 0, 0, .36)), 0 18px 34px color-mix(in srgb, var(--v2-accent) 28%, transparent);
}

@media (max-width: 1420px) {
    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(280px, 330px) minmax(0, 1fr) minmax(250px, 300px);
        grid-template-areas:
            "lesson lesson lesson"
            "template preview output"
            "controls preview output";
    }

    .mode-v2-page--arithmetic .mode-v2-preview-panel,
    .mode-v2-page--arithmetic .mode-v2-output-panel {
        position: sticky;
    }
}

@media (max-width: 1080px) {
    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(290px, 340px) minmax(0, 1fr);
        grid-template-areas:
            "lesson lesson"
            "template preview"
            "controls preview"
            "output output";
    }

    .mode-v2-page--arithmetic .mode-v2-output-panel,
    .mode-v2-page--arithmetic .mode-v2-preview-panel {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        overflow: visible;
    }
}

@media (max-width: 860px) {
    .mode-v2-page--arithmetic .mode-v2-shell {
        width: min(100% - 16px, 1760px);
    }

    .mode-v2-page--arithmetic .mode-v2-hero,
    .mode-v2-page--arithmetic .mode-v2-preview-head,
    .mode-v2-page--arithmetic .mode-v2-preview-toolbar {
        display: grid;
        justify-items: stretch;
    }

    .mode-v2-page--arithmetic .mode-v2-workspace {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "lesson"
            "template"
            "controls"
            "preview"
            "output";
    }

    .mode-v2-page--arithmetic .mode-v2-manual-topic-grid,
    .mode-v2-page--arithmetic .mode-v2-template-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .mode-v2-page--arithmetic .mode-v2-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mode-v2-page--arithmetic .mode-v2-preview-toolbar,
    .mode-v2-page--arithmetic .mode-v2-preview-tools,
    .mode-v2-page--arithmetic .mode-v2-page-switcher {
        width: 100%;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-tools,
    .mode-v2-page--arithmetic .mode-v2-page-switcher {
        justify-content: space-between;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-stage {
        min-height: 560px;
    }
}

@media (max-width: 560px) {
    .mode-v2-page--arithmetic .mode-v2-shell {
        width: min(100% - 14px, 1760px);
    }

    .mode-v2-page--arithmetic .mode-v2-hero {
        grid-template-columns: 1fr;
    }

    .mode-v2-page--arithmetic .mode-v2-hero > div:first-child {
        padding-left: 0;
        padding-top: 54px;
    }

    .mode-v2-page--arithmetic .mode-v2-hero > div:first-child::before {
        top: 0;
        transform: none;
    }

    .mode-v2-page--arithmetic .mode-v2-trust-strip span {
        flex: 1 1 100%;
    }

    .mode-v2-page--arithmetic .mode-v2-manual-topic-grid,
    .mode-v2-page--arithmetic .mode-v2-template-gallery,
    .mode-v2-page--arithmetic .mode-v2-summary,
    .mode-v2-page--arithmetic .mode-v2-field-grid {
        grid-template-columns: 1fr;
    }

    .mode-v2-page--arithmetic .mode-v2-preview-stage {
        min-height: 480px;
        padding: 8px;
    }
}

/* Light theme lock for the Mode Studio V2 hub. */
html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) {
    --v2-bg: #eef6ff !important;
    --v2-panel: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(239, 247, 255, .94)) !important;
    --v2-panel-soft: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(234, 245, 255, .9)) !important;
    --v2-ink: #12233a !important;
    --v2-muted: #526984 !important;
    --v2-line: #c9dcf4 !important;
    --v2-line-strong: #8fb8ea !important;
    --v2-accent: #2587e8 !important;
    --v2-accent-2: #16a8e8 !important;
    --v2-accent-dark: #ffffff !important;
    --v2-good: #07845f !important;
    --v2-shadow: 0 20px 52px rgba(22, 58, 98, .12), inset 0 1px 0 rgba(255, 255, 255, .72) !important;
    --sgv2-topbar-bg: rgba(255, 255, 255, .88) !important;
    --sgv2-topbar-text: #12233a !important;
    --sgv2-topbar-muted: #526984 !important;
    --sgv2-topbar-border: rgba(142, 176, 218, .42) !important;
    color: var(--v2-ink) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 135, 232, .18), transparent 34%),
        radial-gradient(circle at 82% 10%, rgba(31, 169, 141, .14), transparent 30%),
        linear-gradient(180deg, #eef6ff 0%, #e8f1fc 48%, #f8fbff 100%) !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-row,
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-filter-row,
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) .mode-v2-filter-row,
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) .mode-v2-filter-row {
    border: 1px solid var(--v2-line) !important;
    background: rgba(255, 255, 255, .78) !important;
    box-shadow: 0 14px 34px rgba(22, 58, 98, .1) !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-card, .mode-v2-panel, .mode-v2-topic-card, .mode-v2-grade-btn, .mode-v2-summary-item, .mode-v2-filter-btn, .mode-v2-badge, .mode-v2-meta-grid div, .mode-v2-chip-row span, .mode-v2-lock-pill, .mode-v2-empty),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-card, .mode-v2-panel, .mode-v2-topic-card, .mode-v2-grade-btn, .mode-v2-summary-item, .mode-v2-filter-btn, .mode-v2-badge, .mode-v2-meta-grid div, .mode-v2-chip-row span, .mode-v2-lock-pill, .mode-v2-empty),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-card, .mode-v2-panel, .mode-v2-topic-card, .mode-v2-grade-btn, .mode-v2-summary-item, .mode-v2-filter-btn, .mode-v2-badge, .mode-v2-meta-grid div, .mode-v2-chip-row span, .mode-v2-lock-pill, .mode-v2-empty),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-card, .mode-v2-panel, .mode-v2-topic-card, .mode-v2-grade-btn, .mode-v2-summary-item, .mode-v2-filter-btn, .mode-v2-badge, .mode-v2-meta-grid div, .mode-v2-chip-row span, .mode-v2-lock-pill, .mode-v2-empty) {
    border-color: var(--v2-line) !important;
    background: var(--v2-panel) !important;
    color: var(--v2-ink) !important;
    box-shadow: var(--v2-shadow) !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-hub-card, .mode-v2-card.is-locked),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-hub-card, .mode-v2-card.is-locked),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-hub-card, .mode-v2-card.is-locked),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-hub-card, .mode-v2-card.is-locked) {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(239, 247, 255, .94)),
        #ffffff !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-card h2, .mode-v2-panel h2, .mode-v2-panel h3, .mode-v2-topic-card h3, .mode-v2-card__body strong, .mode-v2-meta-grid strong),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-card h2, .mode-v2-panel h2, .mode-v2-panel h3, .mode-v2-topic-card h3, .mode-v2-card__body strong, .mode-v2-meta-grid strong),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-card h2, .mode-v2-panel h2, .mode-v2-panel h3, .mode-v2-topic-card h3, .mode-v2-card__body strong, .mode-v2-meta-grid strong),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-card h2, .mode-v2-panel h2, .mode-v2-panel h3, .mode-v2-topic-card h3, .mode-v2-card__body strong, .mode-v2-meta-grid strong) {
    color: var(--v2-ink) !important;
    -webkit-text-fill-color: var(--v2-ink) !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-hero p, .mode-v2-search, .mode-v2-card p, .mode-v2-topic-card p, .mode-v2-panel p, .mode-v2-card__body small, .mode-v2-card__body em, .mode-v2-meta-grid span, .mode-v2-card__note),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-hero p, .mode-v2-search, .mode-v2-card p, .mode-v2-topic-card p, .mode-v2-panel p, .mode-v2-card__body small, .mode-v2-card__body em, .mode-v2-meta-grid span, .mode-v2-card__note),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-hero p, .mode-v2-search, .mode-v2-card p, .mode-v2-topic-card p, .mode-v2-panel p, .mode-v2-card__body small, .mode-v2-card__body em, .mode-v2-meta-grid span, .mode-v2-card__note),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-hero p, .mode-v2-search, .mode-v2-card p, .mode-v2-topic-card p, .mode-v2-panel p, .mode-v2-card__body small, .mode-v2-card__body em, .mode-v2-meta-grid span, .mode-v2-card__note) {
    color: var(--v2-muted) !important;
    -webkit-text-fill-color: var(--v2-muted) !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-search input, .mode-v2-field input, .mode-v2-field select, .mode-v2-page-control input),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-search input, .mode-v2-field input, .mode-v2-field select, .mode-v2-page-control input),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-search input, .mode-v2-field input, .mode-v2-field select, .mode-v2-page-control input),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-search input, .mode-v2-field input, .mode-v2-field select, .mode-v2-page-control input) {
    border-color: var(--v2-line) !important;
    background: #ffffff !important;
    color: var(--v2-ink) !important;
    -webkit-text-fill-color: var(--v2-ink) !important;
    color-scheme: light !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-filter-btn:hover, .mode-v2-filter-btn:focus-visible, .mode-v2-filter-btn.is-active, .mode-v2-card__action, .mode-v2-primary-btn, .mode-v2-readiness--ready),
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) :where(.mode-v2-filter-btn:hover, .mode-v2-filter-btn:focus-visible, .mode-v2-filter-btn.is-active, .mode-v2-card__action, .mode-v2-primary-btn, .mode-v2-readiness--ready),
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-filter-btn:hover, .mode-v2-filter-btn:focus-visible, .mode-v2-filter-btn.is-active, .mode-v2-card__action, .mode-v2-primary-btn, .mode-v2-readiness--ready),
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) :where(.mode-v2-filter-btn:hover, .mode-v2-filter-btn:focus-visible, .mode-v2-filter-btn.is-active, .mode-v2-card__action, .mode-v2-primary-btn, .mode-v2-readiness--ready) {
    border-color: transparent !important;
    background: linear-gradient(135deg, #2f7df6, #16a8e8) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-v2-mode-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-card__action.is-disabled,
html[data-arithmetic-theme="light"] body.mode-studio-v2-body:not(.mode-v2-page--arithmetic) .mode-v2-card__action.is-disabled,
body.mode-studio-v2-body.has-site-topbar-v2[data-v2-mode-theme="light"]:not(.mode-v2-page--arithmetic) .mode-v2-card__action.is-disabled,
body.mode-studio-v2-body.has-site-topbar-v2[data-arithmetic-theme="light"]:not(.mode-v2-page--arithmetic) .mode-v2-card__action.is-disabled {
    border-color: var(--v2-line) !important;
    background: #dbe7f5 !important;
    color: #48617d !important;
    -webkit-text-fill-color: #48617d !important;
}
