:root {
    --bg: #fbfaf7; --fg: #1f1e1b; --muted: #6b6860; --line: #dedad0; --card: #ffffff; --accent: #2a5a8a;
    --error: #a32020; --warning: #8a5a00; --info: #2a5a8a; --ok: #2b6a2b; --badge: #e8f0e0;
    /* charts: hex only, so an alpha can be appended */
    --c-base: #a7a398; --c-base-alt: #cfcbc0; --c-solution: #2a6fb0; --c-solution-alt: #8db9e0;
    --c-covered: #3f9a5a; --c-exported: #d08a2c;
    --c-panels: #e0a526; --c-battery: #3f9a5a; --c-both: #7a4fb0;
    --c-band1: #3f9a5a; --c-band2: #e0a526; --c-band3: #c0473a;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #1b1a18; --fg: #ece9e1; --muted: #a29e93; --line: #3a3833; --card: #24231f; --accent: #8ab8f0;
        --error: #ff8080; --warning: #f0c060; --info: #8ab8f0; --ok: #8fd08f; --badge: #2e3a26;
        --c-base: #77736a; --c-base-alt: #57534b; --c-solution: #5aa0e0; --c-solution-alt: #2f5f8a;
        --c-covered: #5cbf78; --c-exported: #e8a24a;
        --c-panels: #f0bd4a; --c-battery: #5cbf78; --c-both: #a37ad8;
        --c-band1: #5cbf78; --c-band2: #f0bd4a; --c-band3: #e0685a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 system-ui, sans-serif; }
main, header.top { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
header.top { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; padding-top: 14px; padding-bottom: 4px; }
.brand { font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; }
header.top nav { display: flex; gap: 4px; }
header.top nav a { padding: 3px 10px; border-radius: 4px; color: var(--fg); text-decoration: none; }
header.top nav a.active { background: var(--fg); color: var(--bg); }
header.top #config { margin: 0 0 0 auto; }
h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 8px; }
h3 { font-size: 14px; margin: 12px 0 6px; }
a { color: var(--accent); }
section { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
table.wide { width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
th { font-weight: 600; }
.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot th, tfoot td { border-bottom: none; }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover { background: var(--badge); }
.scroll { overflow-x: auto; }
label { margin-right: 12px; display: inline-block; margin-bottom: 6px; }
label.block { display: block; }
textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; }
input, textarea, button, select, .button { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font: inherit; }
button, .button { cursor: pointer; text-decoration: none; display: inline-block; }
.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
form.inline { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.form-grid { display: flex; gap: 8px; flex-wrap: wrap; }
pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; max-height: 480px; overflow: auto; }
details { margin: 6px 0; }
summary { cursor: pointer; color: var(--muted); }
.mono { font-family: ui-monospace, monospace; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.missing, .unknown { color: var(--error); }
.ok { color: var(--ok); }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin: 6px 0; }
.code { font-family: ui-monospace, monospace; border-bottom: 1px dotted; }
.findings { list-style: none; padding: 0; }
.findings li { padding: 2px 0; }
.sev { font-weight: 600; text-transform: uppercase; font-size: 11px; }
.findings .error .sev { color: var(--error); }
.findings .warning .sev { color: var(--warning); }
.findings .info .sev { color: var(--info); }
.http-2 { color: var(--ok); }
.http-4, .http-5 { color: var(--error); }
.state-complete { color: var(--ok); }
.state-failed { color: var(--error); }
.state-running, .state-accepted { color: var(--warning); }
.failure { font-weight: 600; }
.crumbs { margin: 0 0 6px; color: var(--muted); }

/* tariff on a 24-hour bar */
.tariff { max-width: 640px; margin-top: 8px; }
.strip-row { margin: 3px 0; }
.strip { position: relative; height: 16px; background: var(--line); border-radius: 3px; overflow: hidden; }
.strip span { position: absolute; top: 0; bottom: 0; }
.strip-hours { display: flex; justify-content: space-between; }
.legend-item { margin-right: 12px; white-space: nowrap; }
.legend-item i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

/* the year's figures */
.house { display: flex; gap: 16px; flex-wrap: wrap; }
.house-block { flex: 1 1 320px; }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 12px; margin: 0; }
.figures div { min-width: 0; }
.figures dt { color: var(--muted); font-size: 12px; }
.figures dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.small-figures dd { font-size: 14px; }

/* charts */
.chart-box { position: relative; height: 320px; }
.chart-box.tall { height: 420px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.tabs button.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* the solutions */
.filters { display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: baseline; margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.sol-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: var(--card); }
.sol-card:hover { border-color: var(--muted); }
.sol-card.selected { border-color: var(--c-solution); box-shadow: 0 0 0 2px var(--c-solution); }
.sol-card .products { margin: 0; padding-left: 18px; }
.sol-card .more { margin-top: auto; align-self: flex-start; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag, .badge, .type { border-radius: 4px; padding: 0 5px; font-size: 12px; white-space: nowrap; }
.badge { background: var(--badge); }
.tag { border: 1px solid var(--line); }
.type { color: #1f1e1b; }
.type-panels { background: var(--c-panels); }
.type-battery { background: var(--c-battery); }
.type-both { background: var(--c-both); color: #fff; }
.variant { margin: 0; }
.pager { display: flex; gap: 12px; float: right; }

@media (max-width: 600px) {
    .pager { float: none; margin-bottom: 6px; }
    .chart-box { height: 260px; }
}
.months td:first-child { white-space: nowrap; }
section { overflow-x: auto; }
input:not([type=checkbox]), select, textarea { max-width: 100%; }
#query-preview { word-break: break-all; }
