:root {
    --bg: #f4f6fb;
    --text: #1f2937;
    --muted: #5f6b7a;
    --brand: #0a6ebd;
    --brand-dark: #084d86;
    --card: #ffffff;
    --border: #d8dfeb;
    --error: #a40000;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Verdana", "Tahoma", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #eef3ff 0%, #f7f9fc 100%);
}

.container {
    width: min(980px, 100% - 2rem);
    margin: 1.5rem auto 3rem;
}

.narrow {
    width: min(700px, 100% - 2rem);
}

h1 {
    margin: 0 0 1rem;
}

h2 {
    margin: 0.2rem 0 0.8rem;
}

h3 {
    margin: 0 0 0.5rem;
}

.lead {
    color: var(--muted);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

#timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--brand-dark);
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 1rem;
}

.question pre {
    overflow-x: auto;
    background: #f1f5f9;
    border: 1px solid #d0d8e5;
    border-radius: 8px;
    padding: 0.75rem;
}

.question pre code.hljs,
pre code.hljs {
    display: block;
    overflow-x: auto;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.85rem;
    border-radius: 6px;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
    color: #f472b6;
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-template-tag,
.hljs-template-variable {
    color: #86efac;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #94a3b8;
}

.hljs-number,
.hljs-regexp,
.hljs-variable,
.hljs-built_in,
.hljs-builtin-name {
    color: #fcd34d;
}

.options {
    display: grid;
    gap: 0.45rem;
}

.options label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.error {
    color: var(--error);
    font-weight: bold;
}

button,
.button {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

.button.secondary {
    background: #4b5563;
}

.submit-row {
    display: flex;
    justify-content: flex-end;
    margin: 1rem 0 2rem;
}

.actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.result-head p,
.review p {
    margin: 0.35rem 0;
}

.note ul {
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .container,
    .narrow {
        width: calc(100% - 1rem);
        margin-top: 1rem;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.print-body {
    background: #fff;
}

.print-container {
    font-size: 11px;
    line-height: 1.35;
}

@media print {
    body {
        background: #fff;
    }

    .button,
    button {
        display: none !important;
    }

    .print-container {
        font-size: 10px;
        margin: 0;
        width: 100%;
    }
}
