/* Speed & Uptime Watch - one stylesheet for every page.
   Themes: light (default), dark, high contrast. Brand color comes from brand.properties (--brand, set on each page).
   Body text is at least 15px (UI-03); the user can enlarge it in the theme menu (data-size). */

:root {
  --brand: #4f46e5; --brand-rgb: 79, 70, 229; --brand-dark: #3e37b2; --brand-soft: rgba(79, 70, 229, .12);
  --bg: #f4f6fb; --bg-2: #eef1f8; --card: #ffffff; --card-2: #f8fafc; --line: #e3e8f0; --line-2: #d4dbe7;
  --text: #0f172a; --text-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --up: #16a34a; --up-bg: #e8f7ee; --warn: #c27803; --warn-bg: #fdf3dc; --down: #dc2626; --down-bg: #fde8e8;
  --info: #2563eb; --info-bg: #e5eefe; --muted-bg: #eef1f6;
  --c-dns: #14b8a6; --c-connect: #f59e0b; --c-tls: #a855f7; --c-send: #64748b; --c-wait: #3b82f6; --c-receive: #22c55e; --c-blocked: #cbd5e1;
  --t-html: #3b82f6; --t-css: #a855f7; --t-js: #f59e0b; --t-image: #22c55e; --t-font: #ec4899; --t-media: #14b8a6; --t-other: #94a3b8; --t-redirect: #64748b;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-2: 0 4px 6px -1px rgba(15, 23, 42, .07), 0 10px 24px -6px rgba(15, 23, 42, .12);
  --shadow-3: 0 20px 50px -12px rgba(15, 23, 42, .28);
  --radius: 14px; --radius-sm: 9px;
  --side: #0f172a; --side-2: #1e293b; --side-text: #cbd5e1; --side-muted: #64748b;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --fs: 15px;
  color-scheme: light;
}
:root[data-size="l"] { --fs: 16.5px; }
:root[data-size="xl"] { --fs: 18px; }
:root[data-size="xxl"] { --fs: 20px; }

:root[data-theme="dark"] {
  --bg: #0b1120; --bg-2: #0f172a; --card: #111a2e; --card-2: #0f1729; --line: #1f2a40; --line-2: #2a3752;
  --text: #e5e9f2; --text-2: #c3cbdb; --muted: #8b97ad; --faint: #5d6a82;
  --up: #22c55e; --up-bg: rgba(34, 197, 94, .13); --warn: #f5a524; --warn-bg: rgba(245, 165, 36, .13); --down: #f05252; --down-bg: rgba(240, 82, 82, .14);
  --info: #60a5fa; --info-bg: rgba(96, 165, 250, .14); --muted-bg: #18233a;
  --c-blocked: #334155;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, .5); --shadow-3: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --side: #070b16; --side-2: #121b2f;
  color-scheme: dark;
}
:root[data-theme="contrast"] {
  --bg: #000; --bg-2: #000; --card: #000; --card-2: #0a0a0a; --line: #fff; --line-2: #fff;
  --text: #fff; --text-2: #fff; --muted: #f0f0f0; --faint: #d0d0d0;
  --brand: #ffd400; --brand-rgb: 255, 212, 0; --brand-dark: #ffe14d; --brand-soft: rgba(255, 212, 0, .2);
  --up: #3dff6e; --up-bg: #002b0d; --warn: #ffd400; --warn-bg: #2b2400; --down: #ff6b6b; --down-bg: #2b0000; --info: #6bc5ff; --info-bg: #001f33; --muted-bg: #111;
  --shadow-1: none; --shadow-2: none; --shadow-3: none;
  --side: #000; --side-2: #111; --side-text: #fff; --side-muted: #ddd;
  color-scheme: dark;
}
:root[data-theme="contrast"] .card, :root[data-theme="contrast"] .btn { border-width: 2px; }
:root[data-theme="contrast"] a { text-decoration: underline; }
:root[data-theme="contrast"] .btn-primary { color: #000; }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .8em; }
code, kbd, .mono { font-family: var(--mono); font-size: .88em; }
code { background: var(--muted-bg); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 .35em; font-size: .75rem; color: var(--muted); background: var(--card); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb), .55); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--card); padding: .5rem 1rem; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- icons ---------- */
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.2em; }
.i-sm { width: .95em; height: .95em; }
.i-lg { width: 1.5em; height: 1.5em; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
html.nav-collapsed .shell { grid-template-columns: 72px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--side), var(--side-2)); color: var(--side-text);
  display: flex; flex-direction: column; padding: 16px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: .65rem; color: inherit; font-weight: 750; padding: 4px 6px 14px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: .82rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .8); flex: none; overflow: hidden; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand .name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.brand .name small { color: var(--side-muted); font-weight: 500; font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: var(--side-text); font-weight: 550; font-size: .93rem; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.nav a.active { background: rgba(var(--brand-rgb), .22); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav a .count { margin-left: auto; background: var(--down); color: #fff; font-size: .7rem; border-radius: 99px; padding: 0 .45rem; font-weight: 700; line-height: 1.5; }
.nav a .count.warn { background: var(--warn); }
.side-foot { margin-top: auto; padding: 14px 8px 2px; font-size: .74rem; color: var(--side-muted); }
html.nav-collapsed .sidebar .name, html.nav-collapsed .nav a span, html.nav-collapsed .nav-label, html.nav-collapsed .side-foot { display: none; }
html.nav-collapsed .nav a { justify-content: center; }
html.nav-collapsed .nav a .count { position: absolute; top: 2px; right: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: 10px 24px; background: rgba(var(--brand-rgb), 0);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line);
  background-color: color-mix(in srgb, var(--bg) 82%, transparent); }
.topbar .spacer { flex: 1; }
.search-trigger { display: flex; align-items: center; gap: .55rem; min-width: 280px; padding: .45rem .7rem; border: 1px solid var(--line); background: var(--card);
  border-radius: 10px; color: var(--muted); cursor: pointer; font: inherit; font-size: .92rem; box-shadow: var(--shadow-1); }
.search-trigger:hover { border-color: var(--line-2); }
.search-trigger kbd { margin-left: auto; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); margin: 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .95rem; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2;
  box-shadow: var(--shadow-1); transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--line-2); background: var(--card-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--brand), var(--brand-dark)); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(var(--brand-rgb), .9); }
.btn-primary:hover { background: var(--brand-dark); border-color: transparent; }
.btn-danger { color: var(--down); }
.btn-danger:hover { background: var(--down-bg); border-color: var(--down); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--muted-bg); }
.btn-sm { padding: .35rem .65rem; font-size: .84rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--muted-bg); }
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 650; font-size: .88rem; margin-bottom: 5px; color: var(--text-2); }
.field .hint, .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.input, select.input, textarea.input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); color: var(--text);
  font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
textarea.input { min-height: 90px; resize: vertical; }
.input-group { display: flex; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; }
.check { display: flex; align-items: flex-start; gap: .55rem; cursor: pointer; font-size: .93rem; }
.check input { margin-top: .25rem; accent-color: var(--brand); width: 16px; height: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sub { color: var(--muted); font-size: .85rem; }
.card-body { padding: 18px 20px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cols-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; padding: 16px 18px; }
.kpi .label { color: var(--muted); font-size: .8rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.kpi .value { font-size: 1.85rem; font-weight: 780; letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; }
.kpi .value small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.kpi .foot { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--kpi-tint, var(--brand-soft)); }
.kpi.up { --kpi-tint: var(--up-bg); } .kpi.up .value { color: var(--up); }
.kpi.down { --kpi-tint: var(--down-bg); } .kpi.down .value { color: var(--down); }
.kpi.warn { --kpi-tint: var(--warn-bg); } .kpi.warn .value { color: var(--warn); }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: var(--muted-bg); color: var(--muted); }
.badge.up { background: var(--up-bg); color: var(--up); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.down { background: var(--down-bg); color: var(--down); }
.badge.info { background: var(--info-bg); color: var(--info); }
.tag { display: inline-block; padding: .05rem .5rem; border-radius: 6px; font-size: .76rem; background: var(--muted-bg); color: var(--text-2); font-weight: 600; margin: 1px 2px 1px 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.up { background: var(--up); box-shadow: 0 0 0 4px var(--up-bg); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.dot.down { background: var(--down); box-shadow: 0 0 0 4px var(--down-bg); animation: pulse 1.6s infinite; }
.dot.info { background: var(--info); box-shadow: 0 0 0 4px var(--info-bg); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .dot.down { animation: none; } * { transition: none !important; } }
.text-up { color: var(--up); } .text-down { color: var(--down); } .text-warn { color: var(--warn); } .text-info { color: var(--info); }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .85rem; } .tiny { font-size: .76rem; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 14px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 14px; } .mb-0 { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: .6rem; } .row-wrap { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--card-2); }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mname { display: flex; align-items: center; gap: .7rem; min-width: 200px; }
.mname b { display: block; color: var(--text); }
.mname small { display: block; color: var(--muted); font-size: .8rem; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* sparkline and uptime bars */
.spark { width: 120px; height: 30px; display: block; }
.spark polyline { fill: none; stroke: var(--brand); stroke-width: 1.7; stroke-linejoin: round; }
.spark.down polyline { stroke: var(--down); }
.bars { display: flex; gap: 2px; align-items: stretch; height: 30px; }
.bars span { flex: 1; min-width: 2px; border-radius: 3px; background: var(--up); opacity: .9; position: relative; }
.bars span.minor { background: var(--warn); }
.bars span.major { background: var(--down); }
.bars span.maintenance { background: var(--info); }
.bars span.none { background: var(--line-2); opacity: .6; }
.bars span:hover { opacity: 1; transform: scaleY(1.12); }
.bars.sm { height: 22px; gap: 1px; }
.bars-legend { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-top: 6px; }

/* ---------- toasts, modals, dropdowns, palette ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.toast { display: flex; gap: .7rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--up); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow-3); transition: opacity .3s, transform .3s; }
.toast.err { border-left-color: var(--down); }
.toast div { flex: 1; font-size: .92rem; }
.toast button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.toast.hide { opacity: 0; transform: translateY(8px); }
.toast .secret { display: block; margin-top: 6px; font-family: var(--mono); background: var(--muted-bg); padding: 6px 8px; border-radius: 8px; word-break: break-all; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); display: none; align-items: flex-start; justify-content: center; z-index: 80; padding: 10vh 16px 16px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 480px; padding: 22px; box-shadow: var(--shadow-3); }
.modal .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 18px; }
.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: var(--shadow-3); display: none; z-index: 60; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .65rem; border-radius: 8px; color: var(--text); background: none; border: 0;
  font: inherit; font-size: .9rem; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--muted-bg); text-decoration: none; }
.menu .menu-head { padding: .5rem .65rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .menu-head small { display: block; color: var(--muted); }
.menu .sep { border-top: 1px solid var(--line); margin: 4px 0; }
.menu .menu-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: .45rem .65rem .2rem; font-weight: 700; }
.menu button.on { color: var(--brand); font-weight: 700; }
.user-btn { display: flex; align-items: center; gap: .55rem; background: none; border: 0; cursor: pointer; color: var(--text); padding: 4px 6px; border-radius: 10px; font: inherit; }
.user-btn:hover { background: var(--muted-bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: .8rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), #06b6d4); flex: none; }
.user-btn .who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-btn .who small { color: var(--muted); font-size: .75rem; }

.palette { position: fixed; inset: 0; z-index: 95; background: rgba(2, 6, 23, .55); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.palette.open { display: flex; }
.palette .box { width: 100%; max-width: 620px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-3); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font: inherit; font-size: 1.05rem; background: transparent; color: var(--text); outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; cursor: pointer; }
.palette li.sel { background: var(--brand-soft); }
.palette li small { margin-left: auto; color: var(--muted); font-size: .78rem; }
.palette .foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); display: flex; gap: 1rem; }

/* ---------- alerts / empty states ---------- */
.alert { display: flex; gap: .7rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-size: .93rem; margin-bottom: 14px; }
.alert.err { background: var(--down-bg); border-color: transparent; color: var(--down); }
.alert.ok { background: var(--up-bg); border-color: transparent; color: var(--up); }
.alert.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.alert.info { background: var(--info-bg); border-color: transparent; color: var(--info); }
.alert > div { color: var(--text); }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty .i { width: 42px; height: 42px; color: var(--faint); margin-bottom: 8px; }
.empty h3 { color: var(--text); }

/* ---------- monitor type picker ---------- */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.type-card { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--card); display: block; }
.type-card:hover { border-color: var(--line-2); }
.type-card input { position: absolute; opacity: 0; }
.type-card b { display: flex; align-items: center; gap: .5rem; }
.type-card small { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.type-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.type-card .i { color: var(--brand); }
[data-for] { display: none; }
[data-for].show { display: block; }

/* ---------- incident timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 36px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--faint); }
.timeline li.DETECTED::before, .timeline li.CONFIRMED::before { border-color: var(--down); }
.timeline li.RESOLVED::before { border-color: var(--up); background: var(--up); }
.timeline li.ACKNOWLEDGED::before { border-color: var(--info); }
.timeline li.NOTIFIED::before, .timeline li.REPEATED::before { border-color: var(--warn); }
.timeline li.MAINTENANCE::before, .timeline li.MAINTENANCE_ENDED::before { border-color: var(--info); }
.timeline li.NOTE::before, .timeline li.ROOT_CAUSE::before { border-color: var(--brand); }
.timeline .when { font-size: .8rem; color: var(--muted); }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; height: 220px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .area { fill: url(#chartFill); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; }
.chart .line-max { fill: none; stroke: var(--brand); stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.chart .fail { fill: var(--down); opacity: .85; }
.chart .hover-line { stroke: var(--muted); stroke-dasharray: 2 2; }
.chart-tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .8rem;
  box-shadow: var(--shadow-2); white-space: nowrap; display: none; z-index: 5; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--card-2); }
.seg a, .seg button { padding: .3rem .7rem; border-radius: 7px; color: var(--muted); font-weight: 650; font-size: .84rem; border: 0; background: none; cursor: pointer; }
.seg a.on, .seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-1); text-decoration: none; }

/* ---------- speed test ---------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: 56px 24px 92px; text-align: center;
  background: radial-gradient(900px 400px at 15% -10%, rgba(255, 255, 255, .18), transparent 60%),
              radial-gradient(700px 380px at 110% 10%, rgba(6, 182, 212, .35), transparent 60%),
              linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, #0ea5e9); }
.hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .3em; }
.hero p.lead { font-size: 1.12rem; opacity: .92; max-width: 640px; margin: 0 auto 26px; }
.hero form { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; background: rgba(255, 255, 255, .14); padding: 8px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 20px 60px -20px rgba(2, 6, 23, .6); }
.hero form .input { border: 0; font-size: 1.05rem; padding: .85rem 1rem; border-radius: 11px; }
.hero form .btn { padding: .85rem 1.4rem; font-size: 1rem; background: #0f172a; color: #fff; border: 0; }
.hero .samples { margin-top: 14px; font-size: .9rem; opacity: .95; }
.hero .samples button { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff; border-radius: 99px; padding: .2rem .7rem; margin: 2px; cursor: pointer; font: inherit; font-size: .85rem; }
.hero .samples button:hover { background: rgba(255, 255, 255, .26); }
.site-head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; z-index: 5; }
.site-head .brand .name small { color: rgba(255, 255, 255, .75); }
.site-head .brand .mark { background: rgba(255, 255, 255, .2); box-shadow: none; }
.site-head .links { display: flex; gap: .4rem; align-items: center; }
.site-head .links a, .site-head .links button { color: #fff; opacity: .92; font-weight: 600; padding: .35rem .7rem; border-radius: 9px; }
.site-head .links a:hover { background: rgba(255, 255, 255, .14); text-decoration: none; }
.site-head .icon-btn { color: #fff; }
.public-wrap { max-width: 1180px; margin: -56px auto 40px; padding: 0 16px; position: relative; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 20px; }
.feature .i { width: 28px; height: 28px; color: var(--brand); margin-bottom: 8px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.progress { height: 10px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #06b6d4); border-radius: 99px; transition: width .4s; }
.running-card { max-width: 720px; margin: 0 auto; padding: 30px; text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.summary { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
.grade-box { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; }
.ring { --p: 0; --c: var(--up); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--muted-bg) 0); }
.ring > div { width: 104px; height: 104px; border-radius: 50%; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring b { font-size: 2.6rem; line-height: 1; font-weight: 800; }
.ring small { color: var(--muted); font-weight: 650; }
.ring.warn { --c: var(--warn); } .ring.down { --c: var(--down); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { padding: 14px 16px; }
.metric .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin: 0; font-weight: 700; }
.metric .value { font-size: 1.5rem; font-weight: 780; margin-top: 4px; letter-spacing: -.02em; }
.metric .delta { font-size: .8rem; font-weight: 650; }
.delta.better { color: var(--up); } .delta.worse { color: var(--down); }
.checks-list { list-style: none; margin: 0; padding: 0; }
.checks-list > li { border-bottom: 1px solid var(--line); }
.checks-list > li:last-child { border-bottom: 0; }
.checks-list details summary { display: flex; align-items: center; gap: .8rem; padding: 12px 20px; cursor: pointer; list-style: none; }
.checks-list details summary::-webkit-details-marker { display: none; }
.checks-list details[open] summary { background: var(--card-2); }
.checks-list .score { width: 46px; text-align: center; font-weight: 800; border-radius: 8px; padding: .15rem 0; font-size: .9rem; }
.checks-list .score.good { background: var(--up-bg); color: var(--up); }
.checks-list .score.warn { background: var(--warn-bg); color: var(--warn); }
.checks-list .score.bad { background: var(--down-bg); color: var(--down); }
.checks-list .body { padding: 4px 20px 16px 78px; font-size: .92rem; }
.checks-list .body ul { margin: 8px 0 0; padding-left: 18px; font-family: var(--mono); font-size: .78rem; color: var(--text-2); }
.checks-list .body li { word-break: break-all; margin-bottom: 2px; }
.share-bars { display: flex; flex-direction: column; gap: 9px; }
.share-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 82px 46px; gap: 10px; align-items: center; font-size: .88rem; }
.share-row .track { height: 10px; background: var(--muted-bg); border-radius: 99px; overflow: hidden; }
.share-row .track span { display: block; height: 100%; border-radius: 99px; }
.share-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; flex: none; }
.t-html { background: var(--t-html); } .t-css { background: var(--t-css); } .t-js { background: var(--t-js); } .t-image { background: var(--t-image); }
.t-font { background: var(--t-font); } .t-media { background: var(--t-media); } .t-other { background: var(--t-other); } .t-redirect { background: var(--t-redirect); }

.wf-tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.wf-tools .input { width: auto; min-width: 220px; padding: .4rem .65rem; font-size: .88rem; }
.wf { font-size: .82rem; }
.wf-row { display: grid; grid-template-columns: 34px minmax(0, 2.2fr) 54px 74px minmax(0, 3fr); align-items: center; gap: 8px; padding: 4px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.wf-row:hover { background: var(--card-2); }
.wf-row.head { cursor: default; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; background: var(--card-2); }
.wf-row .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.wf-row .url .host { color: var(--muted); }
.wf-row.err .url, .wf-row.err .st { color: var(--down); }
.wf-track { position: relative; height: 16px; }
.wf-bar { position: absolute; top: 3px; height: 10px; display: flex; border-radius: 3px; overflow: hidden; min-width: 2px; }
.wf-bar i { display: block; height: 100%; }
.wf-bar .p-blocked { background: var(--c-blocked); } .wf-bar .p-dns { background: var(--c-dns); } .wf-bar .p-connect { background: var(--c-connect); }
.wf-bar .p-tls { background: var(--c-tls); } .wf-bar .p-send { background: var(--c-send); } .wf-bar .p-wait { background: var(--c-wait); } .wf-bar .p-receive { background: var(--c-receive); }
.wf-mark { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 1.5px dashed; }
.wf-mark.html { border-color: var(--t-html); } .wf-mark.load { border-color: var(--down); }
.wf-detail { display: none; padding: 10px 20px 14px 62px; background: var(--card-2); border-bottom: 1px solid var(--line); font-size: .82rem; }
.wf-detail.open { display: block; }
.wf-detail dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 3px 12px; margin: 0; }
.wf-detail dt { color: var(--muted); }
.wf-detail dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: .78rem; }
.wf-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 20px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.wf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wf-legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }

/* ---------- public status page ---------- */
.sp { --accent: var(--brand); max-width: 900px; margin: 0 auto; padding: 0 16px 40px; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 28px 0 20px; }
.sp-logo { display: flex; align-items: center; gap: .75rem; color: var(--text); font-weight: 750; font-size: 1.15rem; }
.sp-logo:hover { text-decoration: none; }
.sp-logo .mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 800; overflow: hidden; }
.sp-logo img { max-height: 42px; max-width: 200px; }
.sp-banner { border-radius: 16px; padding: 20px 22px; color: #fff; display: flex; align-items: center; gap: .9rem; font-size: 1.2rem; font-weight: 750; box-shadow: var(--shadow-2); margin-bottom: 22px; }
.sp-banner.up { background: linear-gradient(135deg, #16a34a, #15803d); }
.sp-banner.degraded { background: linear-gradient(135deg, #d97706, #b45309); }
.sp-banner.down { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.sp-banner.maintenance, .sp-banner.pending { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.sp-banner small { display: block; font-size: .82rem; font-weight: 500; opacity: .9; }
.sp-group { margin-bottom: 18px; }
.sp-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 4px; }
.sp-item { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sp-item:last-child { border-bottom: 0; }
.sp-item .top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 10px; }
.sp-item .top b { font-size: 1rem; }
.sp-item .state { font-weight: 700; font-size: .88rem; }
.sp-item .state.up { color: var(--up); } .sp-item .state.down { color: var(--down); } .sp-item .state.degraded { color: var(--warn); } .sp-item .state.maintenance { color: var(--info); }
.sp-post { padding: 16px 20px; border-left: 4px solid var(--warn); }
.sp-post.MAINTENANCE { border-left-color: var(--info); }
.sp-post.resolved { border-left-color: var(--up); }
.sp-post .upd { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--line); }
.sp-post .upd p { margin: 2px 0 8px; }
.sp-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 30px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.auth-art { color: #fff; padding: 42px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 400px at 0% 0%, rgba(255, 255, 255, .16), transparent 60%), linear-gradient(150deg, var(--brand-dark), var(--brand) 60%, #0ea5e9); }
.auth-art h2 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
.auth-art ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-art li { display: flex; gap: .7rem; align-items: center; opacity: .95; }
.auth-art .brand .mark { background: rgba(255, 255, 255, .2); box-shadow: none; }
.auth-art .brand .name small { color: rgba(255, 255, 255, .8); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--card); }
.auth-form .box { width: 100%; max-width: 400px; }
.demo-box { margin-top: 20px; padding: 14px; border-radius: 12px; background: var(--card-2); border: 1px dashed var(--line-2); font-size: .88rem; }
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.who-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px; cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.who-btn:hover { border-color: var(--brand); }
.who-btn b { display: block; font-size: .85rem; }
.who-btn small { color: var(--muted); font-size: .72rem; }

/* ---------- help ---------- */
.doc { max-width: 860px; margin: 0 auto; padding: 0 16px 60px; }
.doc h2 { margin-top: 2rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.doc img { max-width: 100%; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.doc .toc { columns: 2; padding-left: 18px; }
.doc table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.doc td, .doc th { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; background: var(--card); }
.faq summary { cursor: pointer; font-weight: 650; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell, html.nav-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-3); }
  body.nav-open .sidebar { transform: none; }
  html.nav-collapsed .sidebar .name, html.nav-collapsed .nav a span, html.nav-collapsed .nav-label { display: initial; }
  .search-trigger { min-width: 0; flex: 1; }
  .search-trigger .long { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .grid-2, .grid-3, .grid-4, .cols-even { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .hide-sm { display: none !important; }
  .wf-row { grid-template-columns: 26px minmax(0, 1fr) 46px minmax(0, 1.2fr); }
  .wf-row .sz { display: none; }
  .share-row { grid-template-columns: 90px minmax(0, 1fr) 70px; }
  .share-row .pc { display: none; }
  .hero h1 { font-size: 1.8rem; }
  .hero form { flex-direction: column; }
  .user-btn .who { display: none; }
}
@media (min-width: 901px) { .show-sm { display: none !important; } }
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* links stay readable on dark backgrounds (WCAG AA) */
:root[data-theme="dark"] a:not(.btn) { color: #a5b4fc; }
