/* =========================================================
   40Hz Yoga — Light lavender wellness design system
   ========================================================= */
:root {
    --bg-base: #f5f2fb;
    --bg-elevated: #ffffff;
    --bg-highlight: #eee9f8;
    --bg-press: #e3dbf3;
    --bg-sidebar: #ffffff;
    --bg-tooltip: #5b4b8a;

    --text-primary: #241e3a;
    --text-secondary: #6d6584;
    --text-subdued: #7c7398;
    --text-dim: #a59cc6;

    --accent: #7c5ce0;
    --accent-bright: #8f6ff0;
    --accent-dark: #6a4bd0;
    --accent-hover: #9a7ff4;

    --card-hover: #f3effb;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 500px;

    --sidebar-width: 280px;
    --player-height: 88px;
    --topbar-height: 64px;
    --np-width: 420px;
    --content-max: 1180px;

    --bottom-nav-height: 0px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --player-offset: calc(var(--player-height) + var(--bottom-nav-height) + var(--safe-bottom));
    --ui-offset: calc(var(--bottom-nav-height) + var(--safe-bottom));

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;

    --shadow-card: 0 8px 24px rgba(90, 70, 160, 0.14);
    --shadow-modal: 0 16px 48px rgba(90, 70, 160, 0.24);
    --border-soft: rgba(93, 74, 150, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.player-visible { --ui-offset: var(--player-offset); }

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button { font-family: var(--font); background: none; border: none; color: inherit; cursor: pointer; }
input, select { font-family: var(--font); }
a { text-decoration: none; color: inherit; }
svg { width: 24px; height: 24px; display: block; }

::-webkit-scrollbar { width: 0; height: 0; display: none; }
* { scrollbar-width: none; -ms-overflow-style: none; }

/* ============================ Loading ============================ */
.loading-screen {
    position: fixed; inset: 0; z-index: 1000;
    background: #f5f2fb;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s ease;
}
.loading-screen.hidden { opacity: 0; pointer-events: none; }
.loading-content { text-align: center; }
.loading-logo { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.loading-logo svg { width: 34px; height: 34px; }
.loading-title { font-family: var(--font-serif); font-size: 30px; font-weight: 600; letter-spacing: -0.5px; }
.loading-subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 14px; }
.loading-spinner { margin-top: 28px; display: flex; justify-content: center; }
.spinner-ring { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(124, 92, 224, 0.2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================ App layout ============================ */
.app {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--ui-offset));
    height: calc(100dvh - var(--ui-offset));
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ece5fb 0%, var(--bg-base) 320px);
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================ Sidebar ============================ */
.sidebar {
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 24px 12px 12px;
    gap: 4px;
    min-height: 0;
    border-right: 1px solid var(--border-soft);
}
.sidebar-logo {
    display: flex; align-items: center; gap: 12px;
    padding: 0 12px 18px;
}
.logo-mark {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; }
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600; font-size: 15px;
    transition: color 0.2s, background 0.2s;
}
.nav-link svg { width: 22px; height: 22px; }
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--accent); }

.sidebar-section {
    margin-top: 22px;
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 0;
}
.sidebar-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px 12px;
}
.sidebar-section-header span { color: var(--text-secondary); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-add { color: var(--text-secondary); display: flex; }
.sidebar-add:hover { color: var(--accent); }
.sidebar-add svg { width: 20px; height: 20px; }

.sidebar-playlists { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.sidebar-empty { color: var(--text-dim); font-size: 13px; padding: 8px 12px; }
.sidebar-playlist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: var(--radius-md);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: background 0.15s, color 0.2s;
}
.sidebar-playlist-item:hover { color: var(--text-primary); background: var(--bg-highlight); }
.sidebar-playlist-item .pl-art {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 12px; flex-shrink: 0;
    overflow: hidden;
}
.sidebar-playlist-item .pl-art img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-playlist-item .pl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-footer { margin-top: 8px; }
.sidebar-settings {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 12px; border-radius: var(--radius-md);
    color: var(--text-secondary); font-weight: 600; font-size: 15px; width: 100%;
    transition: color 0.2s;
}
.sidebar-settings svg { width: 22px; height: 22px; }
.sidebar-settings:hover { color: var(--text-primary); }

/* ============================ Main / Topbar ============================ */
.main {
    display: flex; flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
    width: 100%;
}
.topbar {
    height: var(--topbar-height);
    position: sticky; top: 0; z-index: 20;
    background: rgba(245, 242, 251, 0.72);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}
.topbar-inner {
    width: 100%; max-width: var(--content-max); margin: 0 auto;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 32px;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; justify-self: start; grid-column: 1; }
.topbar-brand .logo-text { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; }
.topbar-nav { display: flex; align-items: center; gap: 4px; grid-column: 2; }
.topbar-settings { justify-self: end; grid-column: 3; }
.topnav-link {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s, background 0.2s;
}
.topnav-link:hover { color: var(--text-primary); }
.topnav-link.active { color: #fff; background: var(--accent); }
.topbar-settings {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(93, 74, 150, 0.1); color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.topbar-settings svg { width: 20px; height: 20px; }
.topbar-settings:hover { background: var(--bg-press); color: var(--accent); }

.view { flex: 1; overflow-y: auto; padding: 0; min-height: 0; }
.view-inner { max-width: var(--content-max); margin: 0 auto; padding: 0 32px 56px; }

/* ============================ Hero / greetings ============================ */
.greeting { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; padding: 16px 0 8px; }

.section { margin-top: 44px; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.section-eyebrow {
    display: block; font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent); margin-bottom: 8px;
}
.section-title { font-family: var(--font-serif); font-size: 28px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.1; }
.section-title a { color: var(--text-secondary); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.section-title a:hover { text-decoration: underline; }

/* Quick tiles */
.quick-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}
.quick-tile {
    flex: 0 0 340px;
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: background 0.25s;
    position: relative;
    height: 64px;
    padding-right: 12px;
    box-shadow: 0 1px 3px rgba(90,70,160,0.06);
}
.quick-tile:hover { background: var(--bg-highlight); }
.quick-tile .qt-art { width: 64px; height: 64px; flex-shrink: 0; }
.quick-tile .qt-art img { width: 100%; height: 100%; object-fit: cover; }
.quick-tile .qt-art .qt-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright)); font-weight: 800; color: #fff; }
.quick-tile .qt-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.quick-tile .qt-play {
    position: relative;
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(124, 92, 224, 0.45), 0 0 0 1px rgba(255,255,255,0.18) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    flex-shrink: 0;
}
.quick-tile .qt-play svg { width: 20px; height: 20px; }
.quick-tile .qt-play:active {
    transform: scale(0.84);
    box-shadow: 0 2px 6px rgba(124, 92, 224, 0.55), 0 0 0 1px rgba(255,255,255,0.28) inset;
    filter: brightness(1.08);
}

/* ============================ Cards grid ============================ */
.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.card {
    flex: 0 0 190px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: background 0.25s;
    position: relative;
}
.card:hover { background: var(--card-hover); }
.card-art {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #e6e0f4;
    box-shadow: var(--shadow-card);
    margin-bottom: 12px;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art .card-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright));
    color: #fff; font-weight: 800; font-size: 22px;
}
.card-play {
    position: absolute; right: 8px; bottom: 8px;
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(124, 92, 224, 0.5), 0 0 0 1px rgba(255,255,255,0.2) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.card-play svg { width: 20px; height: 20px; }
.card-play:active {
    transform: scale(0.84);
    box-shadow: 0 2px 6px rgba(124, 92, 224, 0.55), 0 0 0 1px rgba(255,255,255,0.3) inset;
    filter: brightness(1.1);
}

.card-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 6px; color: var(--text-subdued); font-size: 12px; margin-top: 4px; }
.card-meta .dot { color: var(--text-dim); }

/* ============================ Search ============================ */
.search-box {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: var(--radius-pill);
    padding: 10px 18px;
    max-width: 400px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(90,70,160,0.08);
    border: 1px solid var(--border-soft);
}
.search-box svg { width: 20px; height: 20px; color: var(--accent); }
.search-box input { border: none; outline: none; flex: 1; font-size: 15px; color: var(--text-primary); background: transparent; }
.search-box input::placeholder { color: var(--text-dim); }

.search-title { font-family: var(--font-serif); font-size: 28px; font-weight: 600; letter-spacing: -0.4px; margin: 32px 0 18px; }
.search-empty { color: var(--text-secondary); font-size: 15px; }

/* ============================ Library ============================ */
.library-tabs { display: flex; gap: 8px; margin: 12px 0 20px; }
.library-tab {
    padding: 8px 18px; border-radius: var(--radius-pill);
    background: var(--bg-elevated); color: var(--text-primary);
    font-size: 13px; font-weight: 600;
    transition: background 0.2s;
    border: 1px solid var(--border-soft);
}
.library-tab:hover { background: var(--bg-highlight); }
.library-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.list-row {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center; gap: 14px;
    padding: 8px 12px; border-radius: var(--radius-md);
    cursor: pointer;
}
.list-row:hover { background: var(--bg-highlight); }
.list-row .list-index { color: var(--text-secondary); text-align: center; font-size: 15px; }
.list-row .list-art { width: 44px; height: 44px; border-radius: var(--radius-sm); overflow: hidden; background: #e6e0f4; display: flex; align-items: center; justify-content: center; }
.list-row .list-art img { width: 100%; height: 100%; object-fit: cover; }
.list-row .list-art .list-fallback { background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright)); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 14px; }
.list-row .list-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .list-sub { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.list-row .list-action { color: var(--text-secondary); font-size: 13px; }

.empty-state { color: var(--text-secondary); font-size: 15px; padding: 24px 0; }

/* Journey stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 20px; box-shadow: 0 1px 3px rgba(90,70,160,0.06); }
.stat-card h3 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; color: var(--accent); }
.stat-card p { color: var(--text-secondary); font-size: 13px; margin-top: 6px; }

/* ============================ Player bar ============================ */
.player-bar {
    position: fixed; left: 0; right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--safe-bottom));
    height: var(--player-height);
    background: #fff;
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    z-index: 60;
    box-shadow: 0 -4px 20px rgba(90,70,160,0.08);
    transform: translateY(calc(100% + var(--bottom-nav-height) + var(--safe-bottom) + 12px));
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body.player-visible .player-bar { transform: translateY(0); }

.player-progress {
    display: flex; align-items: center; gap: 10px;
    width: 100%; max-width: 780px;
    margin: 0 auto;
    padding: 6px 16px 0;
    flex-shrink: 0;
}
.progress-time { color: var(--text-secondary); font-size: 11px; min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.progress-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(93, 74, 150, 0.18); cursor: pointer; position: relative; }
.progress-fill { height: 100%; width: 0; border-radius: 2px; background: var(--accent); position: relative; transition: width 0.1s linear; }
.progress-bar:hover .progress-fill { background: var(--accent-hover); }
.progress-bar:hover .progress-fill::after {
    content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%);
    width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}

.player-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: center;
    padding: 4px 16px 10px;
    gap: 16px;
}

.player-left { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.player-art { width: 56px; height: 56px; border-radius: var(--radius-sm); background: #e6e0f4; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(90,70,160,0.18); }
.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-art span { font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright)); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.player-meta { min-width: 0; }
.player-title-row { display: flex; align-items: center; gap: 8px; }
.player-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.player-fav { color: var(--text-secondary); display: flex; flex-shrink: 0; }
.player-fav svg { width: 16px; height: 16px; }
.player-fav:hover { color: var(--accent); }
.player-fav.favorited { color: var(--accent); }
.player-subtitle { color: var(--text-secondary); font-size: 12px; display: block; margin-top: 2px; }

.player-center { display: flex; align-items: center; justify-content: center; }
.player-controls { display: flex; align-items: center; gap: 16px; }
.transport-btn { color: var(--text-secondary); display: flex; transition: color 0.15s; }
.transport-btn svg { width: 18px; height: 18px; }
.transport-btn:hover { color: var(--text-primary); }
.transport-btn:disabled { color: var(--text-dim); }
.play-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.1s, background 0.15s;
}
.play-toggle svg { width: 18px; height: 18px; }
.play-toggle:hover { transform: scale(1.05); background: var(--accent-hover); }

.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.np-toggle { color: var(--text-secondary); }
.np-toggle svg { width: 18px; height: 18px; }
.np-toggle:hover { color: var(--text-primary); }
.np-toggle.active { color: var(--accent); }
.vis-toggle { color: var(--text-secondary); }
.vis-toggle svg { width: 18px; height: 18px; }
.vis-toggle:hover { color: var(--text-primary); }
.vis-toggle.active { color: var(--accent); }
.player-volume { display: flex; align-items: center; gap: 8px; }
.player-volume svg { width: 18px; height: 18px; color: var(--text-secondary); }
.volume-slider {
    -webkit-appearance: none; appearance: none;
    width: 90px; height: 4px; border-radius: 2px;
    background: rgba(93, 74, 150, 0.18); outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
}
.volume-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; }

/* ============================ Bottom nav (mobile) ============================ */
.bottom-nav {
    display: none;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: #fff;
    border-top: 1px solid var(--border-soft);
    z-index: 59;
    box-shadow: 0 -2px 12px rgba(90,70,160,0.06);
}
.bottom-nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
    height: 100%;
    color: var(--text-secondary);
    font-size: 11px; font-weight: 600;
    transition: color 0.2s;
}
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--accent); }
.bottom-nav-item:active { opacity: 0.6; }


/* ============================ Now Playing panel ============================ */
.now-playing-panel {
    position: fixed; top: 0; right: 0; bottom: var(--ui-offset);
    width: var(--np-width); max-width: 92vw;
    background: #fff;
    border-left: 1px solid var(--border-soft);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    z-index: 70;
    display: flex; flex-direction: column;
    box-shadow: -8px 0 30px rgba(90,70,160,0.12);
}
.now-playing-panel.open { transform: translateX(0); }
.np-backdrop {
    position: fixed; inset: 0; bottom: var(--ui-offset);
    background: rgba(30, 20, 60, 0.4);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
    z-index: 65;
}
.np-backdrop.open { opacity: 1; visibility: visible; }

/* On desktop the now-playing panel floats without a full-screen backdrop,
   so the sidebar/main remain clickable (Spotify-style). */
@media (min-width: 901px) {
    .np-backdrop { display: none; }
}

.np-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.np-header h2 { font-size: 16px; font-weight: 800; }
.np-close { color: var(--text-secondary); display: flex; }
.np-close svg { width: 22px; height: 22px; }
.np-close:hover { color: var(--text-primary); }

.np-body { overflow-y: auto; padding: 0 24px 24px; flex: 1; }
.np-cover { width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-md); background: #e6e0f4; overflow: hidden; margin: 12px 0 20px; box-shadow: var(--shadow-card); display: flex; align-items: center; justify-content: center; }
.np-cover img { width: 100%; height: 100%; object-fit: cover; }
.np-cover span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-dark), var(--accent-bright)); color: #fff; font-weight: 800; font-size: 44px; }
.np-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.np-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

/* ============================ Visualizer drawer (expanded player) ============================ */
.visualizer-drawer {
    position: fixed; left: 0; right: 0; bottom: var(--ui-offset);
    background: #fff;
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -8px 30px rgba(90,70,160,0.16);
    z-index: 55;
    transform: translateY(105%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    max-height: calc(100vh - var(--ui-offset));
    max-height: calc(100dvh - var(--ui-offset));
    display: flex;
    flex-direction: column;
}
.visualizer-drawer.open { transform: translateY(0); }

.vis-drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border-soft);
}
.vis-session { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vis-session-text { display: flex; flex-direction: column; min-width: 0; }
.vis-session-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.status-dot.active { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.session-type { color: var(--text-secondary); font-size: 11px; }

.vis-close { color: var(--text-secondary); display: flex; padding: 4px; }
.vis-close svg { width: 22px; height: 22px; }
.vis-close:hover { color: var(--accent); }

/* Floating tab to re-expand the visualizer when collapsed */
.vis-expand-tab {
    position: fixed;
    bottom: calc(var(--ui-offset) + 12px);
    right: 24px;
    z-index: 54;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 8px 20px rgba(90,70,160,0.4);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
.vis-expand-tab svg { width: 18px; height: 18px; }
.vis-expand-tab.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.vis-expand-tab:hover { background: var(--accent-hover); }

.vis-drawer-body { padding: 12px 24px 18px; overflow-y: auto; min-height: 0; }

.vis-scale {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; color: var(--text-dim); margin-bottom: 10px;
    letter-spacing: 0.3px;
}
.vis-scale-left { display: flex; align-items: center; gap: 8px; }
.vis-scale b { color: var(--text-secondary); font-weight: 700; }
.scale-sep { color: var(--text-dim); opacity: 0.5; }
.vis-scale-right b { color: var(--accent); font-weight: 700; }

.vis-main {
    display: grid;
    grid-template-columns: 190px 1fr 210px;
    gap: 20px;
    align-items: stretch;
}

.vis-side { display: flex; flex-direction: column; justify-content: center; gap: 14px; }

.readout-row { display: flex; flex-direction: column; gap: 6px; }
.readout { display: flex; justify-content: space-between; align-items: center; background: var(--bg-highlight); border-radius: var(--radius-sm); padding: 8px 12px; }
.readout-label { color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.readout-value { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--accent-dark); }

.canvas-wrap { border-radius: var(--radius-md); overflow: hidden; background: #241e3a; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); }
#frequencyCanvas { width: 100%; height: 170px; display: block; }

.vis-freqs {
    display: flex; flex-direction: column;
    border-left: 1px solid var(--border-soft);
    padding-left: 20px;
    justify-content: center;
    max-height: 170px;
    overflow: hidden;
}
.vis-freqs-header { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.active-freq-list { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.freq-item-compact { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); }
.freq-hz { font-weight: 600; color: var(--accent); white-space: nowrap; }
.freq-amp { color: var(--text-secondary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mixer row (integrated into the visualizer drawer) */
.vis-mixer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}
.vis-mixer-group { min-width: 0; }
.vis-mixer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.vis-mixer-header label { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.vis-mixer-header span { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.vis-mixer-desc { color: var(--text-dim); font-size: 11px; margin-top: 4px; }

.mix-controls h4 { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

/* Mixer */
.mix-controls { margin-top: 24px; }
.mix-group { margin-bottom: 20px; }
.mix-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.mix-header label { font-size: 14px; font-weight: 600; }
.mix-header span { color: var(--text-secondary); font-size: 13px; font-variant-numeric: tabular-nums; }
.mix-desc { color: var(--text-dim); font-size: 12px; margin-top: 6px; }
.mix-slider-wrap { position: relative; height: 20px; }
.mix-track {
    position: absolute; top: 8px; left: 0; right: 0; height: 4px;
    background: rgba(93, 74, 150, 0.16); border-radius: 2px;
    overflow: hidden;
}
.mix-fill { height: 100%; width: 30%; border-radius: 2px; background: var(--accent); transition: width 0.05s linear; }
.mix-slider {
    -webkit-appearance: none; appearance: none;
    position: absolute; top: 0; left: 0;
    width: 100%; height: 20px; margin: 0;
    background: transparent; outline: none; cursor: pointer;
}
.mix-slider::-webkit-slider-runnable-track { height: 20px; background: transparent; }
.mix-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); margin-top: 4px; cursor: pointer;
    box-shadow: 0 1px 3px rgba(90,70,160,0.4);
}
.mix-slider::-moz-range-track { height: 20px; background: transparent; }
.mix-slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; }

/* ============================ Modal ============================ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(30, 20, 60, 0.5);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
    width: 480px; max-width: 92vw; max-height: 88vh;
    background: #fff; border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow-modal);
    transform: translateY(16px); transition: transform 0.25s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border-soft); }
.modal-header h2 { font-size: 18px; font-weight: 800; }
.modal-close { color: var(--text-secondary); display: flex; }
.modal-close svg { width: 22px; height: 22px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { overflow-y: auto; padding: 20px 24px; }
.settings-group { margin-bottom: 28px; }
.settings-group h3 { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }
.settings-item { margin-bottom: 18px; }
.settings-item .settings-label { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; font-weight: 500; }
.settings-item .settings-label span:last-child { color: var(--text-secondary); }
.settings-item.checkbox { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.settings-item.checkbox input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.settings-select { width: 100%; background: var(--bg-highlight); color: var(--text-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px 12px; font-size: 14px; outline: none; }
.settings-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.btn-secondary { padding: 10px 20px; border-radius: var(--radius-pill); background: transparent; border: 1px solid var(--border-soft); color: var(--text-primary); font-weight: 700; font-size: 14px; }
.btn-secondary:hover { border-color: var(--accent); }
.btn-primary { padding: 10px 24px; border-radius: var(--radius-pill); background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.btn-primary:hover { background: var(--accent-hover); }

/* ============================ Notifications ============================ */
.notifications { position: fixed; bottom: calc(var(--ui-offset) + 16px); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.notification {
    background: var(--accent); color: #fff;
    padding: 12px 20px; border-radius: var(--radius-md);
    font-weight: 700; font-size: 14px;
    box-shadow: var(--shadow-card);
    animation: notif-in 0.3s ease;
}
.notification.info { background: var(--bg-tooltip); color: #fff; }
@keyframes notif-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ============================ Home intro ============================ */
.home-intro { padding-top: 8px; }
.home-subline { color: var(--text-secondary); font-size: 15px; max-width: 640px; margin-top: 6px; line-height: 1.5; }

/* ============================ Hero ============================ */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: center;
    background: #e6defa;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(40, 26, 88, 0.94) 0%, rgba(84, 58, 160, 0.8) 42%, rgba(124, 92, 224, 0.3) 100%);
}
.hero-content {
    position: relative; z-index: 2;
    width: 100%; max-width: var(--content-max);
    margin: 0 auto; padding: 80px 32px;
    text-align: center;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
    color: #e9dcff; margin-bottom: 22px;
}
.hero-content h1 {
    font-family: var(--font-serif); font-size: 60px; font-weight: 600;
    letter-spacing: -1px; line-height: 1.04; color: #fff; max-width: 680px;
    margin: 0 auto;
}
.hero-content p { color: rgba(255,255,255,0.9); font-size: 16px; line-height: 1.7; margin-top: 20px; max-width: 520px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }
.hero-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 26px; border-radius: var(--radius-pill);
    font-size: 14px; font-weight: 700; text-decoration: none;
    transition: transform 0.15s, background 0.2s;
}
.hero-btn svg { width: 18px; height: 18px; }
.hero-btn.primary { background: #fff; color: var(--accent-dark); }
.hero-btn.primary:hover { background: #f3effb; transform: scale(1.04); }
.hero-btn.ghost { background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.hero-btn.ghost:hover { background: rgba(255,255,255,0.26); transform: scale(1.04); }

/* ============================ Science ============================ */
.science-layout { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: start; }
.science-copy { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: 0 1px 3px rgba(90,70,160,0.06); }
.science-copy h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin: 24px 0 10px; }
.science-copy h3:first-child { margin-top: 0; }
.science-copy p { color: var(--text-secondary); font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.science-copy strong { color: var(--text-primary); }
.science-copy em { color: var(--text-primary); font-style: italic; }

/* ============================ Benefits (editorial) ============================ */
.benefits-section {
    margin-top: 64px;
    background: linear-gradient(180deg, #ffffff 0%, #f5f0fc 100%);
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    padding: 64px 56px 60px;
    box-shadow: 0 2px 10px rgba(90, 70, 160, 0.05);
}

.benefits-masthead {
    position: relative;
    max-width: 720px;
    margin: 0 auto 48px;
    padding-top: 30px;
    text-align: center;
}
.benefits-masthead::before {
    content: '';
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 44px; height: 2px;
    background: var(--accent);
}
.benefits-kicker {
    display: block;
    font-size: 11px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}
.benefits-title {
    font-family: var(--font-serif);
    font-size: clamp(34px, 5vw, 54px);
    font-weight: 600; letter-spacing: -1px; line-height: 1.04;
    color: var(--text-primary);
}
.benefits-title em { font-style: italic; font-weight: 400; color: var(--accent-dark); }
.benefits-dek {
    color: var(--text-secondary);
    font-size: 16.5px; line-height: 1.75;
    margin-top: 20px;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 44px 64px;
}
.benefit-item {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.benefit-icon {
    width: 52px; height: 52px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(124,92,224,0.14), rgba(124,92,224,0.05));
    border: 1px solid rgba(124,92,224,0.12);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.25s, background 0.25s;
}
.benefit-icon svg { width: 24px; height: 24px; }
.benefit-item h3 {
    font-family: var(--font-serif);
    font-size: 24px; font-weight: 600; letter-spacing: -0.3px;
    color: var(--text-primary);
    transition: color 0.25s;
}
.benefit-item p {
    color: var(--text-secondary);
    font-size: 14.5px; line-height: 1.7;
}
.benefit-item:hover h3 { color: var(--accent-dark); }
.benefit-item:hover .benefit-icon { background: linear-gradient(135deg, rgba(124,92,224,0.22), rgba(124,92,224,0.1)); transform: translateY(-2px); }

/* ============================ Programs ============================ */
.section-count { color: var(--text-secondary); font-size: 13px; font-weight: 700; letter-spacing: 0.5px; }
.program-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.program-card { flex: 0 0 340px; background: var(--bg-elevated); border-radius: 16px; overflow: hidden; transition: background 0.25s, box-shadow 0.25s, transform 0.25s; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(90,70,160,0.06); }
.program-card:hover { background: #fff; box-shadow: var(--shadow-card); transform: translateY(-3px); }
.program-card-art { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.program-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.program-card:hover .program-card-art img { transform: scale(1.05); }
.program-card-tone {
    position: absolute; top: 12px; left: 12px;
    background: rgba(30, 20, 60, 0.55); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    padding: 5px 10px; border-radius: var(--radius-pill); backdrop-filter: blur(4px);
}
.program-card-play {
    position: absolute; right: 12px; bottom: 12px;
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent-dark));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(60, 30, 120, 0.4), 0 0 0 1px rgba(255,255,255,0.2) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.program-card-play svg { width: 20px; height: 20px; }
.program-card-play:active {
    transform: scale(0.84);
    box-shadow: 0 2px 6px rgba(60, 30, 120, 0.45), 0 0 0 1px rgba(255,255,255,0.3) inset;
    filter: brightness(1.1);
}

/* Playing state — soft pulsing ring */
.card-play.playing::after,
.program-card-play.playing::after,
.quick-tile .qt-play.playing::after {
    content: '';
    position: absolute; inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(124, 92, 224, 0.45);
    animation: play-pulse 1.6s ease-out infinite;
}
@keyframes play-pulse {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

.program-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.program-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.program-card-top h3 { font-family: var(--font-serif); font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.program-card-level { color: var(--text-secondary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.program-card-desc { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; }
.program-card-benefits { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.program-card-benefits li { color: var(--text-subdued); font-size: 13px; padding-left: 18px; position: relative; }
.program-card-benefits li::before { content: ''; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.program-card-meta {
    display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12px; font-weight: 600;
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.program-card-meta .dot { color: var(--text-dim); }
.program-more {
    margin-left: auto; display: inline-flex; align-items: center; gap: 2px;
    color: var(--accent); font-weight: 700; font-size: 12.5px;
    transition: color 0.15s;
}
.program-more svg { width: 16px; height: 16px; }
.program-more:hover { color: var(--accent-hover); }

/* Featured / Editor's Pick spotlight */
.feature-card {
    flex: 1 1 100%;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--bg-elevated);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-modal); }
.feature-art { position: relative; min-height: 360px; }
.feature-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; mix-blend-mode: multiply; }
.feature-art .program-card-tone { top: 20px; left: 20px; }
.feature-body { padding: 44px 44px 40px; display: flex; flex-direction: column; gap: 14px; }
.feature-eyebrow {
    font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent);
    display: inline-flex; align-items: center; gap: 8px;
}
.feature-eyebrow::after { content: ''; width: 28px; height: 1px; background: var(--accent); }
.feature-title { font-family: var(--font-serif); font-size: 36px; font-weight: 600; letter-spacing: -0.5px; line-height: 1.05; }
.feature-desc { color: var(--text-secondary); font-size: 15px; line-height: 1.65; }
.feature-benefits { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.feature-benefits li { color: var(--text-subdued); font-size: 13px; padding-left: 16px; position: relative; }
.feature-benefits li::before { content: ''; position: absolute; left: 0; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.feature-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.feature-actions .hero-btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(124, 92, 224, 0.3); }
.feature-actions .hero-btn.primary:hover { background: var(--accent-hover); transform: scale(1.03); }
.feature-more {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); font-weight: 700; font-size: 14px; transition: color 0.15s;
}
.feature-more svg { width: 16px; height: 16px; }
.feature-more:hover { color: var(--accent-hover); }
.feature-meta { color: var(--text-dim); font-size: 12px; font-weight: 600; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }

/* ============================ Program detail modal ============================ */
.program-modal { width: 560px; }
.program-hero { position: relative; height: 210px; overflow: hidden; flex-shrink: 0; }
.program-hero img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; mix-blend-mode: multiply; }
.program-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,20,60,0.1) 0%, rgba(30,20,60,0.82) 100%); }
.program-hero-content { position: absolute; left: 24px; bottom: 20px; z-index: 2; }
.program-tone { color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: 0.9; }
.program-hero-content h2 { font-size: 30px; font-weight: 900; letter-spacing: -0.8px; margin: 6px 0 12px; color: #fff; }
.program-hero-content .hero-btn { padding: 10px 20px; font-size: 13px; }

/* ============================ Class locator modal ============================ */
.locator-modal { width: 720px; }
.locator-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.locator-body { padding: 0; }
#locatorMap { height: 480px; width: 100%; background: #e6defa; }
.locator-fallback { display: flex; align-items: center; justify-content: center; height: 480px; padding: 24px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.locator-pin-wrap { background: transparent; border: none; }
.locator-pin {
    width: 32px; height: 42px; display: flex; align-items: center; justify-content: center;
    color: #fff; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.35));
}
.locator-pin svg { width: 100%; height: 100%; color: var(--accent); }

.program-header-meta { min-width: 0; }
.program-eyebrow { display: block; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 4px; }
.program-header-meta h2 { font-size: 20px; font-weight: 800; }

.program-about { color: var(--text-secondary); font-size: 14.5px; line-height: 1.7; margin-bottom: 20px; }
.program-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.program-stat { background: var(--bg-highlight); border-radius: var(--radius-md); padding: 16px 14px; text-align: center; }
.program-stat strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--accent-dark); }
.program-stat span { display: block; color: var(--text-secondary); font-size: 11.5px; margin-top: 4px; }

.detail-block { margin-bottom: 24px; }
.detail-block h4 { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.detail-benefits { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-benefits li { color: var(--text-primary); font-size: 13.5px; padding: 10px 14px; background: var(--bg-highlight); border-radius: var(--radius-md); }
.detail-freq-list { display: flex; flex-direction: column; gap: 8px; }
.detail-freq { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.detail-freq-hz { font-weight: 800; font-size: 14px; color: var(--accent-dark); min-width: 72px; font-variant-numeric: tabular-nums; }
.detail-freq-info { display: flex; flex-direction: column; }
.detail-freq-name { font-size: 14px; font-weight: 600; }
.detail-freq-desc { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.harmonic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.harmonic-chip { background: var(--bg-highlight); border: 1px solid var(--border-soft); color: var(--text-primary); font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: var(--radius-pill); }

/* ============================ Responsive ============================ */
@media (max-width: 900px) {
    .player-right .player-volume { display: none; }
    .player-controls { gap: 12px; }
    .vis-main { grid-template-columns: 170px 1fr; }
    .vis-freqs { display: none; }
}

@media (max-width: 700px) {
    :root {
        --bottom-nav-height: 60px;
        --player-height: 72px;
    }

    .bottom-nav { display: flex; }
    .topbar-nav { display: none; }

    /* Compact player bar */
    .player-bar { box-shadow: 0 -2px 12px rgba(90,70,160,0.08); }
    .player-progress { padding: 4px 12px 0; gap: 8px; }
    .progress-time { font-size: 10px; min-width: 32px; }
    .player-main { grid-template-columns: 1fr auto auto; padding: 0 12px 8px; gap: 10px; }
    .player-art { width: 44px; height: 44px; }
    .player-art span { font-size: 15px; }
    .player-title { font-size: 13px; }
    .player-subtitle { font-size: 11px; }
    .player-fav { display: none; }
    #playerShuffleBtn, #playerRepeatBtn, #nowPlayingToggle { display: none; }
    .player-controls { gap: 14px; }
    .transport-btn svg { width: 20px; height: 20px; }
    .play-toggle { width: 40px; height: 40px; }
    .play-toggle svg { width: 20px; height: 20px; }
    .player-right { gap: 8px; }

    .vis-scale { display: none; }
    .vis-main { grid-template-columns: 1fr; gap: 14px; }
    .vis-main .canvas-wrap { order: 1; }
    .vis-main .vis-side { order: 2; }
    .vis-side {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .vis-side .readout-row { display: none; }
    .vis-drawer-header { padding: 8px 16px; }
    .vis-drawer-body { padding: 12px 16px 16px; }
    #frequencyCanvas { height: 160px; }
    .vis-mixer { gap: 14px; margin-top: 12px; }
    .vis-mixer-desc { display: none; }
    .view-inner { padding: 0 16px 48px; }
    .topbar-inner { padding: 0 16px; }
    .card-grid { gap: 14px; }
    .card-grid .card { flex: 1 1 140px; }
    .quick-grid .quick-tile { flex: 1 1 45%; }

    .section { margin-top: 32px; }
    .section-header { margin-bottom: 14px; }
    .section-title { font-size: 22px; }

    .hero-banner { min-height: 0; align-items: center; }
    .hero-content { padding: 56px 20px; text-align: center; }
    .hero-content h1 { font-size: 34px; letter-spacing: -0.5px; }
    .hero-content p { font-size: 14px; margin-left: auto; margin-right: auto; }
    .hero-eyebrow { letter-spacing: 2px; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-btn { justify-content: center; width: 100%; }

    .feature-card { grid-template-columns: 1fr; }
    .feature-art { min-height: 200px; }
    .feature-body { padding: 24px; }
    .feature-title { font-size: 28px; }

    .science-layout { grid-template-columns: 1fr; gap: 20px; }
    .science-copy { padding: 20px; }

    .program-grid { gap: 16px; }
    .program-grid .program-card { flex: 1 1 100%; }
    .benefits-section { margin-top: 40px; padding: 40px 22px 36px; border-radius: 22px; }
    .benefits-masthead { margin-bottom: 36px; }
    .benefits-dek { font-size: 15px; }
    .benefit-grid { grid-template-columns: 1fr; gap: 34px; }
    .detail-benefits { grid-template-columns: 1fr; }
    .program-modal { width: 100%; }
    .locator-modal { width: 100%; }
    #locatorMap, .locator-fallback { height: 56vh; min-height: 320px; }

    .now-playing-panel { max-width: 100vw; }
}

@media (max-width: 400px) {
    .view-inner { padding: 0 12px 44px; }
    .quick-grid .quick-tile { flex: 1 1 100%; }
    .card-grid { gap: 12px; }
    .card-grid .card { flex: 1 1 128px; }
    .hero-content { padding: 44px 16px; }
    .hero-content h1 { font-size: 30px; }
    .hero-btn { padding: 12px 20px; font-size: 13px; }
    .vis-mixer { grid-template-columns: 1fr; gap: 16px; }
    .topbar-brand .logo-text { font-size: 16px; }
}

/* ============================ Access Gate ============================ */
.access-gate {
    position: fixed; inset: 0; z-index: 1100;
    background: linear-gradient(180deg, #ece5fb 0%, var(--bg-base) 70%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; overflow-y: auto;
}
.access-gate[hidden] { display: none; }
.gate-card {
    width: 460px; max-width: 100%;
    background: #fff; border-radius: 20px;
    padding: 40px 36px; text-align: center;
    box-shadow: var(--shadow-modal);
}
.gate-logo {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.gate-logo svg { width: 36px; height: 36px; }
.gate-title { font-family: var(--font-serif); font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 6px; color: var(--text-primary); }
.gate-subtitle { color: var(--text-secondary); font-size: 15px; margin: 0 0 28px; line-height: 1.5; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }
.gate-email {
    width: 100%; box-sizing: border-box;
    background: var(--bg-highlight); color: var(--text-primary);
    border: 1px solid var(--border-soft); border-radius: var(--radius-pill);
    padding: 14px 20px; font-size: 15px; outline: none; text-align: center;
}
.gate-email:focus { border-color: var(--accent); }
.gate-submit { width: 100%; padding: 14px; font-size: 15px; }
.gate-note { color: var(--text-subdued); font-size: 12.5px; line-height: 1.5; margin: 18px 0 0; }
.gate-sent-view .gate-sent-msg { font-size: 15px; color: var(--text-primary); margin: 0; line-height: 1.6; }
.gate-sent-view .btn-secondary { margin-top: 18px; width: 100%; }
.gate-sent-view .btn-link { margin-top: 12px; color: var(--accent); font-size: 14px; font-weight: 600; }
.gate-msg { margin-top: 14px; font-size: 13.5px; font-weight: 600; }
.gate-msg.error { color: #d14b4b; }
.gate-msg:empty { display: none; }

@media (max-width: 700px) {
    .access-gate { padding: 16px; }
    .gate-card { padding: 32px 22px; border-radius: 18px; }
    .gate-logo { width: 54px; height: 54px; margin-bottom: 14px; }
    .gate-logo svg { width: 30px; height: 30px; }
    .gate-title { font-size: 24px; }
    .gate-subtitle { font-size: 14px; margin-bottom: 22px; }
    .gate-email { font-size: 16px; padding: 13px 18px; }
    .gate-submit { font-size: 15px; padding: 14px; }
    .gate-note { font-size: 12px; margin-top: 16px; }
    .gate-sent-view .gate-sent-msg { font-size: 14.5px; }
}
