/* Cool-slate palette; status colour is the only decoration that carries meaning. */
:root {
    --paper: #eef1f6;
    --panel: #ffffff;
    --ink: #131a26;
    --muted: #5c6880;
    --rule: #d2d9e6;
    --accent: #4636b8;
    --ok: #1a7048;
    --warn: #8a5a00;
    --bad: #a82a44;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0f141b;
        --panel: #161d27;
        --ink: #e5eaf3;
        --muted: #93a0b8;
        --rule: #27313f;
        --accent: #9d8cff;
        --ok: #4cc38a;
        --warn: #d9a441;
        --bad: #f2708c;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    max-width: 62rem;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
}

.masthead { margin-bottom: 1.75rem; }

.masthead h1 {
    margin: 0;
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.masthead p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    max-width: 46ch;
}

/* Form */

.panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 4px;
}

.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-wide { grid-column: 1 / -1; }

label, legend {
    display: block;
    margin-bottom: 0.4rem;
    padding: 0;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

textarea, input[type="text"], select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.9rem;
}

textarea { resize: vertical; }

.hint {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.checks { display: grid; gap: 0.35rem; }
.checks-inline { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }

.check {
    display: flex;
    gap: 0.55rem;
    align-items: baseline;
    margin: 0;
    font-family: var(--sans);
    font-size: 0.9rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--ink);
}

.check small {
    display: block;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.actions { grid-column: 1 / -1; }

button {
    padding: 0.6rem 1.5rem;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 3px;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}

button:hover { filter: brightness(1.1); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Messages */

.notice {
    margin: 1rem 0 0;
    padding: 0.7rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--muted);
    border-radius: 3px;
    font-size: 0.9rem;
}

.notice.bad { border-left-color: var(--bad); }
.notice.warn { border-left-color: var(--warn); }

/* Results */

.results { margin-top: 2rem; display: grid; gap: 1.25rem; }

.result {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--muted);
    border-radius: 4px;
    overflow: hidden;
}

.result.ok { border-left-color: var(--ok); }
.result.warn { border-left-color: var(--warn); }
.result.bad { border-left-color: var(--bad); }

.result h2 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    margin: 0;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.result h2 .qtype { color: var(--accent); }
.result h2 .at, .result h2 .label { color: var(--muted); font-weight: 400; }
.result h2 .label::before { content: "("; }
.result h2 .label::after { content: ")"; }

.chip {
    margin-left: auto;
    padding: 0.1rem 0.5rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

.ok .chip { color: var(--ok); }
.warn .chip { color: var(--warn); }
.bad .chip { color: var(--bad); }

pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.5;
    tab-size: 8;
}

.colophon {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
}

@media (max-width: 42rem) {
    body { padding: 1.25rem 0.9rem 3rem; }
    .panel { grid-template-columns: minmax(0, 1fr); padding: 1.1rem; }
    .result h2 { font-size: 0.78rem; }
    .chip { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
