:root {
    --bg: #f5f7f2;
    --panel: #ffffff;
    --text: #1b241f;
    --muted: #5c6a61;
    --line: #d9e0d6;
    --accent: #24785a;
    --accent-dark: #17543e;
    --danger: #b42318;
    --warn: #9a6700;
    --ok-bg: #e8f5ee;
    --warn-bg: #fff4d6;
    --danger-bg: #fce8e6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: #18382d;
    color: #fff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 14px 24px;
}

.brand {
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

nav a {
    color: #eef8f3;
    font-size: 14px;
    text-decoration: none;
}

.page {
    margin: 0 auto;
    max-width: 1240px;
    padding: 24px;
}

h1 {
    font-size: clamp(28px, 4vw, 42px);
    margin: 0 0 22px;
}

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

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
    margin-bottom: 18px;
    padding: 18px;
}

.compact {
    margin: 0;
}

.wide {
    overflow: hidden;
}

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

.grid.two {
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.grid.cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stats {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 18px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    text-decoration: none;
}

.stat strong {
    display: block;
    font-size: 32px;
}

.stat span,
small,
.hint {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 14px;
}

input,
select,
textarea {
    background: #fff;
    border: 1px solid #b9c4bd;
    border-radius: 6px;
    color: var(--text);
    display: block;
    font: inherit;
    margin-top: 6px;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    resize: vertical;
}

button,
.button {
    align-items: center;
    background: #eef4f0;
    border: 1px solid #b9c4bd;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    text-decoration: none;
}

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

button:hover,
.button:hover {
    filter: brightness(0.97);
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.inline {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

.toolbar {
    align-items: end;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

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

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

code {
    background: #eef4f0;
    border-radius: 4px;
    padding: 2px 5px;
}

.badge {
    background: #eef4f0;
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
}

.flash,
.result {
    border-radius: 8px;
    display: block;
    font-weight: 800;
    margin: 0 0 18px;
    padding: 12px 14px;
}

.flash.ok,
.result.ok {
    background: var(--ok-bg);
    color: var(--accent-dark);
}

.flash.error,
.result.error {
    background: var(--danger-bg);
    color: var(--danger);
}

.result.warn {
    background: var(--warn-bg);
    color: var(--warn);
}

.result.idle {
    background: #eef4f0;
    color: var(--muted);
}

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

.coverage th,
.coverage td {
    min-width: 96px;
}

.coverage th:first-child,
.coverage td:first-child {
    left: 0;
    min-width: 240px;
    position: sticky;
}

.coverage th:first-child {
    background: var(--panel);
}

.coverage td:first-child {
    background: #fbfcfa;
}

.passed {
    background: var(--ok-bg);
    color: var(--accent-dark);
    font-weight: 800;
}

.missing {
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 800;
}

progress {
    accent-color: var(--accent);
    width: 100%;
}

.form-narrow {
    max-width: 420px;
}

@media (max-width: 820px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 16px;
    }

    .page {
        padding: 18px 14px;
    }

    .grid.two {
        grid-template-columns: 1fr;
    }

    .inline {
        grid-template-columns: 1fr;
    }
}
