/* Ahenq Unified — DESIGN-WEB-02 foundation. Brand palette from the landing page;
   semantic interaction colors are theme-specific for accessible contrast. */
:root {
  color-scheme: dark;
  --brand-midnight: #0a0f1c;
  --brand-blue: #66b6ff;
  --brand-sky: #6cd0ff;
  --brand-aqua: #4fe0d6;
  --page: #0a0f1c;
  --surface: #111d30;
  --surface-raised: #16243a;
  --surface-soft: #192a42;
  --text: #eef3ff;
  --muted: #aab9cd;
  --quiet: #9eacbf;
  --line: #293a52;
  --line-strong: #526882;
  --accent: #6cd0ff;
  --accent-hover: #9be0ff;
  --accent-ink: #0b1727;
  --error: #ffa49b;
  --success: #77dec0;
  --shadow: 0 20px 70px #00000029;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f2f5fa;
  --surface: #ffffff;
  --surface-raised: #f5f8fc;
  --surface-soft: #e9eff7;
  --text: #142239;
  --muted: #53647b;
  --quiet: #586980;
  --line: #dce4ef;
  --line-strong: #8799b1;
  --accent: #0067b8;
  --accent-hover: #005494;
  --accent-ink: #ffffff;
  --error: #ae342b;
  --success: #176c55;
  --shadow: 0 20px 70px #192a4212;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]), :root[data-theme="system"] {
    color-scheme: light;
    --page: #f2f5fa;
    --surface: #ffffff;
    --surface-raised: #f5f8fc;
    --surface-soft: #e9eff7;
    --text: #142239;
    --muted: #53647b;
    --quiet: #586980;
    --line: #dce4ef;
    --line-strong: #8799b1;
    --accent: #0067b8;
    --accent-hover: #005494;
    --accent-ink: #ffffff;
    --error: #ae342b;
    --success: #176c55;
    --shadow: 0 20px 70px #192a4212;
  }
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); transition: background-color .22s ease, color .22s ease; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .58; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
::selection { color: var(--accent-ink); background: var(--accent); }
.app-shell { min-height: 100dvh; padding-bottom: 142px; }
.app-header { height: 78px; padding: 0 max(42px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; gap: 58px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 90%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); }
.brand { color: var(--text); font-size: 30px; font-weight: 780; letter-spacing: -2.5px; line-height: 1; text-decoration: none; }
.brand span { color: var(--accent); }
.primary-nav { height: 100%; display: flex; align-items: center; }
.nav-link { height: 100%; padding: 0 2px; display: inline-flex; gap: 9px; align-items: center; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 640; position: relative; }
.nav-link::after { content: ""; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent); }
.nav-glyph { color: var(--accent); font-size: 16px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.preview-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; letter-spacing: .01em; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 12px; transition: border-color .2s, background-color .2s; }
.theme-toggle:hover { border-color: var(--line-strong); background: var(--surface-raised); }
.theme-toggle > span:first-child { color: var(--accent); font-size: 16px; }
.content { width: min(1110px, calc(100% - 88px)); margin: 0 auto; }
.discover-intro { min-height: 300px; margin: 26px 0 48px; padding: 47px 62px; display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; position: relative; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(ellipse at 75% 55%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 49%), linear-gradient(116deg, var(--surface) 17%, var(--surface-raised) 100%); }
.intro-copy { position: relative; z-index: 2; }
.eyebrow { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .17em; line-height: 1.5; }
.eyebrow-mark { margin-right: 7px; color: var(--accent); font-size: 13px; }
.discover-intro h1 { margin: 16px 0 12px; max-width: 600px; font-size: clamp(47px, 6vw, 73px); font-weight: 610; letter-spacing: -.075em; line-height: .99; }
.mobile-break { display: none; }
.intro-description { max-width: 410px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.intro-orbit { width: 226px; height: 226px; flex: 0 0 226px; margin-right: 55px; position: relative; display: grid; place-items: center; }
.orbit { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 50%; position: absolute; transform: rotate(-24deg); }
.orbit-one { width: 190px; height: 112px; }
.orbit-two { width: 112px; height: 190px; transform: rotate(58deg); }
.orbit-core { width: 78px; height: 78px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--accent), #298bbd); color: #0b1727; font-family: Georgia, serif; font-size: 39px; font-style: italic; box-shadow: 0 0 65px color-mix(in srgb, var(--accent) 20%, transparent); }
.orbit-star { position: absolute; color: var(--accent); }
.star-one { top: 18px; right: 26px; font-size: 19px; }
.star-two { bottom: 12px; left: 35px; color: var(--error); font-size: 17px; }
.discovery { padding-bottom: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.section-kicker { color: var(--accent); font-size: 9px; letter-spacing: .16em; }
.section-heading h2 { margin: 5px 0 0; font-size: 26px; font-weight: 590; letter-spacing: -.045em; }
.station-count { margin: 0 2px 3px 0; color: var(--muted); font-size: 12px; }
.search-form { height: 58px; display: flex; align-items: center; gap: 13px; padding: 5px 6px 5px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .18s, box-shadow .18s; }
.search-form:focus-within { border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.search-icon { margin-top: -3px; color: var(--muted); font-size: 29px; line-height: 1; transform: rotate(-20deg); }
.search-form input { width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search-form input::placeholder { color: var(--quiet); }
.search-form input:focus-visible { outline: none; }
.clear-search { width: 30px; height: 30px; flex: 0 0 30px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 19px; }
.search-submit { height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 12px; padding: 0 17px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; transition: background .2s, transform .2s; }
.search-submit:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.search-submit span:last-child { font-size: 16px; }
.filter-row { min-height: 62px; padding: 12px 0 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.filter-control { height: 36px; min-width: 145px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.filter-control:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-icon { color: var(--accent); font-size: 16px; line-height: 1; }
.language-icon { font-size: 13px; }
.genre-icon { font-size: 14px; }
.filter-control select { width: 100%; height: 100%; padding: 0 18px 0 0; appearance: none; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.filter-control select:focus-visible { outline: none; }
.filter-control option { background: var(--surface); color: var(--text); }
.select-chevron { position: absolute; right: 10px; top: 8px; pointer-events: none; color: var(--quiet); font-size: 13px; }
.reset-filters { padding: 8px 4px; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.reset-filters:hover { color: var(--text); }
.reset-filters span { font-size: 16px; }
.result-status { min-height: 20px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.filter-message { margin: 0 0 12px; color: var(--error); font-size: 12px; }
.station-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.station-card { min-width: 0; min-height: 111px; padding: 13px; display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .18s, background .18s, transform .18s; }
.station-card:hover { border-color: var(--line-strong); background: var(--surface-raised); transform: translateY(-1px); }
.station-card.is-active { border-color: color-mix(in srgb, var(--accent) 58%, var(--line)); background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%); }
.station-art { width: 67px; height: 67px; flex: 0 0 67px; display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid #ffffff12; border-radius: 9px; isolation: isolate; }
.station-art::before, .station-art::after { content: ""; position: absolute; z-index: -1; width: 90px; height: 90px; border: 1px solid #ffffff27; border-radius: 44% 56% 61% 39%; transform: rotate(32deg); }
.station-art::after { width: 55px; height: 55px; transform: rotate(-29deg); border-color: #ffffff24; }
.art-monogram { color: #ffffffeb; font-size: 19px; font-weight: 730; letter-spacing: -.06em; text-shadow: 0 1px 5px #0005; }
.art-0 { background: linear-gradient(145deg, #c36c54, #783b46); }
.art-1 { background: linear-gradient(145deg, #508a85, #244a54); }
.art-2 { background: linear-gradient(145deg, #9c8350, #564429); }
.art-3 { background: linear-gradient(145deg, #7784a6, #39435f); }
.art-4 { background: linear-gradient(145deg, #a27790, #5b3e62); }
.art-5 { background: linear-gradient(145deg, #718e50, #344d37); }
.station-details { min-width: 0; flex: 1; }
.station-details h3 { margin: 0 0 3px; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; letter-spacing: -.012em; text-overflow: ellipsis; white-space: nowrap; }
.station-origin { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.station-tags { margin-top: 8px; display: flex; gap: 5px; overflow: hidden; }
.station-tags span { max-width: 90px; overflow: hidden; padding: 2px 6px; border-radius: 4px; background: var(--surface-soft); color: var(--muted); font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.station-play { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--text); font-size: 10px; transition: color .18s, background .18s, border-color .18s, transform .18s; }
.station-play:hover, .station-play.selected-play { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); transform: scale(1.04); }
.mini-equalizer { height: 14px; display: flex; align-items: center; gap: 2px; }
.mini-equalizer i { width: 2px; height: 7px; border-radius: 2px; background: currentColor; animation: equalize .8s ease-in-out infinite alternate; }
.mini-equalizer i:nth-child(2) { height: 12px; animation-delay: -.3s; }
.mini-equalizer i:nth-child(3) { height: 5px; animation-delay: -.55s; }
.unavailable { flex: 0 0 auto; color: var(--quiet); font-size: 9px; line-height: 1.35; text-align: right; }
.empty-state { min-height: 250px; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--surface); text-align: center; }
.empty-orbit { color: var(--accent); font-size: 32px; }
.empty-state h3 { margin: 10px 0 3px; font-size: 18px; font-weight: 590; }
.empty-state p { max-width: 410px; margin: 0; color: var(--muted); font-size: 12px; }
.text-action { margin-top: 17px; padding: 9px 13px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface-raised); color: var(--text); font-size: 12px; }
.loading-grid { min-height: 235px; }
.station-skeleton { height: 111px; padding: 13px; display: grid; grid-template-columns: 67px 1fr; grid-template-rows: 18px 18px 18px; gap: 5px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.station-skeleton span { grid-row: 1 / 4; width: 67px; height: 67px; border-radius: 9px; background: var(--surface-soft); }
.station-skeleton i, .station-skeleton b { width: 76%; height: 10px; margin-top: 5px; border-radius: 5px; background: var(--surface-soft); }
.station-skeleton b { width: 52%; }
.attribution { max-width: 670px; margin: 28px auto 0; display: flex; align-items: start; justify-content: center; gap: 10px; color: var(--quiet); }
.attribution-mark { margin-top: 1px; color: var(--muted); font-size: 16px; }
.attribution p { margin: 0; font-size: 10px; line-height: 1.65; text-align: center; }
.attribution a { color: var(--muted); text-underline-offset: 2px; }
.player-dock { min-height: 94px; padding: 13px max(34px, calc((100vw - 1280px) / 2)); padding-bottom: max(13px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 48px minmax(190px, 1fr) minmax(220px, 390px) auto; align-items: center; gap: 15px; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.player-station-art { width: 45px; height: 45px; display: grid; place-items: center; position: relative; border-radius: 8px; background: linear-gradient(145deg, #194b82, #0b1727); color: #bde9ff; font-size: 21px; }
.player-pulse { position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--quiet); }
.state-live ~ .player-pulse { background: var(--success); }
.player-current { min-width: 0; display: grid; gap: 3px; }
.player-current strong { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.player-state { display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.player-state > i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--quiet); }
.player-state.state-live { color: var(--success); }
.player-state.state-live > i { background: var(--success); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 70%, transparent); }
.player-state.state-error { color: var(--error); }
.player-state.state-error > i { background: var(--error); }
.player-dock audio { width: 100%; height: 39px; opacity: .85; }
.player-actions { display: flex; align-items: center; gap: 8px; }
.player-control { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text); font-size: 13px; transition: border-color .18s, background .18s; }
.player-control:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
.player-control.primary-control { width: 42px; height: 42px; border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-size: 14px; }
.player-control.primary-control:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.pwa-status { position: relative; z-index: 40; min-height: 42px; padding: 9px max(16px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-raised); color: var(--text); font-size: 12px; line-height: 1.5; text-align: center; }
.pwa-status[hidden] { display: none; }
.pwa-action { min-height: 38px; padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--page); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; }
.pwa-action:hover { border-color: var(--accent); }
.pwa-action:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sync-privacy-note { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.6; }
@media (display-mode: standalone) { .app-header { padding-top: env(safe-area-inset-top); height: calc(70px + env(safe-area-inset-top)); } }
@media (max-width: 600px) { .pwa-status { padding: 9px 14px; font-size: 11px; } .pwa-action { min-height: 44px; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes equalize { from { transform: scaleY(.42); } to { transform: scaleY(1); } }
@media (max-width: 940px) {
  .app-header { padding: 0 28px; gap: 37px; }
  .content { width: calc(100% - 56px); }
  .discover-intro { padding: 40px 42px; }
  .intro-orbit { margin-right: 8px; transform: scale(.85); }
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-dock { padding-left: 24px; padding-right: 24px; grid-template-columns: 45px minmax(140px, 1fr) minmax(170px, 35%) auto; gap: 11px; }
  .player-actions { gap: 5px; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 75px; }
  .app-shell { padding-bottom: 177px; }
  .app-header { height: 64px; padding: 0 18px; gap: 12px; }
  .brand { font-size: 27px; }
  .primary-nav { gap: 9px; }
  .nav-link { gap: 0; padding: 0 3px; font-size: 0; }
  .nav-glyph { font-size: 17px; }
  .header-actions { gap: 8px; }
  .preview-label { display: none; }
  .theme-toggle { width: 38px; height: 38px; min-height: 38px; padding: 0; font-size: 0; }
  .theme-toggle > span:first-child { font-size: 17px; }
  .theme-toggle-label { display: none; }
  .content { width: calc(100% - 36px); }
  .discover-intro { min-height: 245px; margin: 18px 0 35px; padding: 30px 25px; border-radius: 15px; }
  .discover-intro h1 { margin-top: 13px; font-size: clamp(47px, 12vw, 62px); }
  .intro-description { max-width: 300px; font-size: 12px; }
  .intro-orbit { width: 110px; height: 130px; flex-basis: 110px; margin: 0 -19px 0 -40px; opacity: .63; transform: scale(.62); }
  .orbit-one { width: 185px; height: 108px; }
  .orbit-two { width: 108px; height: 185px; }
  .orbit-core { width: 75px; height: 75px; }
  .section-heading { margin-bottom: 14px; }
  .section-heading h2 { font-size: 22px; }
  .section-kicker { font-size: 8px; }
  .station-count { margin-bottom: 2px; font-size: 10px; }
  .search-form { height: 53px; gap: 9px; padding-left: 13px; }
  .search-form input { font-size: 12px; }
  .search-submit { height: 41px; gap: 8px; padding: 0 11px; font-size: 11px; }
  .filter-row { gap: 7px; padding: 11px 0 13px; }
  .filter-control { min-width: 0; height: 34px; flex: 1 1 calc(50% - 4px); padding: 0 8px; gap: 6px; }
  .filter-control select { font-size: 11px; }
  .select-chevron { right: 7px; top: 8px; font-size: 11px; }
  .filter-icon { font-size: 14px; }
  .result-status { margin-bottom: 9px; font-size: 11px; }
  .station-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .station-card { min-height: 88px; padding: 10px; gap: 11px; }
  .station-art { width: 59px; height: 59px; flex-basis: 59px; }
  .station-details h3 { font-size: 12px; }
  .station-origin { font-size: 9px; }
  .station-tags { margin-top: 6px; }
  .station-tags span { font-size: 8px; }
  .station-play { width: 34px; height: 34px; flex-basis: 34px; }
  .attribution { margin-top: 21px; gap: 7px; }
  .attribution p { font-size: 9px; text-align: left; }
  .player-dock { min-height: 150px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); grid-template-columns: 39px minmax(0, 1fr) auto; grid-template-rows: 42px 45px; gap: 5px 10px; }
  .player-station-art { width: 37px; height: 37px; font-size: 17px; }
  .player-current { gap: 1px; }
  .player-current strong { font-size: 11px; }
  .player-state { font-size: 9px; }
  .player-dock audio { grid-column: 1 / 3; grid-row: 2; height: 38px; min-width: 0; }
  .player-actions { grid-column: 3; grid-row: 1 / 3; display: grid; grid-template-columns: repeat(2, 35px); gap: 8px 6px; }
  .player-control { width: 32px; height: 32px; font-size: 12px; }
  .player-control.primary-control { width: 38px; height: 38px; font-size: 13px; }
  .player-control:last-child { grid-column: 1; }
}
@media (max-width: 360px) {
  .app-header { padding: 0 12px; gap: 15px; }
  .content { width: calc(100% - 24px); }
  .discover-intro { padding-left: 20px; padding-right: 20px; }
  .intro-orbit { margin-right: -30px; margin-left: -48px; opacity: .48; }
  .theme-toggle { width: 34px; height: 34px; min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Personal library and synthetic local preview */
.primary-nav { gap: 27px; }
.nav-link { padding: 0; border: 0; background: transparent; cursor: pointer; }
.nav-link::after { opacity: 0; transition: opacity .16s; }
.nav-link.active::after { opacity: 1; }
.account-action { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; }
.library-view { min-height: 53vh; padding: 48px 0 30px; }
.local-auth-card, .manual-station-form { display: grid; gap: 17px; padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.local-auth-card { max-width: 610px; margin: 22px auto 28px; }
.provider-button { min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--page); color: var(--text); font-size: 12px; font-weight: 570; transition: border-color .16s, transform .16s, background .16s; }
.provider-button:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.provider-button:disabled { opacity: .6; }
.provider-mark { width: 18px; font-size: 17px; line-height: 1; }
.apple-mark { height: 19px; fill: currentColor; }
.google-mark { font-weight: 750; color: #4285f4; }
.local-preview-auth { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line); }
.local-preview-auth summary { color: var(--muted); font-size: 11px; cursor: pointer; }
.account-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 14px 0 20px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.account-summary strong { font-size: 13px; font-weight: 580; }
.account-summary p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.account-summary-actions { display: flex; gap: 8px; }
.premium-status-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 0 0 22px; padding: 21px 23px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(112deg, var(--surface), var(--surface-raised)); }
.premium-status-premium { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(112deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-raised)); }
.premium-status-verification_unavailable { border-color: color-mix(in srgb, var(--error) 35%, var(--line)); }
.premium-status-copy h3 { display: flex; align-items: center; gap: 10px; margin: 5px 0 5px; font-size: 19px; font-weight: 590; letter-spacing: -.035em; }
.premium-status-copy > p:last-child { max-width: 690px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.premium-status-badge { padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 8px; font-weight: 720; letter-spacing: .1em; }
.premium-status-premium .premium-status-badge { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: var(--accent); }
.premium-status-count { min-width: 115px; display: grid; justify-items: end; gap: 1px; color: var(--muted); font-size: 10px; }
.premium-status-count strong { color: var(--text); font-size: 17px; font-weight: 630; letter-spacing: -.025em; }
.local-auth-card h3, .manual-station-form h3 { margin: 5px 0 0; font-size: 19px; font-weight: 590; letter-spacing: -.035em; }
.auth-explainer, .auth-footnote { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-footnote { color: var(--quiet); font-size: 10px; }
.local-auth-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.local-auth-form label, .manual-station-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.local-auth-form input, .manual-station-form input, .edit-fields input { min-width: 0; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--page); color: var(--text); font-size: 12px; }
.local-auth-form .search-submit, .manual-station-form .search-submit { height: 40px; }
.manual-station-form { grid-template-columns: 1fr 1.3fr 1.5fr 1.2fr auto; align-items: end; margin: 0 0 18px; padding: 18px; }
.manual-station-form h3 { font-size: 16px; }
.optional-label { color: var(--quiet); font-size: 10px; }
.library-grid { margin-top: 15px; }
.library-card { gap: 10px; }
.library-card .station-art { width: 58px; height: 58px; flex-basis: 58px; }
.library-buttons { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.library-buttons button, .library-action { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--muted); font-size: 14px; }
.library-buttons button:hover, .library-action:hover { border-color: var(--accent); color: var(--accent); }
.library-buttons .station-play { color: var(--text); }
.library-action { width: 27px; height: 27px; flex: 0 0 27px; font-size: 16px; }
.favorite-action { color: var(--error); }
.edit-fields { display: grid; gap: 5px; }
.edit-fields input { height: 30px; padding: 0 7px; font-size: 10px; }
.action-error { margin: 0; color: var(--error); font-size: 12px; }
.action-notice { margin: 14px 0; color: var(--success); font-size: 12px; }
.library-empty { margin-top: 18px; }
.account-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 35px 0 12px; padding: 19px 21px; border: 1px solid color-mix(in srgb, var(--error) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--error) 4%, var(--surface)); }
.account-danger-zone h3 { margin: 4px 0 5px; font-size: 15px; font-weight: 580; }
.account-danger-zone p:not(.eyebrow) { max-width: 610px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.delete-account-button { min-height: 38px; flex: 0 0 auto; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--error) 45%, var(--line)); border-radius: 7px; background: transparent; color: var(--error); font-size: 11px; }
.delete-account-button:hover:not(:disabled) { background: color-mix(in srgb, var(--error) 10%, transparent); }
.delete-account-button:disabled { opacity: .6; }
@media (max-width: 940px) {
  .primary-nav { gap: 17px; }
  .manual-station-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-station-form > div { grid-column: 1 / -1; }
  .local-auth-form { grid-template-columns: 1fr 1fr; }
  .local-auth-form .search-submit { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 600px) {
  .primary-nav { gap: 11px; }
  .nav-link { gap: 0; padding: 0 3px; font-size: 0; }
  .nav-glyph { font-size: 17px; }
  .account-action { padding: 6px 7px; font-size: 9px; }
  .library-view { padding-top: 32px; }
  .local-auth-card { padding: 19px; }
  .local-auth-form, .manual-station-form { grid-template-columns: 1fr; }
  .local-auth-form .search-submit, .manual-station-form > div { grid-column: auto; }
  .manual-station-form { padding: 15px; }
  .library-card { flex-wrap: wrap; }
  .library-card .station-details { flex-basis: calc(100% - 85px); }
  .library-buttons { margin-left: auto; }
  .account-danger-zone { align-items: stretch; flex-direction: column; padding: 16px; }
  .delete-account-button { align-self: flex-start; }
  .account-summary { align-items: stretch; flex-direction: column; padding: 15px; }
  .account-summary-actions { flex-wrap: wrap; }
  .premium-status-card { align-items: flex-start; padding: 17px; }
  .premium-status-copy h3 { align-items: flex-start; flex-direction: column; gap: 6px; }
  .premium-status-count { min-width: auto; padding-top: 21px; }
}
@media (max-width: 360px) {
  .primary-nav { gap: 8px; }
  .nav-link { font-size: 9px; }
  .account-action { font-size: 8px; }
}

/* Unified layout foundation: keep current working controls and guest behavior.
   Brand assets, full responsive navigation and theme selector follow in DESIGN-WEB-02. */
.discover-intro { min-height: 0; margin: 24px 0 28px; padding: 28px 32px; border-radius: 12px; }
.discover-intro h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.035em; line-height: 1.15; }
.intro-description { max-width: 720px; }
.intro-orbit { display: none; }
.station-card { min-height: 96px; }
.station-details h3 { font-size: 15px; }
.station-origin { font-size: 12px; }
.station-tags span { font-size: 11px; }
.station-play { width: 44px; height: 44px; flex-basis: 44px; font-size: 14px; }
.filter-control { min-height: 44px; }
.theme-toggle { min-height: 44px; }
.player-current strong { font-size: 14px; }
.player-state { font-size: 12px; }
.player-control.primary-control { width: 44px; height: 44px; }
@media (max-width: 600px) {
  .discover-intro { padding: 20px; margin: 16px 0 24px; }
  .discover-intro h1 { font-size: 28px; }
  .intro-description { font-size: 13px; max-width: none; }
  .station-card { min-height: 76px; }
  .station-art { width: 48px; height: 48px; flex-basis: 48px; }
  .station-details h3 { font-size: 14px; }
  .station-origin { font-size: 11px; }
  .station-tags span { font-size: 10px; }
  .theme-toggle { width: 44px; height: 44px; }
  .search-form input { font-size: 16px; }
}
.brand { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; color: var(--text); line-height: 0; text-decoration: none; }
.brand-logo { display: block; width: 44px; height: 44px; flex: 0 0 44px; object-fit: contain; border-radius: 0; }
.brand { gap: 10px; min-height: 44px; line-height: 1.15; }
.brand .brand-name { font-size: 24px; font-weight: 700; letter-spacing: -.035em; color: var(--text); white-space: nowrap; }
.theme-picker select { min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 14px; }
@media (max-width: 600px) {
  .app-header { gap: 8px; padding-inline: 12px; }
  .brand-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .brand { gap: 8px; }
  .brand .brand-name { font-size: 21px; }
  .theme-picker select { max-width: 94px; font-size: 12px; padding-inline: 5px; }
  .primary-nav { gap: 7px; }
  .nav-link { min-width: 28px; }
  .header-actions { gap: 4px; }
}

/* Unified responsive shell. One navigation tree; no duplicate interactive controls. */
.primary-nav .nav-link { min-height: 44px; }
.primary-nav .nav-link.active { color: var(--accent); }
.nav-glyph { flex-shrink: 0; }
.station-details h3 { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.player-control { width: 44px; height: 44px; flex-shrink: 0; }
.player-dock audio { min-width: 0; max-width: 100%; }
@media (min-width: 1100px) {
  body:has(.pwa-status:not([hidden])) .app-shell { --pwa-banner-height: 57px; }
  .pwa-status { min-height: 57px; }
  .app-shell { --sidebar-width: 216px; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); align-items: start; padding-bottom: max(110px, calc(94px + env(safe-area-inset-bottom))); }
  .app-header { grid-column: 1; align-self: stretch; position: sticky; top: 0; height: calc(100dvh - var(--pwa-banner-height, 0px)); min-height: 0; overflow-y: auto; padding: 28px 16px 114px; gap: 28px; flex-direction: column; align-items: stretch; border-bottom: 0; border-right: 1px solid var(--line); background: var(--surface); }
  .app-header .brand { padding-inline: 8px; }
  .primary-nav { height: auto; flex-direction: column; align-items: stretch; gap: 6px; }
  .primary-nav .nav-link { height: auto; padding: 10px 12px; border-radius: 9px; gap: 12px; font-size: 15px; text-align: left; }
  .primary-nav .nav-link::after { display: none; }
  .primary-nav .nav-link.active { background: var(--surface-soft); }
  .primary-nav .nav-link:hover { background: var(--surface-raised); }
  .header-actions { margin: auto 0 0; flex-direction: column; align-items: stretch; gap: 12px; }
  .header-actions .preview-label { overflow-wrap: anywhere; }
  .theme-picker select { width: 100%; }
  .content { grid-column: 2; width: min(1200px, calc(100% - 48px)); min-width: 0; }
  .player-dock { left: var(--sidebar-width); padding-inline: 24px; grid-template-columns: 48px minmax(0,1fr) minmax(150px, 32%) auto; gap: 12px; }
}
@media (min-width: 1100px) and (max-width: 1320px) {
  .station-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1099px) {
  .app-header { flex-wrap: wrap; height: auto; min-height: 64px; padding-block: 10px; }
  .primary-nav { height: auto; }
}
@media (max-width: 600px) {
  .app-shell { --mobile-navigation: 0px; padding-bottom: calc(190px + var(--mobile-navigation) + env(safe-area-inset-bottom)); }
  .app-header { justify-content: space-between; padding-block: 10px; backdrop-filter: none; }
  .header-actions { margin-left: auto; }
  .primary-nav { order: 3; width: 100%; justify-content: center; gap: 4px; }
  .primary-nav .nav-link { min-width: 44px; padding-inline: 8px; font-size: 12px; gap: 6px; }
  .primary-nav .nav-link::after { display: none; }
  .primary-nav .nav-link.active { background: var(--surface-soft); border-radius: 9px; }
  /* A single guest Discover tab stays in the header; bottom navigation
     is reserved for an actual multi-destination account/library UI. */
  .app-shell:has(.primary-nav > .nav-link:nth-child(2)) { --mobile-navigation: 64px; }
  .primary-nav:has(> .nav-link:nth-child(2)) { position: fixed; bottom: 0; left: 0; right: 0; width: auto; z-index: 31; background: var(--surface); padding: 6px 12px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); gap: 8px; }
  .primary-nav:has(> .nav-link:nth-child(2)) .nav-link { flex: 1; flex-direction: column; gap: 2px; min-height: 48px; }
  .player-dock { bottom: var(--mobile-navigation); min-height: 135px; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .app-shell:has(.primary-nav > .nav-link:nth-child(2)) .player-dock { bottom: calc(var(--mobile-navigation) + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .player-actions { grid-template-columns: repeat(2,44px); gap: 5px; }
  .player-control:last-child { grid-column: 1; }
  .player-station-art { width: 44px; height: 44px; }
  .player-current strong { white-space: normal; overflow-wrap: anywhere; }
  .station-grid { gap: 6px; }
  .station-card { border-radius: 12px; }
}
@media (display-mode: standalone) and (max-width: 1099px) {
  .app-header { height: auto; padding-top: max(10px, env(safe-area-inset-top)); }
}

/* Approved native artwork fills the station fallback and the expanded player. */
.station-art { background: #0a1a48 url("../icons/default-station-artwork.png") center / cover no-repeat; }
.station-art::before, .station-art::after { display: none; }
.art-monogram { visibility: hidden; }
.player-station-art { background: #0a1a48 url("../icons/default-station-artwork.png") center / cover no-repeat; }
.player-current-action { width: 100%; min-width: 0; padding: 0; display: grid; gap: 3px; border: 0; background: transparent; color: inherit; text-align: left; }
.player-current-action:hover strong { color: var(--accent); }
.now-playing-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; max-height: min(90dvh, 780px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.now-playing-dialog::backdrop { background: #050914b8; backdrop-filter: blur(7px); }
.now-playing-sheet { padding: 20px 24px 28px; }
.now-playing-header { display: flex; align-items: center; justify-content: space-between; }
.now-playing-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-raised); color: var(--text); font-size: 24px; }
.now-playing-artwork { width: min(100%, 280px); height: min(38dvh, 280px); max-height: 280px; aspect-ratio: 1; display: block; margin: 20px auto 22px; object-fit: cover; border-radius: 16px; box-shadow: 0 16px 42px #05091455; }
.now-playing-copy { min-width: 0; text-align: center; }
.now-playing-copy h2 { margin: 0; overflow-wrap: anywhere; font-size: 22px; line-height: 1.25; }
.now-playing-copy p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.now-playing-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.now-playing-actions .player-control { width: 48px; height: 48px; }
.now-playing-actions .primary-control { width: 56px; height: 56px; }
@media (max-width: 600px) {
  .now-playing-dialog { width: 100%; max-height: min(92dvh, 820px); margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; }
  .now-playing-sheet { padding: 14px 20px max(24px, env(safe-area-inset-bottom)); }
  .now-playing-artwork { width: min(67vw, 250px); height: min(34dvh, 250px); margin-block: 15px 19px; }
}

/* DESIGN-WEB-03: native controls, profile top right, appearance bottom left. */
.control-icon { display: block; width: 22px; height: 22px; flex: 0 0 22px; }
.nav-link .control-icon { color: currentColor; width: 20px; height: 20px; flex-basis: 20px; }
.profile-action, .icon-action, .appearance-option { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; }
.profile-action { gap: 8px; padding: 8px 14px; font-size: 13px; font-weight: 650; }
.profile-action .control-icon { color: var(--accent); width: 24px; height: 24px; flex-basis: 24px; }
.profile-action:hover, .icon-action:hover, .appearance-option:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.appearance-desktop { display: none; }
.appearance-mobile { display: flex; align-items: center; }
.appearance-trigger, .appearance-menu { display: none; }
.appearance-fallback { position: relative; }
.appearance-fallback select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.appearance-fallback:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.appearance-menu-option { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 8px; color: var(--text); background: transparent; text-align: left; }
.appearance-menu-option:hover, .appearance-menu-option.selected { background: var(--surface-soft); }
.appearance-menu-option.selected, .appearance-option.selected { color: var(--accent); }
.appearance-check { margin-left: auto; width: 18px; height: 18px; flex-basis: 18px; }
@supports selector(:popover-open) {
  .appearance-trigger { display: inline-flex; }
  .appearance-fallback { display: none; }
  .appearance-menu:popover-open { display: grid; gap: 2px; position: fixed; inset: 74px 12px auto auto; margin: 0; width: min(212px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
}
@media (min-width: 1100px) {
  .app-shell { grid-template-rows: auto 1fr; }
  .app-header { grid-row: 1 / 3; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .profile-bar { grid-column: 2; grid-row: 1; justify-self: end; padding: 20px 24px 0; }
  .content { grid-row: 2; }
  .app-shell:not(:has(.profile-bar)) .content { grid-row: 1 / 3; }
  .appearance-mobile { display: none; }
  .appearance-desktop { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; }
  .appearance-option { flex: 1; min-width: 44px; padding: 0; background: transparent; border-color: transparent; border-radius: 10px; }
  .appearance-option.selected { background: var(--surface); border-color: var(--line-strong); }
}
@media (max-width: 1099px) {
  .app-shell { position: relative; }
  .app-shell:has(.profile-bar) .app-header { padding-right: 64px; }
  .profile-bar { position: absolute; top: 10px; right: 12px; z-index: 25; }
  .profile-action { width: 44px; height: 44px; padding: 0; }
  .profile-action-label { display: none; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 600px) {
  .app-shell:has(.profile-bar) .app-header { padding-right: 64px; }
  .app-header .brand { min-width: 0; }
  .app-header .brand-name { font-size: 20px; }
  .app-header .header-actions { gap: 4px; }
  .primary-nav:not(:has(> .nav-link:nth-child(2))) { justify-content: flex-start; }
}
@media (display-mode: standalone) and (max-width: 1099px) {
  .profile-bar { top: max(10px, env(safe-area-inset-top)); }
}

/* DESIGN-WEB-04: installation is an optional action, never an ambient banner. */
ahenq-install[hidden] { display: none !important; }
ahenq-install:not([hidden]) { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); }
.install-entry, .install-dismiss { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px; border: 0; border-radius: 9px; background: transparent; color: inherit; }
.install-entry:hover, .install-dismiss:hover { color: var(--text); background: var(--surface-soft); }
.install-dismiss .control-icon { width: 16px; height: 16px; flex-basis: 16px; }
.install-label { font-size: 13px; white-space: nowrap; }
.install-help { width: min(390px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.install-help::backdrop { background: #05091499; }
.install-help h2 { margin: 0; font-size: 20px; }
.install-help p { color: var(--muted); }
.install-help .pwa-action { min-height: 44px; margin: 4px; }
@media (min-width: 1100px) {
  ahenq-install:not([hidden]) { width: 100%; padding-top: 6px; border-top: 1px solid var(--line); }
  .install-entry { flex: 1; justify-content: flex-start; }
}
@media (max-width: 1099px) {
  .install-label, ahenq-install .install-dismiss { display: none; }
  ahenq-install:not([hidden]) { gap: 0; }
}
