/* Shared theme colours. Advertising layout lives separately in ads.css. */
:root {
    color-scheme: light;
    --bg: #f3f6fa; --surface: #ffffff; --soft: #eaf0f8;
    --text: #192b42; --muted: #586b82; --border: #d8e1ec;
    --accent: #245bcc; --accent-hover: #1948ad; --on-accent: #fff;
    --favourite: #fff3d5; --favourite-text: #805300;
    --playing-bg: #dceaff; --playing-border: #245bcc;
    --shadow: 0 6px 24px rgb(23 43 73 / 5%);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101722; --surface: #192332; --soft: #233147;
    --text: #ecf2fb; --muted: #a9b8cb; --border: #34445a;
    --accent: #96b9ff; --accent-hover: #b5ceff; --on-accent: #112547;
    --favourite: #3a3020; --favourite-text: #f5ce79;
    --playing-bg: #263f65; --playing-border: #96b9ff;
    --shadow: 0 6px 24px rgb(0 0 0 / 12%);
}
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 16px; line-height: 1.5; max-width: 800px; margin: 0 auto; padding: 24px 18px 40px; background: var(--bg); color: var(--text); }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.035em; min-width: 0; }
h1 span { display: block; font-size: 0.66em; letter-spacing: -0.015em; font-weight: 500; margin-top: 6px; color: var(--muted); }
h1, h2, h3, .status { overflow-wrap: anywhere; }
.header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; max-width: 100%; }
.header-logo { display: block; width: 80px; height: 80px; flex: 0 0 80px; object-fit: cover; border-radius: 14px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, input, select { font: inherit; border-radius: 10px; max-width: 100%; min-width: 0; }
button { padding: 11px 16px; min-height: 44px; border: 1px solid transparent; background: var(--accent); color: var(--on-accent); cursor: pointer; font-weight: 600; }
button:hover { background: var(--accent-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#theme-toggle, .info-button { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
#theme-toggle { font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
#theme-toggle[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); }
#theme-toggle:hover, .info-button:hover { background: var(--soft); }
.info-button { width: 44px; height: 44px; padding: 8px; }
.info-button span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; font-family: Georgia, serif; }
.controls, #search-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
#search-container { display: none; }
input, select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
input::placeholder { color: var(--muted); }
.controls select { flex: 1 1 220px; }
#load-btn { flex: 0 1 auto; }
#search-container > * { flex: 1 1 220px; }
#favorites-section { display: none; margin-bottom: 24px; padding: 18px; background: var(--soft); border: 1px solid var(--border); border-radius: 16px; }
#favorites-section h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.station-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
#station-container { max-height: 520px; overflow-y: auto; padding: 2px 4px 6px 2px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.station-item { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.station-item:hover { border-color: var(--accent); }
.station-item.is-playing { border: 2px solid var(--playing-border); background: var(--playing-bg); box-shadow: inset 6px 0 0 var(--playing-border); }
.station-item.is-playing .station-playback-status { display: inline-block; padding: 3px 10px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; }
.station-playback-status { margin-top: 6px; color: var(--accent); font-size: 14px; font-weight: 600; }
.station-info { flex: 1 1 140px; min-width: 0; }
.station-name { font-size: 16px; font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.station-tags { font-size: 13px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; margin-left: auto; }
.btn-group button { min-width: 44px; min-height: 44px; padding: 10px 12px; overflow-wrap: anywhere; }
button.fav-btn { background: var(--favourite); color: var(--favourite-text); }
button.fav-btn:hover { border-color: var(--favourite-text); }
button.fav-btn.unfav { background: var(--soft); color: var(--text); }
#player-container { padding: 20px; margin: 20px 0; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow); }
#now-playing { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
#audio-player { display: block; width: 100%; max-width: 100%; min-width: 0; }
.status { color: var(--muted); font-size: 14px; margin: 16px 0; }
.info-dialog { width: 540px; max-width: calc(100% - 30px); max-height: 85vh; max-height: 85dvh; overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.info-dialog::backdrop { background: rgb(5 12 23 / 65%); }
.info-dialog h2 { margin: 0 0 16px; font-size: 22px; }
.info-dialog h3 { margin: 20px 0 8px; font-size: 18px; }
.info-dialog p { margin: 0 0 14px; line-height: 1.65; }
.info-dialog form { margin-top: 20px; text-align: right; }
@media (max-width: 479px) {
    .header-brand { gap: 10px; }
    .header-logo { width: 56px; height: 56px; flex-basis: 56px; border-radius: 10px; }
    body { padding: 16px 12px 28px; }
    .page-heading { gap: 14px; margin-top: 0; padding-bottom: 18px; }
    #load-btn { width: 100%; }
    #favorites-section { padding: 12px; }
    .station-item { padding: 12px; }
}
