*{box-sizing:border-box}
body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;
 font-family:system-ui,sans-serif;background:linear-gradient(135deg,#1e293b,#0f172a);color:#0f172a;padding:16px}
.card{background:#fff;padding:2.5rem 2rem;border-radius:14px;width:100%;max-width:380px;box-shadow:0 20px 50px rgba(0,0,0,.35)}
h1{margin:0 0 .25rem;font-size:1.6rem;text-align:center}
p.sub{margin:0 0 1.75rem;text-align:center;color:#64748b}
label{display:block;font-size:.85rem;font-weight:600;margin-bottom:.35rem}
input{width:100%;padding:.7rem .8rem;border:1px solid #cbd5e1;border-radius:8px;font-size:1rem;margin-bottom:1.1rem}
input:focus{outline:2px solid #3b82f6;border-color:transparent}
button,.btn{display:block;width:100%;padding:.8rem;border:0;border-radius:8px;background:#2563eb;color:#fff;
 font-size:1rem;font-weight:600;cursor:pointer;text-align:center;text-decoration:none}
button:hover,.btn:hover{background:#1d4ed8}
.error{background:#fee2e2;color:#b91c1c;padding:.7rem .8rem;border-radius:8px;margin-bottom:1rem;font-size:.9rem}
body.dash{align-items:flex-start}
.wrap{width:100%;max-width:960px;padding-block:2rem;color:#e2e8f0}
.top{display:flex;flex-wrap:wrap;gap:1rem;justify-content:space-between;align-items:center;margin-bottom:1.5rem}
.top h1{text-align:left;color:#fff}
.top .sub{text-align:left;margin:0;color:#94a3b8}
.btn.small{width:auto;padding:.6rem 1rem}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem;margin-bottom:1.25rem}
.stat{background:#fff;color:#0f172a;border-radius:14px;padding:1.25rem 1.4rem;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.stat h2{margin:0 0 .5rem;font-size:.9rem;text-transform:uppercase;letter-spacing:.04em;color:#64748b}
.big{font-size:1.9rem;font-weight:700;margin:0 0 .8rem;font-variant-numeric:tabular-nums}
.big small{font-size:.9rem;font-weight:500;color:#64748b}
dl{display:grid;grid-template-columns:1fr auto;gap:.3rem .8rem;margin:0;font-size:.9rem}
dt{color:#64748b} dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.note{margin:.9rem 0 0;font-size:.85rem;color:#334155}
.info{color:#cbd5e1;font-size:.9rem;line-height:1.5;max-width:70ch}
.dash .btn{max-width:360px}
.muted{color:#94a3b8}
.updated{font-size:.8rem;margin-top:1rem}
.section{font-size:1.1rem;color:#fff;margin:1.75rem 0 .9rem;display:flex;align-items:baseline;gap:.6rem;flex-wrap:wrap}
.section small{font-weight:400;font-size:.9rem}
.live{font-size:.8rem;font-weight:500;color:#4ade80}
.live.off{color:#f87171}
.meter{height:10px;background:#e2e8f0;border-radius:999px;overflow:hidden}
.meter span{display:block;height:100%;width:0;background:#2a78d6;border-radius:999px;transition:width .6s ease}
.meter.warn span{background:#e34948}
.chart{margin:.9rem 0 0}
.chart svg{display:block;width:100%;height:auto;touch-action:none}
.chart .grid{stroke:#e2e8f0;stroke-width:1}
.chart .axis{font-size:9px;fill:#64748b}
.chart .line{fill:none;stroke:#2a78d6;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.chart .area{fill:#2a78d6;opacity:.12}
.chart .dot{fill:#2a78d6;stroke:#fff;stroke-width:2}
.chart .cross{stroke:#94a3b8;stroke-width:1;stroke-dasharray:3 3}
.tip{position:fixed;pointer-events:none;background:#0f172a;color:#fff;font-size:.8rem;padding:.35rem .55rem;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,.35);white-space:nowrap;z-index:10}
[hidden]{display:none!important}
.table-wrap{overflow-x:auto;margin-bottom:.5rem}
table.apps{width:100%;border-collapse:collapse;font-size:.9rem;min-width:560px}
.apps th{text-align:left;font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:#64748b;padding:.4rem .6rem;border-bottom:1px solid #e2e8f0}
.apps td{padding:.55rem .6rem;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.apps td small{color:#64748b}
.apps .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.apps .barcol{width:22%}
.apps .muted-row td{color:#64748b}
svg.bar{display:block;width:100%;height:8px}
svg.bar rect{fill:#2a78d6}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.link-btn{margin-top:.9rem;background:none;border:0;padding:0;color:#2563eb;font-weight:600;font-size:.9rem;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
.link-btn:hover{color:#1d4ed8}
dialog.lightbox{border:0;border-radius:14px;padding:1.25rem 1.4rem;width:min(960px,calc(100vw - 32px));max-height:calc(100vh - 48px);color:#0f172a;box-shadow:0 30px 80px rgba(0,0,0,.5)}
dialog.lightbox::backdrop{background:rgba(2,6,23,.7);backdrop-filter:blur(2px)}
.lb-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1rem}
.lb-head h2{margin:0;font-size:1.15rem;display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap}
.lightbox .live{color:#16a34a}
.lightbox .live.off{color:#dc2626}
.lb-close{background:#f1f5f9;border:0;border-radius:8px;width:2.2rem;height:2.2rem;font-size:1rem;cursor:pointer;flex:none}
.lb-close:hover{background:#e2e8f0}
.mem-summary{display:flex;flex-wrap:wrap;gap:.6rem;margin-bottom:.9rem}
.mem-summary div{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:.5rem .8rem;display:flex;flex-direction:column;min-width:110px}
.mem-summary span{font-size:.75rem;color:#64748b;text-transform:uppercase;letter-spacing:.04em}
.mem-summary strong{font-variant-numeric:tabular-nums}
.toggle{display:inline-flex;gap:.4rem;align-items:center;font-size:.85rem;margin-bottom:.6rem;cursor:pointer}
.toggle input{width:auto;margin:0}
.procs td small{word-break:break-all}
.action-btn{display:inline-flex;align-items:center;gap:.5rem;margin-top:1rem;padding:.6rem 1rem;border:1px solid #bfdbfe;border-radius:10px;
 background:linear-gradient(180deg,#eff6ff,#dbeafe);color:#1e40af;font-size:.9rem;font-weight:600;cursor:pointer;
 box-shadow:0 1px 2px rgba(15,23,42,.08);transition:transform .12s ease,box-shadow .12s ease,background .12s ease}
.action-btn:hover{background:linear-gradient(180deg,#dbeafe,#bfdbfe);box-shadow:0 4px 12px rgba(37,99,235,.25);transform:translateY(-1px)}
.action-btn:active{transform:translateY(0);box-shadow:0 1px 2px rgba(15,23,42,.08)}
.action-btn:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}
.swap-line{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.6rem;margin-top:.6rem;font-size:.85rem;color:#334155}
.swap-line #swap-txt{font-variant-numeric:tabular-nums;color:#64748b}
.meter.thin{height:6px}
.small-note{font-size:.8rem;font-weight:400}
.sites{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:1rem;margin-bottom:.5rem}
.site{background:#fff;color:#0f172a;border-radius:14px;padding:1.1rem 1.25rem;box-shadow:0 10px 30px rgba(0,0,0,.3);border-top:4px solid #16a34a}
.site-degraded{border-top-color:#f59e0b}
.site-down{border-top-color:#dc2626}
.site-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;margin-bottom:.8rem}
.site-title{display:grid;gap:.1rem;min-width:0}
.site-title a{font-weight:700;color:#0f172a;text-decoration:none;word-break:break-all}
.site-title a:hover{color:#2563eb;text-decoration:underline}
.site-badge{display:inline-flex;align-items:center;gap:.35rem;flex:none;font-size:.78rem;font-weight:700;padding:.25rem .6rem;border-radius:999px}
.badge-up{background:#dcfce7;color:#166534}
.badge-degraded{background:#fef3c7;color:#92400e}
.badge-down{background:#fee2e2;color:#991b1b}
.site-dot{font-size:.7rem}
.site-facts{grid-template-columns:auto 1fr;font-size:.85rem}
.site-facts dd{text-align:left}
.site-facts dd.ok{color:#166534}
.site-facts dd.warn{color:#92400e}
.site-facts dd.bad{color:#991b1b;font-weight:600}
