:root {
  --bg: #071223;
  --panel: rgba(10, 21, 40, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #e8f0ff;
  --muted: #9db0d0;
  --accent: #ef4444;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(239, 68, 68, 0.2), transparent 24%),
    radial-gradient(circle at 85% 12%, rgba(56, 189, 248, 0.18), transparent 22%),
    linear-gradient(180deg, #091427 0%, #071223 100%);
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.control-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 32px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1;
}

.intro {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}

.control-panel {
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.control-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.control-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c7d7f3;
}

.input-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
}

.stepper,
input[type="number"] {
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 24px;
}

.stepper {
  cursor: pointer;
}

input[type="number"] {
  width: 100%;
  padding: 0 16px;
  text-align: center;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.panel {
  padding: 28px;
  margin-top: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.address-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.address-chip strong {
  color: var(--text);
  font-size: 22px;
}

.dip-board {
  position: relative;
  padding: 26px 18px 22px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2467c8 0%, #0e4aab 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.dip-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 26%);
  pointer-events: none;
}

.dip-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.switch-row {
  display: grid;
  grid-template-columns: repeat(10, minmax(58px, 1fr));
  gap: 10px;
}

.switch-cell {
  text-align: center;
}

.switch-shell {
  position: relative;
  width: 100%;
  height: 124px;
  padding: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #111827 0%, #030712 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.switch-shell:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.switch-knob {
  position: absolute;
  left: 50%;
  top: 54px;
  width: 64%;
  height: 48%;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(180deg, #ffffff 0%, #d4dae5 100%);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: top 180ms ease, background 180ms ease;
}

.switch-shell.is-on .switch-knob {
  top: 12px;
  background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%);
}

.switch-number {
  margin-top: 10px;
  font-weight: 700;
  color: white;
}

.switch-weight {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.explanation p {
  color: var(--muted);
  line-height: 1.7;
}

.active-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.active-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.active-list li strong {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.active-list li.on strong {
  color: #fca5a5;
}

.active-list li.off strong {
  color: #93a4c0;
}

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

  .switch-row {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
  }

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

@media (max-width: 640px) {
  .app {
    padding-inline: 14px;
  }

  .hero-copy,
  .control-panel,
  .panel {
    padding: 20px;
  }

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

  .dip-board {
    padding: 14px 8px 12px;
  }

  .dip-header {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .switch-row {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
  }

  .switch-shell {
    height: 58px;
    border-radius: 4px;
  }

  .switch-knob {
    top: 30px;
    width: 72%;
    height: 36%;
    border-radius: 3px;
  }

  .switch-shell.is-on .switch-knob {
    top: 6px;
  }

  .switch-number {
    margin-top: 6px;
    font-size: 10px;
  }

  .switch-weight {
    margin-top: 2px;
    font-size: 9px;
  }

  .active-list {
    grid-template-columns: 1fr;
  }
}
