:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #171a1c;
  --muted: #5d6673;
  --line: #dce2e8;
  --accent: #12646f;
  --accent-strong: #0b4d57;
  --accent-soft: #e8f4f5;
  --warning: #8a5a00;
  --warning-bg: #fff4d8;
  --danger: #b42318;
  --danger-bg: #fff0ed;
  --shadow: 0 20px 55px rgba(23, 26, 28, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(18, 100, 111, 0.08), rgba(18, 100, 111, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 32px 0 24px;
}

.hero {
  padding: 8px 0 22px;
}

.brand {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 8px;
  font-size: clamp(2.15rem, 1.75rem + 1.6vw, 3.35rem);
  line-height: 1.05;
}

.intro {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.test-panel {
  overflow: hidden;
  border: 1px solid rgba(18, 100, 111, 0.16);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.safety-note {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--warning);
  font-size: 0.98rem;
}

.volume-control {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.volume-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-weight: 800;
}

.volume-label-row output {
  color: var(--accent);
}

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

.volume-control p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status {
  min-height: 48px;
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.test-group {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.test-group:last-child {
  border-bottom: 0;
}

.test-group h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.25;
}

.test-copy {
  display: grid;
  gap: 6px;
}

.test-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.button-row,
.frequency-grid,
.sweep-grid {
  display: grid;
  gap: 10px;
}

.button-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.frequency-panel {
  display: grid;
  gap: 18px;
}

.frequency-band {
  display: grid;
  gap: 10px;
}

.frequency-band h4 {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.2;
}

.frequency-band p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.sweep-grid {
  grid-template-columns: 1fr;
}

.button {
  min-height: 54px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(18, 100, 111, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
  border-color: rgba(18, 100, 111, 0.48);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.button:active {
  transform: translateY(1px);
}

.button:focus-visible {
  outline: 3px solid rgba(18, 100, 111, 0.28);
  outline-offset: 3px;
}

.button-wide {
  background: var(--accent);
  color: #ffffff;
}

.button-wide:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.button-stop {
  border-color: rgba(180, 35, 24, 0.25);
  background: var(--danger-bg);
  color: var(--danger);
}

.button-stop:hover {
  border-color: rgba(180, 35, 24, 0.45);
  background: #ffe1dc;
  color: var(--danger);
}

.content-section {
  padding: 30px 0 0;
}

.content-section h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.25;
}

.content-section p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.faq {
  display: grid;
  gap: 10px;
}

.faq h2 {
  margin-bottom: 0;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

summary {
  min-height: 54px;
  padding: 15px 16px;
  cursor: pointer;
  font-weight: 800;
}

details p {
  padding: 0 16px 16px;
}

.footer {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 18px 0 34px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .site-shell {
    padding-top: 48px;
  }

  .panel-header {
    grid-template-columns: 1fr minmax(170px, 220px);
    align-items: center;
    padding: 24px;
  }

  .status,
  .volume-control,
  .test-group {
    padding-right: 24px;
    padding-left: 24px;
  }

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

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

@media (min-width: 900px) {
  .test-group {
    display: grid;
    grid-template-columns: 245px 1fr;
    gap: 18px;
    align-items: start;
  }

  .test-group h3 {
    margin-bottom: 0;
    padding-top: 0;
  }

  .test-copy {
    padding-top: 7px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
