:root {
  color-scheme: dark;
  font: 1rem/1.45 system-ui, sans-serif;
  color: #e6ebe9;
  background: #111516;
  --metal: #242a2c;
  --edge: #414a4c;
  --muted: #a9b5b6;
  --screen: #0a1516;
  --accent: #9af4d5;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 50% 0, #293032, #111516 65rem); min-height: 100vh; }
main { width: min(100% - 2.5rem, 83rem); margin: 0 auto; padding: 2.2rem 0; }
.site-header { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: .6rem 2rem; margin-bottom: 1.3rem; }
.site-header h1 { margin: .35rem 0 .12rem; font-size: clamp(1.65rem, 4vw, 2.6rem); letter-spacing: -.045em; line-height: 1.1; }
.site-header p { margin: 0; color: var(--muted); font-size: .9rem; }
.site-header .shared { max-width: 28rem; }
a { color: var(--accent); text-underline-offset: .22em; font-size: .85rem; }
.receiver-bank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.15rem; }
.radio {
  border: 1px solid #596468;
  border-radius: 14px;
  padding: clamp(.8rem, 2.2vw, 1.5rem);
  background: linear-gradient(#2c3336, var(--metal) 24rem);
  box-shadow: inset 0 1px 0 #ffffff19, 0 10px 24px #0005, 0 4px 0 #0c1011;
  min-width: 0;
}
.radio[data-radio="2"] { --accent: #f3cf84; }
.faceplate { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.faceplate h2 { margin: 0; font-size: clamp(.86rem, 2vw, 1rem); font-weight: 750; letter-spacing: .08em; }
.faceplate h2 span { color: var(--muted); margin-left: .45rem; letter-spacing: .03em; font-size: .77em; font-weight: 600; }
.rx-indicator { display: flex; align-items: center; gap: .4rem; color: var(--muted); font: 700 .75rem Consolas, monospace; }
.rx-indicator::before { content: ''; width: .48rem; height: .48rem; border-radius: 50%; background: #667375; box-shadow: 0 0 0 2px #0d1416; }
.receiving .rx-indicator::before { background: var(--accent); box-shadow: 0 0 .55rem var(--accent); }
.display {
  border: 1px solid #070f10;
  border-radius: 8px;
  box-shadow: inset 0 2px 10px #0009, 0 1px 0 #ffffff28;
  background: radial-gradient(ellipse at 23% 110%, #203637, var(--screen) 80%);
  padding: .85rem clamp(.7rem, 2vw, 1.2rem);
  color: var(--accent);
  font-family: Consolas, 'Courier New', monospace;
}
.display-top, .display-bottom { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.display-top { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #b1c4c2; }
.dial { display: flex; align-items: baseline; gap: .4rem; margin: .65rem 0; white-space: nowrap; }
.dial > span:first-child { font-size: clamp(1.8rem, 4.85vw, 4.7rem); font-weight: 600; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.dial .dial-digit {
  display: inline; width: auto; min-height: 0; padding: 0; border: 0; border-radius: 3px;
  background: transparent; color: inherit; box-shadow: none; font: inherit; letter-spacing: inherit;
  cursor: ns-resize;
}
.dial .dial-digit:hover { background: #ffffff15; }
.dial .dial-digit[aria-pressed="true"] { background: var(--accent); color: #10201e; }
.dial .dial-digit:active { transform: none; }
.unit { font-size: .78rem; letter-spacing: .06em; }
.waterfall { margin: .15rem 0 .65rem; }
.waterfall-plot { position: relative; border: 1px solid #344748; border-radius: 3px; overflow: hidden; background: #070f17; }
.waterfall canvas { display: block; width: 100%; height: 56px; }
.waterfall-cursor { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #e5f5ed55; pointer-events: none; }
.waterfall-idle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: .1rem .3rem; background: #091417e8; color: #bac9c6; white-space: nowrap; font-size: .7rem; }
.waterfall-scale { display: grid; grid-template-columns: 1fr auto 1fr; margin-top: .2rem; gap: .25rem; color: #b1c4c2; font-size: .66rem; }
.waterfall-scale span:last-child { text-align: right; }
.mode { font-size: .88rem; border: 1px solid currentColor; border-radius: 3px; padding: .05rem .3rem; }
.s-meter { display: flex; align-items: center; gap: .4rem; font-size: .73rem; }
.s-meter meter { width: clamp(3.75rem, 11vw, 8rem); }
.s-meter meter::-webkit-meter-bar { border-radius: 2px; }
.s-meter meter::-webkit-meter-optimum-value {
  background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 7px);
}
.rf-reading { min-width: 5ch; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audio-level { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; gap: .55rem; }
meter { width: clamp(3.6rem, 11vw, 9rem); height: .65rem; }
meter::-webkit-meter-bar { background: #2a3a3a; border: 0; border-radius: 1px; }
meter::-webkit-meter-optimum-value { background: var(--accent); }
meter::-moz-meter-bar { background: var(--accent); }
form, .audio { display: grid; grid-template-columns: minmax(0,1fr) minmax(4.7rem,.47fr); gap: .65rem; align-items: end; }
form { margin: .95rem 0 0; }
.tune-frequency { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem; }
label { display: grid; gap: .23rem; min-width: 0; font-size: .78rem; color: #c7cfce; }
button, input, select { min-width: 0; font: inherit; }
button, input[type="number"], select {
  width: 100%;
  min-height: 2.45rem;
  padding: .32rem .52rem;
  border: 1px solid #505b5e;
  border-radius: 5px;
  background: #171c1d;
  color: #edf1ef;
}
button {
  cursor: pointer;
  box-shadow: 0 2px 0 #111718;
  background: linear-gradient(#3b4346, #292f32);
  font-size: .84rem;
  font-weight: 650;
}
button:active { transform: translateY(1px); box-shadow: 0 1px 0 #111718; }
button:disabled { cursor: default; opacity: .55; }
button[id^="listen-"] { width: auto; min-width: 5.4rem; color: #111b19; background: var(--accent); border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.band-tuner, .presets { grid-column: 1 / -1; }
.band-tuner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: .2rem .75rem; align-items: end; border-bottom: 1px solid var(--edge); padding: .1rem 0 .6rem; }
.band-readout, .band-scale { display: flex; justify-content: space-between; align-items: center; gap: .3rem; }
.band-readout output { font: .77rem Consolas, monospace; color: var(--accent); }
.band-scale { grid-column: 2; color: var(--muted); font: .66rem/1.2 Consolas, monospace; }
.band-track input { margin: .1rem 0; min-height: 1.55rem; cursor: ew-resize; }
.vfo-step { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1fr) 2.6rem 2.6rem; align-items: end; gap: .4rem; }
.vfo-step button { font-size: 1.15rem; padding: 0; }
.audio { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-top: .75rem; margin-top: .9rem; border-top: 1px solid var(--edge); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.message { margin: .55rem 0 0; min-height: 1.2em; color: var(--accent); font-size: .8rem; }
details { margin-top: .62rem; font-size: .82rem; }
summary { cursor: pointer; }
details[id^="listening-controls-"] { padding: .55rem .7rem; background: #191e20; border: 1px solid var(--edge); border-radius: 5px; }
.audio-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: .65rem .85rem; margin-top: .65rem; }
.audio-options output { color: var(--accent); margin-left: .25rem; font-variant-numeric: tabular-nums; }
.audio-options .audio-check { display: flex; align-items: center; gap: .4rem; }
.audio-options input[type="range"], .audio input[type="range"] { margin: 0; }
.coverage { color: var(--muted); border-top: 1px solid var(--edge); padding-top: .55rem; }
.coverage ul { padding-left: 1.1rem; }
@media (max-width: 720px) {
  main { width: min(100% - 1.4rem, 35rem); padding: 1rem 0 2rem; }
  .receiver-bank { grid-template-columns: minmax(0, 1fr); }
  .dial > span:first-child { font-size: clamp(2rem, 9.6vw, 4.25rem); }
}
@media (max-width: 370px) {
  .tune-frequency { grid-column: 1 / -1; }
  form { grid-template-columns: minmax(0, 1fr); }
  .band-tuner { grid-template-columns: minmax(0, 1fr); }
  .band-scale { grid-column: 1; }
}
