@font-face {
  font-family: 'Inter Widget';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0b0f0d;
  --surface: #141a17;
  --surface-2: #1b2320;
  --line: #2b3632;
  --text: #edf3ef;
  --muted: #9fb0a8;
  --accent: #3ffc97;
  --accent-ink: #03160b;
  --danger: #ff6b7a;
  --focus: #8fd3ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 'Inter Widget', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.dock {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 18px;
}

h1 { margin: 0; font-size: 18px; font-weight: 800; }
h2 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

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

.health { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.health.bad { color: var(--danger); }

.onair {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'sym price' 'status status';
  gap: 4px 12px;
  align-items: baseline;
}
.onair-symbol { grid-area: sym; font-size: 26px; font-weight: 800; }
.onair-price { grid-area: price; justify-self: end; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.onair-price .up { color: var(--accent); }
.onair-price .down { color: var(--danger); }
.onair-status { grid-area: status; color: var(--muted); font-size: 13px; letter-spacing: 0.06em; }

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

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

button {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 700;
  cursor: pointer;
}
button:hover { border-color: #46564f; }
button[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: 0.55; cursor: progress; }

input,
select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f1412;
}
input[readonly] { color: var(--muted); font-size: 13px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; }
.stack { display: grid; gap: 6px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.grid2 label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
label { font-size: 13px; color: var(--muted); }
section > label { display: block; margin: 10px 0 6px; }

.message { min-height: 1.45em; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.message.ok { color: var(--accent); }
.message.bad { color: var(--danger); }

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

.seg {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.seg + .hint { margin-bottom: 12px; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

details { margin-top: 12px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.check input { width: auto; min-height: 0; }

.preview {
  position: relative;
  margin-top: 10px;
  width: 100%;
  aspect-ratio: 1920 / 824;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #000;
}
.preview iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 824px;
  border: 0;
  transform-origin: 0 0;
  transform: scale(var(--preview-scale, 0.2));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
