/* Nirdmon */

/* ---------- tokens ---------- */

:root {
  color-scheme: light;
  --bg: #f5f4fa;
  --surface: #ffffff;
  --surface-2: #f0eff6;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --ink: #15131f;
  --ink-2: #4b4859;
  --muted: #777389;
  --line: rgba(21, 19, 31, 0.10);
  --line-strong: rgba(21, 19, 31, 0.18);
  --accent: #7b3fbf;          /* the purple in the logo */
  --accent-ink: #ffffff;
  --accent-2: #1f9a3a;        /* the green in the logo */
  --accent-3: #2a78d6;
  --shadow: 0 1px 2px rgba(21, 19, 31, 0.05), 0 8px 24px -12px rgba(46, 26, 86, 0.18);
  --shadow-lift: 0 2px 4px rgba(21, 19, 31, 0.06), 0 22px 44px -18px rgba(76, 35, 140, 0.35);
  --aurora-1: rgba(123, 63, 191, 0.22);
  --aurora-2: rgba(31, 154, 58, 0.16);
  --aurora-3: rgba(42, 120, 214, 0.16);

  /* status: fixed across themes, always paired with an icon and a word */
  --good: #0ca30c;
  --warn: #fab219;
  --crit: #d03b3b;
  --none: #c9c6d6;
  --paused: #9f9bb0;

  /* chart */
  --chart-surface: var(--surface);
  --grid: #e7e5ee;
  --axis: #c3c0cf;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;

  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0a12;
    --surface: #15131e;
    --surface-2: #1d1a29;
    --surface-glass: rgba(24, 21, 35, 0.66);
    --ink: #f5f3ff;
    --ink-2: #c8c4da;
    --muted: #8e89a4;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #a57cf2;
    --accent-ink: #120a22;
    --accent-2: #3fcf6a;
    --accent-3: #3987e5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.5), 0 26px 50px -20px rgba(120, 70, 220, 0.45);
    --aurora-1: rgba(140, 80, 230, 0.30);
    --aurora-2: rgba(40, 190, 90, 0.16);
    --aurora-3: rgba(57, 135, 229, 0.20);
    --none: #3a3649;
    --paused: #5d5870;
    --grid: #262334;
    --axis: #3a3649;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0a12;
  --surface: #15131e;
  --surface-2: #1d1a29;
  --surface-glass: rgba(24, 21, 35, 0.66);
  --ink: #f5f3ff;
  --ink-2: #c8c4da;
  --muted: #8e89a4;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #a57cf2;
  --accent-ink: #120a22;
  --accent-2: #3fcf6a;
  --accent-3: #3987e5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.5), 0 26px 50px -20px rgba(120, 70, 220, 0.45);
  --aurora-1: rgba(140, 80, 230, 0.30);
  --aurora-2: rgba(40, 190, 90, 0.16);
  --aurora-3: rgba(57, 135, 229, 0.20);
  --none: #3a3649;
  --paused: #5d5870;
  --grid: #262334;
  --axis: #3a3649;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem); font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- aurora background ---------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: var(--aurora-1); top: -25vmax; left: -15vmax; }
.aurora span:nth-child(2) { background: var(--aurora-2); top: 10vmax; right: -25vmax; animation-duration: 34s; animation-delay: -8s; }
.aurora span:nth-child(3) { background: var(--aurora-3); bottom: -35vmax; left: 20vmax; animation-duration: 40s; animation-delay: -16s; }

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.12); }
  100% { transform: translate(-4vmax, 8vmax) scale(0.95); }
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(16px, calc((100vw - 1240px) / 2));
  background: var(--surface-glass);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand img { display: block; height: 32px; width: auto; border-radius: 6px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover img { transform: rotate(-2deg) scale(1.04); }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  position: relative;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 550;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 30%; right: 30%; bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-button {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}
.icon-button:hover { color: var(--accent); transform: rotate(25deg); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.avatar::-webkit-details-marker { display: none; }
.avatar-sm { width: 24px; height: 24px; font-size: 0.75rem; vertical-align: middle; margin-right: 6px; cursor: default; }

.menu { position: relative; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  animation: pop 0.18s ease-out;
}
.menu-panel a, .menu-panel button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-who { padding: 6px 10px 10px; color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--line); margin-bottom: 6px; }

@keyframes pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ---------- layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow a { color: inherit; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 460px; }

.footer {
  padding: 24px 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.footer a { color: inherit; }

/* ---------- gradient text ---------- */

.gradient-text {
  background: linear-gradient(100deg, var(--accent-2), var(--accent) 45%, var(--accent-3) 70%, var(--accent-2));
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s linear infinite;
}
.gradient-alert { background-image: linear-gradient(100deg, var(--warn), var(--crit) 45%, #e8508a 70%, var(--warn)); background-size: 250% 100%; }

@keyframes shimmer { to { background-position: -250% 0; } }

/* ---------- cards ---------- */

.card {
  position: relative;
  padding: 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { margin-top: 4px; }
.card-head-pad { padding: 18px 20px 0; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.card-danger { border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); }

.page > :nth-child(2) { animation-delay: 0.04s; }
.page > :nth-child(3) { animation-delay: 0.08s; }
.page > :nth-child(4) { animation-delay: 0.12s; }
.page > :nth-child(5) { animation-delay: 0.16s; }
.page > :nth-child(6) { animation-delay: 0.20s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* spinning conic border */
.card-glow::before, .tile-alert::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), var(--accent-2), var(--accent), var(--accent-3), var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin-angle 6s linear infinite;
}
.tile-alert::before { background: conic-gradient(from var(--angle), var(--warn), var(--crit), #e8508a, var(--warn)); }

@keyframes spin-angle { to { --angle: 360deg; } }

/* ---------- tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.tiles-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; transition: transform 0.25s, box-shadow 0.25s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.tile-value { font-size: 2.4rem; font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; }
.tile-value-sm { font-size: 1.35rem; padding-top: 8px; }
.tile-metric { gap: 10px; }
.tile-metric .pill { align-self: flex-start; }
.tile-detail { color: var(--ink-2); font-size: 0.9rem; overflow-wrap: anywhere; }
.tile-foot { margin-top: auto; }

/* ---------- status pills and orbs ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.pill-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--none);
}
.pill-ok    { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.pill-warn  { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.pill-error { background: color-mix(in srgb, var(--crit) 13%, var(--surface)); border-color: color-mix(in srgb, var(--crit) 35%, transparent); }
.pill-ok .pill-icon    { background: var(--good); }
.pill-warn .pill-icon  { background: var(--warn); color: #1a1300; }
.pill-error .pill-icon { background: var(--crit); }
.pill-none, .pill-off  { color: var(--muted); }
.pill-off .pill-icon   { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }

.orb {
  position: relative;
  display: inline-block;
  flex: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--none);
}
.orb-ok    { background: var(--good); box-shadow: 0 0 10px color-mix(in srgb, var(--good) 70%, transparent); }
.orb-warn  { background: var(--warn); }
.orb-error { background: var(--crit); }
.orb-paused { background: transparent; border: 2px solid var(--paused); }
.orb-warn::after, .orb-error::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.orb-warn::after { animation-duration: 2.6s; }

@keyframes ping {
  75%, 100% { transform: scale(2.8); opacity: 0; }
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  vertical-align: middle;
}

/* ---------- status strips ---------- */

.strip {
  display: flex;
  gap: 2px;
  align-items: stretch;
  height: 24px;
  min-width: 180px;
  animation: reveal 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.strip-bar {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--none);
  transition: transform 0.15s, filter 0.15s;
  transform-origin: bottom;
}
.strip-bar:hover { transform: scaleY(1.25); filter: brightness(1.15); }
.strip-ok { background: var(--good); }
.strip-warn { background: var(--warn); }
.strip-error { background: var(--crit); }

@keyframes reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.strips { display: flex; flex-direction: column; gap: 12px; }
.strip-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; }
.strip-row .strip { height: 30px; }
.strip-label { font-size: 0.8rem; font-weight: 650; color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 0.8rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .strip-bar { display: inline-block; flex: none; width: 10px; height: 14px; }
.legend .strip-bar:hover { transform: none; }

/* ---------- tables ---------- */

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .details { color: var(--ink-2); max-width: 420px; overflow-wrap: anywhere; }
.col-strip { width: 28%; min-width: 200px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.is-paused td { opacity: 0.55; }
.is-paused td:first-child { opacity: 1; }
.filter-empty { padding: 20px; text-align: center; }

.domain-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 620;
}
.domain-link:hover { color: var(--accent); text-decoration: none; }
.domain-link:hover span { text-decoration: underline; text-underline-offset: 3px; }

.domain-title { display: flex; align-items: center; gap: 14px; overflow-wrap: anywhere; }
.domain-title .orb { width: 14px; height: 14px; }
.visit { font-size: 1.1rem; color: var(--muted); transition: transform 0.2s, color 0.2s; }
.visit:hover { color: var(--accent); transform: translate(2px, -2px); text-decoration: none; }

/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--ink-2); }
input:not([type="checkbox"]), textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { font-family: var(--mono); font-size: 0.85rem; resize: vertical; }
input:not([type="checkbox"]):focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.inline-checks .button { margin-left: auto; }

.search { flex: 1 1 240px; max-width: 360px; }
.search input { padding-left: 34px; background: var(--surface) no-repeat 11px 50% / 15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777389' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }

.switch { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--none);
  transition: background 0.25s;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.switch input:checked + span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- buttons ---------- */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(0.98); }
.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #5b2fa3 55%, var(--accent-3) 130%);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.button-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s;
}
.button-primary:hover::after { transform: translateX(120%); }
.button-primary:hover { box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.button-ghost { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
.button-ghost:hover { border-color: var(--accent); color: var(--accent); }
.button-danger { color: #fff; background: var(--crit); }
.button-danger:hover { box-shadow: 0 8px 20px -10px var(--crit); }
.button-sm { padding: 5px 12px; font-size: 0.82rem; }
.button-lg { padding: 13px 24px; font-size: 1.05rem; }
.button-block { width: 100%; }
.button[disabled] { opacity: 0.7; cursor: progress; }
.spin { display: inline-block; }
.is-busy .spin { animation: rotate 0.8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-glass);
}
.segmented a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
}
.segmented a:hover { color: var(--ink); text-decoration: none; }
.segmented a[aria-current] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }

/* ---------- drawer ---------- */

.drawer summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 700;
  transition: transform 0.3s;
}
.drawer[open] summary::before { transform: rotate(45deg); }
.drawer[open] summary { margin-bottom: 16px; }
.drawer.flash { animation: flash-ring 1.2s ease-out; }
@keyframes flash-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 18px transparent; }
}

/* ---------- banners and toasts ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}
.banner .pill-icon { width: 22px; height: 22px; }
.banner-error { border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.banner-error .pill-icon { background: var(--crit); }
.banner-info .pill-icon { background: var(--paused); }

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  animation: toast-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast p { flex: 1; font-size: 0.9rem; }
.toast.is-leaving { animation: toast-out 0.3s ease-in forwards; }
.toast-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
}
.toast-success .toast-icon { background: var(--good); }
.toast-error .toast-icon { background: var(--crit); }
.toast-close { border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---------- landing and login ---------- */

.landing .page { justify-content: center; }
.hero { width: 100%; max-width: 880px; margin: 5vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero .eyebrow { justify-content: center; }
.hero-title { font-size: clamp(2.3rem, 1.4rem + 4.5vw, 4.4rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; }
.hero-lede { max-width: 620px; color: var(--ink-2); font-size: 1.1rem; }
.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px;
  width: 100%;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.hero-features li { display: flex; flex-direction: column; gap: 4px; }
.hero-features li span:last-child { color: var(--muted); font-size: 0.88rem; }
.feature-icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent-2) 22%, transparent));
  font-size: 1.1rem;
}
.card-float { animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both, bob 6s ease-in-out infinite 0.6s; }
.hero-features li:nth-child(2) { animation-delay: 0.08s, 1.4s; }
.hero-features li:nth-child(3) { animation-delay: 0.16s, 2.2s; }
.hero-features li:nth-child(4) { animation-delay: 0.24s, 3s; }
@keyframes bob { 50% { transform: translateY(-6px); } }

.auth-card { width: 100%; max-width: 400px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 16px; }

.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 20px; }
.error-code { font-size: 5rem; font-weight: 850; line-height: 1; }
.empty-inline { padding: 28px 20px; text-align: center; color: var(--muted); }
.confetti { display: inline-block; color: var(--accent); animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: rotate(180deg) scale(1.3); opacity: 0.6; } }

/* ---------- renewals timeline ---------- */

.timeline { padding: 16px; }
.timeline-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.timeline-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--good);
  scroll-snap-align: start;
  transition: transform 0.2s;
}
.timeline-item:hover { transform: translateY(-3px); }
.timeline-item a { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.timeline-warn { border-top-color: var(--warn); }
.timeline-error { border-top-color: var(--crit); }
.timeline-days { font-size: 1.3rem; font-weight: 750; letter-spacing: -0.02em; }

/* ---------- latency chart ---------- */

.chart { position: relative; margin: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 10px; font-size: 0.85rem; color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.chart-plot { position: relative; height: 280px; }
.chart-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-empty { display: grid; place-items: center; height: 100%; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { stroke: none; opacity: 0.1; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.chart .end-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .hover-dot { stroke: var(--chart-surface); stroke-width: 2; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.tip {
  position: fixed;
  z-index: 40;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
.tip.is-on { opacity: 1; transform: none; }
.tip-title { margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.tip-row { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tip-row b { margin-left: auto; font-weight: 650; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px 14px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .page-head { align-items: flex-start; }
  .tile-value { font-size: 2rem; }
  .inline-checks .button { margin-left: 0; }
}

/* ---------- motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora { display: none; }
}

@media (forced-colors: active) {
  .strip-bar, .orb { forced-color-adjust: none; }
}

@media print {
  .aurora, .topbar, .toasts, .drawer, form { display: none !important; }
  .card { box-shadow: none; backdrop-filter: none; }
}
