/* Adapted from src/studio/studio.css in the project repository.
   Look: a car dashboard at night. Black page, signal red needle, amber readouts, condensed type. */
html { font-size: 17px; }
:root {
  color-scheme: dark;
  font-family: "Ubuntu", "Roboto Condensed", "Arial Narrow", "DejaVu Sans", system-ui, sans-serif;
  font-stretch: 75%;
  background: #0b0b0d;
  color: #f2f2f2;
  --panel: #17171b;
  --field: #101013;
  --muted: #b4b4bb;
  --line: #34343b;
  --accent: #ff3b30;
  --amber: #ff9f0a;
  --rec: #ff9f0a;
  --on-accent: #0b0b0d;
  --warn: #ff9f0a;
}
* { box-sizing: border-box; }
body { margin: 0 auto; padding: 28px clamp(14px, 5vw, 70px) 60px; max-width: 1440px; line-height: 1.45; }
header, .heading, .speed-label, .actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); align-items: flex-start; flex-wrap: wrap; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }
h1 { font-size: clamp(28px, 5vw, 44px); letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
h2 { font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
h4 { font-size: .92rem; margin: 16px 0 6px; }
p + p, p + .tablewrap, .tablewrap + p, p + pre, p + audio, p + .actions, p + dl { margin-top: 10px; }
.lede { color: var(--muted); max-width: 60ch; margin-top: 10px; }
.section-label { display: block; margin-bottom: 6px; color: var(--accent); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.small, .note, .scale, .readings, .actions { font-size: .88rem; }
.small, .note { color: var(--muted); }
a, button { border-radius: 6px; padding: 8px 12px; font: inherit; text-decoration: none; cursor: pointer; }
a { color: var(--amber); border: 1px solid var(--line); }
p a, td a, li a { padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
button { color: var(--on-accent); background: var(--accent); border: 1px solid transparent; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
button[aria-pressed=true] { background: var(--amber); }
button:disabled { cursor: wait; opacity: .66; }
code { font-family: ui-monospace, monospace; font-size: .86em; color: var(--amber); overflow-wrap: anywhere; }
input, select, textarea { font: inherit; accent-color: var(--accent); }
input[type=number], select, textarea { border: 1px solid var(--line); background: var(--field); color: inherit; border-radius: 5px; padding: 6px 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.notice { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: clamp(14px, 2.3vw, 24px); margin-bottom: 16px; }
.notice h2 { margin-bottom: 12px; }
.notice h3 { margin: 0 0 6px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.two > div { border-radius: 9px; padding: 12px 14px; border: 1px solid var(--line); }
.two .live { border-left: 5px solid var(--accent); }
.two .recorded { border-left: 5px solid var(--rec); }
.notice ul { padding-left: 1.1em; display: grid; gap: 5px; font-size: .95rem; }
.notice .small { margin-top: 12px; }

main { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cluster, .layer-section, .wide { grid-column: 1 / -1; }
.cluster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: clamp(14px, 2vw, 20px); min-width: 0; }
.tag { display: inline-block; align-self: flex-start; margin-bottom: 8px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; }
.live-tag { color: var(--on-accent); background: var(--accent); }
.rec-tag { color: var(--on-accent); background: var(--rec); }
.actions { justify-content: flex-start; flex-wrap: wrap; }
#audio-status[data-warn=true], #design-status[data-refused=true] { color: var(--warn); }

.dial { display: flex; flex-direction: column; }
.dial h2 { margin-bottom: 0; color: var(--muted); }
.gauge { position: relative; margin: 0 auto; width: 100%; max-width: 246px; }
.gauge svg { height: auto; }
.gauge .track { fill: none; stroke: var(--line); stroke-width: 6; stroke-linecap: round; }
.gauge .fill { fill: none; stroke: var(--amber); stroke-width: 6; stroke-linecap: round; }
.gauge .tick { stroke: var(--muted); stroke-width: 1.5; }
.gauge .tick.major { stroke: #f2f2f2; stroke-width: 2.5; }
.gauge text { fill: var(--muted); font-size: 12px; text-anchor: middle; dominant-baseline: central; }
.gauge .needle { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.gauge .hub { fill: var(--panel); stroke: var(--accent); stroke-width: 3; }
/* No sweep animation: a picture taken just after a reading changes must show the needle at the new reading. */
.gauge .rotor { transform-origin: 120px 120px; }
.readout { position: absolute; left: 0; right: 0; top: 66%; text-align: center; display: grid; justify-items: center; pointer-events: none; }
.readout strong { color: var(--amber); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readout span { color: var(--muted); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.speed-label { margin: 8px 0 6px; font-size: .88rem; }
output, .signal strong { color: var(--amber); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; margin: 2px 0 8px; display: block; cursor: pointer; }
.scale { display: flex; justify-content: space-between; gap: 3px; color: var(--muted); }
.signal { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.dial .signal { margin-top: auto; }
.signal span { color: var(--muted); font-size: .86rem; letter-spacing: .06em; text-transform: uppercase; }
.signal strong { font-size: 1.2rem; }

.spectrum { display: flex; flex-direction: column; }
.heading { flex-wrap: wrap; }
.spectrum .heading { margin-bottom: 10px; }
#source { color: var(--amber); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.plot { background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.spectrum .plot { flex: 1; display: flex; flex-direction: column; justify-content: center; }
svg { display: block; width: 100%; }
#spectrum { height: 168px; }
svg line { stroke: var(--line); }
svg rect { fill: var(--amber); }
.note { margin-top: 9px; }

.layer-section { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 2px; }
.layer-section h2 { color: var(--accent); }
#layers { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
#layers li { display: grid; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 7px 14px; font-size: .95rem; }
#layers li[data-kind=noise] { border-left-color: var(--amber); }
#layers b { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; color: var(--muted); }
#layers span { font-variant-numeric: tabular-nums; }
#layers-note { flex-basis: 100%; }

.inputs { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 16px; margin: 16px 0; }
.inputs label { display: grid; gap: 5px; font-size: .86rem; }
.inputs .ready { display: flex; align-items: center; min-height: 32px; gap: 6px; }
.inputs input[type=range] { width: 150px; }
.readings > div { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.readings dt, .note { color: var(--muted); }
.readings dd { text-align: right; }
.readings + .small { margin-top: 10px; }
.design .heading { margin-bottom: 13px; }
.preset { font-size: .88rem; }
textarea { display: block; width: 100%; resize: vertical; font-family: ui-monospace, monospace; font-size: .83rem; line-height: 1.48; }
.design .actions { margin-top: 10px; }
.design .small { margin-top: 8px; }
.market h2 { margin-top: 2px; font-size: 1.25rem; text-transform: none; letter-spacing: 0; }
.market .readings { margin-top: 14px; }
#rules dd[data-open=true] { color: var(--muted); font-style: italic; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 7px 10px 7px 0; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
td.num, th.num { text-align: right; }
#compare td[data-match=yes] { color: var(--amber); }
#compare td[data-match=no] { color: var(--warn); }
.log { margin: 10px 0 0; padding: 10px 12px; background: var(--field); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; font-family: ui-monospace, monospace; font-size: .8rem; line-height: 1.5; white-space: pre; }
audio { width: 100%; max-width: 520px; display: block; margin-top: 8px; }

.recordings { margin-top: 28px; display: grid; gap: 14px; }
.recordings > .note { margin: 0; max-width: 80ch; }
.limits { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 10px; max-width: 80ch; }

@media (max-width: 960px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .cluster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .spectrum { grid-column: 1 / -1; order: 3; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .cluster { grid-template-columns: minmax(0, 1fr); }
  .plot .scale { font-size: .7rem; }
  .inputs input[type=range] { width: 120px; }
}
