:root {
  --bg: #0f172a;
  --panel: #111827;
  --border: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --green: #22c55e;
  --yellow: #fbbf24;
  --red: #f87171;
  --accent: #38bdf8;
  --pill-bg: #1f2937;
  --chip-bg: #1f2937;
  --chip-active: #2563eb;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(circle at 20% 20%, #111827 0, #0f172a 40%),
              radial-gradient(circle at 80% 0%, #0b253a 0, #0f172a 45%),
              radial-gradient(circle at 50% 80%, #0b1b30 0, #0f172a 55%);
  color: var(--text);
  padding: 32px 18px 48px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.title h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.2;
}

.title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.badge {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge b {
  color: var(--text);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 14px 45px rgba(0,0,0,0.25);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.controls .group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.controls label.small {
  font-size: 12px;
  color: var(--muted);
}

select, input[type="text"], .button {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
}

select, input[type="text"] {
  min-width: 200px;
}

.button {
  cursor: pointer;
  min-width: 46px;
  text-align: center;
  background: linear-gradient(135deg, #1f2937, #111827);
  border: 1px solid #1f2937;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.chips {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.chip {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chip.active {
  background: var(--chip-active);
  color: #e5f0ff;
  border-color: #3b82f6;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.pillDot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted);
}

.pillDot.green { background: var(--green); }
.pillDot.yellow { background: var(--yellow); }
.pillDot.red { background: var(--red); }

.grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
}

.card h2,
.checkWrap h2 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 18px;
}

.subnote {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

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

.table tr td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}

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

.table .k {
  width: 42%;
  color: var(--muted);
}

.value-mono {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  color: #c7d2fe;
}

.checkWrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.resultHeader {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0b1324, #0a162c);
  border: 1px solid #1e293b;
}

.traffic {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.trafficLight {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.bulb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1f2937;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.4);
}

.bulb.on.red { background: radial-gradient(circle at 30% 30%, #fca5a5, #ef4444); box-shadow: 0 0 8px rgba(248,113,113,0.6); }
.bulb.on.yellow { background: radial-gradient(circle at 30% 30%, #fde68a, #fbbf24); box-shadow: 0 0 8px rgba(251,191,36,0.6); }
.bulb.on.green { background: radial-gradient(circle at 30% 30%, #86efac, #22c55e); box-shadow: 0 0 8px rgba(34,197,94,0.55); }

.verdict {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.verdict .main {
  font-size: 22px;
  font-weight: 700;
}

.verdict .hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.checkTable {
  background: #0c1324;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.checkRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}

.checkRow .label {
  font-size: 14px;
  margin-bottom: 2px;
}

.checkRow .text {
  color: var(--muted);
  font-size: 13px;
}

.checkRow .icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0b1220;
}

.icon.match { background: var(--green); }
.icon.soft { background: var(--yellow); color: #1f2937; }
.icon.mismatch { background: var(--red); }
.icon.unknown { background: #4b5563; }

.footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.small-muted {
  color: var(--muted);
  font-size: 12px;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0b1220;
  color: var(--text);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.05);
}

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

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

  .traffic {
    flex-direction: row;
  }
}

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

  select, input[type="text"] {
    width: 100%;
  }

  .chips { flex-wrap: wrap; }
}
