:root {
  color-scheme: dark;
  --bg: #0b0c0e; --bg-alt: #0f1114; --card: #14161a;
  --fg: #e8eaed; --muted: #9aa0a6; --dim: #5f6368; --line: #24272c; --line-2: #2f333a;
  --up: #81c995; --down: #f28b82;
  --r: .5rem; --ease: cubic-bezier(.2,.7,.2,1);
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: 1rem; font-weight: 600; }
h3 { font-size: .8rem; color: var(--muted); font-weight: 600; }
p { margin: 0; }
pre, code { font-family: var(--mono); font-size: .86em; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; overflow-x: auto; white-space: pre; margin: 1rem 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.row { display: flex; align-items: center; gap: .75rem; }
.between { justify-content: space-between; }
:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand span { font: 400 1rem/1 Optima, "Cinzel", Georgia, serif; letter-spacing: .16em; text-transform: uppercase; }
.brand em { font-style: normal; font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .18rem .45rem; border: 1px solid var(--line-2); border-radius: 3px; }
.brand.big span { font-size: 1.35rem; }
.mark { width: 1.5rem; height: 1.5rem; display: inline-block; background: currentColor; -webkit-mask: url(/logo.svg) center / contain no-repeat; mask: url(/logo.svg) center / contain no-repeat; }
.brand.big .mark { width: 2.1rem; height: 2.1rem; }
.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--fg); }

/* app shell */
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; padding: 1rem .75rem; border-right: 1px solid var(--line); background: var(--bg-alt); overflow-y: auto; }
.side .brand { padding: .25rem .5rem; }
.side-nav { display: grid; gap: 1px; }
.side-h { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: .9rem .55rem .3rem; }
.side-h:first-child { margin-top: 0; }
.side-nav a { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 4px; text-decoration: none; color: var(--muted); font-size: .88rem; }
.side-nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav a svg { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-nav a:hover { color: var(--fg); background: rgba(232,234,237,.04); }
.side-nav a.on { color: var(--fg); background: rgba(232,234,237,.07); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: .6rem .55rem 0; border-top: 1px solid var(--line); font-size: .8rem; color: var(--dim); }
.main { display: flex; flex-direction: column; min-width: 0; }
.bar { display: none; }
.content { flex: 1; width: 100%; max-width: 74rem; margin: 0 auto; padding: 1.75rem 2rem 3.5rem; }
.app-foot { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; padding: 1rem 2rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--dim); }
.app-foot a { color: inherit; text-decoration: none; }
.app-foot a:hover { color: var(--fg); }
.scrim { display: none; }
@media (max-width: 60rem) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 16.5rem; z-index: 30; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .shell.open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .shell.open .scrim { opacity: 1; pointer-events: auto; }
  .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 3.2rem; padding: 0 1rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .menu { width: 2.2rem; height: 2.2rem; border: 1px solid var(--line-2); border-radius: 4px; background: transparent; display: grid; place-content: center; gap: .28rem; cursor: pointer; }
  .menu span { display: block; width: 1rem; height: 1.5px; background: var(--fg); }
  .content { padding: 1.25rem 1rem 3rem; }
  .app-foot { padding: 1rem; }
}

/* page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1.25rem; }
.eyebrow { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 0 0 .35rem; }
.crumb { display: flex; gap: .45rem; font-size: .82rem; color: var(--muted); margin: 0 0 .3rem; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.crumb span { color: var(--dim); }
.hosts { margin-top: .25rem; }
.tools { flex-wrap: wrap; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.switch select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.switch .chev { width: 1rem; height: 1rem; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* controls */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--bg-alt); }
.seg a { padding: .38rem .8rem; text-decoration: none; font-size: .82rem; color: var(--muted); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a:hover { color: var(--fg); }
.seg a.on { background: rgba(232,234,237,.08); color: var(--fg); font-weight: 500; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: var(--r); text-decoration: none; font-size: .85rem; font-weight: 500; background: var(--fg); color: var(--bg); }
.btn:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: var(--muted); }

/* cards */
.card { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.25rem; }
.card + .card { margin-top: 1rem; }
a.card { text-decoration: none; }
a.card:hover { border-color: var(--line-2); background: #16181d; }
.grid { display: grid; gap: 1rem; }
.grid.sites { grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); margin-top: 1rem; }
.grid .card { margin: 0; }
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty pre { text-align: left; display: inline-block; }

/* site cards */
.site .kpis { display: flex; gap: 2rem; margin-top: .9rem; }
.site .kpis div { display: grid; }
.site .kpis b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.site .kpis span { color: var(--muted); font-size: .75rem; }
.site .go { position: absolute; right: 1.1rem; bottom: 1rem; color: var(--dim); }
.site:hover .go { color: var(--fg); }
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--muted); }
.status i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--up); }
.status.off i { background: var(--dim); }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1.1rem; display: grid; gap: .2rem; }
.tile .lbl { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.tile b { font-size: 1.6rem; line-height: 1.15; font-variant-numeric: tabular-nums; font-weight: 600; }
.tile .delta { font-size: .78rem; color: var(--muted); display: flex; align-items: baseline; gap: .4rem; font-variant-numeric: tabular-nums; }
.tile .delta small { color: var(--dim); font-size: .72rem; }
.tile .delta.up { color: var(--up); }
.tile .delta.down { color: var(--down); }
.tile.live .lbl i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--up); }
@media (max-width: 56rem) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 30rem) { .tiles { grid-template-columns: 1fr; } }

/* chart */
.chart-card { padding-bottom: .75rem; }
.chart-wrap { position: relative; margin-top: .5rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--line); }
.chart .line { fill: none; stroke: #8ab4f8; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: #8ab4f8; opacity: .08; }
.chart .line.partial { stroke-dasharray: 3 4; opacity: .7; }
.chart .dot { fill: var(--bg); stroke: #8ab4f8; stroke-width: 1.5; }
.chart .lbl { fill: var(--dim); font-size: 10px; font-family: var(--sans); }
.chart .lbl.mid { text-anchor: middle; }
.chart .lbl.end { text-anchor: end; }
.chart .hit rect { fill: transparent; }
.chart .hit .cursor { stroke: var(--line-2); stroke-width: 1; opacity: 0; }
.chart .hit .pt { fill: #8ab4f8; opacity: 0; }
.chart .hit.on .cursor, .chart .hit.on .pt { opacity: 1; }
.tip { position: absolute; transform: translate(-50%, -100%); background: #202124; border: 1px solid var(--line-2); color: var(--fg); padding: .4rem .6rem; border-radius: 4px; font-size: .78rem; white-space: nowrap; pointer-events: none; line-height: 1.35; }
.tip[hidden] { display: none; }
.tip small { display: block; color: var(--muted); font-size: .7rem; }
.tip::after { display: none; }

/* breakdown tables */
.panel { padding: .5rem .75rem .6rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
.tbl th:nth-child(2), .tbl td.v, .tbl th:nth-child(3), .tbl td.s { text-align: right; white-space: nowrap; }
.tbl td { padding: .42rem .5rem; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.k { position: relative; max-width: 0; width: 100%; }
.tbl td.k span { position: relative; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td.k .mini { position: absolute; left: 0; bottom: 0; height: 2px; background: #8ab4f8; opacity: .45; }
.tbl td.v { font-variant-numeric: tabular-nums; }
.tbl td.s { color: var(--muted); font-variant-numeric: tabular-nums; width: 3.5rem; }
.tbl td.none { color: var(--dim); padding: 1rem .5rem; }

/* forms */
.form { display: grid; gap: .55rem; max-width: 30rem; }
.form label { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.form input { font: inherit; padding: .6rem .75rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); }
.form input:focus { outline: 2px solid #8ab4f8; outline-offset: 1px; border-color: transparent; }
.form-actions { display: flex; gap: .6rem; margin-top: .6rem; }
.form-actions .btn { border: 0; cursor: pointer; font: inherit; font-weight: 500; }
.card.danger { border-color: color-mix(in srgb, var(--down) 35%, var(--line)); }
.card.danger h3 { color: var(--down); }
.card.danger p { margin: .4rem 0 .8rem; }
.btn.del { background: var(--down); color: var(--bg); }
.btn.del:hover { background: #f6a9a2; }
.side-add { color: var(--dim) !important; }
.side-add:hover { color: var(--fg) !important; }

/* auth */
.auth { min-height: 100vh; }
.auth-grid { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; border-right: 1px solid var(--line); background: var(--bg-alt); }
.auth-side h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; max-width: 22ch; font-weight: 600; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; color: var(--muted); max-width: 42ch; font-size: .92rem; }
.ticks li { padding-left: 1.3rem; position: relative; }
.ticks li::before { content: "—"; position: absolute; left: 0; color: var(--dim); }
.auth-form { display: grid; place-items: center; padding: 2rem 1.5rem; }
.login { width: 100%; max-width: 21rem; display: grid; gap: .7rem; }
.login h2 { font-size: 1.3rem; }
.login label { font-size: .82rem; color: var(--muted); margin-top: .4rem; }
.login input { font: inherit; padding: .65rem .8rem; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg); color: var(--fg); }
.login input:focus { outline: 2px solid #8ab4f8; outline-offset: 1px; border-color: transparent; }
.login button { font: inherit; font-weight: 500; padding: .7rem; border-radius: var(--r); border: 0; background: var(--fg); color: var(--bg); cursor: pointer; margin-top: .3rem; }
.login button:hover { background: #fff; }
.login .back { margin-top: .2rem; }
.login .back a { text-decoration: none; color: var(--muted); }
.login .back a:hover { color: var(--fg); }
.err { padding: .6rem .8rem; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--down) 45%, var(--line)); color: var(--down); font-size: .85rem; }
@media (max-width: 52rem) { .auth-grid { grid-template-columns: 1fr; } .auth-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 2.25rem 1.5rem; } }

/* landing */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 72rem; margin: 0 auto; height: 3.4rem; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.top nav { display: flex; align-items: center; gap: 1.4rem; font-size: .88rem; color: var(--muted); }
.top nav a { text-decoration: none; }
.top nav a:hover { color: var(--fg); }
.pill { padding: .4rem .85rem; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--fg) !important; }
.pill:hover { border-color: var(--muted); }
.landing .hero { max-width: 72rem; margin: 0 auto; padding: 4.5rem 1.5rem 3rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (min-width: 64rem) { .landing .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-bottom: 4rem; } .landing .actions { margin-bottom: 0; } }
.landing h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 1.1rem; max-width: 24ch; font-weight: 650; }
.landing h1 span { color: var(--muted); }
.landing .lead { font-size: 1.05rem; color: var(--muted); max-width: 54ch; margin: 0 0 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2.5rem; }
.preview { width: 100%; max-width: 46rem; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--card); }
.preview-bar { display: flex; align-items: center; gap: .4rem; padding: .6rem .9rem; border-bottom: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.preview-bar i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--line-2); }
.preview-bar span { margin-left: .4rem; }
.preview-kpis { display: flex; gap: 2rem; padding: .9rem 1.2rem 0; }
.preview-kpis div { display: grid; }
.preview-kpis b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.preview-kpis span { color: var(--muted); font-size: .72rem; }
.preview .chart { padding: .4rem .9rem 0; }
.bars.mini { list-style: none; margin: 0; padding: .5rem 1.2rem 1.1rem; font-size: .78rem; display: grid; gap: .35rem; }
.bars.mini li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .3rem .5rem; overflow: hidden; border-radius: 3px; }
.bars.mini .bar { position: absolute; inset: 0 auto 0 0; background: #8ab4f8; opacity: .1; }
.bars.mini .k, .bars.mini .v { position: relative; }
.bars.mini .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.landing section.wrap { padding-top: 2rem; padding-bottom: 2rem; }
.landing .grid.three { margin-top: 0; }
.num { display: block; color: var(--dim); font-variant-numeric: tabular-nums; margin-bottom: .5rem; font-weight: 500; font-size: .82rem; }
.landing .card { padding: 1.25rem 1.4rem; }
.landing .card h3 { font-size: .95rem; color: var(--fg); margin: 0 0 .4rem; }
.landing .card p { color: var(--muted); font-size: .88rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.25rem; border-top: 1px solid var(--line); margin-top: .5rem; align-items: start; }
.facts div { display: grid; gap: .1rem; }
.facts b { font-size: 1.35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts span { color: var(--muted); font-size: .82rem; }
@media (max-width: 40rem) { .top nav a:not(.pill) { display: none; } .actions .btn { flex: 1; justify-content: center; } }

/* landing footer */
.lp-foot { border-top: 1px solid var(--line); margin-top: 2.5rem; background: var(--bg-alt); }
.lp-foot-in { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; padding-top: 2.5rem; padding-bottom: 1.75rem; }
.lp-foot .col { display: grid; align-content: start; gap: .45rem; }
.lp-foot .col a { text-decoration: none; color: var(--muted); font-size: .85rem; }
.lp-foot .col a:hover { color: var(--fg); }
.lp-foot h4 { margin: 0 0 .3rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg); }
.brandcol p { max-width: 32ch; margin-top: .6rem; }
.lp-foot-legal { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; padding-top: 1rem; padding-bottom: 1.25rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--dim); }
@media (max-width: 48rem) { .lp-foot-in { grid-template-columns: 1fr 1fr; } .brandcol { grid-column: 1 / -1; } }

/* prose */
.prose { max-width: 42rem; }
.prose h1 { margin-bottom: 1rem; }
.prose h2 { font-size: 1rem; margin: 1.5rem 0 .4rem; }
.prose p { margin: 0 0 .7rem; color: var(--muted); }
.prose ul { padding-left: 1.2rem; color: var(--muted); }
.prose li { margin: .2rem 0; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
