:root {
    color-scheme: dark;
    --bg: #12151a;
    --panel: #1a1f27;
    --line: #2b333f;
    --text: #dfe5ee;
    --muted: #8d99ab;
    --accent: #4c9aff;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    position: sticky;
    top: 0;
    z-index: 2;
}

.bar h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bar a {
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
}

.bar a:hover {
    text-decoration: underline;
}

.tag,
.pill {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
}

.pill.ok {
    color: var(--ok);
    border-color: var(--ok);
}

.pill.bad {
    color: var(--bad);
    border-color: var(--bad);
}

main {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.25fr);
    gap: 14px;
    padding: 14px;
    align-items: start;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 0;
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 10px;
}

.choices label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 150px;
    flex: 1 1 150px;
}

.field > span {
    font-size: 12px;
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
    color: var(--text);
    background: #10141a;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 5px 8px;
}

input[type="radio"] {
    padding: 0;
    accent-color: var(--accent);
}

select[size] {
    padding: 2px;
}

textarea {
    width: 100%;
    min-height: 160px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 12px;
    white-space: pre;
    overflow: auto;
}

#sample-select,
#sample-filter,
#file-input {
    width: 100%;
}

#sample-select {
    font-family: var(--mono);
    font-size: 12px;
    margin-top: 6px;
}

button {
    cursor: pointer;
    background: #222a35;
}

button:hover:not(:disabled) {
    border-color: var(--accent);
}

button:disabled {
    opacity: 0.45;
    cursor: default;
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #06101f;
    font-weight: 600;
    padding: 6px 18px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.status {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
    overflow-wrap: anywhere;
}

code {
    font-family: var(--mono);
    font-size: 12px;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin: 10px 0;
}

.tabs button {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--muted);
    padding: 5px 10px;
}

.tabs button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-pane {
    min-height: 90px;
}

pre {
    margin: 8px 0 0;
    padding: 8px;
    background: #0c1016;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 12px;
    max-height: 460px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.verdict {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 8px;
}

.verdict.ok {
    background: rgba(63, 185, 80, 0.15);
    color: var(--ok);
}

.verdict.bad {
    background: rgba(248, 81, 73, 0.15);
    color: var(--bad);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 4px 6px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    font-weight: 600;
}

td.error {
    color: var(--bad);
}

td.warning {
    color: var(--warn);
}

dl.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 2px 12px;
    margin: 0 0 8px;
    font-size: 13px;
}

dl.facts dt {
    color: var(--muted);
}

dl.facts dd {
    margin: 0;
    font-family: var(--mono);
    overflow-wrap: anywhere;
}

iframe {
    width: 100%;
    height: 620px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
}

.log {
    margin: 0;
    padding-left: 20px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    max-height: 180px;
    overflow: auto;
}

.log .bad {
    color: var(--bad);
}

.hidden {
    display: none !important;
}

@media (max-width: 1080px) {
    main {
        grid-template-columns: 1fr;
    }
}
