: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 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
}

.logo__mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(0, 229, 168, 0.55);
}

.logo__text span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.4rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.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--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);
}

.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,
.cta h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.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--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 .btn--sm {
    display: none;
  }

  .burger {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem 1rem;
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }
}

@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__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;
}

.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;
}

.lab-form {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field[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-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);
}

.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;
}

.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;
}

@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-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.lab-hint,
.muted {
  color: var(--muted);
}

.lab-hint {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.mono {
  font-family: var(--mono);
}

.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;
  }
}
