:root {
  --bg: #07111f;
  --bg-2: #0b1728;
  --panel: rgba(10, 20, 36, 0.88);
  --panel-2: rgba(7, 15, 28, 0.96);
  --panel-3: #0f1d31;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(96, 165, 250, 0.28);
  --text: #e5eefc;
  --muted: #93a8c7;
  --muted-2: #6f87ab;
  --green: #22c55e;
  --green-2: #86efac;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --cyan: #22d3ee;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 26%),
    linear-gradient(180deg, #07111f 0%, #081423 45%, #09111b 100%);
  min-height: 100vh;
}

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

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(6, 12, 21, 0.76);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.topbar-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(59, 130, 246, 0.24));
  border: 1px solid rgba(96, 165, 250, 0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.logo-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #c9f7d8;
  stroke-width: 1.8;
}

.logo-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.logo-text span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.2s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.page {
  padding: 36px 0 60px;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(12, 23, 40, 0.88), rgba(8, 16, 28, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 34px;
  margin-bottom: 28px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(34,197,94,0.12), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(59,130,246,0.16), transparent 28%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-2);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-panel {
  background: rgba(5, 12, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.hero-panel-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.hero-stat {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.hero-note {
  margin-top: 8px;
  font-size: 14px;
  color: var(--green-2);
}

.section-title {
  margin: 0 0 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 26px;
}

.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.calculator-shell {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(11, 23, 40, 0.94), rgba(7, 16, 29, 0.98));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255,255,255,0.015);
}

.shell-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.shell-title-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(34,197,94,0.14), rgba(59,130,246,0.18));
  border: 1px solid rgba(96, 165, 250, 0.22);
}

.shell-title-badge svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #d6fce2;
  stroke-width: 1.8;
}

.shell-title h3 {
  margin: 0;
  font-size: 18px;
}

.shell-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.shell-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--green-2);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.22);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  padding: 22px;
}

.calc-form,
.calc-output {
  background: linear-gradient(180deg, rgba(8, 18, 31, 0.95), rgba(6, 12, 23, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.block-title h4 {
  margin: 0;
  font-size: 18px;
}

.block-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
}

.field {
  margin-top: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}

.field small {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 8, 17, 0.96);
  color: #f7fbff;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  outline: none;
  font-size: 15px;
  transition: 0.2s ease;
  appearance: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.kpi {
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 8, 17, 0.92);
  border-radius: 16px;
  padding: 14px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.kpi strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  line-height: 1.5;
  font-size: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 8, 17, 0.92);
}

.check-item span {
  font-size: 14px;
  color: var(--text);
}

.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #04120a;
  background: linear-gradient(135deg, #22c55e, #86efac);
  box-shadow: 0 10px 28px rgba(34, 197, 94, 0.18);
}

.btn-secondary {
  color: #f8fbff;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.18);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(34, 197, 94, 0.25);
}

.btn-secondary:hover {
  box-shadow: 0 14px 34px rgba(59, 130, 246, 0.24);
}

.result-card {
  margin-top: 18px;
  background: rgba(2, 8, 17, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  overflow: hidden;
}

.result-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  line-height: 1.6;
  font-size: 14px;
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.result-table td:first-child {
  width: 180px;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--green-2);
  font-size: 21px;
  word-break: break-all;
}

.range-visual {
  margin-top: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 8, 17, 0.94);
  padding: 16px;
}

.range-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.segment {
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.segment.network {
  background: rgba(239, 68, 68, 0.84);
  color: #fff;
}

.segment.hosts {
  background: rgba(245, 158, 11, 0.84);
  color: #fff;
}

.segment.broadcast {
  background: rgba(34, 197, 94, 0.84);
  color: #04120a;
}

.range-note {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.message {
  min-height: 22px;
  margin-top: 14px;
  color: var(--green-2);
  font-size: 14px;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

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

@media (max-width: 980px) {
  .hero-grid,
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .check-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .calc-form,
  .calc-output {
    padding: 20px;
  }

  .shell-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page {
    padding-top: 24px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .topbar-inner {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }
}