:root {
  --bg: #05070d;
  --cyan: #00f0ff;
  --magenta: #ff2ee6;
  --purple: #9d4bff;
  --green: #39ff88;
  --amber: #ffb020;
  --tile-alpha: 0.28;
  --glass: rgba(20, 26, 43, var(--tile-alpha));
  --glass-border: rgba(0, 240, 255, 0.25);
  --text-dim: #7d8aa8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: #eaf2ff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  min-height: 100%;
}

#bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.15) brightness(0.8);
}
/* Darkens/evens out the video so glass cards + text stay readable on top,
   without hiding the footage - stronger at the edges, clear in the middle. */
#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(5,7,13,0.55) 0%, rgba(5,7,13,0.25) 25%, rgba(5,7,13,0.55) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(5,7,13,0.5) 100%);
  pointer-events: none;
}
/* Lightweight shooting-star sparkle layer drawn on top of the real video. */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Separate, always-on-top background theme switcher - distinct from the
   per-widget ⚙ gears, controls the video + overall darkness for the whole
   page rather than one card's data. */
#bg-settings-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transform: scale(.82);
  transition: opacity .25s ease, transform .25s ease, border-color .2s ease, box-shadow .2s ease;
}
#bg-settings-toggle::before {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
}
#bg-settings-toggle:hover,
#bg-settings-toggle:focus-visible,
#bg-settings-toggle.menu-open {
  opacity: 1;
  transform: scale(1);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0,240,255,0.35);
}
@media (hover: none), (pointer: coarse) {
  #bg-settings-toggle { opacity: .28; transform: scale(.9); }
  #bg-settings-toggle:focus,
  #bg-settings-toggle.menu-open { opacity: 1; transform: scale(1); }
}
#bg-settings-panel {
  display: none;
  position: fixed;
  top: 62px;
  right: 16px;
  z-index: 100;
  min-width: 260px;
  background: rgba(10, 13, 22, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0,240,255,0.1);
  backdrop-filter: blur(10px);
}
#bg-settings-panel.open { display: block; }
#bg-settings-panel .s-row-title {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.bg-theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cfe0ff;
  margin-bottom: 8px;
  cursor: pointer;
}
.bg-theme-option input {
  accent-color: var(--cyan);
}
#bg-darkness-slider {
  width: 100%;
  accent-color: var(--cyan);
}

.app {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 340px;
  margin-bottom: 28px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: linear-gradient(160deg, rgba(157,75,255, calc(0.12 * var(--tile-alpha))), rgba(0,240,255, calc(0.06 * var(--tile-alpha))) 60%, rgba(5,7,13, calc(0.4 * var(--tile-alpha))));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease-out, box-shadow .25s ease, border-color .25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.hero-sub .dot { color: var(--purple); margin: 0 6px; }
.hero-clock {
  font-size: clamp(56px, 9vw, 108px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  margin-top: 10px;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(0,240,255,0.6), 0 0 60px rgba(157,75,255,0.25);
  letter-spacing: 4px;
  line-height: 1;
}
.hero-date {
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 10px;
}
.hero-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.hero-meta .dot { color: var(--purple); margin: 0 8px; }
.hero-meta b { color: var(--cyan); font-weight: 600; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(57,255,136,0.4);
  background: rgba(57,255,136,0.08);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--green);
}
.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.7; }
}

/* ---------- GRID / CARDS ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  /* Every translucent layer scales off --tile-alpha (0-1) so the opacity
     slider can take a tile all the way to fully see-through, not just fade
     the base fill while a fixed-alpha highlight gradient keeps it tinted. */
  background:
    linear-gradient(135deg, rgba(255,255,255, calc(0.10 * var(--tile-alpha))), rgba(255,255,255, calc(0.01 * var(--tile-alpha))) 45%, rgba(157,75,255, calc(0.05 * var(--tile-alpha))) 100%),
    var(--glass);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 26px;
  padding: 18px 20px 16px;
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  box-shadow:
    0 8px 30px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255, calc(0.25 * var(--tile-alpha))),
    inset 0 0 20px rgba(255,255,255, calc(0.03 * var(--tile-alpha)));
  transition: transform .15s ease-out, box-shadow .25s ease, border-color .25s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  overflow: visible;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255, calc(0.9 * var(--tile-alpha))), transparent);
  opacity: 0.7;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255,255,255, calc(0.18 * var(--tile-alpha))), transparent 55%);
  pointer-events: none;
}
.card:hover {
  border-color: rgba(255,255,255,0.32);
  box-shadow:
    0 14px 40px rgba(0,240,255,0.12),
    0 8px 30px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255, calc(0.4 * var(--tile-alpha)));
}
.app.edit-mode .card,
.app.edit-mode .hero {
  cursor: grab;
}
.card.dragging,
.hero.dragging {
  cursor: grabbing !important;
  z-index: 500;
  transition: none;
  transform: none;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,240,255,0.4),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.resize-handle {
  display: none;
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  border-radius: 4px;
  z-index: 5;
  background:
    linear-gradient(135deg, transparent 45%, rgba(0,240,255,0.6) 45%, rgba(0,240,255,0.6) 55%, transparent 55%, transparent 65%, rgba(0,240,255,0.6) 65%, rgba(0,240,255,0.6) 75%, transparent 75%);
}
.app.edit-mode .resize-handle {
  display: block;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 {
  font-size: 13px;
  letter-spacing: 3px;
  margin: 0;
  color: #cfe0ff;
  font-weight: 700;
}
.card-tag {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.pulse-tag { color: var(--green); }

.head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gear-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all .2s ease, opacity .2s ease;
  flex-shrink: 0;
  opacity: 0;
}
.card:hover .gear-btn,
.hero:hover .gear-btn,
.gear-btn.active {
  opacity: 1;
}
.gear-btn:hover, .gear-btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0,240,255,0.35);
  transform: rotate(45deg);
}

.settings-popover {
  display: none;
  position: absolute;
  top: 46px;
  right: 16px;
  z-index: 10;
  min-width: 220px;
  background: rgba(10, 13, 22, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0,240,255,0.1);
  backdrop-filter: blur(10px);
}
.settings-popover.open { display: block; }
.settings-popover .s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #cfe0ff;
  margin-bottom: 10px;
}
.settings-popover .s-row:last-child { margin-bottom: 0; }
.settings-popover .s-row-title {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.settings-popover select {
  background: rgba(255,255,255,0.06);
  color: #eaf2ff;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}
/* The dropdown's open option list is rendered by the OS/browser, not this
   page - it ignores backdrop-filter/alpha entirely, and without an explicit
   solid background here it falls back to the native default (white),
   which combined with the select's light #eaf2ff text made every option
   unreadable (light text on light background). */
.settings-popover select option {
  background: #131a2b;
  color: #eaf2ff;
}
.settings-popover input[type="checkbox"] {
  accent-color: var(--cyan);
}
.checkbox-list {
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #cfe0ff;
}

.disk-row {
  margin-bottom: 12px;
}
.disk-row:last-child { margin-bottom: 0; }
.disk-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.disk-row-head b { color: #eaf2ff; }
.disk-bar-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.disk-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  box-shadow: 0 0 8px rgba(157,75,255,0.5);
  transition: width .6s ease;
}
.disk-bar-fill.warn { background: linear-gradient(90deg, var(--amber), var(--magenta)); }
.card-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* ---------- GAUGES ---------- */
.card[hidden] { display:none !important; }
.gauge-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.gauge {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 10;
}
.gauge-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset .6s ease;
  filter: drop-shadow(0 0 6px var(--cyan));
}
.gauge-magenta .gauge-fill { stroke: var(--magenta); filter: drop-shadow(0 0 6px var(--magenta)); }
.gauge-cyan .gauge-fill { stroke: var(--purple); filter: drop-shadow(0 0 6px var(--purple)); }
.gauge-amber .gauge-fill { stroke: var(--amber); filter: drop-shadow(0 0 6px var(--amber)); }
.gauge-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gauge-value small { font-size: 13px; color: var(--text-dim); margin-left: 2px; }
.gauge-labeled .gauge-value {
  flex-direction: column;
  gap: 3px;
}
.gauge-label {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.vps-source-btn {
  position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:7px;
  min-height:27px; padding:4px 10px 4px 7px; border:1px solid rgba(55,238,255,.4);
  border-radius:999px; color:var(--cyan); background:linear-gradient(135deg,rgba(28,220,255,.13),rgba(129,66,255,.12));
  box-shadow:inset 0 0 12px rgba(55,238,255,.08),0 0 10px rgba(55,238,255,.08);
  font-family:inherit; font-size:9px; font-weight:700; line-height:1; letter-spacing:1px; cursor:pointer;
  transition:transform .2s ease,border-color .3s ease,box-shadow .3s ease,color .3s ease;
}
.vps-source-btn::after {
  content:""; position:absolute; inset:-60% auto -60% -45%; width:32%; transform:rotate(18deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.42),transparent);
  animation:vps-switch-shine 4s ease-in-out infinite;
}
.vps-source-btn:hover { transform:translateY(-1px); border-color:var(--cyan); box-shadow:0 0 16px rgba(55,238,255,.28),inset 0 0 14px rgba(55,238,255,.12); }
.vps-source-btn:active { transform:scale(.95); }
.vps-switch-orb {
  width:11px; height:11px; flex:0 0 11px; border-radius:50%; background:var(--cyan);
  box-shadow:0 0 5px var(--cyan),0 0 11px var(--cyan); animation:vps-orb-pulse 1.8s ease-in-out infinite;
}
.card-vps.pc-mode .vps-source-btn { color:var(--magenta); border-color:rgba(255,46,230,.48); background:linear-gradient(135deg,rgba(255,46,230,.13),rgba(129,66,255,.15)); box-shadow:inset 0 0 12px rgba(255,46,230,.08),0 0 10px rgba(255,46,230,.1); }
.card-vps.pc-mode .vps-source-btn:hover { box-shadow:0 0 16px rgba(255,46,230,.3),inset 0 0 14px rgba(255,46,230,.13); }
.card-vps.pc-mode .vps-switch-orb { background:var(--magenta); box-shadow:0 0 5px var(--magenta),0 0 11px var(--magenta); }
.card-net.vps-mode .vps-source-btn { color:var(--magenta); border-color:rgba(255,46,230,.48); background:linear-gradient(135deg,rgba(255,46,230,.13),rgba(129,66,255,.15)); }
.card-net.vps-mode .vps-switch-orb { background:var(--magenta); box-shadow:0 0 5px var(--magenta),0 0 11px var(--magenta); }
@keyframes vps-switch-shine { 0%,68% { left:-45%; } 88%,100% { left:125%; } }
@keyframes vps-orb-pulse { 0%,100% { opacity:.72; transform:scale(.82); } 50% { opacity:1; transform:scale(1.08); } }
@media (prefers-reduced-motion:reduce) { .vps-source-btn::after,.vps-switch-orb { animation:none; } }
.card-vps .pc-only-gauge { display:none; }
.card-vps.pc-mode .gauge-row { gap:10px; }
.card-vps.pc-mode .gauge { width:78px; height:78px; }
.card-vps.pc-mode .gauge-value { font-size:19px; }
.card-vps.pc-mode .gauge-value small { font-size:10px; }
.card-vps.pc-mode .gauge-label { font-size:7px; letter-spacing:.7px; }
.card-vps.pc-mode .pc-only-gauge { display:block; }

/* ---------- CPU: dual gauge + vertical per-core bar chart ---------- */
.card-cpu-wide { grid-column: span 2; }
.cpu-body {
  display: flex;
  align-items: stretch;
  gap: 18px;
  height: 110px;
}
.cpu-gauges {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}
.core-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.core-bar {
  flex: 1 1 0;
  min-width: 2px;
  max-width: 16px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--cyan), var(--purple) 60%, var(--magenta));
  box-shadow: 0 0 4px rgba(0,240,255,0.3);
  transition: height .35s ease;
}

/* ==================== Services (Fluxed Studio) ==================== */
.services-list { display: flex; flex-direction: column; }
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.service-row + .service-row { border-top: 1px dashed rgba(255,255,255,0.08); }
.service-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.service-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-dim);
  transition: background .3s, box-shadow .3s;
}
.service-dot.alive { background: var(--green); box-shadow: 0 0 8px var(--green); }
.service-label { font-size: 13px; color: #eaf2ff; white-space: nowrap; }
.service-ping { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.service-transition {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
}
.service-transition.visible { display: inline-block; animation: service-status-blink .75s ease-in-out infinite; }
.service-transition.starting { color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,.8); }
.service-transition.stopping { color: var(--magenta); text-shadow: 0 0 8px rgba(255,46,230,.8); }
@keyframes service-status-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.service-actions { display: flex; align-items: center; gap: 12px; }
.service-open {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color .2s, border-color .2s;
}
.service-open:hover { color: var(--cyan); border-color: var(--cyan); }

/* Neon service toggle: animated energy track with a luminous moving core. */
.toggle-switch {
  --w: 62px; --h: 30px;
  width: var(--w); height: var(--h);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.ts-housing {
  display: block;
  position: relative;
  width: 100%; height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #171c29, #090c13);
  border: 1px solid rgba(137,151,184,.42);
  box-shadow: inset 0 2px 8px rgba(0,0,0,.82), 0 0 0 rgba(0,240,255,0);
  transition: border-color .3s, box-shadow .3s, background .3s;
  overflow: hidden;
}
.ts-housing::before,
.ts-housing::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .04em;
  transition: opacity .25s, color .25s;
}
.ts-housing::before { content: "ON"; left: 8px; color: var(--green); opacity: .18; }
.ts-housing::after { content: "OFF"; right: 6px; color: #a5afc3; opacity: .8; }
.ts-paddle {
  position: absolute;
  left: 4px; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5f8ff, #96a3bd 42%, #424b60 76%);
  box-shadow: 0 2px 7px rgba(0,0,0,.75), inset 0 1px 2px rgba(255,255,255,.75);
  transform: translateX(0);
  transition: transform .34s cubic-bezier(.34,1.56,.64,1), background .3s, box-shadow .3s;
  z-index: 2;
}
.toggle-switch[aria-pressed="true"] .ts-housing {
  border-color: rgba(57,255,136,.78);
  background: linear-gradient(90deg, rgba(26,122,76,.66), rgba(8,29,24,.96));
  box-shadow: inset 0 2px 8px rgba(0,0,0,.55), 0 0 14px rgba(57,255,136,.38);
}
.toggle-switch[aria-pressed="true"] .ts-housing::before { opacity: 1; }
.toggle-switch[aria-pressed="true"] .ts-housing::after { opacity: .16; }
.toggle-switch[aria-pressed="true"] .ts-paddle {
  transform: translateX(33px);
  background: radial-gradient(circle at 35% 30%, #effff6, #39ff88 45%, #148e4a 78%);
  box-shadow: 0 2px 7px rgba(0,0,0,.65), inset 0 1px 2px rgba(255,255,255,.8), 0 0 13px rgba(57,255,136,.9);
}
.toggle-switch.pending { pointer-events: none; }
.toggle-switch.pending .ts-housing { animation: ts-energy .7s ease-in-out infinite; }
.toggle-switch.pending .ts-paddle { animation: ts-pulse .7s ease-in-out infinite; }
.toggle-switch.turning-off .ts-housing { border-color: rgba(255,46,230,.75); box-shadow: 0 0 13px rgba(255,46,230,.42); }
@keyframes ts-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.75); } }
@keyframes ts-energy { 0%,100% { opacity: 1; } 50% { opacity: .62; } }

.stat-list { flex: 1; }
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-dim);
}
.stat-row b { color: #eaf2ff; font-variant-numeric: tabular-nums; }

.sparkline {
  width: 100%;
  height: 46px;
  margin-top: 12px;
  display: block;
}

/* ---------- NETWORK ---------- */
.net-row { display: flex; gap: 24px; }
.net-stat { display: flex; align-items: center; gap: 10px; }
.net-arrow { font-size: 20px; }
.net-arrow.up { color: var(--magenta); text-shadow: 0 0 8px rgba(255,46,230,0.6); }
.net-arrow.down { color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,0.6); }
.net-label { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.net-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- UPTIME ---------- */
.uptime-value {
  font-size: 34px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  text-shadow: 0 0 14px rgba(57,255,136,0.5);
  letter-spacing: 1px;
}
.battery-wrap { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.battery-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.battery-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); width: 0%; transition: width .5s ease; }

/* ---------- EQUALIZER ---------- */
/* ---------- PING ---------- */
.ping-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ping-add-row input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 5px 8px;
  color: #eaf2ff;
  font-size: 12px;
}
.ping-add-row button {
  padding: 5px 12px;
}
.ping-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ping-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.ping-row-head {
  display: grid;
  grid-template-columns: 1fr 52px 16px;
  align-items: center;
  gap: 8px;
}
.ping-row-spark {
  width: 100%;
  height: 24px;
  display: block;
}
.ping-row-host {
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ping-row-latency {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.ping-row-latency.ping-good { color: var(--green); }
.ping-row-latency.ping-mid { color: var(--amber); }
.ping-row-latency.ping-bad { color: var(--magenta); }
.ping-row-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  text-align: center;
}
.ping-row-remove:hover { color: var(--magenta); }
.ping-row-head-2col { grid-template-columns: 1fr 52px; }

/* ---------- NETWORK: speed test ---------- */
.net-speedtest-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}
.net-speedtest-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.net-speedtest-down { color: #ff3b3b; }
.net-speedtest-up { color: #3b9bff; }

.net-ping-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.net-ping-divider::before,
.net-ping-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
}

/* ---------- 1C RELEASES ---------- */
.onec-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-file-upload { min-height: 300px; }
.file-drop-zone {
  min-height: 180px;
  border: 1px dashed rgba(65, 235, 255, .55);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 20px;
  text-align: center;
  background: rgba(16, 35, 55, .34);
  transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.file-drop-zone.dragging {
  border-color: var(--cyan);
  background: rgba(24, 211, 255, .12);
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(24, 211, 255, .18);
}
.file-drop-icon { color: var(--cyan); font-size: 34px; line-height: 1; }
.file-drop-title { font-weight: 700; letter-spacing: .08em; }
.file-drop-subtitle { color: var(--muted); font-size: 13px; }
.file-upload-job { margin-top: 14px; }
.file-upload-name { margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-upload-status { margin-top: 7px; color: var(--muted); font-size: 13px; }
.file-upload-job .onec-job-link { display: inline-block; margin-top: 10px; }
.file-catalog-toggle { width: 100%; margin-top: 14px; }
.file-catalog-list { margin-top: 10px; max-height: 250px; overflow: auto; }
.file-catalog-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 10px 2px;
  border-top: 1px dashed rgba(255,255,255,.1);
}
.file-catalog-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-catalog-meta { color: var(--text-dim); font-size: 10px; }
.file-catalog-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; gap: 6px; }
.file-catalog-actions button,
.file-catalog-actions a {
  border: 1px solid var(--glass-border); border-radius: 6px; background: rgba(255,255,255,.025);
  color: var(--text-dim); text-decoration: none; font-size: 11px; padding: 6px 8px; cursor: pointer;
}
.file-catalog-actions a:hover,
.file-catalog-actions button:hover { color: var(--cyan); border-color: var(--cyan); }
.file-catalog-actions .delete:hover { color: var(--magenta); border-color: var(--magenta); }
.file-catalog-empty { color: var(--text-dim); text-align: center; padding: 16px 4px; font-size: 12px; }
.file-catalog-modal.open { animation: catalog-backdrop-in .2s ease-out; }
.file-catalog-box {
  width: min(920px, 94vw);
  height: min(680px, 86vh);
  max-height: 86vh;
  animation: catalog-window-in .24s cubic-bezier(.2,.9,.25,1.08);
}
.file-catalog-box .onec-catalog-head { flex-shrink: 0; padding: 18px 22px; }
.file-catalog-hint { margin-top: 4px; color: var(--text-dim); font-size: 11px; }
.file-catalog-box .file-catalog-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 8px 22px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) rgba(255,255,255,.05);
}
.file-catalog-box .file-catalog-item { padding: 14px 2px; }
@keyframes catalog-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes catalog-window-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .file-catalog-box { width: 96vw; height: 90vh; max-height: 90vh; border-radius: 10px; }
  .file-catalog-box .onec-catalog-head { padding: 14px; }
  .file-catalog-box .file-catalog-list { padding: 6px 14px 16px; }
  .file-catalog-item { grid-template-columns: minmax(0, 1fr); }
  .file-catalog-actions { grid-row: auto; grid-column: 1; justify-content: flex-start; flex-wrap: wrap; }
}
.onec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.onec-label {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.onec-row select {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 5px 8px;
  color: #eaf2ff;
  font-size: 12px;
}
.onec-row select option { background: #0b0f1a; }
.onec-download-btn {
  width: 100%;
  margin-top: 4px;
}
.onec-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.onec-jobs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.onec-job-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.onec-job-row:last-child { border-bottom: none; padding-bottom: 0; }
.onec-job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.onec-job-title {
  font-size: 12px;
  color: #eaf2ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.onec-job-dismiss {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  flex-shrink: 0;
}
.onec-job-dismiss:hover { color: var(--magenta); }
.onec-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.onec-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width .3s ease;
}
.onec-job-row.onec-job-done .onec-progress-fill {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}
.onec-job-row.onec-job-error .onec-progress-fill {
  background: var(--magenta);
}

/* ---------- GARANT-MET SSL ---------- */
.gm-ok { color: var(--green); }
.gm-warn { color: #ffcf5c; }
.gm-error { color: var(--magenta); }
#gm-job-row { border-bottom: none; padding-bottom: 0; }
.onec-progress-label {
  font-size: 11px;
  color: var(--text-dim);
}
.onec-job-link {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}
.onec-job-link:hover { text-decoration: underline; }
.onec-job-error-text {
  color: var(--magenta);
  font-size: 11px;
}
.onec-catalog-btn {
  width: 100%;
}

.onec-catalog-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 4, 9, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.onec-catalog-modal.open { display: flex; }
.onec-catalog-box {
  width: min(560px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 13, 22, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(0,240,255,0.12);
}
.onec-catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.onec-catalog-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #eaf2ff;
}
.onec-catalog-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.onec-catalog-close:hover { color: var(--magenta); }
.onec-catalog-list {
  overflow-y: auto;
  padding: 8px 18px 18px;
}
.onec-catalog-empty {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 24px 0;
}
.onec-catalog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.onec-catalog-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.onec-catalog-name {
  font-size: 13px;
  color: #eaf2ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.onec-catalog-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.onec-catalog-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.onec-catalog-actions button {
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--cyan);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  transition: all .2s ease;
}
.onec-catalog-actions button:hover {
  background: rgba(0,240,255,0.1);
}
.onec-catalog-actions .onec-catalog-delete {
  color: var(--magenta);
  border-color: rgba(255,46,230,0.35);
}
.onec-catalog-actions .onec-catalog-delete:hover {
  background: rgba(255,46,230,0.12);
}
.onec-catalog-actions .onec-catalog-delete.confirm {
  background: var(--magenta);
  color: #05070d;
  font-weight: 700;
}


/* ---------- FOOTER ---------- */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.ghost-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--cyan);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all .2s ease;
}
.ghost-btn:hover {
  background: rgba(0,240,255,0.1);
  box-shadow: 0 0 14px rgba(0,240,255,0.3);
}

@media (max-width: 600px) {
  .hero { height: auto; padding: 30px 16px; }
  .gauge-row { flex-direction: column; }
  .net-row { flex-direction: column; gap: 12px; }
}
