/* Cursorly Admin — dark precision console wearing the website's design system
   ("Cold Open"): ink #0a0d13, ivory hairlines, Cabinet Grotesk display type,
   one azure accent, branded cursor, film grain. Semantic good/warn/danger stay
   (the console needs states the marketing site doesn't). Still isolated: all
   assets self-hosted under the strict beacon-free CSP. */

@font-face {
  font-family: "Cabinet Grotesk";
  src: url(/assets/fonts/cabinet-grotesk-variable.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0d13;
  --bg-2: #0c0f15;
  --surface: #14181f;
  --surface-2: #0f131a;
  --surface-3: #1a1f29;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(243, 240, 234, 0.10);
  --ivory: #f3f0ea;
  --text: #e8eaef;
  --muted: #aab2bd;
  --faint: #8b929d;
  --azure: #4f8cff;
  --azure-ink: #2f6bff;
  --accent-weak: rgba(79, 140, 255, 0.14);
  --accent-ring: rgba(79, 140, 255, 0.42);
  --good: #46d39a;
  --warn: #f0b252;
  --danger: #ff5d6c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 14px 36px -16px rgba(17, 22, 34, 0.20);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system,
    BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Cabinet Grotesk", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "SF Mono", "Consolas", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must beat component display rules (.modal/.login set
   `display`, which would otherwise override the UA `[hidden]{display:none}` and
   leave the modal permanently visible with no action bound to it). */
[hidden] {
  display: none !important;
}

/* Explicit root background: the rubber-band overscroll area paints the root's
   background, and without this it flashes the UA's white canvas. (Safe here,
   unlike the marketing site: admin has no negative-z-index layers.) */
html {
  background: var(--bg);
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Body paints NO background: the live engine sits in the fixed z-index:-1
   .backdrop, and an opaque body paint would render above and bury it (the
   canvas background comes from html). */
body {
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The Cursorly pointer IS the page cursor, same as the marketing site. */
body {
  cursor: url(/assets/cursor.png) 7 4, url(/assets/cursor.svg) 7 4, auto;
}

a,
button,
[role="button"],
label,
summary {
  cursor: url(/assets/cursor.png) 7 4, url(/assets/cursor.svg) 7 4, pointer;
}

input,
textarea {
  cursor: text;
}

/* The live engine backdrop: glow gradients under the world canvas under a
   constant scrim — the site's backdrop stack, ambient edition. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(47, 107, 255, 0.13), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(127, 208, 255, 0.05), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  isolation: isolate;
}

.backdrop canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}

.backdrop canvas.is-on {
  opacity: 1;
}

.backdrop-scrim {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.66;
}

@media (prefers-reduced-motion: reduce) {
  .backdrop canvas {
    display: none !important;
  }
}

#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
  background: url(/assets/noise.png);
  background-size: 64px 64px;
  mix-blend-mode: overlay;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mono {
  font-family: var(--mono);
  font-size: 0.85em;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

h2,
h3 {
  font-family: var(--font-head);
  font-weight: 640;
  letter-spacing: -0.022em;
  line-height: 1.05;
  margin: 0;
}

/* ---- brand ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand b {
  color: var(--azure);
  font-weight: 600;
}

.brand .reticle {
  flex: none;
}

.brand-lg {
  font-size: 22px;
  margin-bottom: 18px;
}

/* ---- buttons ---- */
.btn {
  font: inherit;
  font-weight: 550;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
  transition: background var(--ease) 0.18s, border-color var(--ease) 0.18s, transform 0.12s var(--ease);
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 16px;
  width: 100%;
}

.btn-primary {
  background: var(--azure-ink);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 32px -8px rgba(47, 107, 255, 0.55);
}

.btn-primary:hover {
  background: var(--azure);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(243, 240, 234, 0.14);
}

.btn-warn {
  background: color-mix(in oklab, var(--warn) 16%, var(--surface-2));
  border-color: color-mix(in oklab, var(--warn) 34%, var(--line));
  color: #ffe6bd;
}

/* ---- login ---- */
.login {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 92vw);
  background: linear-gradient(180deg, rgba(20, 24, 31, 0.8), rgba(15, 19, 26, 0.86));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
}

.login-card .muted {
  margin: 0 0 22px;
}

.deny-title {
  font-family: var(--font-head);
  font-weight: 650;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 14px 0 8px;
  color: var(--danger);
}

.fineprint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 16px 0 0;
  line-height: 1.45;
}

/* ---- topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- view nav: the website's floating pill, repurposed as the console's
   section switcher ---- */
.viewnav {
  position: sticky;
  top: 64px;
  z-index: 4;
  display: flex;
  justify-content: center;
  padding: 14px 16px 2px;
  pointer-events: none;
}

.viewnav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(12, 15, 21, 0.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  max-width: 100%;
  overflow-x: auto;
}

.viewnav-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.viewnav-btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.viewnav-btn.is-active {
  color: #fff;
  background: var(--azure-ink);
  box-shadow: 0 6px 22px -8px rgba(47, 107, 255, 0.6);
}

.viewnav-btn:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}

.who {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-demo {
  background: color-mix(in oklab, var(--warn) 18%, transparent);
  color: var(--warn);
  border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent);
}

.badge-live {
  background: color-mix(in oklab, var(--good) 16%, transparent);
  color: var(--good);
  border: 1px solid color-mix(in oklab, var(--good) 40%, transparent);
}

/* ---- layout ---- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 26px 26px 80px;
}

/* One view on screen at a time (hash-routed); each opens with the site's
   editorial voice: a big Cabinet Grotesk title over a hairline rule. */
.view {
  animation: view-in 0.32s var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.view-title {
  font-family: var(--font-head);
  font-weight: 640;
  font-size: clamp(30px, 4.2vw, 46px);
  letter-spacing: -0.022em;
  line-height: 1.02;
  color: var(--ivory);
  margin: 0;
}

.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
}

.subhead h2 {
  font-size: 16px;
  color: var(--ivory);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pager-meta {
  font-family: var(--mono);
  font-size: 12px;
}

.pager .btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.panel {
  background: linear-gradient(180deg, rgba(20, 24, 31, 0.82), rgba(15, 19, 26, 0.88));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-soft);
}

/* ---- bento metrics ---- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(20, 24, 31, 0.88), rgba(15, 19, 26, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  transition: border-color var(--ease) 0.2s, transform var(--ease) 0.2s;
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.card-big {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card-azure {
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(47, 107, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: color-mix(in oklab, var(--azure) 28%, var(--line));
}

.card-label {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.card-value {
  font-family: var(--font-head);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-size: 28px;
}

.card-big .card-value {
  font-size: 52px;
  line-height: 1;
}

.card-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 8px;
}

/* ---- model mix bars ---- */
.bar-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.bar-row:last-child {
  border-bottom: 0;
}

.bar-label {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--azure-ink), var(--azure));
  transition: width 0.6s var(--ease);
}

.bar-meta {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---- user console ---- */
.lookup {
  display: flex;
  gap: 10px;
}

.lookup input {
  flex: 1;
}

input,
select,
textarea {
  font: inherit;
  width: 100%;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

textarea {
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}

.results {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-row {
  display: grid;
  grid-template-columns: 1.3fr 1.9fr 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: border-color var(--ease) 0.16s, background var(--ease) 0.16s;
}

.result-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.result-row:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}

.rr-name {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-email {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-uid {
  color: var(--muted);
}

.rr-bal {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.user-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.ur-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 22px;
}

.ur-grid>div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ur-k {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.ur-v {
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-transform: capitalize;
}

.pill-free {
  color: var(--muted);
}

.pill-paid {
  color: var(--azure);
  border-color: color-mix(in oklab, var(--azure) 40%, transparent);
}

.pill-staff {
  color: var(--good);
  border-color: color-mix(in oklab, var(--good) 40%, transparent);
}

.pill-good {
  color: var(--good);
  border-color: color-mix(in oklab, var(--good) 40%, transparent);
}

.pill-danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.act {
  font-size: 13px;
  padding: 7px 13px;
}

.act-good:hover {
  border-color: color-mix(in oklab, var(--good) 50%, transparent);
  color: var(--good);
}

.act-warn:hover {
  border-color: color-mix(in oklab, var(--warn) 50%, transparent);
  color: var(--warn);
}

.act-danger:hover {
  border-color: color-mix(in oklab, var(--danger) 50%, transparent);
  color: var(--danger);
}

.act-azure:hover {
  border-color: color-mix(in oklab, var(--azure) 50%, transparent);
  color: var(--azure);
}

/* ---- bulk ---- */
.bulk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 12.5px;
}

.field .hint {
  color: var(--muted);
  font-size: 11.5px;
}

/* ---- modal ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 11, 0.6);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(440px, 94vw);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.95);
  animation: pop 0.18s var(--ease);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h3 {
  font-size: 16px;
}

.modal-head h3.tone-danger {
  color: var(--danger);
}

.modal-head h3.tone-warn {
  color: var(--warn);
}

.modal-head h3.tone-good {
  color: var(--good);
}

.modal-head h3.tone-azure {
  color: var(--azure);
}

.iconbtn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.iconbtn:hover {
  color: var(--text);
  background: var(--surface-3);
}

#actionForm {
  padding: 18px 20px 20px;
}

.authblock {
  margin-top: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(47, 107, 255, 0.04);
}

.authblock-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azure);
}

.authblock .field:last-child {
  margin-bottom: 0;
}

.sensitive-note {
  color: var(--warn);
  font-size: 12.5px;
  margin: 2px 0 12px;
}

.bulk-summary {
  margin-bottom: 14px;
  font-size: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* ---- toasts ---- */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 13.5px;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast-good {
  border-left-color: var(--good);
}

.toast-warn {
  border-left-color: var(--warn);
}

.toast-danger {
  border-left-color: var(--danger);
}

.toast-neutral {
  border-left-color: var(--azure);
}

.foot {
  margin-top: 8px;
  text-align: center;
}

/* ---- live status dot (topbar + health rail) ---- */
.dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: none;
  background: var(--muted);
  color: var(--muted);
}

.dot-good {
  background: var(--good);
  color: var(--good);
}

.dot-warn {
  background: var(--warn);
  color: var(--warn);
}

.dot-danger {
  background: var(--danger);
  color: var(--danger);
}

.dot-live::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 currentColor;
  animation: dotpulse 2.4s var(--ease) infinite;
}

@keyframes dotpulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 9px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---- topbar live micro-readout ---- */
.live-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line-soft);
}

/* ---- system health panel ---- */
.health {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 2.2fr;
  gap: 26px;
  padding: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 60px -40px rgba(47, 107, 255, 0.35);
  transition: border-color var(--ease) 0.25s;
}

.health[data-state="degraded"] {
  border-color: color-mix(in oklab, var(--warn) 30%, var(--line));
}

.health[data-state="down"] {
  border-color: color-mix(in oklab, var(--danger) 34%, var(--line));
}

.health-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

.health-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: 650;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.health-verdict.tone-warn {
  color: var(--warn);
}

.health-verdict.tone-danger {
  color: var(--danger);
}

.health-sub {
  color: var(--muted);
  font-size: 12.5px;
}

.health-badge {
  margin-top: 6px;
  align-self: flex-start;
}

.health-grid {
  display: grid;
  gap: 14px;
}

.health-grid-solo {
  grid-template-columns: minmax(0, 360px);
}

.htile {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--ease) 0.2s, transform var(--ease) 0.2s;
}

.htile:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.htile-label {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.htile-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.htile-val {
  font-family: var(--font-head);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-size: 30px;
  line-height: 1;
}

.htile-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.kill-wrap {
  margin-top: 8px;
}

/* ---- meters / gauges ---- */
.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 10px;
}

.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--azure-ink), var(--azure));
  transition: width 0.5s var(--ease), background 0.3s var(--ease);
}

.meter-fill.tone-warn {
  background: linear-gradient(90deg, #c98a2e, var(--warn));
}

.meter-fill.tone-danger {
  background: linear-gradient(90deg, #c23d49, var(--danger));
}

/* ---- value-change flash ---- */
.flash {
  animation: flashpop 0.18s var(--ease);
}

@keyframes flashpop {
  0% {
    transform: translateY(-2px);
    opacity: 0.55;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

/* ---- card inner top-highlight ---- */
.card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ---- search: focus ring, result stagger, highlight ---- */
.lookup {
  position: relative;
}

.lookup:focus-within {
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.14);
  border-radius: var(--radius-sm);
}

.result-row {
  --i: 0;
  animation: rowin 0.26s var(--ease) backwards;
  animation-delay: calc(var(--i) * 18ms);
}

@keyframes rowin {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.result-row.is-active,
.result-row[aria-selected="true"] {
  border-color: var(--azure);
  background: var(--surface-3);
}

.result-row:active {
  transform: scale(0.985);
}

mark.hl {
  background: transparent;
  color: var(--azure);
  font-weight: 650;
}

.search-hint,
.search-rest {
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.empty-pad {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius-sm);
}

.head-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.sync-line {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---- integrations sync board ---- */
.panel.conns {
  padding: 4px 0;
}

.conn-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--ease) 0.2s;
}

.conn-row:last-child {
  border-bottom: 0;
}

.conn-row:hover {
  background: var(--surface-2);
}

.conn-name {
  font-weight: 550;
}

.conn-detail {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.conn-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.conn-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--good);
}

.conn-status.conn-warn {
  color: var(--warn);
}

.conn-status.conn-bad {
  color: var(--danger);
}

.conn-lat,
.conn-sync {
  font-size: 11.5px;
}

/* ---- analytics: trend chart + summary strip + top users ---- */
.trend-chart-wrap {
  margin-bottom: 20px;
}

.trend-chart {
  width: 100%;
  height: 168px;
  display: block;
}

.tc-bar {
  fill: color-mix(in oklab, var(--azure) 20%, transparent);
}

.tc-area {
  fill: rgba(47, 107, 255, 0.1);
}

.tc-line {
  fill: none;
  stroke: var(--azure);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.trend-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
}

.lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.lg::before {
  content: "";
  width: 13px;
  height: 3px;
  border-radius: 2px;
  background: var(--azure);
}

.lg-bar::before {
  width: 6px;
  height: 11px;
  background: color-mix(in oklab, var(--azure) 30%, var(--surface-3));
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.card-value.sm {
  font-size: 20px;
}

.pos {
  color: var(--good);
}

.neg {
  color: var(--danger);
}

.cpu-row {
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  width: 100%;
  text-align: left;
  color: var(--text);
  background: none;
  cursor: pointer;
  font: inherit;
  transition: background var(--ease) 0.16s;
}

.cpu-row:hover {
  background: var(--surface-2);
}

.cpu-row:active {
  transform: scale(0.99);
}

.cpu-row:focus-visible {
  outline: 2px solid var(--azure);
  outline-offset: 2px;
}

.stuck-list {
  margin-top: 20px;
}

.stuck-head {
  margin-bottom: 10px;
}

.bar-fill-warn {
  background: linear-gradient(90deg, #c98a2e, var(--warn));
}

@media (max-width: 880px) {
  .health {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .health-grid {
    grid-template-columns: 1fr;
  }

  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .conn-lat {
    display: none;
  }

  .card-big {
    grid-column: span 2;
    grid-row: auto;
  }

  .ur-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bar-row {
    grid-template-columns: 130px 1fr;
  }

  .bar-meta {
    grid-column: 1 / -1;
    text-align: right;
  }

  .bulk-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- growth: waitlist / feedback lists ---- */
.growth-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.glist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}

.glist-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}

.glist-item .glist-row {
  padding: 0;
  border-bottom: none;
}

.gl-main {
  flex: 1;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.gl-date {
  white-space: nowrap;
}

.gl-msg {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .growth-cols {
    grid-template-columns: 1fr;
  }
}

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