:root {
  --bg: #070b14;
  --bg-elevated: #0d1424;
  --bg-card: rgba(16, 24, 42, 0.72);
  --line: rgba(120, 160, 220, 0.14);
  --text: #e8eefc;
  --muted: #93a0bd;
  --accent: #00e5a8;
  --accent-2: #4f8cff;
  --danger: #ff6b8a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.bg-grid,
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(79, 140, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 140, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.bg-glow {
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 229, 168, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(79, 140, 255, 0.16), transparent 30%),
    radial-gradient(circle at 50% 80%, rgba(0, 229, 168, 0.08), transparent 35%);
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  min-height: 72px;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex-shrink: 0;
}

.header__title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.08rem;
  min-width: 0;
}

.header__eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}

.header__tagline {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(42vw, 280px);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
}

.logo__mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: url("assets/logo-bot-512.png") center / cover no-repeat;
  box-shadow: 0 0 20px rgba(0, 229, 168, 0.4);
  flex-shrink: 0;
}

.logo__text span {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.nav a {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 0.35rem;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #19c4ff);
  color: #041018;
  font-weight: 700;
  border: 0;
  box-shadow: 0 10px 30px rgba(0, 229, 168, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 229, 168, 0.28);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn--stop {
  color: #ffb4b4;
  border-color: rgba(255, 120, 120, 0.45);
}

.btn--stop:hover {
  color: #ffd0d0;
  border-color: rgba(255, 120, 120, 0.7);
  box-shadow: none;
  transform: none;
}

.btn--maintenance-on {
  color: #ffe2c4;
  border-color: rgba(255, 170, 80, 0.55);
  background: rgba(140, 70, 20, 0.35);
}

.btn--maintenance-on:hover {
  color: #fff0dc;
  border-color: rgba(255, 170, 80, 0.8);
  background: rgba(160, 80, 24, 0.45);
}

.btn--sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
}

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.burger span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  padding: 5rem 0 4rem;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1,
.section__head h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.cta h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead,
.section__head p,
.cta p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 54ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.8rem 0 2rem;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.hero__stats strong {
  display: block;
  font-size: 1.5rem;
  font-family: var(--mono);
  color: var(--text);
}

.hero__stats span {
  color: var(--muted);
  font-size: 0.85rem;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.panel__header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #334155;
}

.dot:nth-child(1) { background: #ff6b8a; }
.dot:nth-child(2) { background: #ffd166; }
.dot:nth-child(3) { background: #00e5a8; }

.panel__title {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.panel__body {
  padding: 1.1rem 1.2rem 1.2rem;
}

.probe-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(120, 160, 220, 0.12);
  font-family: var(--mono);
  font-size: 0.92rem;
}

.probe-row span:first-child {
  color: var(--muted);
}

.probe-row--total {
  border-bottom: 0;
  margin-bottom: 0.8rem;
}

.probe-value--online {
  color: var(--accent-2);
  font-weight: 600;
}

.probe-value--ping {
  color: var(--accent);
  font-weight: 600;
}

.probe-value--accent,
.probe-value--ok {
  color: var(--accent);
  font-weight: 600;
}

.probe-value--bad {
  color: var(--danger);
  font-weight: 600;
}

.probe-value--wait {
  color: var(--muted);
}

#spark {
  width: 100%;
  height: 90px;
  display: block;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.section {
  padding: 4.5rem 0;
}

.section--alt {
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.55), transparent);
  border-block: 1px solid var(--line);
}

.section__head {
  margin-bottom: 2rem;
  max-width: 720px;
}

.cards,
.services,
.metrics {
  display: grid;
  gap: 1rem;
}

.cards--3,
.services {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.service,
.metric {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  backdrop-filter: blur(8px);
}

.card__icon {
  font-family: var(--mono);
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.card h3,
.service h3 {
  margin-bottom: 0.55rem;
  font-size: 1.2rem;
}

.card p,
.service p,
.metric__hint {
  color: var(--muted);
}

.service ul {
  margin-top: 1rem;
  padding-left: 1.1rem;
  color: var(--muted);
}

.service li + li {
  margin-top: 0.35rem;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric__label {
  display: block;
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  font-family: var(--mono);
  margin-bottom: 0.35rem;
}

.section--cta {
  padding-bottom: 5rem;
}

.cta {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem;
  border-radius: calc(var(--radius) + 6px);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(0, 229, 168, 0.12), transparent 40%),
    var(--bg-elevated);
  box-shadow: var(--shadow);
}

.cta__box {
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.cta__link {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.cta__note {
  color: var(--muted);
  font-size: 0.92rem;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2rem;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .hero__grid,
  .cards--3,
  .services,
  .metrics,
  .cta {
    grid-template-columns: 1fr;
  }

  .header__tagline {
    display: none;
  }

  .header__actions {
    margin-left: auto;
  }

  .header .btn--sm {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    padding: 0.5rem 1rem 1rem;
    z-index: 60;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .nav a.active::after {
    display: none;
  }

  .nav a.active {
    color: var(--accent);
  }
}

@media (max-width: 560px) {
  .hero__stats {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
  }
}

.products {
  display: grid;
  gap: 1.2rem;
}

.product {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.6rem;
  backdrop-filter: blur(8px);
}

.product__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.product__head-text {
  min-width: 0;
}

.product__cta {
  flex-shrink: 0;
  white-space: nowrap;
}

.product__badge {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}

.product h3 {
  font-size: 1.5rem;
  margin-bottom: 0;
}

@media (max-width: 560px) {
  .product__head {
    flex-direction: column;
    align-items: stretch;
  }

  .product__cta {
    align-self: flex-end;
  }
}

.product__url {
  margin-bottom: 1rem;
}

.product__url a,
.cta p a,
.cta__note a,
.product code {
  color: var(--accent-2);
}

.product p,
.product__list,
.product__note {
  color: var(--muted);
}

.product__list {
  margin: 1rem 0 1rem 1.1rem;
}

.product__list li + li {
  margin-top: 0.35rem;
}

.product__note {
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.product code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.lab-preview {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

.steps {
  margin: 1rem 0 1.5rem 1.1rem;
  color: var(--muted);
}

.steps li + li {
  margin-top: 0.7rem;
}

.steps strong {
  color: var(--text);
}

.flow {
  display: grid;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.flow__ok {
  color: var(--accent);
}

.lab-page .lab {
  padding: 2.5rem 0 4rem;
}

.lab__layout {
  display: grid;
  gap: 1rem;
}

.lab__intro h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}

.lab__intro p {
  color: var(--muted);
  max-width: 70ch;
}

.lab__link-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.92rem;
}

.lab__link-status .agent-link {
  color: var(--accent);
  text-decoration: none;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
}

.lab__link-status .agent-link:hover {
  text-decoration: underline;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
}

.status-dot--ok {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 229, 168, 0.55);
}

.status-dot--bad {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 107, 138, 0.45);
}

.status-dot--unknown {
  background: #64748b;
}

.lab-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
}

.lab-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.op-card {
  border: 1px solid rgba(120, 160, 220, 0.28);
  border-radius: 14px;
  padding: 0.9rem;
  background: #10182a;
}

.op-card--online {
  border-color: rgba(0, 229, 168, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 168, 0.08);
}

.op-card--offline {
  opacity: 0.85;
  border-color: rgba(255, 107, 138, 0.35);
}

.op-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.op-card__top strong {
  color: #f2f6ff;
  font-size: 1rem;
}

.op-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #041018;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.op-card--offline .op-badge {
  color: #fff;
  background: var(--danger);
}

.op-card__meta {
  display: grid;
  gap: 0.2rem;
  color: #b7c3de;
  font-size: 0.82rem;
}

.wl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.55rem 0 0;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  width: fit-content;
}

.wl-badge--on {
  color: #041018;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 229, 168, 0.35);
}

.wl-badge--off {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 107, 138, 0.35);
}

.wl-badge--unknown {
  color: #cbd5e1;
  background: rgba(100, 116, 139, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.signal {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  margin: 0.55rem 0 0.65rem;
  min-height: 22px;
}

.signal__bar {
  display: inline-block;
  width: 5px;
  height: var(--h, 10px);
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.28);
}

.signal__bar--on {
  background: linear-gradient(180deg, #5dffc4, var(--accent));
  box-shadow: 0 0 8px rgba(0, 229, 168, 0.35);
}

.op-card--offline .signal__bar--on {
  background: var(--danger);
  box-shadow: none;
}

.signal__rtt {
  margin-left: 0.25rem;
  color: #d7e4ff;
  font-size: 0.78rem;
  line-height: 1;
  align-self: center;
}

.agent-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-start;
}

.agent-pick {
  display: grid;
  gap: 0.4rem;
  flex: 0 1 auto;
  width: fit-content;
  max-width: min(100%, calc(50% - 0.5rem));
  min-width: 0;
}

.agent-pick__label {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.agent-pick__id {
  color: var(--accent);
  font-weight: 600;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.88em;
  letter-spacing: 0.02em;
}

.op-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1424;
}

.op-pick__item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  padding: 0.15rem 0.25rem;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.op-pick__item:hover:not(.op-pick__item--off) {
  background: rgba(0, 229, 168, 0.08);
}

.op-pick__item--off {
  opacity: 0.35;
  cursor: not-allowed;
}

.op-pick__item input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}

.op-pick__logo {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.op-pick__item--off .op-pick__logo {
  filter: grayscale(1);
  opacity: 0.55;
}

@media (max-width: 768px) {
  .agent-picks {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .agent-pick {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .op-pick {
    width: 100%;
    box-sizing: border-box;
    gap: 0.5rem 0.6rem;
    padding: 0.55rem 0.65rem;
  }

  .op-pick__item {
    flex: 0 0 auto;
  }
}

.lab-form {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field[hidden],
.input[hidden],
textarea[hidden] {
  display: none !important;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.input,
.select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1424;
  color: var(--text);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  font: inherit;
  color-scheme: dark;
}

select.input,
.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

select.input option,
.select option {
  background-color: #0d1424;
  color: #e8eefc;
}

select.input option:checked,
.select option:checked,
select.input option:hover,
.select option:hover {
  background-color: #14304a;
  color: #ffffff;
}

select.input option:disabled,
.select option:disabled {
  color: #6b7690;
  background-color: #0a101c;
}

.input:focus,
.select:focus {
  outline: 1px solid rgba(0, 229, 168, 0.45);
}

.input--area {
  resize: vertical;
  min-height: 5rem;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.45;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: url("assets/logo-bot-512.png") center / cover no-repeat;
  box-shadow: 0 0 24px rgba(0, 229, 168, 0.4);
}

.login-box {
  max-width: 420px;
  margin: 4rem auto;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.login-error {
  color: var(--danger);
  font-size: 0.92rem;
  margin: 0.8rem 0;
}

.tg-wrap {
  margin: 1.2rem 0 0.5rem;
  min-height: 48px;
}

.login-fallback {
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.login-fallback summary {
  cursor: pointer;
  margin-bottom: 0.8rem;
}

.login-fallback .lab-form {
  margin-top: 0.5rem;
}

.user-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.user-bar__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.user-bar__meta strong {
  color: var(--text);
}

.role-badge {
  display: inline-flex;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.role-badge--admin {
  background: rgba(79, 140, 255, 0.2);
  color: #9ec1ff;
}

.role-badge--user {
  background: rgba(0, 229, 168, 0.15);
  color: var(--accent);
}

.role-badge--moderator {
  background: rgba(255, 176, 59, 0.18);
  color: #ffc96a;
}

.servers-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.server-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.server-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.server-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.server-row__order {
  display: inline-flex;
  gap: 0.15rem;
}

.btn--icon {
  min-width: 2rem;
  padding-inline: 0.45rem;
  font-family: var(--mono);
  line-height: 1.2;
}

.server-row__title {
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
}

.server-row__scan-time {
  font-weight: 500;
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--muted);
}

.server-row__meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--mono);
  margin: 0.25rem 0 0.65rem;
}

.srv-ops {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 900px) {
  .srv-ops {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .srv-ops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.srv-op {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: #10182a;
}

.srv-op--ok {
  border-color: rgba(0, 229, 168, 0.45);
}

.srv-op--fail {
  border-color: rgba(255, 107, 138, 0.4);
}

.srv-op__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.srv-op__top strong {
  font-size: 0.88rem;
  color: #f2f6ff;
}

.srv-op__badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  color: #041018;
  background: var(--accent);
}

.srv-op--fail .srv-op__badge {
  color: #fff;
  background: var(--danger);
}

.srv-op__ping {
  color: #b7c3de;
  font-size: 0.8rem;
}

.stats-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.8rem;
}

.stats-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.7rem;
  align-items: stretch;
}

.stats-row__label {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
}

.stats-row__cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat-card {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.stat-card--total {
  max-width: 200px;
}

.stat-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.2rem;
  margin-top: 0.25rem;
}

.stat-extra {
  font-size: 0.82rem;
  font-weight: 500;
}

.stat-ok {
  color: #3dd68c;
}

.stat-new {
  color: #5eb8ff;
}

@media (max-width: 800px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .stats-row__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-only[hidden],
.user-panel[hidden] {
  display: none !important;
}

.lab-panel__head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lab-panel[data-collapsible] > .lab-panel__head {
  cursor: pointer;
  user-select: none;
}

.lab-panel__collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lab-panel__collapse:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lab-panel--collapsed .lab-panel__collapse {
  transform: rotate(-90deg);
}

.lab-panel--collapsed > .lab-panel__body {
  display: none;
}

.lab-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.lab-form__actions--admin {
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.lab-form__actions-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.lab-form__actions--admin #maintenance-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

.lab-hint,
.muted {
  color: var(--muted);
}

.lab-hint {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

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

.lab-progress {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(56, 120, 255, 0.08);
  border: 1px solid rgba(96, 165, 255, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.lab-progress__title {
  font-size: 0.78rem;
  color: #8eb4ff;
  margin-bottom: 0.15rem;
}

.lab-progress__row {
  display: grid;
  grid-template-columns: 4.6rem 1fr 2.4rem;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.lab-progress__label {
  color: #a8c4f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-progress__track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.lab-progress__fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.25s ease;
  min-width: 0;
}

.lab-progress__row--done .lab-progress__fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.lab-progress__row--error .lab-progress__fill {
  background: #ef4444;
  width: 100% !important;
  opacity: 0.35;
}

.lab-progress__row--error .lab-progress__label {
  color: #fca5a5;
}

.lab-progress__row--pending .lab-progress__fill {
  background: rgba(255, 255, 255, 0.12);
  width: 0 !important;
}

.lab-progress__pct {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #7a9fd4;
  text-align: right;
}

.lab-progress--completed .lab-progress__title {
  color: #6ee7a0;
}

.lab-progress--simple {
  color: #b8d4ff;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.lab-log {
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  margin: 0;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  color: #d7e4ff;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .lab-preview {
    grid-template-columns: 1fr;
  }
}
