:root {
    --bg: #0b0f17;
    --panel: #121826;
    --panel-2: #172033;
    --line: #243049;
    --text: #e6eaf2;
    --muted: #8b95a8;
    --accent: #5eead4;
    --accent-ink: #062b27;
    --pos: #4ade80;
    --neg: #f87171;
    --ok: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

html, body { background: var(--bg); color: var(--text); }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; }
a { color: var(--accent); }
.mono { font-family: var(--mono); }
.text-secondary { color: var(--muted) !important; }

.topbar { border-bottom: 1px solid var(--line); background: rgba(11, 15, 23, .9); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.topbar .container-xl { height: 58px; }
.brand { color: var(--text); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: .2px; }
.brand-mark { color: var(--accent); margin-right: 4px; }
.brand-sub { color: var(--muted); font-size: .85rem; }
.toplink { color: var(--muted); text-decoration: none; font-size: .9rem; }
.toplink:hover { color: var(--text); }
.footer-note { color: var(--muted); font-size: .8rem; padding: 24px 12px 40px; border-top: 1px solid var(--line); margin-top: 24px; }

.hero { margin: 8px 0 24px; }
.hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 750; letter-spacing: -.5px; }
.lead-muted { color: var(--muted); max-width: 760px; font-size: 1.02rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.panel-title { font-size: 1rem; font-weight: 650; margin-bottom: 14px; text-transform: none; }

.form-control, .form-control:focus { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(94, 234, 212, .15); }
.form-text { color: var(--muted); }

.chain-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chain-option { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--panel-2); font-weight: 600; transition: border-color .15s, background .15s; }
.chain-option small { color: var(--muted); font-weight: 500; margin-left: auto; }
.btn-check:checked + .chain-option { border-color: var(--accent); background: rgba(94, 234, 212, .08); }
.btn-check:focus-visible + .chain-option { outline: 2px solid var(--accent); outline-offset: 2px; }
.chain-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.chain-solana { background: linear-gradient(135deg, #9945ff, #14f195); }
.chain-base { background: #0052ff; }

.advanced summary { color: var(--muted); cursor: pointer; font-size: .9rem; }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 700; border: 0; }
.btn-accent:hover, .btn-accent:focus { background: #99f6e4; color: var(--accent-ink); }

.source-list { list-style: none; padding: 0; margin: 0 0 12px; }
.source-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }
.status-dot.off { background: #475569; }
.checks { padding-left: 18px; margin-bottom: 10px; font-size: .9rem; }
.checks li { margin: 4px 0; color: var(--muted); }
.checks strong { color: var(--text); font-weight: 600; }

.progress-panel { max-width: 760px; margin: 40px auto; }
.log { list-style: none; padding: 10px 12px; background: var(--panel-2); border-radius: 8px; font-family: var(--mono); font-size: .78rem; color: var(--muted); max-height: 260px; overflow: auto; }
.log li { padding: 1px 0; }

.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.eyebrow { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; }
.address-title { font-size: clamp(.95rem, 2vw, 1.25rem); word-break: break-all; margin: 4px 0; }

.verdict { border-radius: 16px; padding: 22px 24px; border: 1px solid; }
.verdict-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .8px; opacity: .8; }
.verdict-text { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -.3px; }
.verdict-summary { margin-top: 4px; }
.verdict-counts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.verdict-ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .45); }
.verdict-ok .verdict-text { color: #4ade80; }
.verdict-warn { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .45); }
.verdict-warn .verdict-text { color: #fbbf24; }
.verdict-bad { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .45); }
.verdict-bad .verdict-text { color: #f87171; }
.verdict-body { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.verdict-main { flex: 1 1 320px; }
.score-ring { --p: 0; --c: var(--muted); width: 132px; height: 132px; border-radius: 50%; flex: none;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(148, 163, 184, .15) 0); display: grid; place-items: center; }
.score-ring.score-ok { --c: #4ade80; }
.score-ring.score-warn { --c: #fbbf24; }
.score-ring.score-bad { --c: #f87171; }
.score-inner { width: 106px; height: 106px; border-radius: 50%; background: var(--panel); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.score-inner strong { font-size: 2.1rem; font-weight: 800; }
.score-inner span { color: var(--muted); font-size: .75rem; }
.score-inner em { color: var(--muted); font-size: .68rem; font-style: normal; text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.score-math { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; font-size: .92rem; }
.score-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.score-group { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.score-group-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.score-item { margin-top: 10px; }
.score-item.no-data { opacity: .6; }
.score-bar { height: 6px; background: rgba(148, 163, 184, .15); border-radius: 999px; overflow: hidden; margin: 4px 0 3px; }
.score-bar > div { height: 100%; background: var(--accent); border-radius: 999px; }
.verdict-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid; }
.verdict-chip.verdict-ok { color: #4ade80; }
.verdict-chip.verdict-warn { color: #fbbf24; }
.verdict-chip.verdict-bad { color: #f87171; }

.badge { font-weight: 700; letter-spacing: .3px; }
.badge-pass { background: rgba(34, 197, 94, .18); color: #4ade80; }
.badge-red { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.badge-yellow { background: rgba(245, 158, 11, .2); color: #fcd34d; }
.badge-na { background: rgba(148, 163, 184, .18); color: #cbd5e1; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table thead th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.rules td { vertical-align: top; }
.rule-row { background: rgba(94, 234, 212, .05); }
.pos { color: var(--pos) !important; }
.neg { color: var(--neg) !important; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.metric span { color: var(--muted); font-size: .8rem; }
.metric strong { font-size: 1.25rem; font-weight: 700; }
.metric em { color: var(--muted); font-size: .78rem; font-style: normal; }

.daily-chart svg { width: 100%; height: 160px; display: block; }
.daily-chart .axis { stroke: var(--line); stroke-width: 1; }
.bar-pos { fill: var(--pos); opacity: .85; }
.bar-neg { fill: var(--neg); opacity: .85; }

.flags { white-space: nowrap; }
.flag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; margin-right: 3px; }
.flag-red { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.flag-yellow { background: rgba(245, 158, 11, .2); color: #fcd34d; }
.flag-open { background: rgba(148, 163, 184, .18); color: #cbd5e1; }

details > summary { cursor: pointer; color: var(--muted); }
.compare th { white-space: nowrap; }
.compare-detail summary { color: var(--text); }
.quality, .notes { font-size: .9rem; padding-left: 18px; }
.notes li { color: var(--muted); margin: 4px 0; }

.prose { max-width: 860px; }
.prose h1 { font-size: 1.6rem; font-weight: 750; }
.prose h2 { font-size: 1.1rem; font-weight: 700; margin-top: 22px; }
.prose p, .prose li { color: #cbd5e1; }

@media (max-width: 575px) {
    .panel { padding: 16px; }
    .chain-toggle { grid-template-columns: 1fr; }
}
