:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #1d2733;
    --muted: #667085;
    --line: #d9e0ea;
    --blue: #2364aa;
    --green: #168255;
    --yellow: #a66a00;
    --red: #b42318;
    --shadow: 0 18px 45px rgba(25, 42, 70, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    min-height: 42px;
    padding: 0 16px;
    cursor: pointer;
}

button:hover {
    border-color: #9aa8ba;
}

button.primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

button.ghost {
    background: transparent;
}

button:disabled {
    opacity: .55;
    cursor: wait;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.55;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-card h1 {
    margin: 0 0 22px;
    font-size: 26px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.form-error {
    color: var(--red);
    margin: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px clamp(16px, 4vw, 40px);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard {
    padding: 22px clamp(16px, 4vw, 40px) 42px;
    display: grid;
    gap: 18px;
}

.toolbar,
.summary,
.support-summary,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(170px, 240px) minmax(180px, 1fr) repeat(4, auto);
    align-items: end;
    gap: 12px;
    padding: 16px;
}

.summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.support-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(240px, 2fr);
    gap: 1px;
    overflow: hidden;
}

.support-summary:empty {
    display: none;
}

.support-summary div {
    padding: 14px 16px;
    background: #fff;
    display: grid;
    gap: 4px;
}

.support-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.support-summary strong {
    font-size: 14px;
}

.summary p {
    margin: 0;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}

.panel {
    min-width: 0;
    overflow: hidden;
}

.panel-head {
    min-height: 54px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel h2 {
    margin: 0;
    font-size: 16px;
}

.panel pre,
.diff-list,
.comparison {
    padding: 16px;
    max-height: 440px;
    overflow: auto;
}

.comparison {
    max-height: none;
    border-bottom: 1px solid var(--line);
}

.comparison h3 {
    margin: 0 0 10px;
    font-size: 14px;
}

.comparison h3:not(:first-child) {
    margin-top: 18px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.empty {
    margin: 0;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
}

.badge.ok {
    color: var(--green);
    background: #e8f6ef;
    border-color: #b7e2cc;
}

.badge.warning {
    color: var(--yellow);
    background: #fff5dc;
    border-color: #f4d28b;
}

.badge.error {
    color: var(--red);
    background: #fdeceb;
    border-color: #f3b8b2;
}

.badge.muted {
    color: var(--muted);
    background: #f1f4f8;
    border-color: var(--line);
}

.diff-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fbfcfe;
}

.diff-item strong {
    display: block;
    margin-bottom: 4px;
}

.diff-item p {
    margin: 0;
    color: var(--muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #d6dfeb;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1080px) {
    .toolbar,
    .support-summary,
    .grid.three,
    .grid.two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar {
        padding: 12px;
    }

    button {
        width: 100%;
    }
}
