@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("fonts/ibm-plex-sans-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --night: #140e16;
  --panel: #1a131d;
  --panel-raised: #1f1723;
  --sunk: #0f0a11;
  --field: #221a26;
  --line: #2d2332;
  --line-soft: #241c28;
  --line-strong: #453748;
  --ivory: #f4ebee;
  --mauve: #ad9da8;
  --dusk: #86778b;
  --cerise: #e6386f;
  --cerise-light: #ff8db0;
  --cerise-wash: rgba(230, 56, 111, 0.13);
  --ink-on-ivory: #1a1119;
  /* chart colors, validated against the panel surface (dark mode) */
  --viz-ok: #8f86e0;
  --viz-warn: #c2831c;
  --viz-bad: #e6386f;
  --viz-alt: #2f9f8d;
  --sans: "Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --page: min(1320px, calc(100% - 64px));
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--night); scrollbar-color: var(--line-strong) transparent; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ivory);
  font: 400 14px/1.5 var(--sans);
  background:
    radial-gradient(1100px 560px at 85% -8%, rgba(230, 56, 111, 0.06), transparent 62%),
    radial-gradient(900px 700px at -10% 110%, rgba(128, 84, 150, 0.08), transparent 62%),
    var(--night);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(230, 56, 111, 0.38); color: #fff; }
:focus-visible { outline: 2px solid var(--cerise); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: 0.93em; letter-spacing: -0.01em; }
.muted { color: var(--dusk); }
.soft { color: var(--mauve); }
.num { font-variant-numeric: tabular-nums; }

/* Buttons ------------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 500 13px/1 var(--sans);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.button[disabled] { opacity: 0.55; cursor: progress; }
.button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.button-primary { background: var(--ivory); color: var(--ink-on-ivory); }
.button-primary:hover { background: #fff; }
.button-quiet { background: transparent; color: var(--ivory); border-color: var(--line-strong); }
.button-quiet:hover { border-color: rgba(244, 235, 238, 0.4); background: rgba(244, 235, 238, 0.03); }
.button-danger { background: transparent; color: var(--cerise-light); border-color: rgba(230, 56, 111, 0.45); }
.button-danger:hover { background: var(--cerise-wash); }
.button-danger.is-armed { background: var(--cerise); border-color: var(--cerise); color: #fff; }
.button-wide { width: 100%; height: 42px; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--mauve);
  cursor: pointer;
  list-style: none;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.icon-button:hover { color: var(--ivory); background: rgba(244, 235, 238, 0.06); }
.icon-button::-webkit-details-marker { display: none; }
.icon-button svg { width: 15px; height: 15px; }
.icon-button svg circle { fill: currentColor; }
.icon-button svg path, .icon-button svg rect { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ivory);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-button:hover { text-decoration-color: var(--ivory); }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--sunk); }
.segmented button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--mauve);
  font-size: 13px;
  cursor: pointer;
}
.segmented button:hover { color: var(--ivory); }
.segmented button[aria-pressed="true"] { background: var(--panel-raised); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--line-strong); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--mauve);
  font-size: 13px;
  cursor: pointer;
}
.chip:hover { color: var(--ivory); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--ivory); border-color: rgba(244, 235, 238, 0.45); background: rgba(244, 235, 238, 0.05); }
.chip .count { color: var(--dusk); font-variant-numeric: tabular-nums; }
.chip.is-alert .count { color: var(--cerise-light); }

/* Login -------------------------------------------------------------------- */

.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-form {
  width: min(380px, 100%);
  padding: 40px 36px 36px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(26, 19, 29, 0.8);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.85);
}
.login-form.is-wrong { animation: shake 0.42s var(--ease); }
.login-mark { width: 34px; height: 34px; margin-bottom: 22px; }
.login-mark path, .brand svg path { fill: none; stroke: var(--cerise); stroke-width: 2.2; stroke-linecap: round; }
.login-mark circle:first-of-type, .brand svg circle:first-of-type { fill: var(--ivory); }
.login-mark circle:last-of-type, .brand svg circle:last-of-type { fill: var(--cerise); }
.login-title { margin: 0; font-weight: 300; font-size: 40px; line-height: 1; letter-spacing: -0.028em; }
.login-lede { margin: 14px 0 28px; color: var(--mauve); }

@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* Fields ------------------------------------------------------------------- */

.field { display: grid; gap: 7px; margin: 0 0 18px; }
.field-label { font-size: 12.5px; color: var(--mauve); }
.field input, .field select, .field textarea, .input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ivory);
  font: 400 14px/1.2 var(--sans);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .input::placeholder { color: #6d5f71; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none;
  border-color: rgba(230, 56, 111, 0.75);
  box-shadow: 0 0 0 3px var(--cerise-wash);
}
.field input[disabled] { opacity: 0.55; cursor: not-allowed; }
.field .is-mono, .input.is-mono { font-family: var(--mono); font-size: 13.5px; }
.field textarea {
  height: auto;
  min-height: 160px;
  padding: 12px 14px;
  font: 400 12.5px/1.65 var(--mono);
  white-space: pre;
  overflow: auto;
  resize: vertical;
  tab-size: 4;
}
.field select, select.input {
  appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23ad9da8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
option { background: var(--panel-raised); color: var(--ivory); }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.compose input { border-radius: 8px 0 0 8px; }
.compose select { width: auto; border-left: 0; border-radius: 0 8px 8px 0; font-family: var(--mono); font-size: 13px; color: var(--mauve); }
.field-hint { display: flex; align-items: center; gap: 9px; min-height: 18px; margin: 0; font-size: 12.5px; color: var(--dusk); overflow-wrap: anywhere; }
.form-error { margin: 0 0 16px; color: var(--cerise-light); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.toggle { display: flex; align-items: center; gap: 12px; margin: 2px 0 18px; cursor: pointer; }
.toggle input {
  appearance: none;
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ivory);
  transition: transform 0.2s var(--ease);
}
.toggle input:checked { background: var(--cerise); }
.toggle input:checked::after { transform: translateX(14px); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Shell -------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(20, 14, 22, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; width: var(--page); height: 60px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.tabs { display: flex; align-items: stretch; gap: 4px; height: 100%; }
.tabs a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--mauve);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.15s;
}
.tabs a:hover { color: var(--ivory); }
.tabs a[aria-current="page"] { color: var(--ivory); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--cerise); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.menu { position: relative; }
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-raised);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
}
.menu-panel button { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; }
.menu-panel button:hover { background: rgba(244, 235, 238, 0.055); }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  width: var(--page);
  margin: 18px auto 0;
  padding: 10px 10px 10px 16px;
  border: 1px solid rgba(230, 56, 111, 0.38);
  border-radius: 12px;
  background: var(--cerise-wash);
}
.banner p { margin: 0; }

.page { width: var(--page); margin: 0 auto; padding: 30px 0 110px; }

.view-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin: 0 0 24px; }
.view-title { margin: 0; font: 300 30px/1.1 var(--sans); letter-spacing: -0.024em; }
.view-lede { margin: 8px 0 0; color: var(--mauve); max-width: 72ch; }
.view-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Overview ----------------------------------------------------------------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.kpi { position: relative; min-width: 0; padding: 18px 20px 14px; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: var(--line); }
.kpi-label { color: var(--mauve); font-size: 12.5px; }
.kpi-value { margin: 8px 0 2px; font: 400 28px/1.1 var(--sans); letter-spacing: -0.02em; white-space: nowrap; }
.kpi-value small { margin-left: 3px; color: var(--mauve); font-size: 15px; letter-spacing: 0; }
.kpi-sub { color: var(--dusk); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.is-alert { color: var(--cerise-light); }
.kpi-spark { height: 30px; margin-top: 10px; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

.panel { min-width: 0; padding: 20px 22px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin: 0 0 14px; }
.panel-title { margin: 0; font: 500 14px/1.3 var(--sans); }
.panel-note { margin: 0; color: var(--dusk); font-size: 12.5px; }
.panel-empty { margin: 8px 0; color: var(--dusk); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--mauve); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend i.is-line { width: 14px; height: 2px; border-radius: 2px; }
.chart-box { position: relative; }

.attention { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.attention li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.attention li:first-child { border-top: 0; padding-top: 2px; }
.attention .mark { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--viz-bad); box-shadow: 0 0 0 3px rgba(230, 56, 111, 0.15); }
.attention .mark.is-warn { background: var(--viz-warn); box-shadow: 0 0 0 3px rgba(194, 131, 28, 0.15); }
.attention .mark.is-fine { background: var(--viz-ok); box-shadow: 0 0 0 3px rgba(143, 134, 224, 0.15); }
.attention .text { flex: 1; min-width: 0; }
.attention .text strong { font-weight: 500; }
.attention .text span { display: block; color: var(--dusk); font-size: 12.5px; overflow-wrap: anywhere; }
.attention .button { height: 28px; padding: 0 10px; font-size: 12.5px; }

.strip-row { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr) 64px; align-items: center; gap: 16px; padding: 5px 0; }
.strip-name { min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 400 13px/1.3 var(--mono); }
.strip-name:hover .strip-lead { text-decoration: underline; text-underline-offset: 3px; }
.strip-rest { color: var(--dusk); }
.strip-cells { display: flex; gap: 2px; height: 20px; }
.strip-cell { flex: 1; min-width: 1px; border-radius: 2px; background: var(--line); }
.strip-cell.is-up { background: var(--viz-ok); }
.strip-cell.is-partial { background: var(--viz-warn); }
.strip-cell.is-down { background: var(--viz-bad); }
.strip-cell:hover { filter: brightness(1.3); }
.strip-value { color: var(--mauve); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 76px;
  align-items: center;
  gap: 4px 14px;
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.bar-row:first-child { border-top: 0; }
.bar-row:hover .bar-lead { text-decoration: underline; text-underline-offset: 3px; }
.bar-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 13px/1.3 var(--mono); }
.bar-rest { color: var(--dusk); }
.bar-track { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.bar-value { color: var(--ivory); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-sub { grid-column: 2 / 4; margin-top: -2px; color: var(--dusk); font-size: 12px; }

.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed time { color: var(--dusk); font-variant-numeric: tabular-nums; }
.feed .detail { display: block; color: var(--dusk); font-size: 12px; overflow-wrap: anywhere; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); }
.stats dt { color: var(--dusk); font-size: 12.5px; }
.stats dd { margin: 4px 0 0; font-size: 17px; font-variant-numeric: tabular-nums; }

/* Charts */
.chart { display: block; overflow: visible; }
.chart-grid line { stroke: var(--line-soft); stroke-width: 1; }
.chart-tick { fill: var(--dusk); font: 400 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart-empty { fill: var(--dusk); font: 400 13px var(--sans); }
.chart-wash { fill: rgba(244, 235, 238, 0.05); }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-cross { stroke: var(--line-strong); stroke-width: 1; }
.chart-dot { stroke: var(--panel); stroke-width: 2; }
.spark { display: block; overflow: visible; }
.spark-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; opacity: 0.9; }

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  min-width: 150px;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(31, 23, 35, 0.97);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  font-size: 12.5px;
}
.tooltip-title { margin-bottom: 6px; color: var(--mauve); }
.tooltip-row { display: flex; align-items: center; gap: 8px; padding: 1px 0; }
.tooltip-row strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.tooltip-row span:last-child { color: var(--mauve); }
.tooltip-key { width: 12px; height: 2px; border-radius: 2px; }

/* Sites table -------------------------------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; }
.toolbar .search { margin-left: auto; }
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 270px;
  height: 34px;
  padding: 0 8px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sunk);
}
.search:focus-within { border-color: rgba(230, 56, 111, 0.7); box-shadow: 0 0 0 3px var(--cerise-wash); }
.search svg { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--mauve); stroke-width: 1.4; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; }
.search input::placeholder { color: var(--dusk); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--dusk); font: 400 11px/18px var(--mono); }

.table-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--dusk);
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}
.table th button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
.table th button:hover { color: var(--ivory); }
.table th button[aria-sort]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.table th button[aria-sort="ascending"]::after { transform: translateY(1px) rotate(-135deg); }
.table th button[aria-sort] { color: var(--ivory); }
.table td { padding: 12px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr { cursor: pointer; transition: background-color 0.12s; }
.table tbody tr:hover { background: rgba(244, 235, 238, 0.025); }
.table tbody tr.is-selected { background: var(--cerise-wash); }
.table .check { width: 44px; padding-right: 0; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table .right { text-align: right; }
.row-actions { display: inline-flex; gap: 2px; opacity: 0.35; transition: opacity 0.15s; }
.table tr:hover .row-actions, .table tr:focus-within .row-actions { opacity: 1; }

.checkbox { appearance: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1.5px solid var(--line-strong); border-radius: 4px; background: var(--sunk); cursor: pointer; display: grid; place-items: center; }
.checkbox:checked { border-color: var(--cerise); background: var(--cerise); }
.checkbox:checked::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg); }
.checkbox:indeterminate { border-color: var(--cerise); }
.checkbox:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--cerise); }

.site-host { font: 400 14px/1.3 var(--mono); letter-spacing: -0.01em; white-space: nowrap; }
.site-host .rest { color: var(--dusk); }
.site-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cell-sub { display: block; margin-top: 4px; color: var(--dusk); font-size: 12.5px; max-width: 42ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-main { display: flex; align-items: center; gap: 9px; white-space: nowrap; }

.tag { padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--mauve); font-size: 11.5px; line-height: 1.4; white-space: nowrap; }
.tag-alert { border-color: rgba(230, 56, 111, 0.5); color: var(--cerise-light); }
.tag svg { width: 11px; height: 11px; margin: 0 4px -1px -2px; fill: none; stroke: currentColor; stroke-width: 1.5; }

.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dusk); }
.dot.is-up { background: var(--viz-ok); box-shadow: 0 0 0 3px rgba(143, 134, 224, 0.16); }
.dot.is-down { background: transparent; border: 1.5px solid var(--viz-bad); }
.dot.is-none { background: var(--line-strong); }

.code {
  display: inline-block;
  min-width: 36px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(244, 235, 238, 0.07);
  font: 500 12px/1.4 var(--mono);
  text-align: center;
}
.code.is-bad { background: rgba(230, 56, 111, 0.16); color: var(--cerise-light); }
.code.is-warn { background: rgba(194, 131, 28, 0.18); color: #e7b565; }

.empty-row td { padding: 44px 14px; color: var(--mauve); text-align: center; cursor: default; }

.bulk {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(31, 23, 35, 0.96);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.8);
  transform: translateX(-50%);
}
.bulk .link-button { margin: 0 6px; color: var(--mauve); }

/* History ------------------------------------------------------------------ */

.day-title { margin: 26px 0 8px; color: var(--mauve); font-size: 13px; font-weight: 500; }
.day-title:first-child { margin-top: 0; }
.changes { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.change + .change { border-top: 1px solid var(--line-soft); }
.change-head {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto auto 16px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 13px 18px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.change-head:hover { background: rgba(244, 235, 238, 0.025); }
.change-head time { color: var(--dusk); font-variant-numeric: tabular-nums; }
.change-action { overflow-wrap: anywhere; }
.change-lines { color: var(--dusk); font: 400 12px var(--mono); white-space: nowrap; }
.change-lines .plus { color: #a9a2f0; }
.change-lines .minus { color: var(--cerise-light); }
.change-head .chev { width: 7px; height: 7px; border-right: 1.5px solid var(--mauve); border-bottom: 1.5px solid var(--mauve); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
.change.is-open .chev { transform: rotate(45deg); }
.change-body { padding: 4px 18px 18px; }
.change-body p { margin: 0 0 12px; color: var(--mauve); font-size: 13px; }

.diff {
  margin: 0 0 14px;
  padding: 10px 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--sunk);
  overflow: auto;
  font: 400 12.5px/1.6 var(--mono);
  max-height: 420px;
}
.diff div { padding: 0 14px; white-space: pre; }
.diff .add { background: rgba(143, 134, 224, 0.14); color: #d8d4ff; }
.diff .del { background: rgba(230, 56, 111, 0.13); color: #ffc2d4; }
.diff .hunk { color: var(--dusk); padding-top: 6px; }
.diff .hunk:first-child { padding-top: 0; }
.diff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Caddyfile editor --------------------------------------------------------- */

.editor { display: grid; grid-template-columns: auto minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; background: var(--sunk); overflow: hidden; }
.editor:focus-within { border-color: rgba(230, 56, 111, 0.55); }
.gutter {
  margin: 0;
  padding: 14px 10px 14px 16px;
  border-right: 1px solid var(--line-soft);
  color: #5f5163;
  font: 400 12.5px/1.7 var(--mono);
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}
.editor textarea {
  width: 100%;
  height: min(70vh, 900px);
  min-height: 360px;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  outline: none;
  background: none;
  color: var(--ivory);
  font: 400 12.5px/1.7 var(--mono);
  white-space: pre;
  overflow: auto;
  resize: vertical;
  tab-size: 4;
}
.editor-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 0; }
.editor-foot p { margin: 0; color: var(--dusk); font-size: 12.5px; }

/* Log ---------------------------------------------------------------------- */

.log-table td { padding: 9px 14px; font-size: 13px; }
.log-table tbody tr { cursor: default; }
.log-table time { color: var(--dusk); font-variant-numeric: tabular-nums; white-space: nowrap; }
.level { display: inline-block; padding: 1px 8px; border-radius: 999px; background: rgba(244, 235, 238, 0.06); color: var(--mauve); font-size: 11.5px; }
.level.is-warn { background: rgba(194, 131, 28, 0.18); color: #e7b565; }
.level.is-error { background: rgba(230, 56, 111, 0.16); color: var(--cerise-light); }
.log-fields { display: block; margin-top: 3px; color: var(--dusk); font: 400 12px/1.5 var(--mono); overflow-wrap: anywhere; }

/* Drawer ------------------------------------------------------------------- */

.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(8, 5, 9, 0.55); animation: fade 0.25s var(--ease); }
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(540px, 100%);
  border-left: 1px solid var(--line);
  background: var(--panel-raised);
  box-shadow: -40px 0 100px -30px rgba(0, 0, 0, 0.7);
  animation: slide-in 0.3s var(--ease);
}
.drawer-panel:focus { outline: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 26px 24px 4px 30px; }
.drawer-title { margin: 3px 0 0; font: 300 24px/1.25 var(--sans); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.drawer-title.is-mono { font: 400 18px/1.4 var(--mono); letter-spacing: -0.015em; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 30px 48px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 22px; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 22px; margin: 0 0 24px; font-size: 13.5px; }
.facts dt { color: var(--dusk); }
.facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; overflow-wrap: anywhere; }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; }
.mini-stats div { padding: 12px 14px; }
.mini-stats div + div { border-left: 1px solid var(--line); }
.mini-stats dt { color: var(--dusk); font-size: 12px; }
.mini-stats dd { margin: 4px 0 0; font-size: 18px; font-variant-numeric: tabular-nums; }

.section { padding: 22px 0 24px; border-top: 1px solid var(--line); }
.section:last-child { padding-bottom: 0; }
.section-title { margin: 0 0 14px; font: 500 13.5px/1.3 var(--sans); }
.section > p { margin: 0 0 14px; color: var(--mauve); font-size: 13.5px; }
.disclosure > summary { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 13.5px; cursor: pointer; list-style: none; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--mauve); border-bottom: 1.5px solid var(--mauve); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
.disclosure[open] > summary { margin-bottom: 14px; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.notice { margin: 0 0 22px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--mauve); font-size: 13.5px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.result-status { margin: 4px 0 20px; color: var(--mauve); }
.result-url { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 13px 13px 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); }
.result-url a { font: 400 14px/1.3 var(--mono); text-decoration: none; overflow-wrap: anywhere; }
.result-url a:hover { text-decoration: underline; text-underline-offset: 3px; }
.credentials { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; margin: 0 0 10px; padding: 13px 12px 13px 16px; border: 1px solid rgba(230, 56, 111, 0.35); border-radius: 12px; background: var(--cerise-wash); }
.credentials dt { color: var(--mauve); font-size: 13px; }
.credentials dd { margin: 0; font: 400 14px/1.3 var(--mono); overflow-wrap: anywhere; }
.small-button { height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: none; font-size: 12.5px; cursor: pointer; }
.small-button:hover { border-color: rgba(244, 235, 238, 0.42); }

/* Toasts ------------------------------------------------------------------- */

.toasts { position: fixed; bottom: 26px; left: 50%; z-index: 90; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { max-width: min(560px, calc(100vw - 32px)); padding: 10px 18px; border-radius: 999px; background: var(--ivory); color: var(--ink-on-ivory); font: 500 13.5px/1.35 var(--sans); box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.7); animation: toast-in 0.3s var(--ease); transition: opacity 0.3s, transform 0.3s; }
.toast.is-error { border-radius: 14px; background: var(--cerise); color: #fff; white-space: pre-wrap; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }

.is-loading { opacity: 0.55; transition: opacity 0.2s; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Smaller screens ---------------------------------------------------------- */

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4)::before { display: none; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .table .col-traffic, .table .col-uptime { display: none; }
}

@media (max-width: 760px) {
  :root { --page: calc(100% - 28px); }
  .topbar-inner { flex-wrap: wrap; height: auto; gap: 8px 16px; padding: 12px 0 0; }
  .tabs { order: 3; width: 100%; height: 44px; overflow-x: auto; }
  .tabs a { padding: 0 10px; }
  .topbar-actions .button-primary { height: 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi::before { display: none; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .view-title { font-size: 26px; }
  .strip-row { grid-template-columns: minmax(0, 1fr) 56px; }
  .strip-cells { grid-column: 1 / -1; order: 3; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .bar-track { grid-column: 1 / -1; order: 3; }
  .bar-sub { grid-column: 1 / -1; }
  .toolbar .search { width: 100%; margin-left: 0; }
  .table .col-backend, .table .col-https { display: none; }
  .table .check { display: none; }
  .change-head { grid-template-columns: 50px minmax(0, 1fr) 16px; }
  .change-head .change-source, .change-head .change-lines { display: none; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stats div:nth-child(3) { border-left: 0; }
  .mini-stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .pair { grid-template-columns: 1fr; }
  .drawer-body { padding: 8px 20px 40px; }
  .drawer-head { padding: 20px 16px 4px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Dashboard ------------------------------------------------------------------ */

.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 22px; }
.band { display: grid; grid-template-columns: minmax(250px, auto) minmax(0, 1fr); gap: 16px 40px; align-items: center; margin: 0 0 22px; }
.hero { display: flex; align-items: flex-end; gap: 18px; padding-bottom: 6px; }
.hero-figure { display: flex; align-items: baseline; gap: 8px; }
.hero-value { font: 300 76px/0.9 var(--sans); letter-spacing: -0.04em; }
.hero-of { color: var(--mauve); font-size: 22px; font-weight: 300; white-space: nowrap; }
.hero-text { display: grid; gap: 6px; padding-bottom: 6px; }
.hero-text strong { font-size: 17px; font-weight: 500; }
.hero-text > span { color: var(--mauve); font-size: 13px; line-height: 1.5; max-width: 34ch; }
.hero-down { color: var(--cerise-light); text-decoration-color: rgba(230, 56, 111, 0.4); font-family: var(--mono); font-size: 12.5px; }
.band-note { color: var(--dusk); font-size: 12.5px; }
.band-note:empty { display: none; }

.attention-strip { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.attention-strip li { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; border: 1px solid rgba(194, 131, 28, 0.35); border-radius: 10px; background: rgba(194, 131, 28, 0.07); }
.attention-strip li > span:nth-child(2) { flex: 1; }
.attention-strip .mark { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--viz-warn); }
.attention-strip .button { height: 28px; font-size: 12.5px; }

.domains { margin: 0 0 22px; }
.toolbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.button.is-on { border-color: rgba(230, 56, 111, 0.6); background: var(--cerise-wash); }

.dlist {
  --dcols: minmax(280px, 1.7fr) minmax(150px, 1fr) 210px 200px 118px 74px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
}
.domains.is-selecting .dlist { --dcols: 34px minmax(280px, 1.7fr) minmax(150px, 1fr) 210px 200px 118px 74px; }
.dhead, .drow { display: grid; grid-template-columns: var(--dcols); align-items: center; gap: 16px; padding: 0 14px 0 16px; }
.dhead { height: 40px; border-bottom: 1px solid var(--line); color: var(--dusk); font-size: 12.5px; }
.dhead-sort { justify-self: start; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; white-space: nowrap; }
.dhead-sort:hover, .dhead-sort[aria-sort] { color: var(--ivory); }
.dhead-sort[aria-sort]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-right: 1.3px solid currentColor; border-bottom: 1.3px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.dhead-sort[aria-sort="descending"]::after { transform: translateY(1px) rotate(-135deg); }
.drows { margin: 0; padding: 0; list-style: none; }
.drow { min-height: 62px; border-top: 1px solid var(--line-soft); cursor: pointer; transition: background-color 0.12s; }
.drow:first-child { border-top: 0; }
.drow:hover { background: rgba(244, 235, 238, 0.028); }
.drow.is-selected { background: var(--cerise-wash); }
.drow.is-down { background: rgba(230, 56, 111, 0.05); box-shadow: inset 3px 0 0 var(--viz-bad); }
.drow.is-down:hover { background: rgba(230, 56, 111, 0.08); }
.drow.is-off { box-shadow: inset 3px 0 0 var(--viz-warn); }
.dempty { margin: 0; padding: 40px 16px; color: var(--mauve); text-align: center; }
.drow-check { display: flex; align-items: center; }

.drow-site { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 11px 0; text-decoration: none; }
.drow-icon { position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--sunk); }
.fav { display: block; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; }
.fav-letter { display: grid; place-items: center; background: var(--line-strong); color: var(--ivory); font: 500 11.5px/1 var(--sans); }
.drow-badge { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border: 2.5px solid var(--panel); border-radius: 50%; background: var(--viz-ok); }
.drow.is-down .drow-badge { background: var(--viz-bad); }
.drow.is-off .drow-badge { background: var(--viz-warn); }
.drow.is-down .fav { filter: grayscale(1); opacity: 0.55; }
.drow:hover .drow-badge { border-color: #1e1621; }
.drow-name { display: grid; gap: 3px; min-width: 0; }
.drow-host { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; font: 400 14.5px/1.3 var(--mono); letter-spacing: -0.012em; }
.drow-host .lead { color: var(--ivory); }
.drow-hostname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.drow-host .rest { color: var(--dusk); }
.drow.is-down .drow-host .lead { color: var(--mauve); }
.drow-go { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--cerise); opacity: 0; transform: translate(-3px, 3px); transition: opacity 0.15s, transform 0.15s var(--ease); }
.drow-go svg, .drow-lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drow-site:hover .drow-go, .drow-site:focus-visible .drow-go { opacity: 1; transform: none; }
.drow-site:hover .lead { text-decoration: underline; text-decoration-color: rgba(230, 56, 111, 0.6); text-underline-offset: 4px; }
.drow-lock { flex: none; display: inline-grid; color: var(--mauve); }
.drow-desc { overflow: hidden; color: var(--mauve); font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.drow.is-down .drow-desc { color: var(--cerise-light); }

.col-backend, .col-https { display: grid; gap: 3px; min-width: 0; }
.drow-target { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.drow-sub { overflow: hidden; color: var(--dusk); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.col-traffic, .col-uptime { display: flex; align-items: center; gap: 12px; min-width: 0; }
.row-spark { flex: 1; min-width: 0; height: 24px; }
.drow-num { display: grid; gap: 2px; min-width: 58px; text-align: right; }
.drow-num strong { font-weight: 400; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mini-strip { display: flex; flex: 1; gap: 1px; min-width: 0; height: 16px; }
.mini-strip i { flex: 1; min-width: 1px; border-radius: 1px; background: var(--line); }
.mini-strip i.is-up { background: var(--viz-ok); opacity: 0.85; }
.mini-strip i.is-partial { background: var(--viz-warn); }
.mini-strip i.is-down { background: var(--viz-bad); }
.drow-https { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.drow-https .code { min-width: 0; font-size: 11.5px; }
.col-tools { display: flex; justify-content: flex-end; gap: 2px; opacity: 0.4; transition: opacity 0.15s; }
.drow:hover .col-tools, .drow:focus-within .col-tools { opacity: 1; }

@media (max-width: 1180px) {
  .band { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4)::before { display: none; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .dlist { --dcols: minmax(260px, 1.6fr) 200px 190px 110px 70px; }
  .domains.is-selecting .dlist { --dcols: 34px minmax(260px, 1.6fr) 200px 190px 110px 70px; }
  .dlist .col-backend { display: none; }
}
@media (max-width: 900px) {
  .dlist { --dcols: minmax(0, 1fr) 170px 100px; }
  .domains.is-selecting .dlist { --dcols: 34px minmax(0, 1fr) 170px 100px; }
  .dlist .col-uptime, .dlist .col-tools { display: none; }
}
@media (max-width: 760px) {
  .hero-value { font-size: 60px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kpi:nth-child(4)::before { display: block; }
  .toolbar-end { width: 100%; margin-left: 0; }
  .toolbar-end .search { flex: 1; width: auto; }
  .dlist { --dcols: minmax(0, 1fr) 84px; }
  .domains.is-selecting .dlist { --dcols: 30px minmax(0, 1fr) 84px; }
  .dlist .col-traffic { display: none; }
  .dhead, .drow { gap: 10px; padding: 0 10px 0 12px; }
}
