/* ===========================================================================
   Mediabox Radio — skin-base.css — shared by all three looks (2026-09-29)
   Resets, the engine-only parking lot, and the state rules every look obeys:
   standby vs playing, the Stop label, the status line, reduced motion.
   Each look lives in its own file, scoped by html[data-skin="receiver"|"drive"|"ident"].

   PALETTE COVENANT (the owner has tritanomaly): no color with hue 33-66 deg,
   saturation >= 15 %, lightness 10-97 %. Warm roles are coral or red only.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
p, h1 { margin: 0; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* tuner.js writes these; each look shows their meaning elsewhere */
.engine-only { display: none; }

/* parts only the Receiver uses (meters, dial glass, lamps, knob, legend, listeners) */
:root:not([data-skin="receiver"]) .rx-only { display: none !important; }

/* skins.js swaps the hero in once it runs; until then the engine's own name shows */
.station-hero { display: none; }
.shell.fp-ready .station-engine { display: none; }
.shell.fp-ready .station-hero { display: block; }

/* standby and playing share one slot, so changing state never moves the page */
.shell:has(.pbtn.on) .standby { display: none; }
.shell:not(:has(.pbtn.on)) .now { display: none; }
.display-status:empty { display: none; }

/* the power key names its action: "Tune in" off, "Stop" on */
.pbtn-stop, .pbtn .ic-stop { display: none; }
.pbtn.on .pbtn-txt, .pbtn.on .ic-play { display: none; }
.pbtn.on .pbtn-stop, .pbtn.on .ic-stop { display: inline-block; }

/* where the browser ignores scripted volume (iOS), the page says so instead */
.vol-hint { display: none; }
.shell.no-volume .vslider { display: none; }
.shell.no-volume .vol-hint { display: block; }

/* the look switch: a real control in both looks */
.look { display: flex; }
.look-btn { min-height: 44px; }

/* ---------------------------------------------------------------------------
   W3 (2026-10-30): the controls the engine surfaces switch on, the recovery exit and the dialogs.
   Every new control ships with the hidden attribute in the page; skins.js removes it only where the window.__tuner
   surface it needs exists. Colors come from each look's own tokens (--w3-*): this file adds no color of its own except the
   neutral black of the dialog backdrop. Every new control is at least 44 x 44 px in all three looks.
   --------------------------------------------------------------------------- */
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.w3-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--w3-edge, currentColor);
  border-radius: var(--w3-r, 6px);
  background: var(--w3-btn-bg, transparent);
  box-shadow: var(--w3-btn-shadow, none);
  color: var(--w3-btn-ink, inherit);
  font-family: var(--w3-font, inherit);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.w3-btn:active { transform: translateY(1px); }
.w3-btn:disabled { opacity: 0.55; cursor: default; }

/* the tools row sits under the volume row; the stale-info notice and the confirmations share it */
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.tools-msg { flex: 1 1 100%; min-width: 0; text-align: center; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.tools-msg:empty { margin-top: -8px; }   /* an empty confirmation line adds no gap under the keys, and stays in the page for readers */
.stale { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.stale-text { font-size: 13px; line-height: 1.3; }

/* FE-35: the recovery exit takes the place of the track lines inside the fixed status slot, so nothing moves */
.recovery { padding: 3px; }
.recovery-time { margin-bottom: 3px; overflow: hidden; font-size: 12px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.recovery-actions { display: flex; gap: 8px; }
.rec-btn { flex: 1 1 0; padding: 3px 8px; font-size: 12px; letter-spacing: 0.03em; }
.rec-btn:focus-visible { outline-offset: 0 !important; }   /* the ring stays inside the slot's 3 px of room */
#recoveryOther { flex-grow: 1.7; }   /* the longer label gets the wider key, so it wraps to two lines at most */
.shell[data-recovery="long"] .now { display: none; }
.shell:not(:has(.pbtn.on)) #detailsBtn { display: none; }

/* the dialogs: one frame for the guide (FE-37), the track details (FE-67, FE-40) and the sleep timer (FE-42) */
dialog.w3-dlg {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--w3-dlg-edge, currentColor);
  border-radius: var(--w3-dlg-r, 10px);
  background: var(--w3-dlg-bg, Canvas);
  color: var(--w3-dlg-ink, CanvasText);
  font-family: var(--w3-font, inherit);
  --w3-btn-ink: var(--w3-dlg-ink);
  --w3-edge: var(--w3-dlg-edge);
  --w3-btn-bg: var(--w3-dlg-btn-bg);
  --w3-btn-shadow: var(--w3-dlg-btn-shadow);
}
dialog.w3-dlg::backdrop { background: rgba(0, 0, 0, 0.62); }
.w3-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.w3-head h2 { margin: 0; font-size: 19px; line-height: 1.2; font-weight: 700; }
.w3-hint { margin-bottom: 10px; font-size: 13px; line-height: 1.35; color: var(--w3-dlg-ink-2, inherit); }
.w3-go { padding: 0 16px; }

.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.guide-row {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr) auto;
  grid-template-areas: "num name freq" "num desc desc";
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
  text-align: left;
  border: 1px solid var(--w3-dlg-edge, currentColor);
  border-radius: var(--w3-r, 6px);
  background: var(--w3-row-bg, transparent);
  color: var(--w3-dlg-ink, inherit);
  font-family: var(--w3-font, inherit);
  font-size: 14px;
  line-height: 1.25;
}
.guide-row .g-num { grid-area: num; font-weight: 700; font-variant-numeric: tabular-nums; }
.guide-row .g-name { grid-area: name; font-weight: 700; overflow-wrap: anywhere; }
.guide-row .g-freq { grid-area: freq; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.guide-row .g-desc { grid-area: desc; font-size: 12.5px; }
.guide-row[aria-pressed="true"] {
  background: var(--w3-sel-bg, transparent);
  color: var(--w3-sel-ink, inherit);
  box-shadow: inset 0 0 0 2px var(--w3-sel-edge, currentColor);
}
.guide-pick {
  position: sticky;
  bottom: 0;
  margin: 12px -16px -16px;
  padding: 12px 16px 16px;
  background: var(--w3-dlg-bg, Canvas);
  border-top: 1px solid var(--w3-dlg-edge, currentColor);
}
.guide-name { font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.guide-desc { margin: 2px 0 10px; font-size: 13px; line-height: 1.35; }
.guide-pick .w3-go { width: 100%; }

.details-fields { margin: 0 0 12px; }
.details-fields dt { margin-top: 10px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--w3-dlg-ink-2, inherit); }
.details-fields dd { margin: 2px 0 0; font-size: 18px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.details-old { margin-bottom: 12px; font-size: 13px; line-height: 1.35; color: var(--w3-note, inherit); }
.recent { margin-top: 18px; }
.recent h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--w3-dlg-ink-2, inherit); }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--w3-dlg-edge, currentColor);
}
.recent-text { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.recent-meta { grid-column: 1; font-size: 12px; color: var(--w3-dlg-ink-2, inherit); }
.recent-copy { grid-column: 2; grid-row: 1 / span 2; }
.recent-empty { padding: 8px 0; font-size: 13px; color: var(--w3-dlg-ink-2, inherit); }
#detailsCopy { width: 100%; }
.sleep-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.sleep-choices .w3-btn { padding: 0 6px; }
.sleep-remain { margin-bottom: 12px; font-size: 17px; font-variant-numeric: tabular-nums; }
#sleepCancel { width: 100%; }

@keyframes lamp-blink { 50% { opacity: 0.25; } }

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