@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f5f3ec;
  --panel: #fcfbf6;
  --well: #efeee5;
  --ink: #30382f;
  --muted: #73786b;
  --line: #dcded1;
  --green: #42654e;
  --green-dark: #314e3a;
  --green-pale: #e9eee3;
  --error: #a24535;
  --ui: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font: 14px/1.5 var(--ui);
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
body { min-width: 280px; margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 32px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); cursor: pointer; transition: background 120ms ease, border-color 120ms ease; }
button:hover:not(:disabled) { border-color: #b7c6af; background: var(--green-pale); }
button:active:not(:disabled) { background: #dce5d5; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: #d9e4cf; }

.app-shell { display: flex; flex-direction: column; width: min(760px, 100%); min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: 0 28px; }
.app-header { display: flex; align-items: center; gap: 25px; min-height: 86px; padding: 15px 0; border-bottom: 1px solid var(--line); }
h1 { margin: 0; font: 400 32px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.8px; }
.mode-switch { display: flex; flex-shrink: 0; gap: 1px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--well); }
.mode-switch button { min-height: 31px; padding: 5px 16px; border-color: transparent; background: transparent; color: var(--muted); font-size: 12px; }
.mode-switch button[aria-pressed="true"] { border-color: #d1d8c9; background: var(--panel); color: var(--green-dark); box-shadow: 0 1px 3px #2d3a2510; }
.stop-button { flex-shrink: 0; min-height: 29px; margin-left: auto; padding: 4px 10px; background: transparent; color: var(--muted); font-size: 11px; }
.playback-summary { min-height: 18px; margin: 11px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.error-message { margin: 7px 0 0; padding: 8px 10px; border: 1px solid #e4c7bf; border-radius: 5px; background: #faf0e9; color: var(--error); font-size: 12px; overflow-wrap: anywhere; }
.error-message:empty { display: none; }
.mode-panel { width: 100%; max-width: 640px; margin: 25px auto 28px; }

.station-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.station-button { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 86px; padding: 15px 13px; text-align: left; }
.station-button[aria-pressed="true"] { border-color: #94ac88; background: var(--green-pale); }
.station-symbol { display: grid; flex-shrink: 0; place-items: center; width: 31px; color: var(--green); font: 25px/1 Georgia, serif; }
.station-button > span:nth-child(2) { flex: 1; min-width: 0; }
.station-button strong { display: block; font-size: 13px; font-weight: 600; }
.station-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.station-action { max-width: 40px; color: var(--muted); font-size: 10px; text-align: right; }
.player-panel { min-width: 0; min-height: 158px; margin-top: 17px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.empty-player { display: grid; place-items: center; min-height: 118px; margin: 0; color: var(--muted); font-size: 12px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0; color: var(--muted); font: 600 10px/1.4 var(--ui); letter-spacing: .12em; text-transform: uppercase; }
.section-heading a { color: var(--muted); font-size: 11px; }
audio { display: block; width: 100%; height: 45px; margin: 0; }
.radio-feedback { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 27px; margin-top: 6px; }
#radio-status { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.text-button { min-height: 25px; padding: 3px 6px; border-color: transparent; background: transparent; color: var(--green); font-size: 11px; }
.station-select { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.station-select select { flex: 1; min-width: 0; max-width: 190px; min-height: 29px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); font-size: 12px; }
#radio.is-lofi { max-width: 704px; }
.lofi-embed { min-height: 70px; overflow-x: auto; overflow-y: hidden; border-radius: 5px; scrollbar-width: thin; scrollbar-color: #b7c6af transparent; }
.lofi-stage { position: relative; width: 640px; height: 92px; overflow: hidden; }
.lofi-embed iframe { position: absolute; top: 0; left: 0; display: block; width: 640px; height: 92px; border: 0; border-radius: 5px; transform-origin: top left; }
.player-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; }

.mixer-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.master-volume { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.master-volume input { width: 104px; }
input[type="range"] { display: block; min-width: 0; height: 19px; margin: 0; padding: 0; accent-color: var(--green); cursor: pointer; }
output { min-width: 29px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.sound-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.sound-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); transition: background 120ms ease, border-color 120ms ease; }
.sound-card.is-active { border-color: #94ac88; background: var(--green-pale); }
.sound-toggle { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 70px; padding: 16px 13px 12px; border: 0; border-radius: 0; background: transparent; text-align: left; }
.sound-toggle:hover:not(:disabled) { background: #dce5d550; }
.sound-toggle:focus-visible { position: relative; outline-offset: -4px; }
.sound-mark { display: grid; flex-shrink: 0; place-items: center; width: 28px; height: 28px; border: 1px solid #d3daca; border-radius: 50%; color: var(--green); font: 11px/1 var(--ui); }
.is-active .sound-mark { border-color: var(--green); background: var(--green); color: var(--panel); }
.sound-name { min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.is-pending .sound-mark { opacity: .55; }
.sound-level { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 0 14px 14px; }
.sound-level label { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.sound-level input { width: 100%; }
.ambient-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }

.app-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: auto; padding: 12px 0 14px; border-top: 1px solid var(--line); font-size: 11px; }
.app-footer > a { flex-shrink: 0; }
.app-footer a { color: var(--muted); }
.app-footer a:hover { color: var(--green); }
.source-notes { min-width: 0; text-align: right; }
.source-notes summary { width: fit-content; margin-left: auto; color: var(--muted); cursor: pointer; }
.source-notes > div { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }

@media (max-width: 600px) {
  .app-shell { padding-inline: 18px; }
  .app-header { min-height: 76px; gap: 17px; }
  h1 { font-size: 28px; }
  .mode-switch button { padding-inline: 12px; }
  .station-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .station-button { min-height: 67px; padding-block: 12px; }
  .station-action { max-width: none; }
  .sound-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
}

@media (max-width: 400px) {
  .app-shell { padding-inline: 12px; }
  .app-header { gap: 11px; }
  .mode-switch button { padding-inline: 9px; }
  .stop-button { padding-inline: 7px; }
  .player-panel { padding: 15px 13px; }
  .mode-panel { margin-top: 19px; }
  .sound-toggle { gap: 8px; padding-inline: 10px; }
  .sound-name { font-size: 12px; }
  .sound-level { padding-inline: 11px; }
}

.embedded .app-shell { padding-inline: 12px; }
.embedded .app-header { min-height: 48px; padding-block: 7px; gap: 10px; }
.embedded h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.embedded .mode-switch button { min-height: 26px; padding-block: 3px; }
.embedded .playback-summary { margin-top: 7px; font-size: 10px; }
.embedded .mode-panel { margin-top: 16px; margin-bottom: 21px; }
.embedded .station-button { min-height: 67px; padding-block: 11px; }
.embedded .player-panel { margin-top: 12px; padding: 14px; }
.embedded .sound-toggle { min-height: 61px; padding-top: 12px; }
.embedded .sound-level { padding-bottom: 11px; }
.embedded .app-footer { padding-block: 9px; }

@media (prefers-reduced-motion: reduce) {
  button, .sound-card { transition: none; }
}
