/* ============================================================
   Lanueva Monitor — aurora bloom theme
   ============================================================ */

:root {
  --bg: #05070f;
  --ink: #eef2ff;
  --ink-soft: #c3cde6;
  --muted: #8b97b8;
  --muted-2: #6b7694;

  --mint: #3ee6b0;
  --sky: #5b8cff;
  --violet: #a78bfa;
  --amber: #ffce6b;
  --rose: #ff7a90;

  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --glass: linear-gradient(165deg, rgba(255, 255, 255, 0.078), rgba(255, 255, 255, 0.022) 55%, rgba(255, 255, 255, 0.012));

  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;

  --shadow: 0 30px 70px -38px rgba(2, 6, 20, 0.95), 0 2px 8px -4px rgba(2, 6, 20, 0.6);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.44, 1);

  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -20%, #0d1730 0%, transparent 55%),
    radial-gradient(80% 60% at 100% 0%, #101a2e 0%, transparent 50%),
    linear-gradient(180deg, #060910 0%, #05070f 45%, #04060c 100%);
  z-index: -5;
}

/* ---------------------------------------------------- ambient layers -- */

.aurora {
  position: fixed;
  inset: -25vmax;
  z-index: -4;
  filter: blur(90px) saturate(135%);
  opacity: 0.62;
  pointer-events: none;
  transform: translateZ(0);
}

.aurora i {
  position: absolute;
  display: block;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}

.aurora .b1 {
  top: 2%; left: 4%;
  background: radial-gradient(circle at 35% 35%, rgba(91, 140, 255, 0.85), rgba(91, 140, 255, 0) 68%);
  animation: drift-a 34s var(--ease) infinite alternate;
}
.aurora .b2 {
  top: 18%; right: 2%;
  background: radial-gradient(circle at 45% 40%, rgba(62, 230, 176, 0.72), rgba(62, 230, 176, 0) 66%);
  animation: drift-b 44s var(--ease) infinite alternate;
}
.aurora .b3 {
  bottom: -6%; left: 18%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 206, 107, 0.55), rgba(255, 206, 107, 0) 64%);
  animation: drift-c 52s var(--ease) infinite alternate;
}
.aurora .b4 {
  bottom: 4%; right: 8%;
  background: radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.6), rgba(167, 139, 250, 0) 66%);
  animation: drift-d 40s var(--ease) infinite alternate;
}
.aurora .b5 {
  top: 40%; left: 38%;
  width: 34vmax; height: 34vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 122, 144, 0.34), rgba(255, 122, 144, 0) 68%);
  animation: drift-e 60s var(--ease) infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(-4%, -3%, 0) scale(1); }
  to   { transform: translate3d(6%, 5%, 0) scale(1.14); }
}
@keyframes drift-b {
  from { transform: translate3d(3%, -4%, 0) scale(1.06); }
  to   { transform: translate3d(-6%, 6%, 0) scale(0.94); }
}
@keyframes drift-c {
  from { transform: translate3d(-3%, 2%, 0) scale(0.98); }
  to   { transform: translate3d(5%, -5%, 0) scale(1.12); }
}
@keyframes drift-d {
  from { transform: translate3d(2%, 4%, 0) scale(1.1); }
  to   { transform: translate3d(-5%, -4%, 0) scale(0.96); }
}
@keyframes drift-e {
  from { transform: translate3d(0, 0, 0) scale(0.9) rotate(0deg); }
  to   { transform: translate3d(-4%, 3%, 0) scale(1.2) rotate(18deg); }
}

/* slow flower-like conic sheen */
.petal {
  position: fixed;
  top: 50%; left: 50%;
  width: 130vmax; height: 130vmax;
  margin: -65vmax 0 0 -65vmax;
  z-index: -4;
  background: conic-gradient(from 0deg,
    rgba(91, 140, 255, 0.10),
    rgba(62, 230, 176, 0.10),
    rgba(255, 206, 107, 0.09),
    rgba(255, 122, 144, 0.07),
    rgba(167, 139, 250, 0.10),
    rgba(91, 140, 255, 0.10));
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  animation: spin 180s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 10%, transparent 72%);
  opacity: 0.7;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

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

main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 26px) clamp(14px, 4vw, 40px) 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 14px clamp(14px, 4vw, 40px);
  backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(180deg, rgba(5, 7, 15, 0.78), rgba(5, 7, 15, 0.28) 70%, transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 13px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 24px -14px rgba(91, 140, 255, 0.8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 13px; letter-spacing: 0.22em; font-weight: 620; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.16em; }

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

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-soft);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.2s var(--ease), color 0.3s;
  backdrop-filter: blur(12px);
}
.chip:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.chip:active { transform: scale(0.97); }
.chip.icon { padding: 0; width: 34px; justify-content: center; }
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(62, 230, 176, 0.55);
  animation: ring 2.4s ease-out infinite;
}
.chip.toggle[aria-pressed="false"] { color: var(--muted); }
.chip.toggle[aria-pressed="false"] .dot { background: var(--muted-2); animation: none; box-shadow: none; }

@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(62, 230, 176, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(62, 230, 176, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 230, 176, 0); }
}

.spinning svg { animation: spin 0.9s linear infinite; }

/* -------------------------------------------------------------- hero -- */

.hero { padding: clamp(18px, 5vw, 44px) 0 8px; }

.hero-head { position: relative; margin-bottom: clamp(20px, 4vw, 34px); }

h1 {
  margin: 0 0 6px;
  font-size: clamp(38px, 9vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 640;
}

.grad {
  background: linear-gradient(100deg, #8ff3d4 0%, #7fb0ff 26%, #c9b6ff 46%, #ffd98a 68%, #7ff0c8 88%, #8ff3d4 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue 16s linear infinite;
}
@keyframes hue {
  0% { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 2.6vw, 15px);
  letter-spacing: 0.02em;
}

.verdict {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 16px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12.5px;
  color: var(--ink-soft);
  backdrop-filter: blur(14px);
  transition: border-color 0.4s, background 0.4s;
}
.verdict[data-state="ok"] { border-color: rgba(62, 230, 176, 0.28); background: rgba(62, 230, 176, 0.08); }
.verdict[data-state="warn"] { border-color: rgba(255, 206, 107, 0.32); background: rgba(255, 206, 107, 0.09); }
.verdict[data-state="bad"] { border-color: rgba(255, 122, 144, 0.34); background: rgba(255, 122, 144, 0.1); }

.verdict .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted-2);
  position: relative;
}
.verdict[data-state="ok"] .pulse { background: var(--mint); }
.verdict[data-state="ok"] .pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(62, 230, 176, 0.7);
  animation: pulse 2.2s ease-out infinite;
}
.verdict[data-state="warn"] .pulse { background: var(--amber); }
.verdict[data-state="bad"] .pulse { background: var(--rose); }
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* -------------------------------------------------------------- card -- */

.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* heavy blur only on a handful of surfaces */
.topbar,
.sheet-panel,
.tabs,
.tip,
.toast,
.verdict,
.chip,
.search,
.seg { backdrop-filter: blur(18px) saturate(150%); }

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(143, 243, 212, 0.55), rgba(127, 176, 255, 0.28) 35%, rgba(255, 217, 138, 0.16) 60%, transparent 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.55s var(--ease);
  pointer-events: none;
}
.card:hover::after { opacity: 1; }

/* -------------------------------------------------------------- kpis -- */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: clamp(10px, 1.6vw, 16px);
}

.kpi {
  padding: 18px 18px 16px;
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.5s var(--ease), border-color 0.4s;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--line-strong); }

.kpi::before {
  content: "";
  position: absolute;
  top: -40%; left: -20%;
  width: 70%; height: 120%;
  background: radial-gradient(circle, rgba(127, 176, 255, 0.22), transparent 70%);
  pointer-events: none;
}
.kpi:nth-child(2)::before { background: radial-gradient(circle, rgba(62, 230, 176, 0.2), transparent 70%); }
.kpi:nth-child(3)::before { background: radial-gradient(circle, rgba(255, 206, 107, 0.18), transparent 70%); }
.kpi:nth-child(4)::before { background: radial-gradient(circle, rgba(167, 139, 250, 0.2), transparent 70%); }

.kpi-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi-value {
  margin-top: 8px;
  font-size: clamp(26px, 5.4vw, 34px);
  font-weight: 620;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  background: linear-gradient(160deg, #ffffff, #c8d5f4 60%, #9fb2d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi-sub { margin-top: 5px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.kpi-ring {
  position: absolute;
  right: 14px; top: 14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--p, 0) * 1%), rgba(255, 255, 255, 0.07) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  opacity: 0.9;
  transition: background 1s var(--ease);
}

/* ------------------------------------------------------------ window -- */

.winbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: clamp(18px, 3vw, 26px) 0 14px;
  flex-wrap: wrap;
}
.meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.tabs {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}
.tab {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.35s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-soft); }
.tab.active { color: #06121a; font-weight: 600; }

.tab-glider {
  position: absolute;
  top: 4px; left: 4px;
  height: calc(100% - 8px);
  width: 80px;
  border-radius: 999px;
  background: linear-gradient(120deg, #9df5d8, #8fc0ff 55%, #ffe1a1);
  box-shadow: 0 6px 20px -8px rgba(143, 192, 255, 0.9);
  transition: transform 0.5s var(--spring), width 0.5s var(--spring);
}

/* ------------------------------------------------------------- panel -- */

.panel {
  padding: clamp(16px, 3vw, 24px);
  background: linear-gradient(165deg, rgba(20, 26, 44, 0.62), rgba(9, 12, 22, 0.5));
  backdrop-filter: blur(22px) saturate(150%);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.panel-head h2, .groups-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 580;
  letter-spacing: -0.01em;
}
.panel-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.count {
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: 2px;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.seg-btn {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; padding: 6px 12px; border-radius: 9px;
  cursor: pointer; transition: color 0.3s, background 0.3s;
}
.seg-btn:hover { color: var(--ink-soft); }
.seg-btn.active { color: var(--ink); background: linear-gradient(150deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }

.chart-wrap {
  position: relative;
  margin-top: 8px;
  border-radius: var(--r-md);
  overflow: hidden;
}
#chart { display: block; width: 100%; height: clamp(210px, 34vw, 320px); }
#sheetChart { display: block; width: 100%; height: clamp(170px, 26vw, 240px); }
.chart-wrap.small { margin-top: 4px; }

.chart-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted-2); font-size: 12.5px;
  background: rgba(5, 7, 15, 0.35);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.chart-empty.show { opacity: 1; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; padding-left: 2px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* tooltip */
.tip {
  position: absolute;
  z-index: 5;
  min-width: 118px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 12, 24, 0.94);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(14px);
  font-size: 11.5px;
  color: var(--ink-soft);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -112%) scale(0.97);
  transition: opacity 0.16s ease, transform 0.16s var(--ease);
  white-space: nowrap;
}
.tip.show { opacity: 1; transform: translate(-50%, -112%) scale(1); }
.tip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tip .row { display: flex; align-items: center; justify-content: space-between; gap: 14px; line-height: 1.7; }
.tip .k { color: var(--muted); }
.tip .hd { font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }

/* ------------------------------------------------------------ groups -- */

.groups { margin-top: clamp(26px, 5vw, 44px); }
.groups-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 14px;
}
.filters { display: flex; gap: 8px; }

.search {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: border-color 0.3s, background 0.3s;
}
.search:focus-within { border-color: rgba(143, 192, 255, 0.4); background: rgba(255, 255, 255, 0.06); }
.search input {
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; width: 190px;
}
.search input::placeholder { color: var(--muted-2); }

.platbar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.pchip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit; font-size: 11.5px;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.pchip:hover { color: var(--ink-soft); border-color: var(--line-strong); }
.pchip.active { color: var(--ink); background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }
.pchip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 302px), 1fr));
  gap: clamp(10px, 1.6vw, 16px);
}

.g-card {
  content-visibility: auto;
  contain-intrinsic-size: 186px;
  padding: 16px 16px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 13px;
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.5s;
  animation: rise 0.65s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 26ms);
  overflow: hidden;
  background: linear-gradient(165deg, rgba(24, 30, 50, 0.72), rgba(10, 13, 24, 0.62));
}
.g-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 0% 0%, var(--tint, rgba(127, 176, 255, 0.16)), transparent 62%);
  opacity: 0.85;
  pointer-events: none;
}
.g-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 34px 60px -34px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.g-card:focus-visible { outline: 2px solid rgba(143, 192, 255, 0.7); outline-offset: 3px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.g-top { display: flex; align-items: flex-start; gap: 10px; }
.g-name {
  flex: 1; min-width: 0;
  font-size: 14.5px; font-weight: 560; letter-spacing: -0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g-plat {
  font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 999px; margin-top: 2px; white-space: nowrap;
}
.pdot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px; flex: 0 0 auto;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}
.pdot.ok { background: var(--mint); box-shadow: 0 0 0 3px rgba(62, 230, 176, 0.12), 0 0 12px rgba(62, 230, 176, 0.6); }
.pdot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 206, 107, 0.12); }
.pdot.bad { background: var(--rose); box-shadow: 0 0 0 3px rgba(255, 122, 144, 0.14), 0 0 12px rgba(255, 122, 144, 0.55); }
.pdot.idle { background: #4b556e; box-shadow: none; }

.g-metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; }
.g-metric .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.g-metric .v { font-size: 16px; font-weight: 560; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; }
.g-metric .v.dim { color: var(--muted-2); font-weight: 450; }
.g-metric .v small { font-size: 10px; color: var(--muted); margin-left: 1px; font-weight: 400; }

.uptime { display: flex; gap: 3px; align-items: flex-end; height: 26px; }
.uptime .u {
  flex: 1; min-width: 0; height: 100%;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  transition: transform 0.3s var(--ease), filter 0.3s;
  position: relative;
}
.uptime .u.ok { background: linear-gradient(180deg, #5cf0c0, #23b98c); }
.uptime .u.good { background: linear-gradient(180deg, #56d7a8, #2f9e79); }
.uptime .u.warn { background: linear-gradient(180deg, #ffd98a, #d99f3c); }
.uptime .u.bad { background: linear-gradient(180deg, #ff9aae, #d4566c); }
.uptime .u.none { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 4px, rgba(255, 255, 255, 0.025) 4px 8px); }
.uptime .u:hover { transform: scaleY(1.16); filter: brightness(1.25); }
.uptime.big { height: 40px; gap: 4px; }
.uptime.big .u { border-radius: 5px; }

.g-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.g-foot .warn { color: var(--amber); }
.g-foot .bad { color: var(--rose); }

.empty { text-align: center; color: var(--muted-2); font-size: 13px; padding: 40px 0; }

/* skeleton */
.skeleton-card { height: 176px; overflow: hidden; }
.skeleton-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.08) 42%, transparent 64%);
  animation: sweep 1.6s linear infinite;
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ------------------------------------------------------------- sheet -- */

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 5, 12, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  animation: fade 0.35s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(600px, 100%);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  padding: 20px 22px 30px;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slide-in 0.5s var(--spring);
  background: linear-gradient(165deg, rgba(18, 24, 40, 0.92), rgba(8, 11, 20, 0.96));
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sheet-head h2 { margin: 4px 0 0; font-size: 22px; font-weight: 580; letter-spacing: -0.02em; }

.sheet-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 14px; }
.sk {
  padding: 11px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.sk .k { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.sk .v { font-size: 18px; font-weight: 560; font-variant-numeric: tabular-nums; margin-top: 2px; }

.tabs.small { margin-bottom: 6px; }
.tabs.small .tab { padding: 5px 11px; font-size: 11.5px; }
.tabs.small .tab-glider { width: 62px; }

.block-title {
  margin: 22px 0 9px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}

.errlist, .modellist { display: flex; flex-direction: column; gap: 7px; }
.errrow { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.errrow .name { width: 150px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.errrow .bar { flex: 1; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.errrow .bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 206, 107, 0.85), rgba(255, 122, 144, 0.9));
  transform-origin: left; animation: grow 0.7s var(--ease) both;
}
.errrow .n { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.errrow .tag { font-size: 9.5px; color: var(--muted-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.modellist .mrow { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.modellist .mrow span:first-child { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modellist .mrow span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* -------------------------------------------------------------- misc -- */

.toast {
  position: fixed;
  left: 50%; bottom: 26px;
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 14, 26, 0.94);
  backdrop-filter: blur(14px);
  font-size: 12.5px; color: var(--ink-soft);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--spring);
  z-index: 90;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 48px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px; color: var(--muted-2);
}

.reveal { animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }

/* --------------------------------------------------------- responsive -- */

@media (max-width: 720px) {
  .aurora { filter: blur(52px); opacity: 0.55; }
  .petal { opacity: 0.35; filter: blur(40px); }
  .grid { display: none; }

  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 14px 14px 12px; }
  .kpi-ring { width: 30px; height: 30px; right: 11px; top: 11px; }

  .winbar { gap: 10px; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 8px 6px; }
  .meta { width: 100%; order: 3; }

  .g-metrics { grid-template-columns: 1fr 1fr 1fr; }
  .search input { width: 120px; }

  .sheet-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; height: 90vh;
    border-radius: 26px 26px 0 0;
    padding: 8px 16px 26px;
    animation: sheet-up 0.5s var(--spring);
  }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
  .sheet-grab {
    display: block; width: 40px; height: 4px; border-radius: 99px;
    background: rgba(255, 255, 255, 0.2); margin: 6px auto 12px;
  }
  .sheet-head h2 { font-size: 19px; }
  .sheet-kpis { grid-template-columns: repeat(3, 1fr); }
  .errrow .name { width: 110px; }
}

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

/* uptime tooltip */
.utip {
  position: fixed;
  z-index: 95;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(8, 12, 24, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.95);
  font-size: 11px;
  color: var(--ink-soft);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -140%) scale(0.97);
  transition: opacity 0.14s ease, transform 0.18s var(--ease);
}
.utip.show { opacity: 1; transform: translate(-50%, -140%) scale(1); }
.utip b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* avoid re-animating the whole grid on every keystroke */
.grid-cards.settled .g-card { animation: none; }

.psep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; align-self: center; }

/* unit suffix inside gradient-clipped numbers (must opt out of text clip) */
.kpi-value .unit {
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 2px;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  background: none;
}
