





body.exam { height: 100vh; height: 100dvh; overflow: hidden; }


.platform-brand { margin-bottom: 18px; }
.platform-name {
    display: block;
    font-family: var(--font);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.platform-name b { font-weight: 700; color: #0A3CA0; }
.platform-tagline {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ink-3);
}

.brand-row { display: flex; align-items: center; gap: 16px; }
.brand-item { display: flex; align-items: center; gap: 10px; }
.brand-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 4px;
}
.brand-badge {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #000;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
}
.brand-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.brand-sep { width: 1px; height: 24px; background: var(--tint-400); }


.gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    overflow-y: auto;
    background: var(--tint);
}
.gate-inner {
    margin: auto;
    width: 100%;
    max-width: 1080px;
    padding: 40px 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
    align-items: center;
}
.gate-info .brand-row { margin-bottom: 36px; }
.gate-info h1 { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; }
.gate-info .lead { margin-top: 10px; max-width: 52ch; font-size: 15px; color: var(--ink-2); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 30px; }
.fact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
.fact .icon { font-size: 15px; }

.gate-info h2 { margin-bottom: 8px; font-size: 14px; font-weight: 600; }

.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; }
.rule { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; }
.rule-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
}
.rule.is-strict .rule-icon { background: var(--bad-bg); border-color: #F3C1BD; color: var(--bad); }
.rule-body strong { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.rule-body span { display: block; margin-top: 1px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.rule-body span b { font-weight: 600; color: #000; }

.gate-card {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-pop);
}
.gate-card h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.gate-card .sub { margin: 4px 0 22px; font-size: 13.5px; color: var(--ink-2); }
.gate-card .callout { margin-bottom: 16px; }
.gate-card .btn-primary { margin-top: 6px; }
.gate-note { margin-top: 14px; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); text-align: center; }


body.notice {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.notice-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-pop);
}
.notice-card h1 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; }
.notice-card p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }


.dialog-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    background: var(--tint);
    border-radius: 12px;
}
.dialog-icon .icon { font-size: 24px; }
.dialog-icon.bad  { background: var(--bad-bg);  color: var(--bad); }
.dialog-icon.warn { background: var(--warn-bg); color: var(--warn); }
.dialog-icon.ok   { background: var(--ok-bg);   color: var(--ok); }

.failed-modal, .timeup-modal, .results-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(222, 236, 255, 0.88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}
.results-modal { z-index: 2001; }
.failed-modal, .timeup-modal { z-index: 3000; }

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
.dialog {
    width: 100%;
    max-width: 460px;
    margin: auto;
    padding: 32px;
    background: #fff;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-pop);
    animation: dialog-in 0.2s ease-out;
}
.dialog h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.dialog p { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.dialog p b { font-weight: 600; color: #000; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 26px; }


.score-block {
    margin-top: 22px;
    padding: 18px;
    background: var(--tint-50);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}
.score-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.score-value { font-size: 42px; font-weight: 600; letter-spacing: -0.035em; line-height: 1; }
.score-caption { font-size: 13.5px; color: var(--ink-2); }
.score-caption span { font-weight: 600; color: #000; }
.result-list { margin-top: 16px; }
.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.result-item:last-child { border-bottom: 0; }
.result-label { color: var(--ink-2); }
.result-value { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-align: right; }
.result-value.status-ok { color: var(--ok); }
.result-value.status-warn { color: var(--bad); }


@keyframes tick {
    from { transform: scale(0.9); }
    to   { transform: scale(1); }
}
.countdown {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2000;
    width: 200px;
    height: 200px;
    margin: -100px 0 0 -100px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line-strong);
    
    box-shadow: 0 0 0 200vmax rgba(222, 236, 255, 0.95);
    text-align: center;
    font-size: 96px;
    font-weight: 600;
    line-height: 198px;
    letter-spacing: -0.04em;
    animation: tick 0.5s ease-out;
}
.countdown::after {
    content: "Your exam is about to start";
    position: absolute;
    top: calc(100% + 22px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    color: var(--ink-2);
}




.container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0 8px 8px;
}


.topbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    flex: none;
    height: 58px;
    padding: 0 8px;
}
.topbar .brand-row { gap: 12px; }
.topbar .brand-img, .topbar .brand-badge { width: 30px; height: 30px; border-radius: 8px; }
.topbar .brand-name { font-size: 13px; }

.topbar-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.topbar-title b { font-weight: 700; color: #0A3CA0; }
@media (max-width: 780px) { .topbar-title { display: none; } }

.timer-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.timer {
    min-width: 3.6ch;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.timer.warning { color: var(--bad); }
.timer-pill:has(.timer.warning) { background: var(--bad-bg); border-color: #F3C1BD; color: var(--bad); }

.timer-bar {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
}
.timer-bar > i {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 999px;
    transition: width 1s linear;
}
.topbar:has(.timer.warning) .timer-bar > i { background: var(--bad); }

.user-chip { display: flex; align-items: center; gap: 10px; justify-self: end; min-width: 0; }
.avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; text-align: right; }
.user-meta #candidateName { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta #candidateEmail { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.main-content {
    --problem-w: 42%;
    display: flex;
    flex: 1;
    min-height: 0;
}

.panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    height: 46px;
    padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--line);
}
.panel-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.panel-actions { display: flex; align-items: center; gap: 4px; }

.problem-section { display: none; flex: 0 0 var(--problem-w); min-width: 300px; max-width: 70%; }
.problem-section.show { display: flex; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 32px; }

.splitter { position: relative; flex: none; width: 10px; cursor: col-resize; touch-action: none; }
.splitter::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 36px;
    margin: -18px 0 0 -2px;
    background: var(--tint-400);
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.15s, background-color 0.15s;
}
.splitter:hover::after, .splitter:focus-visible::after, body.is-resizing .splitter::after { opacity: 1; }
body.is-resizing .splitter::after { background: #000; }
body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.problem-section:not(.show) + .splitter { display: none; }


.problem-title { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    background: var(--tint-100);
    border-radius: var(--r-sm);
    font-size: 12.5px;
    font-weight: 500;
}
.chip .icon { font-size: 14px; }

.prose p { font-size: 14px; line-height: 1.65; }
.prose h3 { margin: 26px 0 10px; font-size: 14px; font-weight: 600; }
.prose code {
    padding: 1px 6px;
    background: var(--tint-100);
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 0.88em;
}
.req-list li { position: relative; margin: 8px 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.req-list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 0.65em;
    width: 5px;
    height: 5px;
    background: #000;
    border-radius: 50%;
}

.grade-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font-size: 13.5px;
    line-height: 1.45;
}
.grade-n {
    display: grid;
    place-items: center;
    flex: none;
    width: 22px;
    height: 22px;
    background: var(--tint);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
}


.editor-section { flex: 1; min-width: 0; }
.file-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 10px;
    background: var(--tint-100);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
}
.file-tab .icon { font-size: 15px; }

.editor-host { position: relative; flex: 1; min-height: 0; }
.editor-host > textarea { visibility: hidden; }
.editor-host .CodeMirror {
    position: absolute;
    inset: 0;
    height: auto;
    font-family: var(--mono);
    font-size: 13.5px;
    line-height: 1.6;
}
.editor-host .CodeMirror-scroll { padding-bottom: 8px; }

.editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: 28px;
    padding: 0 14px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-2);
}
.editor-status div { display: flex; gap: 16px; }


.output {
    display: none;
    flex: none;
    flex-direction: column;
    min-height: 150px;
    max-height: 46%;
    background: #fff;
    border-top: 1px solid var(--line-strong);
}
.output.show { display: flex; }
.output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: none;
    height: 42px;
    padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--line);
}
.output-title { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; }
.output-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 16px; }

.summary-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--tint);
    font-size: 12px;
    font-weight: 600;
}
.summary-chip.ok  { background: var(--ok-bg);  color: var(--ok); }
.summary-chip.bad { background: var(--bad-bg); color: var(--bad); }
.summary-chip:empty { display: none; }

.test-empty { padding: 18px 0; text-align: center; font-size: 13.5px; color: var(--ink-2); }
.test-summary { margin-bottom: 14px; }
.test-summary-text { margin-bottom: 8px; font-size: 13.5px; color: var(--ink-2); }
.test-summary-text strong { font-size: 15px; font-weight: 600; color: #000; }

.test-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    font-size: 13.5px;
}
.test-result .test-name { flex: 1; color: #000; }
.test-badge { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.test-pass { background: var(--ok-bg); color: var(--ok); }
.test-fail { background: var(--bad-bg); color: var(--bad); }

.test-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border-radius: var(--r-md);
    font-size: 13.5px;
    line-height: 1.45;
}
.test-message.is-bad { background: var(--bad-bg); color: #7A1A14; }


.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
}
.action-left, .action-right { display: flex; align-items: center; gap: 10px; }
.action-note { font-size: 12.5px; color: var(--ink-2); }
#consoleToggle .chev { transition: transform 0.2s; }
#consoleToggle[aria-expanded="true"] .chev { transform: rotate(180deg); }


.cm-s-versatile.CodeMirror { background: #fff; color: #000; }
.cm-s-versatile .CodeMirror-gutters { background: var(--tint-50); border-right: 1px solid var(--line); }
.cm-s-versatile .CodeMirror-linenumber { color: #7D8DA6; padding: 0 10px 0 6px; }
.cm-s-versatile .CodeMirror-cursor { border-left: 2px solid #000; }
.cm-s-versatile .CodeMirror-activeline-background { background: var(--tint-50); }
.cm-s-versatile div.CodeMirror-selected { background: #D3E4FC; }
.cm-s-versatile.CodeMirror-focused div.CodeMirror-selected { background: #BCD5F8; }
.cm-s-versatile .CodeMirror-matchingbracket { background: var(--tint); color: #000 !important; outline: 1px solid #7FA8EA; }
.cm-s-versatile .cm-keyword { color: #1B4FD8; }
.cm-s-versatile .cm-atom, .cm-s-versatile .cm-number { color: #B45309; }
.cm-s-versatile .cm-def, .cm-s-versatile .cm-variable { color: #000; }
.cm-s-versatile .cm-variable-2 { color: #1A3E8C; }
.cm-s-versatile .cm-variable-3, .cm-s-versatile .cm-type { color: #1A3E8C; }
.cm-s-versatile .cm-property { color: #1A3E8C; }
.cm-s-versatile .cm-string, .cm-s-versatile .cm-string-2 { color: #0A7C42; }
.cm-s-versatile .cm-comment { color: #6B7A90; font-style: italic; }
.cm-s-versatile .cm-tag { color: #1B4FD8; }
.cm-s-versatile .cm-attribute { color: #7A3EC9; }
.cm-s-versatile .cm-bracket, .cm-s-versatile .cm-operator { color: #444; }
.cm-s-versatile .cm-meta { color: #6B7A90; }
.cm-s-versatile .CodeMirror-scrollbar-filler, .cm-s-versatile .CodeMirror-gutter-filler { background: #fff; }


@media (max-width: 1180px) {
    .topbar .brand-name { display: none; }
    .user-meta #candidateEmail { display: none; }
}
@media (max-width: 960px) {
    .gate-inner { grid-template-columns: 1fr; gap: 32px; padding: 28px 24px; }
}
@media (max-width: 1000px) {
    .action-note { display: none; }
}