* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-scale: 1;
}
html {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    font-size: calc(16px * var(--font-scale, 1));
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Thin green scrollbars (shared/scrollbars.css); tuned for dark editor chrome */
    --sb-track: rgba(255, 255, 255, 0.06);
    --sb-thumb: #2ecc71;
    --sb-thumb-hover: #3ddf8a;
    --sb-thumb-active: #27ae60;
}

.editor-page {
    --hint-panel-width: 480px;
    --output-panel-height: 180px;
    --file-explorer-width: 220px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    /* visible so goal hover bubbles can extend above the header */
    overflow: visible;
}

.editor-header {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    min-height: 52px;
    overflow: visible;
    z-index: 20;
}

.editor-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* AP FRQ: visible problem picker in header */
.editor-header--frq .frq-problem-pick {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.frq-problem-pick__label {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9a9a9a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.frq-problem-select {
    flex: 1;
    min-width: 140px;
    max-width: min(100%, 480px);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #e8e8e8;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 6px;
    cursor: pointer;
}

.frq-problem-select:hover {
    border-color: #666;
}

.frq-problem-select:focus {
    outline: 2px solid #2ecc71;
    outline-offset: 2px;
}

.frq-setup-open-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #2ecc71;
    background: transparent;
    border: 1px solid #2ecc71;
    border-radius: 6px;
    cursor: pointer;
}

.frq-setup-open-btn:hover {
    background: rgba(46, 204, 113, 0.12);
}

body.theme-light .frq-setup-open-btn {
    color: #1a7f4c;
    border-color: #1a7f4c;
}

.frq-setup-list .progress-modal-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.frq-setup-list input[type='radio'] {
    margin-top: 3px;
    flex-shrink: 0;
}

.question-content .frq-prompt-figure-wrap {
    margin: 10px 0 14px;
}

.question-content .frq-prompt-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #3c3c3c;
}

body.theme-light .question-content .frq-prompt-img {
    border-color: #ddd;
}

.question-content .frq-example-heading {
    margin: 18px 0 10px;
    padding-top: 4px;
    border-top: 1px solid #3c3c3c;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2ecc71;
}

body.theme-light .frq-problem-pick__label {
    color: #666;
}

body.theme-light .frq-problem-select {
    color: #222;
    background: #fff;
    border-color: #ccc;
}

body.theme-light .frq-problem-select:hover {
    border-color: #aaa;
}

body.theme-light .question-content .frq-example-heading {
    border-top-color: #e0e0e0;
    color: #1a7f4c;
}

.back-link {
    color: #2ecc71;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.back-link:hover {
    background: rgba(46, 204, 113, 0.15);
}

.editor-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #cccccc;
    flex-shrink: 0;
}

.header-progress-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: min(320px, 36vw);
    overflow: visible;
}

.header-progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-progress-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    flex-shrink: 0;
}

.header-progress-track {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
    align-items: center;
    min-width: 0;
    overflow: visible;
}

.header-progress-track--complete .progress-icon--done {
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.45);
}

.progress-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-icon-wrap:not(.progress-icon-wrap--show-bubble) .progress-icon-bubble {
    display: none;
}

.progress-icon-bubble {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    bottom: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 128px;
    max-width: min(260px, 70vw);
    transform: translateY(-50%) translateX(-8px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.22s ease,
        transform 0.26s cubic-bezier(0.34, 1.45, 0.64, 1);
    z-index: 6000;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
}

.progress-icon-wrap--show-bubble:hover .progress-icon-bubble,
.progress-icon-wrap--show-bubble:focus-within .progress-icon-bubble {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
}

.progress-icon-bubble-inner {
    background: linear-gradient(165deg, #ffffff 0%, #fafcfa 100%);
    color: #2a2a2a;
    padding: 10px 14px 11px;
    border-radius: 14px;
    border: 1px solid rgba(46, 204, 113, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 0 0 1px rgba(255, 255, 255, 0.5);
    text-align: center;
    line-height: 1.4;
}

.progress-icon-bubble-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #1e2d24;
    letter-spacing: 0.02em;
}

.progress-icon-bubble--plain .progress-icon-bubble-title::before {
    content: none;
}

.progress-icon-bubble:not(.progress-icon-bubble--plain) .progress-icon-bubble-title::before {
    content: '\2728 ';
    font-size: 10px;
    opacity: 0.85;
}

.progress-icon-bubble-sub {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #3d6b4a;
}

.progress-icon-bubble-sub.progress-bubble-sub--live {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.progress-icon-bubble-tail {
    width: 10px;
    height: 10px;
    margin-right: -5px;
    flex-shrink: 0;
    z-index: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f6faf7 100%);
    border-left: 1px solid rgba(46, 204, 113, 0.2);
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
    transform: rotate(45deg);
}

.progress-icon--unset ~ .progress-icon-bubble .progress-icon-bubble-title::before {
    content: '\1f4a1 ';
}

.progress-icon--unset ~ .progress-icon-bubble .progress-icon-bubble-inner {
    border-color: rgba(0, 0, 0, 0.08);
}

.progress-icon--unset ~ .progress-icon-bubble .progress-icon-bubble-sub {
    color: #5c6560;
    font-weight: 500;
}

.progress-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #555;
    background: #2d2d30;
    color: #888;
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.progress-icon:not(.progress-icon--done):not(.progress-icon--current):hover {
    border-color: #777;
    color: #bbb;
}

.progress-icon--unset {
    border-style: dashed;
    opacity: 0.65;
    cursor: pointer;
}

/* Working on this goal now (not yet passed all tests) */
.progress-icon--current {
    border-color: #2ecc71;
    border-width: 2px;
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
    box-shadow:
        0 0 0 2px rgba(46, 204, 113, 0.35),
        0 0 12px rgba(46, 204, 113, 0.45);
}

.progress-icon--current:hover {
    border-color: #3ddf8a;
    color: #3ddf8a;
}

/* Passed — solid fill */
.progress-icon--done {
    border-color: #24a35a;
    background: #2ecc71;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.progress-icon--done:hover {
    background: #27ae60;
    border-color: #1e8449;
    color: #fff;
}

.progress-setup-link {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #2ecc71;
    background: transparent;
    border: 1px solid rgba(46, 204, 113, 0.35);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.progress-setup-link:hover {
    background: rgba(46, 204, 113, 0.12);
    border-color: #2ecc71;
}

/* Correct-answer celebration */
.correct-celebration[hidden] {
    display: none !important;
}

.correct-celebration {
    position: fixed;
    inset: 0;
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.correct-celebration__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 12, 0.62);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}

.correct-celebration__panel {
    position: relative;
    z-index: 1;
    max-width: min(420px, 100%);
    padding: 40px 44px 32px;
    text-align: center;
    border-radius: 22px;
    background: linear-gradient(168deg, #222925 0%, #181b19 55%, #141615 100%);
    border: 1px solid rgba(46, 204, 113, 0.32);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 28px 64px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(46, 204, 113, 0.07);
    animation: correct-celebration-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes correct-celebration-in {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.correct-celebration__ring {
    position: absolute;
    left: 50%;
    top: 56px;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.2) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.correct-celebration__mark {
    position: relative;
    z-index: 1;
    display: block;
    margin: 0 auto 14px;
    width: min(168px, 44vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 28px rgba(46, 204, 113, 0.38));
    animation: correct-celebration-mark 0.62s cubic-bezier(0.34, 1.45, 0.64, 1) 0.06s both;
}

@keyframes correct-celebration-mark {
    from {
        opacity: 0;
        transform: scale(0.45) rotate(-14deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.correct-celebration__heading {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #ecf8f0;
}

.correct-celebration__sub {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #95b0a3;
}

.correct-celebration__actions {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0 0 18px;
}

.correct-celebration__next {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
}

.correct-celebration__hint {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5d6e64;
}

.correct-celebration__hint kbd {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 1px;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a8c4b4;
}

@media (prefers-reduced-motion: reduce) {
    .correct-celebration__panel,
    .correct-celebration__mark {
        animation: none;
    }

    .correct-celebration__panel {
        opacity: 1;
        transform: none;
    }

    .correct-celebration__mark {
        opacity: 1;
        transform: none;
    }
}

/* Leave editor — custom confirm (white panel, centered) */
.editor-exit-modal[hidden] {
    display: none !important;
}

.editor-exit-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.editor-exit-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.editor-exit-modal__panel {
    position: relative;
    width: min(380px, 100%);
    margin: auto;
    padding: 26px 28px 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.editor-exit-modal__title {
    margin: 0 0 14px;
    font-size: 1.12rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.editor-exit-modal__text {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.editor-exit-modal__text strong {
    color: #222;
    font-weight: 600;
}

.editor-exit-modal__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-exit-modal__btn {
    min-width: 104px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.editor-exit-modal__btn--secondary {
    background: #f3f3f3;
    color: #333;
    border-color: #d8d8d8;
}

.editor-exit-modal__btn--secondary:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.editor-exit-modal__btn--leave {
    background: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}

.editor-exit-modal__btn--leave:hover {
    background: #27ae60;
    border-color: #219a52;
}

body.theme-light .editor-exit-modal__backdrop {
    background: rgba(0, 0, 0, 0.45);
}

/* Five-goals modal */
.progress-modal[hidden] {
    display: none !important;
}

.progress-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.progress-modal.five-goals-summary-modal {
    z-index: 9000;
}

.five-goals-summary-dialog {
    width: min(480px, 100%);
    max-height: min(90vh, 720px);
}

.five-goals-summary-intro {
    flex-shrink: 0;
    padding: 8px 20px 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #b0b0b0;
}

.five-goals-summary-score {
    flex-shrink: 0;
    margin: 16px 20px 10px;
    padding: 18px 20px;
    text-align: center;
    font-size: 2.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: #2ecc71;
    background: linear-gradient(180deg, rgba(46, 204, 113, 0.14) 0%, rgba(46, 204, 113, 0.06) 100%);
    border: 1px solid rgba(46, 204, 113, 0.38);
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.five-goals-summary-total {
    flex-shrink: 0;
    margin: 0 20px 14px;
    padding: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #9a9a9a;
}

.five-goals-summary-list-heading {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    border-top: 1px solid #3c3c3c;
}

.five-goals-summary-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 12px 16px;
}

.five-goals-summary-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.five-goals-summary-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(145deg, #3ddf8a 0%, #27ae60 100%);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.35);
}

.five-goals-summary-name {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
    min-width: 0;
}

.five-goals-summary-time {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #7dcea0;
}

.five-goals-summary-actions {
    flex-shrink: 0;
    justify-content: center;
    padding: 16px 20px 20px;
    border-top: 1px solid #3c3c3c;
    background: rgba(0, 0, 0, 0.12);
}

.progress-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;
}

.progress-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.progress-modal-dialog h2 {
    flex-shrink: 0;
    padding: 18px 20px 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #e8e8e8;
}

.progress-modal-intro {
    flex-shrink: 0;
    padding: 10px 20px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #b0b0b0;
}

.progress-modal-count {
    flex-shrink: 0;
    padding: 12px 20px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #2ecc71;
}

.progress-modal-list {
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    padding: 8px 16px 16px;
    border-top: 1px solid #3c3c3c;
}

.progress-modal-group {
    margin-bottom: 14px;
}

.progress-modal-group:last-child {
    margin-bottom: 0;
}

.progress-modal-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 8px 4px;
}

.progress-modal-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #d4d4d4;
    transition: background 0.12s;
}

.progress-modal-option:hover {
    background: #2a2d2e;
}

.progress-modal-option input {
    accent-color: #2ecc71;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.progress-modal-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 16px;
    border-top: 1px solid #3c3c3c;
    background: rgba(0, 0, 0, 0.2);
}

.progress-modal-spacer {
    flex: 1;
    min-width: 8px;
}

.progress-modal-secondary {
    padding: 6px 14px;
    font-size: 13px;
    background: #3c3c3c;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.progress-modal-secondary:hover {
    background: #4a4a4a;
}

.progress-modal-actions .run-btn {
    padding: 6px 16px;
    font-size: 13px;
}

.progress-modal-actions .run-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.problem-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    flex-shrink: 0;
    margin-right: 2px;
}

.problem-select {
    padding: 5px 10px;
    font-size: 12px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 200px;
}

.problem-select:hover {
    background: #4a4a4a;
}

/* State-only select at top of body; keep out of layout and sight */
.problem-select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.next-problem-btn {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #d4d4d4;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.next-problem-btn:hover {
    background: #4a4a4a;
    border-color: #666;
}

.timer-display {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #2ecc71;
    padding: 6px 12px;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.4);
    border-radius: 4px;
    min-width: 4.5em;
    text-align: center;
}

.timer-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: inherit;
    cursor: pointer;
    min-width: auto;
}

.timer-toggle-btn:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.55);
}

.timer-toggle-btn:focus-visible {
    outline: 2px solid #2ecc71;
    outline-offset: 2px;
}

.timer-display-digits {
    min-width: 3.25em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timer-pause-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    line-height: 1;
    opacity: 0.92;
    flex-shrink: 0;
}

/* Keep same green as running state so the control stays visible on the gray paused overlay */
.timer-toggle-btn--paused {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.12);
    border-color: rgba(46, 204, 113, 0.4);
}

.timer-toggle-btn--paused:hover {
    background: rgba(46, 204, 113, 0.2);
    border-color: rgba(46, 204, 113, 0.55);
}

.timer-toggle-flow-spacer {
    display: none;
    flex-shrink: 0;
    width: 7.25rem;
    height: 36px;
    pointer-events: none;
}

/* Practice paused: gray out and block interaction except the floating timer control */
body.practice-timer-paused .editor-page {
    pointer-events: none;
    user-select: none;
    filter: grayscale(1) brightness(0.55);
}

body.practice-timer-paused .timer-toggle-flow-spacer {
    display: block;
}

body.practice-timer-paused #timer-toggle-btn {
    pointer-events: auto;
    user-select: auto;
    filter: none;
    position: fixed;
    z-index: 12000;
    top: 11px;
    right: 20px;
    margin: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.16);
    border-color: rgba(46, 204, 113, 0.5);
}

body.practice-timer-paused #timer-toggle-btn:hover {
    background: rgba(46, 204, 113, 0.24);
    border-color: rgba(46, 204, 113, 0.65);
}

.editor-hint-row {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

/* File explorer handle - when collapsed, shows icon to restore */
.file-explorer-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    min-width: 6px;
    z-index: 100;
    cursor: pointer;
    background: transparent;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, width 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.file-explorer-handle:hover {
    opacity: 1;
    background: rgba(46, 204, 113, 0.5);
}
/* When collapsed: wider hit area, icon visible */
.editor-hint-row:has(.file-explorer-bar.collapsed) .file-explorer-handle {
    width: 36px;
    opacity: 1;
    background: rgba(46, 204, 113, 0.2);
}
.editor-hint-row:has(.file-explorer-bar.collapsed) .file-explorer-handle:hover {
    background: rgba(46, 204, 113, 0.4);
}
.file-explorer-handle-icon {
    display: none;
    font-size: 18px;
    color: #2ecc71;
    pointer-events: none;
}
.editor-hint-row:has(.file-explorer-bar.collapsed) .file-explorer-handle-icon {
    display: block;
}

/* File explorer resize handle - drag to resize, drag left to collapse */
.file-explorer-resize-handle {
    flex-shrink: 0;
    width: 6px;
    min-width: 6px;
    background: #3c3c3c;
    cursor: col-resize;
    transition: background 0.15s;
}
.file-explorer-resize-handle:hover,
.file-explorer-resize-handle.active {
    background: #2ecc71;
}
/* Hide when bar collapsed */
.editor-hint-row:has(.file-explorer-bar.collapsed) .file-explorer-resize-handle {
    display: none;
}

/* File explorer sidebar */
.file-explorer-bar {
    width: var(--file-explorer-width);
    min-width: 180px;
    max-width: 400px;
    flex-shrink: 0;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s, min-width 0.2s;
}
.file-explorer-bar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right: none;
}
.file-explorer-header {
    flex-shrink: 0;
    padding: 8px 10px;
    background: #333;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    align-items: center;
    gap: 6px;
}
.file-explorer-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    flex: 1;
}
.file-explorer-collapse-btn,
.file-explorer-new-file-btn,
.file-explorer-new-folder-btn,
.file-explorer-icon-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: background 0.15s;
}
.file-explorer-collapse-btn:hover,
.file-explorer-new-file-btn:hover,
.file-explorer-new-folder-btn:hover,
.file-explorer-icon-btn:hover {
    background: #444;
    color: #fff;
}
.file-explorer-icon-btn {
    padding: 4px 6px;
    font-size: 14px;
}
.file-explorer-download-bar {
    flex-shrink: 0;
    padding: 8px 10px;
    background: #2d2d30;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.file-explorer-download-bar[hidden] {
    display: none;
}
.file-explorer-download-label {
    font-size: 11px;
    color: #888;
}
.file-explorer-download-actions {
    display: flex;
    gap: 6px;
}
.file-explorer-download-confirm,
.file-explorer-download-cancel {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}
.file-explorer-download-confirm {
    background: #2ecc71;
    color: #fff;
}
.file-explorer-download-confirm:hover {
    background: #27ae60;
}
.file-explorer-download-confirm:disabled {
    background: #555;
    cursor: not-allowed;
}
.file-explorer-download-cancel {
    background: #3c3c3c;
    color: #ccc;
}
.file-explorer-download-cancel:hover {
    background: #4a4a4a;
    color: #fff;
}
.file-tree-item .file-tree-checkbox {
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #2ecc71;
}
.file-explorer-tree:not(.download-mode) .file-tree-checkbox {
    display: none;
}
.file-explorer-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.file-tree-item {
    display: flex;
    align-items: center;
    padding: 4px 12px 4px 8px;
    font-size: 13px;
    color: #d4d4d4;
    cursor: pointer;
    user-select: none;
}
.file-tree-item:hover {
    background: #2a2d2e;
}
.file-tree-item.open {
    background: #37373d;
    color: #fff;
}
.file-tree-item .tree-icon {
    margin-right: 6px;
    font-size: 14px;
    width: 16px;
    text-align: center;
}
.file-tree-item.folder > .tree-icon {
    cursor: pointer;
}
.file-tree-item.folder.collapsed .tree-icon::before {
    content: '▶';
}
.file-tree-item.folder:not(.collapsed) .tree-icon::before {
    content: '▼';
}
.file-tree-item.file .tree-icon::before {
    content: '📄';
}
.file-tree-children {
    margin-left: 12px;
}
.file-tree-item.folder.collapsed .file-tree-children {
    display: none;
}
.file-tree-context-menu {
    position: fixed;
    min-width: 150px;
    padding: 4px 0;
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 3000;
}
.file-tree-context-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    background: transparent;
    border: none;
    color: #d4d4d4;
    text-align: left;
    cursor: pointer;
}
.file-tree-context-menu button:hover {
    background: #2a2d2e;
}

.resize-handle {
    flex-shrink: 0;
    background: #3c3c3c;
    transition: background 0.15s;
}
.resize-handle:hover,
.resize-handle.active {
    background: #2ecc71;
}
.resize-handle-vertical {
    width: 6px;
    min-width: 6px;
    cursor: col-resize;
    position: relative;
    z-index: 70;
}
.resize-handle-horizontal {
    height: 6px;
    min-height: 6px;
    cursor: row-resize;
}

.sidebar-right {
    width: var(--hint-panel-width);
    min-width: 200px;
    max-width: 80vw;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #252526;
    border-left: 1px solid #3c3c3c;
    /* Stack above the editor column so Beta tooltip is not covered by Monaco */
    position: relative;
    z-index: 60;
    isolation: isolate;
}

.question-panel {
    flex-shrink: 0;
    max-height: min(300px, 42vh);
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #3c3c3c;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

.question-panel-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #3c3c3c;
    background: rgba(0, 0, 0, 0.15);
}

.question-panel-head h3 {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.question-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.question-content {
    font-size: 13px;
    line-height: 1.55;
    color: #d4d4d4;
    padding: 12px 16px 14px;
    overflow-y: auto;
}

.question-content p {
    margin: 0 0 10px;
}

.question-content p:last-child {
    margin-bottom: 0;
}

.question-example {
    font-size: 12px;
    color: #b5b5b5;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    border-left: 3px solid #2ecc71;
}

.question-content code,
.question-content .frq-prompt-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.92em;
    font-weight: 500;
    color: #e8b4a0;
    background: rgba(206, 145, 120, 0.14);
    padding: 0.12em 0.4em;
    border-radius: 4px;
    border: 1px solid rgba(206, 145, 120, 0.28);
    vertical-align: baseline;
}

/* AP FRQ editor: right column is only the question panel, full height */
.sidebar-right--frq .question-panel--frq-full {
    flex: 1;
    min-height: 0;
    max-height: none;
    border-bottom: none;
}

.sidebar-right--frq .question-panel--frq-full .question-content {
    flex: 1;
    min-height: 0;
}

.hint-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0;
    background: #252526;
    position: relative;
    z-index: 2;
}

.hint-panel-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #3c3c3c;
    background: rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 3;
}

.hint-panel-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hint-panel-head h3 {
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.hint-beta-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
}

.hint-beta-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e8f8ee;
    background: #000000;
    border: 2px solid #2ecc71;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.15);
    cursor: default;
    outline: none;
}

.hint-beta-badge:focus-visible {
    box-shadow: 0 0 0 2px #252526, 0 0 0 4px #2ecc71;
}

/*
 * Fixed + very high z-index so the bubble is above editor, modals, etc.
 * left/top are set from JS (see setupHintBetaPopoverPositioning).
 */
.hint-beta-popover {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0;
    transform: translateX(-50%) translateY(-4px);
    width: max-content;
    max-width: min(200px, 65vw);
    padding: 7px 10px;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    color: #1e2a22;
    text-align: left;
    background: linear-gradient(165deg, #ffffff 0%, #f4fbf7 100%);
    border: 1px solid rgba(46, 204, 113, 0.35);
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.6) inset,
        0 6px 18px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 30000;
    transition:
        opacity 0.2s ease,
        transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1),
        visibility 0.2s;
}

/* Nudged left so the tail points toward the Beta pill when the bubble is shifted right */
.hint-beta-popover::after {
    content: '';
    position: absolute;
    left: calc(50% - 14px);
    top: -5px;
    bottom: auto;
    margin-left: -4px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f4fbf7 100%);
    border-left: 1px solid rgba(46, 204, 113, 0.3);
    border-top: 1px solid rgba(46, 204, 113, 0.3);
    transform: rotate(45deg);
}

.hint-beta-wrap:hover .hint-beta-popover,
.hint-beta-wrap:focus-within .hint-beta-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hint-panel .hint-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 16px 16px;
    position: relative;
    z-index: 1;
}

.output-panel {
    flex-shrink: 0;
    height: var(--output-panel-height);
    min-height: 80px;
    max-height: 60vh;
    background: #1e1e1e;
    border-top: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.hint-content {
    font-size: 14px;
    line-height: 1.5;
    color: #d4d4d4;
    /* So fixed hint strings with \n and LLM text with line breaks render as separate lines */
    white-space: pre-line;
}

/* Editor + Output column - output only under editor, not under explorer/hint */
.editor-output-column {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 0;
}

.editor-container {
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
    /* Monaco scrolls inside this box; page stays fixed */
}

/* Monaco editor scrollbar colors (where the theme exposes CSS variables) */
.editor-container .monaco-editor,
.editor-container .monaco-editor-background {
    --vscode-scrollbarSlider-background: rgba(46, 204, 113, 0.5);
    --vscode-scrollbarSlider-hoverBackground: #2ecc71;
    --vscode-scrollbarSlider-activeBackground: #27ae60;
}

body.theme-light .editor-container .monaco-editor,
body.theme-light .editor-container .monaco-editor-background {
    --vscode-scrollbarSlider-background: rgba(39, 174, 96, 0.45);
    --vscode-scrollbarSlider-hoverBackground: #27ae60;
    --vscode-scrollbarSlider-activeBackground: #1e8449;
}
/* Shift editor right when explorer collapsed so line numbers don't overlap the restore handle */
.editor-hint-row:has(.file-explorer-bar.collapsed) .editor-container {
    padding-left: 36px;
}


.output-panel h3 {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #cccccc;
    border-bottom: 1px solid #3c3c3c;
}

.output-panel pre {
    flex: 1;
    margin: 0;
    padding: 16px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-panel pre.empty {
    color: #6a6a6a;
    font-style: italic;
}

.output-panel pre.error {
    color: #f48771;
}

.output-panel pre.output-test-failure {
    color: #e5c07b;
}

.random-problem-btn {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    background: #2d5a87;
    color: #e8f4ff;
    border: 1px solid #3d6a9e;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.random-problem-btn:hover {
    background: #356499;
}

.hint-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: #3c3c3c;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.hint-btn:hover:not(:disabled) {
    background: #4a4a4a;
}

.hint-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hint-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.hint-api-key-btn {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.hint-api-key-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
}

.gemini-api-key-label {
    display: block;
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.gemini-api-key-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #eee;
    background: #1e1e1e;
    border: 1px solid #555;
    border-radius: 4px;
}

.gemini-api-key-input:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.25);
}

.gemini-api-key-error {
    margin: 0 0 12px;
    font-size: 13px;
    color: #e74c3c;
}

.progress-modal-intro a {
    color: #2ecc71;
}

.progress-modal-intro a:hover {
    text-decoration: underline;
}

.run-btn {
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 600;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.run-btn:hover {
    background: #27ae60;
}

.run-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Day (light) theme */
body.theme-light {
    background: #f5f5f5;
    color: #333;
    --sb-track: rgba(0, 0, 0, 0.07);
    --sb-thumb: #27ae60;
    --sb-thumb-hover: #2ecc71;
    --sb-thumb-active: #1e8449;
}
body.theme-light .editor-header {
    background: #fff;
    border-bottom-color: #e0e0e0;
}
body.theme-light .editor-header h1 {
    color: #333;
}
body.theme-light .header-progress-label {
    color: #888;
}
body.theme-light .progress-icon {
    background: #f0f0f0;
    border-color: #ccc;
    color: #888;
}
body.theme-light .progress-icon:hover {
    border-color: #aaa;
    color: #555;
}
body.theme-light .progress-icon--unset {
    border-color: #bbb;
}
body.theme-light .progress-icon--current {
    background: rgba(46, 204, 113, 0.2);
    color: #1a6b3a;
    border-color: #27ae60;
    box-shadow:
        0 0 0 2px rgba(39, 174, 96, 0.3),
        0 0 10px rgba(39, 174, 96, 0.35);
}

body.theme-light .progress-icon--done {
    border-color: #1e8449;
    background: #27ae60;
    color: #fff;
}
body.theme-light .progress-icon-bubble-inner {
    background: linear-gradient(165deg, #ffffff 0%, #f4fbf6 100%);
    border-color: rgba(39, 174, 96, 0.28);
    box-shadow:
        inset 0 1px 0 #fff,
        0 0 0 1px rgba(255, 255, 255, 0.8);
}
body.theme-light .progress-icon-bubble-sub {
    color: #2d6a45;
}
body.theme-light .progress-icon-bubble-tail {
    background: linear-gradient(135deg, #ffffff 0%, #f0faf4 100%);
    border-right-color: rgba(39, 174, 96, 0.22);
    border-bottom-color: rgba(39, 174, 96, 0.22);
}
body.theme-light .progress-icon-bubble {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.12));
}
body.theme-light .progress-setup-link {
    color: #1a7f4c;
    border-color: rgba(39, 174, 96, 0.45);
}
body.theme-light .progress-setup-link:hover {
    background: rgba(46, 204, 113, 0.12);
    border-color: #27ae60;
}
body.theme-light .correct-celebration__backdrop {
    background: rgba(245, 248, 246, 0.72);
}
body.theme-light .correct-celebration__panel {
    background: linear-gradient(168deg, #ffffff 0%, #f4faf6 45%, #eef5f0 100%);
    border-color: rgba(39, 174, 96, 0.35);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 24px 48px rgba(0, 0, 0, 0.12),
        0 0 80px rgba(39, 174, 96, 0.1);
}
body.theme-light .correct-celebration__ring {
    background: radial-gradient(circle, rgba(39, 174, 96, 0.18) 0%, transparent 68%);
}
body.theme-light .correct-celebration__mark {
    filter: drop-shadow(0 10px 24px rgba(39, 174, 96, 0.28));
}
body.theme-light .correct-celebration__heading {
    color: #1a2e22;
}
body.theme-light .correct-celebration__sub {
    color: #4a6356;
}
body.theme-light .correct-celebration__hint {
    color: #7a8f84;
}
body.theme-light .correct-celebration__hint kbd {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
    color: #3d5246;
}
body.theme-light .next-problem-btn {
    color: #333;
    background: #f0f0f0;
    border-color: #ccc;
}
body.theme-light .next-problem-btn:hover {
    background: #e5e5e5;
    border-color: #aaa;
}
body.theme-light .progress-modal-dialog {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}
body.theme-light .progress-modal-dialog h2 {
    color: #222;
}
body.theme-light .progress-modal-intro {
    color: #555;
}
body.theme-light .progress-modal-list {
    border-top-color: #e0e0e0;
}
body.theme-light .progress-modal-option {
    color: #333;
}
body.theme-light .progress-modal-option:hover {
    background: #f0f0f0;
}
body.theme-light .progress-modal-actions {
    border-top-color: #e0e0e0;
    background: #f8f8f8;
}
body.theme-light .five-goals-summary-intro {
    color: #555;
}
body.theme-light .five-goals-summary-score {
    color: #1a7f4c;
    background: linear-gradient(180deg, rgba(39, 174, 96, 0.12) 0%, rgba(39, 174, 96, 0.05) 100%);
    border-color: rgba(39, 174, 96, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}
body.theme-light .five-goals-summary-total {
    color: #666;
}
body.theme-light .five-goals-summary-list-heading {
    color: #666;
    border-top-color: #e0e0e0;
}
body.theme-light .five-goals-summary-row {
    background: #f6faf7;
    border-color: rgba(39, 174, 96, 0.12);
}
body.theme-light .five-goals-summary-name {
    color: #222;
}
body.theme-light .five-goals-summary-time {
    color: #1e6b3d;
}
body.theme-light .five-goals-summary-actions {
    border-top-color: #e0e0e0;
    background: #f8faf9;
}
body.theme-light .progress-modal-secondary {
    background: #e8e8e8;
    color: #333;
    border-color: #ccc;
}
body.theme-light .progress-modal-secondary:hover {
    background: #ddd;
}
body.theme-light .progress-modal-group-title {
    color: #666;
}
body.theme-light .problem-label {
    color: #888;
}
body.theme-light .question-panel-head,
body.theme-light .hint-panel-head {
    background: rgba(0, 0, 0, 0.03);
    border-bottom-color: #e0e0e0;
}
body.theme-light .question-panel-head h3,
body.theme-light .hint-panel-head h3 {
    color: #555;
}
body.theme-light .hint-beta-badge {
    color: #d8f5e4;
    background: #000000;
    border-color: #27ae60;
    box-shadow: 0 0 0 1px rgba(39, 174, 96, 0.2);
}
body.theme-light .hint-beta-badge:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #27ae60;
}
body.theme-light .hint-beta-popover {
    color: #1a2e22;
    background: linear-gradient(165deg, #ffffff 0%, #f0faf4 100%);
    border-color: rgba(39, 174, 96, 0.3);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 6px 16px rgba(0, 0, 0, 0.08);
}
body.theme-light .hint-beta-popover::after {
    background: linear-gradient(135deg, #f0faf4 0%, #e8f5ec 100%);
    border-right-color: rgba(39, 174, 96, 0.22);
    border-bottom-color: rgba(39, 174, 96, 0.22);
}
body.theme-light .problem-select,
body.theme-light .hint-btn {
    background: #f0f0f0;
    color: #333;
    border-color: #ccc;
}
body.theme-light .problem-select:hover,
body.theme-light .hint-btn:hover:not(:disabled) {
    background: #e5e5e5;
}
body.theme-light .hint-api-key-btn {
    color: #666;
    border-color: #ccc;
}
body.theme-light .hint-api-key-btn:hover {
    background: #f0f0f0;
    color: #333;
}
body.theme-light .gemini-api-key-label {
    color: #666;
}
body.theme-light .gemini-api-key-input {
    color: #333;
    background: #fff;
    border-color: #ccc;
}
body.theme-light .progress-modal-intro a {
    color: #1e8449;
}
body.theme-light .sidebar-right {
    background: #fff;
    border-left-color: #e0e0e0;
}
body.theme-light .question-panel {
    border-bottom-color: #e0e0e0;
}

body.theme-light .sidebar-right--frq .question-panel--frq-full {
    border-bottom: none;
}
body.theme-light .question-content {
    color: #333;
}
body.theme-light .question-example {
    color: #444;
    background: #f0f4f8;
    border-left-color: #2ecc71;
}
body.theme-light .question-content code,
body.theme-light .question-content .frq-prompt-code {
    color: #8b1538;
    background: rgba(163, 21, 21, 0.08);
    border-color: rgba(163, 21, 21, 0.2);
}
body.theme-light .hint-panel {
    background: #fff;
    color: #333;
}
body.theme-light .output-panel h3 {
    color: #555;
    border-bottom-color: #e0e0e0;
}
body.theme-light .hint-content {
    color: #333;
}
body.theme-light .random-problem-btn {
    background: #e3f0ff;
    color: #1a4d7a;
    border-color: #b8d4f0;
}
body.theme-light .random-problem-btn:hover {
    background: #d0e6fc;
}
body.theme-light .output-panel {
    background: #fff;
    border-top-color: #e0e0e0;
}
body.theme-light .output-panel pre {
    color: #333;
}
body.theme-light .output-panel pre.empty {
    color: #888;
}
body.theme-light .output-panel pre.output-test-failure {
    color: #8a6d1f;
}
body.theme-light .resize-handle {
    background: #e0e0e0;
}
body.theme-light .resize-handle:hover,
body.theme-light .resize-handle.active {
    background: #2ecc71;
}
body.theme-light .file-explorer-bar {
    background: #f3f3f3;
    border-right-color: #e0e0e0;
}
body.theme-light .file-explorer-resize-handle {
    background: #e0e0e0;
}
body.theme-light .file-explorer-resize-handle:hover,
body.theme-light .file-explorer-resize-handle.active {
    background: #2ecc71;
}
body.theme-light .file-explorer-header {
    background: #e8e8e8;
    border-bottom-color: #e0e0e0;
}
body.theme-light .file-explorer-title {
    color: #666;
}
body.theme-light .file-explorer-collapse-btn,
body.theme-light .file-explorer-new-file-btn,
body.theme-light .file-explorer-new-folder-btn {
    color: #555;
}
body.theme-light .file-explorer-collapse-btn:hover,
body.theme-light .file-explorer-new-file-btn:hover,
body.theme-light .file-explorer-new-folder-btn:hover,
body.theme-light .file-explorer-icon-btn:hover {
    background: #ddd;
    color: #333;
}
body.theme-light .file-explorer-icon-btn {
    color: #555;
}
body.theme-light .file-explorer-download-bar {
    background: #e8e8e8;
    border-bottom-color: #e0e0e0;
}
body.theme-light .file-explorer-download-cancel {
    background: #e0e0e0;
    color: #555;
}
body.theme-light .file-explorer-download-cancel:hover {
    background: #ddd;
    color: #333;
}
body.theme-light .file-tree-item {
    color: #333;
}
body.theme-light .file-tree-item:hover {
    background: #e5e5e5;
}
body.theme-light .file-tree-item.open {
    background: #d0e8d0;
    color: #1a5f1a;
}
body.theme-light .file-tree-context-menu {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
body.theme-light .file-tree-context-menu button {
    color: #333;
}
body.theme-light .file-tree-context-menu button:hover {
    background: #f0f0f0;
}
body.theme-light .resize-handle:hover,
body.theme-light .resize-handle.active {
    background: #2ecc71;
}

@media (max-width: 900px) {
    .editor-header {
        flex-wrap: wrap;
        row-gap: 10px;
    }
    .header-progress-column {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }
    .header-progress-row {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .editor-header-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}
