:root {
    --bg-deep: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a25;
    --accent-primary: #7c5cff;
    --accent-glow: #9d7fff;
    --accent-warm: #ff6b5c;
    --accent-gold: #ffb86c;
    --accent-cool: #5ce1e6;
    --text-primary: #e8e6f0;
    --text-secondary: #b8b6c8;
    --text-muted: #8a889a;
    --border-subtle: rgba(124, 92, 255, 0.15);
    --border-active: rgba(124, 92, 255, 0.4);
    
    /* SOMATIC PULSE ENGINE */
    --pulse-speed: 1s;
    --active-primary: #7c5cff;
    --active-secondary: #5ce1e6;
    --active-glow: rgba(124, 92, 255, 0.15);
}

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

html {
    overflow-x: hidden;
    overflow-y: auto;
}

body { 
    font-family: 'Outfit', sans-serif; 
    background: var(--bg-deep); 
    color: var(--text-primary); 
    min-height: 100dvh; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden;
    overflow-y: auto;
    position: relative; /* Allow absolute positioning context */
}

/* AMBIENT BACKGROUND WITH PULSE */
.ambient-bg { 
    position: fixed; 
    inset: 0; 
    pointer-events: none; 
    z-index: 0;
    background: radial-gradient(ellipse 80% 50% at 20% 20%, rgba(124, 92, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(92, 225, 230, 0.05) 0%, transparent 50%);
    transition: background 1.5s ease-in-out, opacity 1s ease-in-out;
}

.ambient-bg.tuning-active {
    background: radial-gradient(circle at 50% 50%, var(--active-glow) 0%, transparent 70%),
                radial-gradient(ellipse 60% 40% at 80% 80%, var(--active-glow) 0%, transparent 60%);
    animation: somatic-pulse var(--pulse-speed) infinite ease-in-out;
}

@keyframes somatic-pulse {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
    100% { opacity: 0.3; transform: scale(1); }
}

/* === GLOBAL TEXT HIGHLIGHTING SYSTEM === */
.highlight-active { color: var(--active-primary) !important; font-weight: 600; }
.highlight-old { color: var(--accent-warm) !important; font-weight: 500; }
.highlight-action { color: var(--accent-gold) !important; font-weight: 600; }
.content strong { color: var(--active-primary); font-weight: 700; }

/* === PHASE 1: INITIATION FLOW === */
.initiation-flow {
    position: fixed; inset: 0; background: var(--bg-deep); z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.initiation-screen { display: none; max-width: 500px; text-align: center; }
.initiation-screen.active { display: block; animation: fadeInUp 0.6s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.initiation-content h2 {
    font-size: 1.6rem; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.initiation-content p { font-size: 1rem; line-height: 1.7; color: var(--text-secondary); margin-bottom: 1rem; }
.initiation-next {
    margin-top: 2rem; background: var(--accent-primary); color: white; border: none;
    padding: 0.75rem 2rem; border-radius: 50px; font-size: 1.2rem; cursor: pointer;
    transition: all 0.3s; font-family: 'Outfit', sans-serif; font-weight: 500;
}
.initiation-next:hover { background: var(--accent-glow); transform: scale(1.05); }
.scan-animation { font-size: 2rem; color: var(--accent-cool); margin-top: 1.5rem; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

header { 
    padding: 0.15rem 1.25rem 0.5rem 1.25rem; /* Further reduced top padding to bring logo closer to top */
    border-bottom: 1px solid rgba(124, 92, 255, 0.1); /* Subtle border */
    background: transparent; /* Let waves show through */
    position: relative; 
    z-index: 100; /* Higher z-index to be above main content */
    flex-shrink: 0; 
    overflow: visible; /* Don't clip logo or waves */
}
.header-content { max-width: 800px; margin: 0 auto; display: flex; align-items: center; gap: 0.75rem; position: relative; z-index: 101; }
.logo { 
    width: 64px; /* Increased to be larger, closer to broadcast view size */
    height: 64px; 
    border-radius: 8px; 
    overflow: visible; /* Changed from hidden to visible so border doesn't get clipped */
    flex-shrink: 0; 
    position: relative;
    z-index: 102; /* Logo on top layer */
}
.logo img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 8px; /* Add border-radius to img instead */
    display: block;
}
.welcome-banner { width: 100%; max-width: 320px; margin-bottom: 0.5rem; border-radius: 12px; overflow: hidden; }
.welcome-banner img { width: 100%; height: auto; display: block; }

@media (max-width: 480px) {
    .welcome-banner { max-width: 60%; }
    .welcome-banner img { border-radius: 12px; aspect-ratio: 1/1; object-fit: cover; }
    .welcome { padding: 0.5rem 1rem 1.5rem 1rem; }
}

@media (orientation: landscape) and (max-height: 500px) {
    .welcome-banner { max-width: 50%; }
    .welcome-banner img { border-radius: 12px; aspect-ratio: auto; object-fit: contain; }
    .welcome { padding: 0.5rem 1rem 1.5rem 1rem; }
}
.title { font-size: 1rem; font-weight: 500; }
.subtitle { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); font-family: 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; display:none; } 
@media (min-width: 400px) { .subtitle { display: block; } }

main { 
    flex: 1; width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column;
    position: relative; z-index: 1; padding: 0 1.5rem;
    overflow: visible !important; /* Allow signal waves to extend above - use !important to override any other rules */
}

/* Ensure welcome section doesn't clip waves */
.welcome {
    overflow: visible;
    position: relative;
    z-index: 1;
}

/* Mobile: Expand more since chat icons removed from left */
@media (max-width: 768px) {
    main {
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* Small mobile: Even more breathing room */
@media (max-width: 480px) {
    main {
        padding: 0 0.75rem;
    }
}

#messages { 
    flex: 1; overflow-y: auto; padding: 1rem 0; display: flex; flex-direction: column; gap: 1rem;
    min-height: 0; scroll-behavior: smooth;
}

#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

.message { display: flex; gap: 0.75rem; animation: fadeIn 0.4s ease-out; flex-shrink: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; margin-top: 4px; overflow: hidden; }
.avatar.assistant { background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool)); padding: 0; box-shadow: 0 2px 8px rgba(124, 92, 255, 0.3); }
.content.assistant { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 12px 12px 12px 4px; width: fit-content; max-width: 95%; }
.content.assistant:has(.echo-card) { width: 100%; max-width: 100%; margin: 0 auto; display: flex; justify-content: center; }
.message.wide-panel .content.assistant { width: 100%; min-width: 100%; }
.message.user { flex-direction: row-reverse; }
.avatar.user { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.content.user { background: var(--bg-elevated); border: 1px solid var(--border-active); color: var(--text-primary); border-radius: 12px 12px 4px 12px; }
.content p { margin-bottom: 0.75rem; line-height: 1.7; }
.content p:last-child { margin-bottom: 0; }
.content { padding: 0.75rem 1rem; border-radius: 12px; line-height: 1.6; font-size: 0.95rem; }
.content.menu-container { background: transparent; border: none; padding: 0; width: 100%; max-width: 100%; }

/* CARDS */
.echo-card {
    background: var(--bg-elevated); border: 1px solid var(--border-active); border-radius: 16px;
    padding: 1.5rem; text-align: center; margin: 0.5rem auto; box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transition: all 0.4s ease;
    max-width: 600px;
    width: 100%;
}
.echo-card.tuned {
    border-color: var(--active-primary);
    box-shadow: 0 0 40px var(--active-glow), 0 12px 40px rgba(0,0,0,0.3);
    animation: card-glow var(--pulse-speed) infinite ease-in-out;
}
@keyframes card-glow {
    0%, 100% { box-shadow: 0 0 25px var(--active-glow), 0 12px 40px rgba(0,0,0,0.3); }
    50% { box-shadow: 0 0 45px var(--active-glow), 0 12px 40px rgba(0,0,0,0.3); }
}
.echo-title { font-family: 'Space Mono', monospace; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent-cool); margin-bottom: 0.25rem; }
.echo-principle {
    font-size: 1.8rem; font-weight: 700; margin: 0.5rem 0; line-height: 1.1;
    background: linear-gradient(135deg, var(--active-primary), var(--active-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.echo-body { color: var(--text-secondary); margin: 0.75rem 0; line-height: 1.6; font-size: 0.95rem; text-align: left; }

.practice-section { margin: 1.5rem 0; text-align: left; }
.practice-step { margin-bottom: 1.5rem; }
.practice-step strong { display: block; color: var(--accent-gold); margin-bottom: 0.5rem; font-size: 1rem; }
.practice-step p { margin: 0; line-height: 1.7; }

.youtube-embed {
    position: relative; margin: 1rem 0 0.5rem 0; border-radius: 12px; overflow: hidden;
    cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.3); background: #000; 
}
.play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3); font-size: 3rem; color: white; transition: all 0.2s;
}
.youtube-embed:hover .play-overlay { background: rgba(124, 92, 255, 0.4); transform: scale(1.05); }

.tuning-key-display {
    font-family: 'Space Mono', monospace; font-style: italic; color: var(--accent-warm);
    font-size: 1.2rem; margin: 1.5rem 0; padding: 1.25rem; text-align: center; line-height: 1.5;
    border-left: 3px solid var(--accent-warm); background: rgba(255,107,92,0.06); border-radius: 0 8px 8px 0;
}
.tuning-key-label {
    font-size: 0.8rem; color: var(--text-muted); text-align: center; margin-top: 0.75rem;
    font-style: italic; opacity: 0.9;
}

.secondary-button {
    margin-top: 1.5rem; background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-secondary); padding: 0.75rem 1.5rem; border-radius: 50px;
    font-family: 'Space Mono', monospace; font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.secondary-button:hover { border-color: var(--accent-primary); color: var(--text-primary); background: rgba(124, 92, 255, 0.05); }

/* ═══════════════════════════════════════════════════════════════════════════════
   LUCID TUNER AUDIO PLAYER
   ═══════════════════════════════════════════════════════════════════════════════ */

.lucid-player {
    background: var(--bg-elevated);
    border: 1px solid var(--border-active);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}
.lucid-player.audio-active {
    box-shadow: 0 0 30px var(--active-glow), 0 8px 30px rgba(0,0,0,0.3);
}

/* Player Header - Title/CTA */
.player-header {
    text-align: center;
    margin-bottom: 1rem;
}
.player-cta {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-cool);
    margin-bottom: 0.25rem;
}
.player-stream-title {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--active-primary), var(--active-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Album Art & Track Info */
.player-main {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}
.player-artwork {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    position: relative;
}
.player-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player-artwork-pulse {
    position: absolute;
    inset: 0;
    background: var(--active-glow);
    opacity: 0;
    transition: opacity 0.1s ease;
}
.player-track-info {
    flex: 1;
    min-width: 0;
}
.player-track-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}
.player-track-album {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Waveform Visualizer */
.player-visualizer {
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}
.visualizer-bar {
    width: 4px;
    min-height: 3px;
    height: 3px;
    background: linear-gradient(to top, var(--active-primary), var(--active-secondary));
    border-radius: 2px;
    transition: height 0.05s ease;
    opacity: 0.3;
}
/* Bars become fully visible when audio is active */
.lucid-player.audio-active .visualizer-bar {
    opacity: 1;
}

/* Progress Bar */
.player-progress {
    margin-bottom: 0.75rem;
}
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-surface);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: block !important;
    visibility: visible !important;
}
.progress-bar-fill {
    height: 100% !important;
    min-height: 6px !important;
    background: linear-gradient(90deg, #7c5cff, #5ce1e6) !important;
    border-radius: 3px;
    width: 0%;
    min-width: 0%;
    transition: width 0.1s linear;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1;
    will-change: width;
    box-sizing: border-box;
}
.progress-bar-container:hover .progress-bar-fill {
    box-shadow: 0 0 10px var(--active-glow);
}
.player-time {
    display: flex !important;
    justify-content: space-between;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.player-time .current-time,
.player-time .total-time {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Player Controls */
.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.player-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-btn:hover {
    color: var(--text-primary);
    background: rgba(124, 92, 255, 0.1);
}
.player-btn.active {
    color: var(--accent-primary);
}
.player-btn-play {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--active-primary), var(--active-secondary));
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px var(--active-glow);
}
.player-btn-play:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px var(--active-glow);
    background: linear-gradient(135deg, var(--active-primary), var(--active-secondary));
    color: white;
}
.player-btn svg {
    width: 20px;
    height: 20px;
}
.player-btn-play svg {
    width: 24px;
    height: 24px;
}

/* Volume Control */
.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
}
.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-surface);
    border-radius: 2px;
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--active-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--active-glow);
}
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--active-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Playlist Section */
.player-playlist {
    margin-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1rem;
}
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}
.playlist-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.playlist-toggle {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.playlist-toggle.expanded {
    transform: rotate(180deg);
}
.playlist-tracks {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.playlist-tracks.expanded {
    max-height: 300px;
    overflow-y: auto;
}
.playlist-tracks::-webkit-scrollbar {
    width: 4px;
}
.playlist-tracks::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}
.playlist-track {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.playlist-track:hover {
    background: rgba(124, 92, 255, 0.1);
}
.playlist-track.active {
    background: rgba(124, 92, 255, 0.15);
}
.playlist-track-num {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 20px;
    text-align: center;
}
.playlist-track.active .playlist-track-num {
    color: var(--accent-primary);
}
.playlist-track-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-track.active .playlist-track-name {
    color: var(--text-primary);
    font-weight: 500;
}
.playlist-track-playing {
    width: 16px;
    display: none;
}
.playlist-track.active .playlist-track-playing {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}
.playing-bar {
    width: 3px;
    background: var(--accent-primary);
    border-radius: 1px;
    animation: playingBars 0.8s ease infinite;
}
.playing-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.playing-bar:nth-child(2) { height: 12px; animation-delay: 0.2s; }
.playing-bar:nth-child(3) { height: 6px; animation-delay: 0.4s; }
@keyframes playingBars {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

/* YouTube Secondary Link */
.youtube-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.youtube-secondary:hover {
    border-color: #ff0000;
    color: var(--text-secondary);
    background: rgba(255, 0, 0, 0.05);
}
.youtube-secondary svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .lucid-player {
        padding: 1rem;
    }
    .player-artwork {
        width: 64px;
        height: 64px;
    }
    .player-track-title {
        font-size: 0.9rem;
    }
    .player-btn-play {
        width: 48px;
        height: 48px;
    }
    .visualizer-bar {
        width: 3px;
    }
}

.stream-button {
    width: 100%; background: linear-gradient(135deg, var(--active-primary), var(--active-secondary));
    color: white; border: none; padding: 1rem 1.5rem; border-radius: 12px;
    font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: all 0.3s; margin: 1.5rem 0 0.75rem 0; box-shadow: 0 4px 15px var(--active-glow);
}
.stream-button:hover { transform: translateY(-2px); box-shadow: 0 6px 25px var(--active-glow); }

/* CHIPS */
.intention-container { display: flex; flex-direction: column; width: 100%; margin-top: 1.25rem; }
.intention-row { display: flex; gap: 10px; margin-bottom: 10px; width: 100%; flex-shrink: 0; }
.intention-chip {
    width: calc(50% - 5px); flex-shrink: 0; background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 0.85rem 0.5rem;
    border-radius: 6px; font-family: 'Space Mono', monospace; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden;
    display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 8px; box-sizing: border-box;
}
.intention-chip:hover { transform: translateY(-2px); color: white; border-color: transparent; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.intention-chip.calm { border-left: 2px solid rgba(92, 225, 230, 0.5); }
.intention-chip.calm:hover { background: rgba(92, 225, 230, 0.1); border-color: var(--accent-cool); }
.intention-chip.calm .icon-display { color: var(--accent-cool); }
.intention-chip.energy { border-left: 2px solid rgba(255, 107, 92, 0.5); }
.intention-chip.energy:hover { background: rgba(255, 107, 92, 0.1); border-color: var(--accent-warm); }
.intention-chip.energy .icon-display { color: var(--accent-warm); }
.intention-chip.spirit { border-left: 2px solid rgba(124, 92, 255, 0.5); }
.intention-chip.spirit:hover { background: rgba(124, 92, 255, 0.1); border-color: var(--accent-primary); }
.intention-chip.spirit .icon-display { color: var(--accent-primary); }
.intention-chip.selected {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.2);
    color: var(--accent-cool);
}
.intention-chip.selected.calm {
    border-color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.2);
    color: var(--accent-cool);
}
.intention-chip.selected.energy {
    border-color: var(--accent-warm);
    background: rgba(255, 107, 92, 0.2);
    color: var(--accent-warm);
}
.intention-chip.selected.spirit {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.2);
    color: var(--accent-cool);
}
.icon-display { font-size: 1rem; opacity: 0.8; padding-left: 4px; }

.concept-stack { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; width: 100%; }
.concept-chip {
    background: rgba(124, 92, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-primary);
    padding: 1rem; border-radius: 12px; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    text-align: left; transition: all 0.2s; display: flex; align-items: center; gap: 0.75rem;
}
.concept-chip:hover { background: rgba(92, 225, 230, 0.1); border-color: var(--accent-cool); transform: translateY(-2px); }
.concept-icon { font-size: 1.4rem; color: var(--accent-cool); width: 24px; text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════════════
   PORTAL BUTTONS - CINEMATIC UI
   ═══════════════════════════════════════════════════════════════════════════════ */

.button-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

.big-button {
    position: relative;
    background: rgba(18, 18, 26, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-align: left;
    min-height: 90px;
    color: var(--text-primary);
}

/* The Background Layer (For GIF/Image) */
.portal-bg {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-size: cover;
    background-position: center;
    transition: opacity 0.4s, transform 3s ease, filter 0.4s;
    z-index: 0;
    filter: grayscale(100%) contrast(1.2);
    mix-blend-mode: luminosity;
}

/* Hover Effect: The Portal Opens */
.big-button:hover {
    border-color: var(--accent-cool);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(92, 225, 230, 0.1);
}

.big-button:hover .portal-bg {
    opacity: 0.4;
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* Content Layer (Keeps text readable on top of GIF) */
.big-button-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
}

.big-button .icon {
    font-size: 1.6rem;
    color: var(--accent-primary);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.big-button .text { flex-grow: 1; }

.big-button .label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    letter-spacing: 0.02em;
}

.big-button .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
}

/* --- SPECIFIC CARD STYLES --- */

/* 1. The Daily (Active/Alive) */
#dailyBtn .icon { 
    color: var(--accent-cool); 
    border-color: rgba(92, 225, 230, 0.3); 
    box-shadow: 0 0 15px rgba(92, 225, 230, 0.15); 
}
#dailyBtn:hover .icon { 
    background: var(--accent-cool); 
    color: var(--bg-deep); 
    box-shadow: 0 0 25px rgba(92, 225, 230, 0.4);
}

/* 2. The Tuner (Technical/Premium) */
#tuneBtn .icon { 
    color: var(--accent-gold); 
    border-color: rgba(255, 184, 108, 0.3);
}
#tuneBtn .portal-bg { opacity: 0.1; }
#tuneBtn:hover .icon {
    background: var(--accent-gold);
    color: var(--bg-deep);
}

/* 3. Go Deeper (Knowledge Hub) */
.go-deeper-btn .icon { 
    color: var(--accent-primary); 
    border-color: rgba(124, 92, 255, 0.3);
}
.go-deeper-btn:hover .icon {
    background: var(--accent-primary);
    color: white;
}

/* --- CSS VISUALIZER (The "Pulse" equalizer) --- */
.live-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 22px;
}

.bar {
    width: 4px;
    background: currentColor;
    border-radius: 2px;
    animation: equalize 1.2s infinite ease-in-out;
}

.bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.bar:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.bar:nth-child(3) { height: 75%; animation-delay: 0.3s; }
.bar:nth-child(4) { height: 90%; animation-delay: 0.45s; }

@keyframes equalize {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.4); opacity: 0.7; }
}

/* Lock badge for PRO features */
.lock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-warm));
    color: var(--bg-deep);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    z-index: 3;
}

.input-area { padding: 0.75rem 0 1rem 0; background: var(--bg-deep); border-top: 1px solid var(--border-subtle); display: flex; gap: 0.5rem; align-items: flex-end; flex-shrink: 0; }
#userInput { flex: 1; background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-primary); padding: 0.6rem 0.9rem; border-radius: 10px; resize: none; font-family: inherit; font-size: 0.9rem; max-height: 100px; }
#userInput:focus { outline: none; border-color: var(--accent-primary); }
#sendButton { 
    background: var(--accent-primary); color: white; border: none; width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; padding: 0; padding-bottom: 2px;
}

.welcome { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: flex-start; 
    text-align: center; 
    padding: 2rem 1rem 2rem 1rem; /* Added top padding to give waves room to extend upward */
    margin-top: -2rem; /* Negative margin to visually bring content up while allowing overflow */
    overflow: visible !important; /* Changed from overflow-y: auto to visible so waves aren't clipped */
    position: relative;
    z-index: 1;
} /* Reduced top padding to bring content closer to header */
.welcome h1 { font-size: 1.8rem; margin-bottom: 0.5rem; background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* DISABLED BUTTON STATE (Free Tier) */
.big-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.big-button.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-subtle);
}
.big-button.disabled:hover .portal-bg {
    opacity: 0.15;
    transform: none;
    filter: grayscale(100%);
}
.big-button.disabled:hover .icon {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}

/* DAILY COUNTDOWN */
.daily-countdown {
    font-size: 0.75rem;
    color: var(--accent-warm);
    margin-top: 0.25rem;
    font-family: 'Space Mono', monospace;
}

/* UPGRADE MODAL - see enhanced version below */
.upgrade-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}
.upgrade-close:hover {
    color: var(--text-primary);
}
.upgrade-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.upgrade-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.tier-comparison {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}
.tier-column {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    background: var(--bg-elevated);
}
.tier-column.paid {
    border: 1px solid var(--accent-primary);
    background: rgba(124, 92, 255, 0.1);
}
.tier-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.tier-column.paid .tier-label {
    color: var(--accent-primary);
}
.tier-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.tier-features {
    list-style: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.8;
}
.tier-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tier-features .check {
    color: var(--accent-cool);
}
.tier-features .cross {
    color: var(--text-muted);
    opacity: 0.5;
}
.upgrade-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px var(--active-glow);
}
.upgrade-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--active-glow);
}
.upgrade-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* UPSELL BANNER (after daily use) */
.upsell-banner {
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    text-align: center;
}
.upsell-banner p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.upsell-banner button {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.upsell-banner button:hover {
    background: var(--accent-primary);
    color: white;
}

/* LOADING STATE IMPROVEMENTS */
.loading-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}
.loading-message .loading-text {
    animation: loadingPulse 2s ease-in-out infinite;
}
@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.loading-message .loading-dots {
    display: inline-block;
    margin-left: 4px;
}
.loading-message .loading-dots::after {
    content: '';
    animation: loadingDots 1.5s steps(4, end) infinite;
}
@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* ERROR STATE */
.error-message {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 107, 92, 0.1);
    border: 1px solid rgba(255, 107, 92, 0.3);
    border-radius: 12px;
    margin: 1rem 0;
}
.error-message p {
    color: var(--accent-warm);
    margin-bottom: 1rem;
}
.retry-button {
    background: var(--accent-warm);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.retry-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 92, 0.3);
}

/* MODAL ANIMATION */
.upgrade-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}
.upgrade-modal.active {
    display: flex;
    opacity: 1;
}
.upgrade-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: 20px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--active-glow);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
}
.upgrade-modal.active .upgrade-content {
    transform: translateY(0);
}

/* MOBILE RESPONSIVE IMPROVEMENTS */
@media (max-width: 480px) {
    .tier-comparison {
        flex-direction: column;
        gap: 0.75rem;
    }
    .tier-column {
        padding: 0.85rem;
    }
    .tier-price {
        font-size: 1rem;
    }
    .tier-features {
        font-size: 0.75rem;
    }
    .upgrade-content {
        padding: 1.5rem;
        border-radius: 16px;
    }
    .upgrade-title {
        font-size: 1.2rem;
    }
    .upgrade-subtitle {
        font-size: 0.85rem;
    }
    .upgrade-cta {
        padding: 0.85rem 1.25rem;
        font-size: 0.95rem;
    }
    .big-button {
        padding: 0.85rem 1rem;
    }
    .big-button .label {
        font-size: 1rem;
    }
    .big-button .desc {
        font-size: 0.8rem;
    }
    .echo-card {
        padding: 1.25rem;
    }
    .echo-principle {
        font-size: 1.5rem;
    }
    .tuning-key-display {
        font-size: 1rem;
        padding: 1rem;
    }
    .intention-chip {
        padding: 0.75rem 0.4rem;
        font-size: 0.7rem;
    }
}

/* Ensure modal has safe area on mobile */
@media (max-height: 600px) {
    .upgrade-modal {
        padding: 1rem;
        align-items: flex-start;
        overflow-y: auto;
    }
    .upgrade-content {
        margin: auto;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GO DEEPER MODAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.go-deeper-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.go-deeper-modal.active {
    display: flex;
    opacity: 1;
}

.go-deeper-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: 20px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--active-glow);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.go-deeper-modal.active .go-deeper-content {
    transform: translateY(0);
}

.go-deeper-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.go-deeper-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.go-deeper-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.go-deeper-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.go-deeper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.go-deeper-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.go-deeper-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.go-deeper-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.go-deeper-card-subhead {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.go-deeper-card-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.go-deeper-card-btn {
    background: transparent;
    border: 1px solid var(--border-active);
    color: var(--accent-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    margin-top: auto;
}

.go-deeper-card-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
}

/* Mobile: Stack cards vertically */
@media (max-width: 768px) {
    .go-deeper-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .go-deeper-content {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .go-deeper-title {
        font-size: 1.5rem;
    }
    
    .go-deeper-card {
        padding: 1.25rem;
    }
    
    .go-deeper-card-title {
        font-size: 1.1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BROADCAST SIGNAL ANIMATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.signal-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 1rem auto; /* Removed negative margin to keep image in proper position */
    padding: 200px 0 0 0; /* Add top padding to give waves room to extend upward without clipping */
    margin-top: -200px; /* Negative margin to visually keep content in same position */
    display: flex;
    align-items: center; /* This centers the image vertically in the content area */
    justify-content: center;
    overflow: visible !important; /* Ensure waves can extend beyond container */
    z-index: 1000; /* Highest z-index so waves appear above everything */
    /* Allow waves to extend beyond container boundaries */
    clip-path: none;
    -webkit-clip-path: none;
    /* Ensure container itself can extend beyond parent boundaries */
    isolation: isolate; /* Create new stacking context */
}

.signal-image {
    width: 78%; /* Increased from 75% to be closer to broadcast view (80%) but slightly smaller */
    height: auto;
    position: relative;
    z-index: 1;
    display: block;
    border-radius: 12px;
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 65%);
    mask-image: radial-gradient(circle, black 30%, transparent 65%);
    opacity: 0.95;
}

.signal-wave {
    position: absolute; /* Position relative to signal-container */
    /* Position will be set by JavaScript to center on the image, with CSS fallback */
    top: 50%; /* Fallback: center in container if JS doesn't run */
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0; /* Animation will make it visible */
    z-index: 1001; /* Highest z-index so waves appear above everything including logo */
    box-shadow: 0 0 15px rgba(124, 92, 255, 0.2);
    pointer-events: none;
    /* Allow waves to extend above the container and over the header */
    overflow: visible;
    /* Ensure waves aren't clipped by any parent */
    clip-path: none;
    -webkit-clip-path: none;
    /* Extend beyond container boundaries */
    will-change: transform, width, height, opacity;
}

.wave-1 { animation: pulseWave 3s infinite ease-out; animation-delay: 0s; }
.wave-2 { animation: pulseWave 3s infinite ease-out; animation-delay: 1s; }
.wave-3 { animation: pulseWave 3s infinite ease-out; animation-delay: 2s; }

@keyframes pulseWave {
    0% { 
        width: 50px; height: 50px; 
        opacity: 0.8; 
        border-width: 2px;
        border-color: var(--accent-primary);
    }
    100% { 
        width: 380px; height: 380px; 
        opacity: 0; 
        border-width: 0px;
        border-color: var(--accent-cool);
    }
}

/* App Title & Tagline */
.app-title {
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 380px;
    margin: 0 auto 1.5rem auto;
    line-height: 1.5;
    padding: 0 1rem;
}

@media (max-width: 480px) {
    .signal-container {
        max-width: 280px;
        margin-bottom: 0.75rem;
    }
    
    .app-title {
        font-size: 1.4rem;
    }
    
    .app-tagline {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    @keyframes pulseWave {
        0% { width: 40px; height: 40px; opacity: 0.6; border-width: 2px; }
        100% { width: 300px; height: 300px; opacity: 0; border-width: 0px; border-color: var(--accent-cool); }
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS MODAL STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Settings Gear Button in Header */
.settings-gear {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: 8px;
}

.settings-gear:hover {
    color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.1);
}

.settings-gear svg {
    width: 24px;
    height: 24px;
}

/* Update header-content to accommodate gear */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 600px;
    padding: 0 1rem;
}

.header-content .logo {
    flex-shrink: 0;
}

.header-content .title {
    flex-grow: 1;
    text-align: center;
}

/* Settings Modal Overlay */
.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.settings-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Settings Content Container */
.settings-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.settings-modal.active .settings-content {
    transform: translateY(0);
}

/* Settings Close Button */
.settings-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s;
}

.settings-close:hover {
    color: var(--text-primary);
}

/* Settings Title */
.settings-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.settings-label-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

/* Settings Input Fields */
.settings-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 0.875rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.settings-input:focus {
    border-color: var(--accent-cool);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 15px rgba(92, 225, 230, 0.1);
}

.settings-input:read-only {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Settings Divider */
.settings-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1.5rem 0;
}

/* PRO Badge for Settings */
.settings-pro-badge {
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Signal Checkboxes Grid */
.signal-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.signal-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.signal-checkbox-item:hover:not(.disabled) {
    border-color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.05);
}

.signal-checkbox-item.checked {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.1);
    color: var(--text-primary);
}

.signal-checkbox-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.signal-checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.signal-checkbox-item input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.signal-checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.signal-checkbox-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.signal-checkbox-item .signal-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Settings Tier Section */
.settings-tier-section {
    text-align: center;
}

.settings-tier-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.settings-tier-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.settings-tier-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.settings-tier-value.free {
    color: var(--text-secondary);
}

.settings-tier-value.paid {
    color: var(--accent-cool);
}

/* Settings Upgrade Button */
.settings-upgrade-btn {
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
}

.settings-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

.settings-upgrade-btn.hidden {
    display: none;
}

/* Settings Logout Button */
.settings-logout-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.settings-logout-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Settings Save Button */
.settings-save-btn {
    width: 100%;
    background: rgba(92, 225, 230, 0.1);
    border: 1px solid var(--accent-cool);
    color: var(--accent-cool);
    padding: 1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1.5rem;
}

.settings-save-btn:hover {
    background: rgba(92, 225, 230, 0.2);
}

.settings-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Settings Save Status */
.settings-save-status {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    min-height: 1.2rem;
}

.settings-save-status.success {
    color: var(--accent-cool);
}

.settings-save-status.error {
    color: #ff6b6b;
}

.settings-save-status.loading {
    color: var(--text-muted);
}

/* Mobile Responsiveness for Settings */
@media (max-width: 480px) {
    .settings-content {
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    .settings-title {
        font-size: 1.2rem;
    }
    
    .signal-checkboxes {
        grid-template-columns: 1fr;
    }
    
    .signal-checkbox-item {
        font-size: 0.85rem;
    }
    
    .settings-gear svg {
        width: 22px;
        height: 22px;
    }
}

/* Custom Scrollbar for Settings Content */
.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PILOT'S INTERFACE - Signal Profile Modal
   Add this entire section to the END of your styles.css file
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Signal Profile Button (replaces gear icon) */
.signal-profile-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    margin-left: auto;
}

.signal-profile-btn:hover {
    background: rgba(124, 92, 255, 0.1);
}

.signal-profile-btn svg {
    width: 26px;
    height: 26px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.signal-profile-btn:hover svg {
    color: var(--accent-cool);
}

.decoder-manual-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    margin-left: 0.5rem;
}

.decoder-manual-btn:hover {
    background: rgba(92, 225, 230, 0.1);
}

.decoder-manual-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.decoder-manual-btn:hover svg {
    color: var(--accent-cool);
}

.play-pause-music-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
    margin-right: 0.5rem;
}

.play-pause-music-btn:hover {
    background: rgba(124, 92, 255, 0.1);
}

.play-pause-music-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.play-pause-music-btn:hover svg {
    color: var(--accent-primary);
}

/* Decoder Manual Modal */
.decoder-manual-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.decoder-manual-modal.active {
    display: flex;
    opacity: 1;
}

.decoder-manual-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--active-glow);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.decoder-manual-modal.active .decoder-manual-content {
    transform: translateY(0);
}

.decoder-manual-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.decoder-manual-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.decoder-manual-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.decoder-manual-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

.decoder-manual-glossary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glossary-item {
    padding: 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.glossary-term {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-cool);
    margin-bottom: 0.5rem;
}

.glossary-definition {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Guided Tuning Modal */
.guided-tuning-modal {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Add a subtle background pulse layer inside the modal (like ambient-bg) */
.guided-tuning-modal::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse 80% 50% at 20% 20%, rgba(124, 92, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(92, 225, 230, 0.05) 0%, transparent 50%);
    transition: background 1.5s ease-in-out, opacity 1s ease-in-out;
}

.guided-tuning-modal.tuning-active::before {
    background: radial-gradient(circle at 50% 50%, var(--active-glow) 0%, transparent 70%),
                radial-gradient(ellipse 60% 40% at 80% 80%, var(--active-glow) 0%, transparent 60%);
    animation: somatic-pulse var(--pulse-speed) infinite ease-in-out;
}

.guided-tuning-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1; /* Ensure content is above the ::before pseudo-element */
}

.guided-step {
    display: none;
    animation: fadeInUp 0.6s ease-out;
}

.guided-step.active {
    display: block;
}

.guided-step-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.guided-step-body {
    margin-top: 2rem;
}

/* Reduce top spacing for Step 5 (delivery page) */
#guidedStep5 .guided-step-body {
    margin-top: 0.5rem;
}

#guidedEchoCard .echo-card {
    margin-top: 0;
}

.guided-question {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.guided-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.guided-chip {
    padding: 0.75rem 1.25rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.guided-chip:hover {
    border-color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.1);
}

.guided-chip.selected {
    border-color: var(--accent-primary);
    background: rgba(124, 92, 255, 0.2);
    color: var(--accent-cool);
}

.intention-chip:disabled,
.intention-chip[disabled],
button.intention-chip:disabled,
button.intention-chip[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

button.intention-chip {
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

button.intention-chip:hover:not(:disabled) {
    transform: translateY(-2px);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.guided-next-btn {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

.guided-next-btn:hover:not(:disabled) {
    background: var(--accent-glow);
    transform: scale(1.05);
}

.guided-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.guided-interference-result {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 1.5rem;
}

.guided-somatic-action {
    background: var(--bg-elevated);
    border: 1px solid var(--border-active);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.guided-tuning-key {
    background: var(--bg-elevated);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-cool);
    line-height: 1.6;
}

.guided-key-instruction {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.6;
}

/* Ensure progress bar is always visible in guided tuning modal */
#guidedEchoCard .player-progress,
#guidedEchoCard .progress-bar-container,
#guidedEchoCard .progress-bar-fill {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#guidedEchoCard .progress-bar-container {
    height: 6px !important;
    width: 100% !important;
}

#guidedEchoCard .progress-bar-fill {
    height: 100% !important;
    min-width: 0% !important;
}

/* Ensure progress bar is always visible in regular echo cards (daily tuning) */
.echo-card .player-progress,
.echo-card .progress-bar-container,
.echo-card .progress-bar-fill {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.echo-card .progress-bar-container {
    height: 6px !important;
    width: 100% !important;
    background: var(--bg-surface) !important;
}

.echo-card .progress-bar-fill {
    height: 100% !important;
    min-height: 6px !important;
    min-width: 0% !important;
    background: linear-gradient(90deg, #7c5cff, #5ce1e6) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Pilot Interface Modal */
.pilot-modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pilot-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Pilot Modal Header */
.pilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.pilot-title {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pilot-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s;
    border-radius: 8px;
}

.pilot-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Tab Navigation */
.pilot-tabs {
    display: flex;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1rem;
}

.pilot-tab {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.pilot-tab:hover {
    color: var(--text-secondary);
}

.pilot-tab.active {
    color: var(--accent-cool);
}

.pilot-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-cool);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.pilot-tab.active::after {
    transform: scaleX(1);
}

.pilot-tab-icon {
    margin-right: 0.5rem;
}

.pilot-tab .pro-indicator {
    font-size: 0.6rem;
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Tab Content Panels */
.pilot-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.pilot-panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.pilot-panel.active {
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PROTOCOLS TAB (Settings/Signal Exclusions)
   ═══════════════════════════════════════════════════════════════════════════════ */

.protocols-header {
    text-align: center;
    margin-bottom: 2rem;
}

.protocols-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.protocols-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Profile Section */
.profile-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-field {
    margin-bottom: 1rem;
}

.profile-field:last-child {
    margin-bottom: 0;
}

.profile-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

.profile-input:focus {
    border-color: var(--accent-cool);
    background: rgba(255, 255, 255, 0.05);
}

.profile-input:read-only {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Signal Exclusion Section */
.signal-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.signal-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.signal-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.signal-section-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Signal Chips Grid */
.signal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.signal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.signal-chip:hover:not(.disabled) {
    border-color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.08);
}

.signal-chip.excluded {
    border-color: var(--accent-warm);
    background: rgba(255, 107, 92, 0.15);
    color: var(--accent-warm);
}

.signal-chip.excluded .signal-chip-icon {
    color: var(--accent-warm);
}

.signal-chip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.signal-chip-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.signal-chip input[type="checkbox"] {
    display: none;
}

/* Account Section */
.account-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.account-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.account-tier-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.account-tier-value {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.account-tier-value.free {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.account-tier-value.paid {
    color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.1);
}

.account-upgrade-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.3);
}

.account-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4);
}

.account-upgrade-btn.hidden {
    display: none;
}

.account-logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.7rem;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.75rem;
}

.account-logout-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* Save Button */
.protocols-save-btn {
    width: 100%;
    background: rgba(92, 225, 230, 0.1);
    border: 1px solid var(--accent-cool);
    color: var(--accent-cool);
    padding: 1rem;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.protocols-save-btn:hover {
    background: rgba(92, 225, 230, 0.2);
}

.protocols-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.protocols-save-status {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.75rem;
    min-height: 1.2rem;
}

.protocols-save-status.success {
    color: var(--accent-cool);
}

.protocols-save-status.error {
    color: #ff6b6b;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SIGNAL LOG TAB (History)
   ═══════════════════════════════════════════════════════════════════════════════ */

.signal-log-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.signal-log-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.signal-log-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.signal-log-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cool));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* Session Cards */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s;
}

.session-card:hover {
    border-color: var(--border-active);
    transform: translateX(4px);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.session-date {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.session-mode {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(124, 92, 255, 0.1);
    color: var(--accent-primary);
}

.session-mode.daily {
    background: rgba(92, 225, 230, 0.1);
    color: var(--accent-cool);
}

.session-frequency {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--active-primary, var(--accent-primary)), var(--active-secondary, var(--accent-cool)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.session-principle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.session-echo {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.session-context {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

.session-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.session-action-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.session-action-btn:hover {
    border-color: var(--accent-cool);
    color: var(--accent-cool);
    background: rgba(92, 225, 230, 0.05);
}

.session-action-btn.upgrade-btn {
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    font-weight: 600;
    border: none;
}

.session-action-btn.upgrade-btn:hover {
    background: linear-gradient(135deg, #6344e6, var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.4);
}

/* Blur Effect for Free Users */
.session-card.blurred .session-frequency,
.session-card.blurred .session-principle,
.session-card.blurred .session-echo {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}

/* Removed - using .blurred-actions class instead */

.session-card.blurred .session-action-btn.upgrade-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 21 !important;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Encrypted label - now in HTML, not ::after */
.session-card.blurred .encrypted-label {
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Upgrade button container for blurred sessions */
.session-card.blurred .session-actions.blurred-actions {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    z-index: 20 !important;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5) !important;
    border-radius: 8px;
    border: 2px solid rgba(124, 92, 255, 0.6) !important;
    box-shadow: 0 4px 12px rgba(124, 92, 255, 0.3) !important;
}

.session-card.blurred .session-actions.blurred-actions .session-action-btn.upgrade-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: linear-gradient(135deg, var(--accent-primary), #6344e6) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.5) !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.session-card.blurred .session-actions.blurred-actions {
    pointer-events: auto !important;
    z-index: 998 !important;
}

/* Regular session actions (non-blurred) */
.session-card:not(.blurred) .session-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

/* Pinned Sessions */
.session-card.pinned {
    border-color: var(--accent-gold);
    background: linear-gradient(135deg, var(--bg-elevated), rgba(255, 184, 108, 0.05));
}

.session-card.pinned:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(255, 184, 108, 0.2);
}

.session-pin-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.session-pin-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 184, 108, 0.1);
    transform: scale(1.1);
}

.session-pin-btn.pinned {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(255, 184, 108, 0.15);
}

/* Upgrade CTA in Signal Log */
.signal-log-upgrade {
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.1), rgba(92, 225, 230, 0.1));
    border: 1px solid var(--border-active);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}

.signal-log-upgrade-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.signal-log-upgrade-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.signal-log-upgrade-btn {
    background: linear-gradient(135deg, var(--accent-primary), #6344e6);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.signal-log-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 92, 255, 0.4);
}

/* Loading State */
.signal-log-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.signal-log-loading .loading-spinner {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}

/* Empty State */
.signal-log-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.signal-log-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.signal-log-empty-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.signal-log-empty-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Load More */
.load-more-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-subtle);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.load-more-btn:hover {
    border-color: var(--accent-cool);
    color: var(--accent-cool);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .pilot-header {
        padding: 0.75rem 1rem;
    }
    
    .pilot-title {
        font-size: 1rem;
    }
    
    .pilot-tabs {
        padding: 0 0.5rem;
    }
    
    .pilot-tab {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .pilot-content {
        padding: 1rem;
    }
    
    .signal-chips {
        gap: 0.4rem;
    }
    
    .signal-chip {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .signal-log-stats {
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .session-card {
        padding: 0.85rem;
    }
}

/* Custom Scrollbar for Pilot Content */
.pilot-content::-webkit-scrollbar {
    width: 6px;
}

.pilot-content::-webkit-scrollbar-track {
    background: transparent;
}

.pilot-content::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.pilot-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile: Reduce side padding for more real estate */
@media (max-width: 480px) {
    .welcome {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .button-stack {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .big-button {
        margin-left: 0;
        margin-right: 0;
    }
    
    .app-tagline {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Also tighten the tuning result page if needed */
    #tuning-result {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Allow broadcast waves to extend over header */
.signal-container {
    overflow: visible;
}

.signal-wave {
    z-index: 1000; /* Higher than header */
    pointer-events: none; /* So it doesn't block clicks */
}

/* Optional: Remove the faint header line */
header {
    border-bottom: none;
    background: transparent;
}
