/* overflow.css — the storm-overflow pages: /overflow/{slug} (overflow.php) and the company pages
   /sewage/{company} (sewage-company.php). Redesigned 2026-09-30 (Marc: "can you make it look nicer").

   Colours are tokens on .of, so the dark theme is one block. This page paints its own ground in dark,
   so it sets color-scheme on body too (the contract in public/styles.css: whoever owns the background
   owns the scheme). Brown is sewage, red is "discharging now", green "not discharging", grey unknown. */

.of {
    --of-bg: #f5f7fa; --of-card: #fff; --of-card-alt: #f8fafc; --of-border: #e3e8f0; --of-line: #eef1f6;
    --of-text: #15213f; --of-muted: #56627a; --of-faint: #8390a8; --of-link: #1d6fb8;
    --of-brown: #8e5a2b; --of-brown-ink: #6b4423; --of-brown-soft: #f5ede4; --of-brown-bar: #b07a45;
    --of-live: #c0392b; --of-live-soft: #fdeceb; --of-ok: #1e8e5a; --of-ok-soft: #e6f5ed;
    --of-unk: #72808f; --of-unk-soft: #eef1f5; --of-amber: #b45309; --of-amber-soft: #fdf3e2;
    --of-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    max-width: 980px; margin: 0 auto; padding: 18px 16px 64px; color: var(--of-text);
}
[data-theme="dark"] body:has(.of) { background: #0b1220; color-scheme: dark; }
[data-theme="dark"] .of {
    --of-bg: #0b1220; --of-card: #121b2e; --of-card-alt: #0f1727; --of-border: #22304a; --of-line: #1b2740;
    --of-text: #e6edf6; --of-muted: #a4b1c4; --of-faint: #7d8ba2; --of-link: #7cb8f0;
    --of-brown: #c98d55; --of-brown-ink: #e2b184; --of-brown-soft: #2a2018; --of-brown-bar: #b07a45;
    --of-live: #ff6b5e; --of-live-soft: #3a1a19; --of-ok: #4cc38a; --of-ok-soft: #14291f;
    --of-unk: #97a3b5; --of-unk-soft: #1a2436; --of-amber: #f5b301; --of-amber-soft: #2d2410;
    --of-shadow: none;
}
.of a { color: var(--of-link); }

/* ── heading ───────────────────────────────────────────── */
.of-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .84rem; color: var(--of-muted); }
.of-crumbs a { color: var(--of-muted); text-decoration: none; }
.of-crumbs a:hover { color: var(--of-link); text-decoration: underline; }
.of-crumbs span[aria-hidden] { color: var(--of-faint); }
.of h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; margin: 10px 0 6px; text-wrap: balance; color: var(--of-text); }
.of-sub { color: var(--of-muted); font-size: .98rem; margin: 0 0 10px; line-height: 1.5; }
.of-sub a { font-weight: 600; }
.of-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.of-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--of-unk-soft); color: var(--of-muted); }
.of-chip.bath { background: #e3f1fb; color: #1d6fb8; }
.of-chip.shell { background: #fdeef0; color: #b0302b; }
[data-theme="dark"] .of-chip.bath { background: #13283d; color: #7cb8f0; }
[data-theme="dark"] .of-chip.shell { background: #34191c; color: #ff8f86; }

/* ── cards ─────────────────────────────────────────────── */
.of-card { background: var(--of-card); border: 1px solid var(--of-border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--of-shadow); margin: 0 0 14px; min-width: 0; }
.of-card h2 { font-size: 1.08rem; margin: 0 0 4px; color: var(--of-text); letter-spacing: -.01em; }
.of-card h2 small { font-weight: 600; color: var(--of-faint); font-size: .82rem; margin-left: 4px; }
.of-lede { color: var(--of-muted); font-size: .88rem; margin: 0 0 12px; line-height: 1.5; }
.of-caveat { font-size: .78rem; color: var(--of-faint); line-height: 1.5; margin: 10px 0 0; }
.of-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 0 0 14px; }
.of-grid > .of-card { margin: 0; }

/* ── right now ─────────────────────────────────────────── */
.of-now { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: flex-start; padding-left: 22px; }
.of-now:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--of-unk); }
.of-now[data-state="discharging"] { background: var(--of-live-soft); border-color: color-mix(in srgb, var(--of-live) 30%, var(--of-border)); }
.of-now[data-state="discharging"]:before { background: var(--of-live); }
.of-now[data-state="not_discharging"]:before { background: var(--of-ok); }
.of-now-dot { position: relative; flex: none; width: 16px; height: 16px; margin-top: 5px; border-radius: 50%; background: var(--of-unk); }
.of-now[data-state="not_discharging"] .of-now-dot { background: var(--of-ok); }
.of-now[data-state="discharging"] .of-now-dot { background: var(--of-live); }
.of-now[data-state="discharging"] .of-now-dot:after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--of-live); animation: of-ring 1.8s ease-out infinite; }
@keyframes of-ring { 0% { transform: scale(.55); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .of-now[data-state="discharging"] .of-now-dot:after { animation: none; opacity: .4; } }
.of-now-body { min-width: 0; flex: 1; }
.of-now-label { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--of-faint); }
.of-now-state { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 2px; }
.of-now[data-state="discharging"] .of-now-state { color: var(--of-live); }
.of-now[data-state="not_discharging"] .of-now-state { color: var(--of-ok); }
.of-now-when { color: var(--of-text); font-size: .95rem; line-height: 1.45; }
.of-now-when b { font-variant-numeric: tabular-nums; }
.of-now-feed { color: var(--of-faint); font-size: .8rem; margin-top: 4px; }

/* ── stat tiles ────────────────────────────────────────── */
.of-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.of-stat { background: var(--of-card); border: 1px solid var(--of-border); border-radius: 14px; padding: 13px 14px 12px; min-width: 0; box-shadow: var(--of-shadow); }
.of-stat-k { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--of-faint); }
.of-stat-v { font-size: 1.85rem; font-weight: 800; line-height: 1.05; margin-top: 6px; color: var(--of-brown-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.of-stat-v small { font-size: .8rem; font-weight: 700; color: var(--of-muted); margin-left: 3px; letter-spacing: 0; }
.of-stat-v.none { color: var(--of-faint); font-size: 1.35rem; }
.of-stat-f { font-size: .78rem; color: var(--of-muted); margin-top: 5px; line-height: 1.4; }
.of-stat.live { border-color: color-mix(in srgb, var(--of-brown) 40%, var(--of-border)); background: var(--of-brown-soft); }
.of-stat .of-trend { font-weight: 700; }
.of-trend.up { color: var(--of-live); }
.of-trend.down { color: var(--of-ok); }

/* ── year bars ─────────────────────────────────────────── */
.of-bars { display: grid; gap: 7px; margin: 6px 0 4px; }
.of-bar { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .88rem; }
.of-bar-y { font-weight: 700; color: var(--of-muted); font-variant-numeric: tabular-nums; }
.of-bar-y small { display: block; font-size: .68rem; font-weight: 600; color: var(--of-faint); }
.of-bar-t { height: 22px; background: var(--of-card-alt); border: 1px solid var(--of-line); border-radius: 6px; overflow: hidden; }
.of-bar-f { height: 100%; min-width: 2px; background: var(--of-brown-bar); border-radius: 5px 0 0 5px; }
.of-bar.zero .of-bar-f { min-width: 0; }
.of-bar.part .of-bar-f { background: repeating-linear-gradient(135deg, var(--of-brown-bar) 0 6px, color-mix(in srgb, var(--of-brown-bar) 55%, transparent) 6px 12px); }
.of-bar.nodata .of-bar-t { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--of-line) 5px 10px); }
.of-bar-v { text-align: right; font-variant-numeric: tabular-nums; min-width: 128px; color: var(--of-text); }
.of-bar-v b { font-size: .98rem; }
.of-bar-v span { color: var(--of-faint); font-size: .8rem; }
.of-bar-m { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 99px; background: var(--of-ok-soft); color: var(--of-ok); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.of-bar-m.low { background: var(--of-amber-soft); color: var(--of-amber); }

/* ── tables + lists ────────────────────────────────────── */
.of-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.of-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--of-faint); padding: 7px 8px 7px 0; border-bottom: 1px solid var(--of-line); font-weight: 800; }
.of-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--of-line); vertical-align: top; }
.of-table tr:last-child td { border-bottom: 0; }
.of-table .n, .of-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.of-open { color: var(--of-live); font-weight: 700; }
.of-muted { color: var(--of-faint); }
.of-events { list-style: none; margin: 0; padding: 0; }
.of-ev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--of-line); }
.of-ev:last-child { border-bottom: 0; }
.of-ev-when { font-weight: 600; font-size: .92rem; }
.of-ev-dur { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .92rem; }
.of-ev-meta { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--of-faint); }
.of-ev-len { flex: 1; height: 4px; border-radius: 3px; background: var(--of-line); overflow: hidden; }
.of-ev-len i { display: block; height: 100%; background: var(--of-brown-bar); }
.of-ev.open .of-ev-len i { background: var(--of-live); }
.of-rank { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--of-line); font-size: .9rem; }
.of-rank:last-child { border-bottom: 0; }
.of-rank-n { color: var(--of-faint); font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.of-rank-name { min-width: 0; }
.of-rank-name a { font-weight: 600; text-decoration: none; }
.of-rank-name a:hover { text-decoration: underline; }
.of-rank-name small { display: block; color: var(--of-faint); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-rank-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.of-rank-v small { display: block; font-weight: 500; color: var(--of-faint); font-size: .74rem; }
.of-live-tag { display: inline-block; font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--of-live); border-radius: 99px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }

/* ── facts, buttons, map, chart ───────────────────────── */
.of-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 12px; }
.of-fact .k { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--of-faint); }
.of-fact .v { font-size: .93rem; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.of-fact .v span { color: var(--of-faint); font-weight: 500; }
.of-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.of-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 15px; border-radius: 10px; background: #15224b; color: #fff !important; font-weight: 700; font-size: .9rem; text-decoration: none; border: 1px solid #15224b; }
.of-btn:hover { background: #22336b; text-decoration: none; }
.of-btn.ghost { background: transparent; color: var(--of-text) !important; border-color: var(--of-border); }
.of-btn.ghost:hover { border-color: var(--of-link); color: var(--of-link) !important; }
[data-theme="dark"] .of-btn:not(.ghost) { background: #2f6fed; border-color: #2f6fed; }
#ofMap { height: 300px; border-radius: 12px; border: 1px solid var(--of-border); }
.of-chart-wrap { position: relative; height: 240px; }
.of-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.of-pills button { border: 1px solid var(--of-border); background: var(--of-card); color: var(--of-text); border-radius: 99px; padding: 5px 12px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.of-pills button.on { background: #15224b; border-color: #15224b; color: #fff; }
[data-theme="dark"] .of-pills button.on { background: #2f6fed; border-color: #2f6fed; }
.of-pills label { margin-left: auto; font-size: .76rem; color: var(--of-muted); display: flex; align-items: center; gap: 5px; }
.of-attr { font-size: .74rem; color: var(--of-faint); margin-top: 22px; line-height: 1.55; }
.of-cso { width: 14px; height: 14px; border-radius: 50%; background: #8e5a2b; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(142, 90, 43, .35); }
.of-cso.live { background: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, .35); }
.of-more { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .88rem; }

@media (max-width: 760px) {
    .of-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .of { padding: 14px 16px 56px; }
    .of h1 { font-size: 1.42rem; }
    .of-card { padding: 16px; border-radius: 14px; }
    .of-stat-v { font-size: 1.55rem; }
    .of-facts { grid-template-columns: 1fr; }
    .of-bar { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 8px; }
    .of-bar-v { min-width: 0; }
    .of-bar-v { width: 104px; }
    .of-bar-v span { display: block; }
    .of-bar-m { display: table; margin: 3px 0 0 auto; }
    .of-grid { grid-template-columns: minmax(0, 1fr); }
}
