/* Veritas Breath - System Design & Aesthetics */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Default Theme: Zen Aurora (Teal & Emerald) */
    --bg-primary: #0a0f18;
    --bg-secondary: rgba(15, 23, 42, 0.45);
    --bg-panel: rgba(30, 41, 59, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(20, 184, 166, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #14b8a6;
    --accent-glow: rgba(20, 184, 166, 0.35);
    --accent-gradient: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
    /* Phase Colors */
    --color-inhale: #06b6d4;      /* Cyan */
    --color-exhale: #0d9488;      /* Teal */
    --color-hold-full: #8b5cf6;   /* Purple */
    --color-hold-empty: #ec4899;  /* Pink */
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Violet Mist Theme */
.theme-violet {
    --bg-primary: #0a0b1e;
    --bg-secondary: rgba(17, 12, 38, 0.45);
    --bg-panel: rgba(28, 22, 59, 0.4);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(139, 92, 246, 0.15);
    
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.35);
    --accent-gradient: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #a78bfa 100%);
    
    --color-inhale: #a78bfa;
    --color-exhale: #6366f1;
    --color-hold-full: #ec4899;
    --color-hold-empty: #f43f5e;
}

/* Forest Rain Theme */
.theme-forest {
    --bg-primary: #05120e;
    --bg-secondary: rgba(6, 26, 20, 0.45);
    --bg-panel: rgba(10, 37, 29, 0.4);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(34, 197, 94, 0.12);
    
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.35);
    --accent-gradient: linear-gradient(135deg, #047857 0%, #10b981 50%, #34d399 100%);
    
    --color-inhale: #34d399;
    --color-exhale: #059669;
    --color-hold-full: #14b8a6;
    --color-hold-empty: #84cc16;
}

/* Wim Hof Blue (Ice Theme) */
.theme-ice {
    --bg-primary: #040d1a;
    --bg-secondary: rgba(6, 21, 44, 0.5);
    --bg-panel: rgba(13, 37, 70, 0.4);
    --border-color: rgba(255, 255, 255, 0.09);
    --border-glow: rgba(56, 189, 248, 0.18);
    
    --accent: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.35);
    --accent-gradient: linear-gradient(135deg, #0369a1 0%, #0ea5e9 50%, #38bdf8 100%);
    
    --color-inhale: #38bdf8;
    --color-exhale: #0284c7;
    --color-hold-full: #f43f5e;
    --color-hold-empty: #06b6d4;
}

/* Solar Flare Theme */
.theme-solar {
    --bg-primary: #120907;
    --bg-secondary: rgba(29, 13, 10, 0.45);
    --bg-panel: rgba(44, 19, 14, 0.4);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(249, 115, 22, 0.15);
    
    --accent: #f97316;
    --accent-glow: rgba(249, 115, 22, 0.35);
    --accent-gradient: linear-gradient(135deg, #c2410c 0%, #f97316 50%, #fdba74 100%);
    
    --color-inhale: #fca5a5;
    --color-exhale: #ea580c;
    --color-hold-full: #a855f7;
    --color-hold-empty: #fbbf24;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: background-color var(--transition-slow);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(20, 184, 166, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
}

.welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
        rgba(3, 8, 16, .82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.welcome-overlay[hidden] { display: none; }
body.welcome-open { overflow: hidden; }

.welcome-card {
    position: relative;
    width: min(100%, 520px);
    max-height: min(760px, calc(100dvh - 40px));
    overflow: auto;
    padding: clamp(28px, 6vw, 44px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 42%),
        rgba(10, 17, 30, .94);
    border-color: color-mix(in srgb, var(--accent) 24%, rgba(255,255,255,.08));
    box-shadow: 0 30px 90px rgba(0, 0, 0, .52), 0 0 46px color-mix(in srgb, var(--accent) 10%, transparent);
}

.welcome-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .035);
    font: inherit;
    font-size: 1.45rem;
    cursor: pointer;
}

.welcome-mark {
    margin-bottom: 16px;
    border-radius: 24px;
    filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 38%, transparent));
}

.welcome-card h2 {
    max-width: 420px;
    margin: 10px 0 12px;
    font-size: clamp(1.75rem, 6vw, 2.45rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.welcome-card > p {
    max-width: 430px;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.62;
}

.welcome-benefits {
    width: 100%;
    margin: 24px 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.welcome-benefits span {
    min-height: 88px;
    padding: 13px 9px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .025);
    font-size: .78rem;
    line-height: 1.3;
}

.welcome-benefits strong {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: #fff;
    background: color-mix(in srgb, var(--accent) 45%, transparent);
}

.welcome-actions {
    width: min(100%, 360px);
    display: grid;
    justify-items: center;
    gap: 10px;
}

.welcome-start { width: 100%; }

.welcome-account-invite {
    min-height: 42px;
    padding: 6px 14px;
    border: 0;
    color: color-mix(in srgb, var(--accent) 82%, #fff);
    background: transparent;
    font: inherit;
    font-size: .88rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 42%, transparent);
    text-underline-offset: 4px;
    cursor: pointer;
}

.welcome-account-invite:hover,
.welcome-account-invite:focus-visible {
    color: #fff;
    text-decoration-color: var(--accent);
}

.welcome-card > small { margin-top: 12px; color: var(--text-muted); }

@media (max-width: 520px) {
    .welcome-overlay { padding-inline: 14px; }
    .welcome-card { padding: 32px 18px 26px; border-radius: 26px; }
    .welcome-mark { width: 68px; height: 68px; border-radius: 20px; }
    .welcome-benefits { gap: 6px; }
    .welcome-benefits span { min-height: 78px; padding-inline: 5px; font-size: .7rem; }
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-glow);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), 0 0 15px var(--border-glow);
}

.glass-button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-2px);
}

.glass-button:active {
    transform: translateY(0);
}

.glass-button.primary {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.glass-button.primary:hover {
    background: var(--accent-gradient);
    filter: brightness(1.15);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Header */
header {
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 40%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 10px;
    filter: drop-shadow(0 0 8px var(--accent-glow));
    flex: 0 0 auto;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Main Container Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Dashboard View (Selection) */
#dashboard-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 100%;
    opacity: 1;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.dashboard-hero {
    text-align: center;
    margin-bottom: 10px;
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.dashboard-hero p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.techniques-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Compact practice discovery: one recommendation plus a scannable gallery. */
#techniques-grid.technique-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.technique-recommendation {
    position: relative;
    grid-column: 1 / -1;
    min-height: 190px;
    padding: 26px 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    border-color: color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,.08));
    color: #fff;
    background-image: var(--recommendation-image);
    background-position: center;
    background-size: cover;
    text-align: left;
    font: inherit;
    cursor: pointer;
    isolation: isolate;
}

.recommendation-shade {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, rgba(3,8,18,.95) 0%, rgba(3,8,18,.75) 52%, rgba(3,8,18,.18) 100%);
}

.recommendation-copy { max-width: 610px; display: grid; gap: 6px; }
.recommendation-copy small { color: var(--accent); font-size: .66rem; font-weight: 850; letter-spacing: .12em; }
.recommendation-copy strong { font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.08; }
.recommendation-copy > span:not(.recommendation-meta) { color: rgba(255,255,255,.76); font-size: .9rem; line-height: 1.45; }
.recommendation-copy .recommendation-meta { margin-top: 4px; color: rgba(255,255,255,.68); font-size: .75rem; font-weight: 650; }
.recommendation-action {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 999px;
    color: #041416;
    background: var(--accent);
    font-size: .82rem;
    font-weight: 800;
}
.recommendation-action b { font-size: 1.1rem; }

#techniques-grid .content-card-shell { min-width: 0; }
#techniques-grid .technique-card { min-height: 330px; padding: 0 16px 16px; }
#techniques-grid .card-landscape { height: 118px; flex-basis: 118px; margin: 0 -16px 13px; }
#techniques-grid .card-landscape .card-icon { left: 13px; bottom: 11px; width: 40px; height: 40px; border-radius: 12px; }
#techniques-grid .card-info h3 {
    min-height: 2.35em;
    margin: 0 0 7px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 1.05rem;
    line-height: 1.18;
}
#techniques-grid .card-info p { min-height: 2.7em; margin-bottom: 9px; font-size: .8rem; line-height: 1.35; }
#techniques-grid .technique-purpose-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .61rem;
}
#techniques-grid .card-benefits { display: none; }
#techniques-grid .card-metadata { padding-top: 11px; gap: 8px; flex-wrap: wrap; }
#techniques-grid .meta-item { font-size: .68rem; }
#techniques-grid .access-badge { top: 8px; right: 48px; font-size: .54rem; padding: 4px 7px; }
#techniques-grid .favorite-toggle { top: 8px; right: 8px; width: 34px; height: 34px; }
.technique-gallery-empty { grid-column: 1 / -1; min-height: 150px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; }
.technique-gallery-empty span { color: var(--text-muted); }

.music-library-view {
    width: min(100%, 1120px);
    margin: 0 auto;
    animation: fadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.music-library-header {
    max-width: 660px;
    margin: 0 auto 28px;
    text-align: center;
}

.music-library-header h2 {
    margin: 7px 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.music-library-header p,
.music-library-note {
    color: var(--text-muted);
    line-height: 1.55;
}

.music-filters {
    width: 100%;
    margin: 0 0 22px;
    padding: 2px 2px 8px;
    display: flex;
    gap: 9px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.music-filters button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    cursor: pointer;
    scroll-snap-align: start;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.music-filters button:hover {
    color: #fff;
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.music-filters button.active {
    color: #fff;
    border-color: color-mix(in srgb, var(--accent) 52%, transparent);
    background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, .03));
}

.music-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.music-card {
    position: relative;
    min-width: 0;
    padding: 18px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.music-card.is-playing {
    border-color: color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .24), 0 0 30px color-mix(in srgb, var(--accent) 10%, transparent);
}

.music-art {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 24px;
    color: rgba(255, 255, 255, .9);
    background:
        radial-gradient(circle at 35% 25%, color-mix(in srgb, var(--accent) 55%, white), transparent 24%),
        radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--accent) 48%, #26344f), transparent 48%),
        linear-gradient(145deg, #172437, #090e17 72%);
    box-shadow: inset 0 0 28px rgba(255, 255, 255, .06), 0 16px 30px rgba(0, 0, 0, .28);
}

.music-art span {
    position: relative;
    z-index: 2;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: .12em;
}

.music-art i {
    position: absolute;
    width: 76%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
}

.music-art i:nth-of-type(2) { width: 54%; }
.music-art i:nth-of-type(3) { width: 32%; }
.music-card.is-playing .music-art i { animation: musicPulse 3.6s ease-in-out infinite alternate; }

.music-card-copy { min-width: 0; padding-right: 30px; }
.music-card-copy h3 { margin: 2px 0 7px; font-size: 1.2rem; }
.music-card-copy > p { min-height: 3.1em; margin: 0 0 17px; color: var(--text-muted); font-size: .86rem; line-height: 1.5; }

.music-player-row {
    display: grid;
    grid-template-columns: 42px minmax(70px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.music-play-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 50%;
    color: #fff;
    background: color-mix(in srgb, var(--accent) 24%, rgba(255, 255, 255, .04));
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.music-play-btn:hover { transform: scale(1.06); }
.music-play-btn.is-playing { background: var(--accent-gradient); }
.music-play-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }

.music-progress {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.music-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-gradient);
    transition: width .2s linear;
}

.music-time { color: var(--text-muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.music-favorite-toggle { top: 12px; right: 12px; }
.music-empty-state {
    width: min(100%, 520px);
    margin: 18px auto 0;
    padding: 30px 24px;
    text-align: center;
}
.music-empty-state[hidden] { display: none; }
.music-empty-state > span { color: var(--accent); font-size: 2rem; }
.music-empty-state h3 { margin: 8px 0 6px; }
.music-empty-state p { margin: 0; color: var(--text-muted); }
.music-library-note { margin: 18px 0 0; text-align: center; font-size: .78rem; }
.music-library-disclaimer {
    width: min(100%, 720px);
    margin: 7px auto 0;
    color: var(--text-muted);
    text-align: center;
    font-size: .72rem;
    line-height: 1.5;
}
.music-setting-control { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-color); }

@keyframes musicPulse {
    from { transform: scale(.94); opacity: .45; }
    to { transform: scale(1.08); opacity: .9; }
}

@media (max-width: 820px) {
    .music-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .music-card { grid-template-columns: 86px minmax(0, 1fr); gap: 13px; padding: 14px; }
    .music-card-copy { padding-right: 25px; }
    .music-favorite-toggle { top: 10px; right: 10px; }
    .music-player-row { grid-template-columns: 38px minmax(55px, 1fr); }
    .music-play-btn { width: 38px; height: 38px; }
    .music-time { grid-column: 2; }
    .music-card-copy > p { min-height: auto; }
}

.technique-card {
    padding: 0 22px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 404px;
    height: auto;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-landscape {
    position: relative;
    height: 154px;
    margin: 0 -22px 18px;
    overflow: hidden;
    flex: 0 0 154px;
    border-radius: 24px 24px 0 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    isolation: isolate;
    transition: filter var(--transition-normal);
}

.card-landscape-shade {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(3, 9, 18, .08) 0%, rgba(3, 9, 18, .12) 45%, rgba(7, 14, 26, .88) 100%),
        radial-gradient(circle at 50% 24%, transparent 0%, rgba(2, 8, 18, .2) 100%);
}

.card-landscape .card-icon {
    position: absolute;
    left: 18px;
    bottom: 15px;
    margin: 0;
    color: #d7fbff;
    border-color: rgba(125, 229, 255, .45);
    background: rgba(4, 13, 27, .7);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .28), 0 0 22px color-mix(in srgb, var(--accent) 22%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.content-card-shell {
    position: relative;
    min-width: 0;
    display: flex;
}

.content-card-shell > .technique-card {
    height: 100%;
}

.content-card-shell .access-badge {
    right: 56px;
}

.favorite-toggle {
    position: absolute;
    z-index: 5;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    color: rgba(255, 255, 255, .68);
    background: rgba(7, 13, 24, .72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.favorite-toggle:hover {
    transform: scale(1.06);
    color: #fff;
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.favorite-toggle svg {
    width: 18px;
    height: 18px;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 1.7;
    transition: fill var(--transition-fast), filter var(--transition-fast);
}

.favorite-toggle.is-favorite {
    color: #fff;
    border-color: color-mix(in srgb, var(--accent) 58%, transparent);
    background: color-mix(in srgb, var(--accent) 28%, rgba(7, 13, 24, .72));
}

.favorite-toggle.is-favorite svg {
    fill: currentColor;
    filter: drop-shadow(0 0 6px var(--accent));
}

.favorites-view {
    width: min(100%, 980px);
    margin: 0 auto;
    animation: fadeInUp .75s cubic-bezier(.16, 1, .3, 1);
}

.favorites-header {
    max-width: 680px;
    margin: 0 auto 28px;
    text-align: center;
}

.favorites-header h2 {
    margin: 7px 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.favorites-header p,
.favorites-storage-note {
    color: var(--text-muted);
    line-height: 1.55;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.favorite-library-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.favorite-library-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 36%, transparent);
}

.favorite-main-action {
    width: 100%;
    min-height: 150px;
    padding: 20px 56px 20px 20px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.favorite-card-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, rgba(255,255,255,.07));
    border-radius: 16px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,.025));
}

.favorite-card-icon svg {
    width: 28px;
    height: 28px;
}

.favorite-card-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.favorite-card-copy small {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .07em;
}

.favorite-card-copy strong {
    color: var(--text-primary);
    font-size: 1.08rem;
}

.favorite-card-copy > span {
    margin-top: 6px;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.favorite-card-arrow {
    color: var(--accent);
    font-size: 1.35rem;
}

.favorite-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    color: var(--text-muted);
    background: rgba(7,13,24,.7);
    cursor: pointer;
}

.favorite-remove:hover {
    color: #fff;
    border-color: rgba(255,255,255,.18);
}

.favorite-remove svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.favorites-storage-note {
    margin: 18px 0 0;
    text-align: center;
    font-size: .75rem;
}

.favorites-empty {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 42px 30px;
    text-align: center;
}

.favorites-empty > span {
    display: block;
    color: var(--accent);
    font-size: 3.2rem;
    line-height: 1;
    filter: drop-shadow(0 0 14px var(--accent-glow));
}

.favorites-empty h3 {
    margin: 17px 0 8px;
    font-size: 1.3rem;
}

.favorites-empty p {
    max-width: 410px;
    margin: 0 auto 22px;
    color: var(--text-muted);
    line-height: 1.55;
}

@media (max-width: 760px) {
    .favorites-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .favorite-main-action {
        min-height: 134px;
        padding: 17px 48px 17px 15px;
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
    }
    .favorite-card-icon { width: 44px; height: 44px; border-radius: 14px; }
    .favorite-card-arrow { display: none; }
}

.technique-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--accent-glow) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.technique-card:hover::before {
    opacity: 0.4;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 14px;
    transition: all var(--transition-normal);
}

.technique-card:hover .card-icon {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
    border-color: transparent;
}

.technique-card:hover .card-landscape {
    filter: saturate(1.08) brightness(1.04);
}

.card-info h3 {
    font-size: 1.28rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.85em;
}

.card-benefits,
.benefit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-benefits {
    position: relative;
    z-index: 1;
    margin: 0 0 14px;
}

.card-benefits span,
.benefit-chips span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, .08));
    border-radius: 999px;
    color: color-mix(in srgb, var(--accent) 52%, var(--text-secondary));
    background: color-mix(in srgb, var(--accent) 7%, rgba(255, 255, 255, .025));
    font-size: .68rem;
    font-weight: 650;
    line-height: 1.15;
}

.card-breath-summary {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-metadata {
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: auto;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.meta-item span { white-space: nowrap; }

.meta-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Practice View (Breathing Space) */
#practice-view {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.practice-header {
    text-align: center;
    margin-bottom: 30px;
}

.practice-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.practice-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.45;
}

.practice-dose {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 999px;
    color: rgba(204, 251, 241, 0.9);
    background: rgba(20, 184, 166, 0.08);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1;
}

.practice-dose[hidden] { display: none; }

.breath-path-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 0 8px var(--accent-glow);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

/* Animated Breathing Sphere Space */
.sphere-container {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

/* Background Canvas for Interactive Ripple/Lotus/Aura animations */
#animation-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(620px, 150vw);
    height: min(620px, 150vw);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    border-radius: 0;
    will-change: transform, opacity;
    backface-visibility: hidden;
    contain: strict;
}

body:not(.style-ola) #animation-canvas {
    -webkit-mask-image: radial-gradient(circle at center, #000 0%, #000 55%, rgba(0, 0, 0, 0.86) 70%, transparent 92%);
    mask-image: radial-gradient(circle at center, #000 0%, #000 55%, rgba(0, 0, 0, 0.86) 70%, transparent 92%);
}

/* The Core Breathing Bubble */
.breathing-bubble {
    width: 280px;
    height: 180px;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Dynamic State Colors & Glows for CSS bubble fallback */
.breathing-bubble.inhale {}
.breathing-bubble.exhale {}
.breathing-bubble.hold-full {
    animation: none;
}

.breathing-bubble.hold-empty {
    animation: none;
}

@keyframes bubblePulse {
    0%, 100% { transform: scale(1.0); filter: brightness(1); }
    50% { transform: scale(1.03); filter: brightness(1.15); }
}

/* Inside the Bubble Content */
.bubble-text-phase {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    margin-bottom: 8px;
    text-align: center;
    width: 100%;
    transition: color 0.5s;
    white-space: nowrap; /* Prevents long text like 'Retén Lleno' from breaking into two lines and shrinking visually */
}

.bubble-timer {
    font-size: 3rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(0,0,0,0.6);
    text-align: center;
}

/* Creator Badge Style */
.creator-badge {
    position: relative;
    inset: auto;
    transform: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    background: rgba(5, 12, 24, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.055);
    padding: 5px 11px;
    border-radius: 30px;
    z-index: 10;
    opacity: 0.66;
    transition: opacity var(--transition-fast), border-color var(--transition-fast);
    cursor: default;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    align-self: center;
    flex: 0 0 auto;
    margin: 8px 0 18px;
}

.creator-badge strong {
    font-weight: 650;
}

.creator-badge .creator-name {
    color: var(--text-secondary);
}

.creator-badge .product-name {
    color: var(--accent);
}

.creator-badge .badge-separator {
    color: rgba(255, 255, 255, 0.22);
}

.creator-badge:hover {
    opacity: 0.92;
    border-color: rgba(45, 212, 191, 0.18);
}

/* Help text below bubble (Nadi Shodhana instruction / Wim Hof phase) */
.guidance-text {
    min-height: 82px;
    height: 82px;
    text-align: center;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 500;
    max-width: 400px;
    margin-bottom: 20px;
    z-index: 2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    line-height: 1.25;
}

.guidance-subtext {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.25;
}

/* Weekly routine planner */
.routine-planner-view {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 80px;
    color: var(--text-main, #f4f7fb);
}

.premium-section-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-premium-badge {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 6px;
    border: 1px solid rgba(250, 204, 21, .25);
    border-radius: 999px;
    color: #f8dc83;
    background: rgba(250, 204, 21, .08);
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.premium-section-tab.active .tab-premium-badge {
    border-color: rgba(255, 255, 255, .28);
    color: #fff;
    background: rgba(255, 255, 255, .13);
}

.routine-hero {
    display: block;
    max-width: 760px;
    margin: 46px 0 32px;
    padding: 0;
}

.routine-hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: .98;
    letter-spacing: -.04em;
}

.routine-hero p,
.routine-preset-card p,
.routine-notification-note {
    color: var(--text-muted, #9aa8bd);
    line-height: 1.6;
}

.routine-active-card,
.routine-builder,
.routine-preset-card {
    border: 1px solid rgba(84, 222, 214, .18);
    background: linear-gradient(145deg, rgba(16, 28, 42, .93), rgba(8, 17, 28, .86));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.routine-active-card {
    padding: clamp(22px, 4vw, 38px);
    border-radius: 28px;
    margin-bottom: 48px;
}

.routine-active-card.is-complete {
    border-color: rgba(60, 222, 184, .55);
    background: linear-gradient(145deg, rgba(15, 54, 56, .92), rgba(8, 24, 35, .9));
}

.routine-active-heading,
.routine-section-heading,
.routine-today-card,
.routine-time-label,
.routine-builder-row,
.routine-builder summary {
    display: flex;
    align-items: center;
}

.routine-active-heading {
    justify-content: space-between;
    gap: 20px;
}

.routine-active-heading h2,
.routine-section-heading h2 {
    margin: 6px 0 0;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.routine-link-button {
    border: 0;
    background: transparent;
    color: #8ea2b8;
    cursor: pointer;
    padding: 10px;
}

.routine-progress-track {
    height: 8px;
    margin: 26px 0 20px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.routine-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #27c7ba, #69e8d8);
    box-shadow: 0 0 18px rgba(39, 199, 186, .5);
    transition: width .45s ease;
}

.routine-reminder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(255, 255, 255, .035);
}

.routine-reminder-card span,
.routine-reminder-card strong,
.routine-reminder-card small { display: block; }
.routine-reminder-card small { margin-top: 2px; color: #91a1b6; }
.routine-reminder-card button {
    flex: 0 0 auto;
    border: 1px solid rgba(84, 222, 214, .32);
    border-radius: 11px;
    padding: 9px 13px;
    color: #70e5d8;
    background: rgba(28, 194, 177, .08);
    cursor: pointer;
}
.routine-reminder-card.enabled { border-color: rgba(84, 222, 214, .22); }
.routine-reminder-card.enabled > b { color: #64e5d3; font-size: 1.25rem; }

.routine-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.routine-metrics span {
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .035);
}

.routine-metrics strong,
.routine-metrics small {
    display: block;
}

.routine-metrics strong { font-size: 1.45rem; }
.routine-metrics small { color: #91a1b6; margin-top: 2px; }

.routine-week-strip,
.challenge-mini-path {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.routine-day-dot {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 58px;
    border-radius: 15px;
    color: #8392a7;
    background: rgba(255, 255, 255, .035);
}

.routine-day-dot b { font-size: 1.1rem; }
.routine-day-dot.done { color: #64e5d3; background: rgba(39, 199, 186, .12); }
.routine-day-dot.next { outline: 1px solid rgba(100, 229, 211, .62); color: #fff; }

.routine-today-card {
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(2, 10, 18, .46);
}

.routine-today-card div,
.routine-today-card strong,
.routine-today-card span { display: block; }
.routine-today-card small { color: #36cbbb; font-weight: 800; letter-spacing: .1em; }
.routine-kind-chip {
    display: inline-flex;
    width: fit-content;
    margin-top: 8px;
    padding: 4px 8px;
    border: 1px solid rgba(103, 232, 249, .22);
    border-radius: 999px;
    color: #8debe3;
    background: rgba(39, 199, 186, .08);
    font-size: .7rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .08em;
}
.routine-today-card strong { margin: 7px 0 4px; font-size: 1.2rem; }
.routine-today-card span { color: #9caabe; }
.routine-today-card button { flex: 0 0 auto; }
.routine-upcoming-card {
    border-style: dashed;
    background: rgba(12, 24, 38, .58);
}
.routine-upcoming-card button[disabled] {
    cursor: not-allowed;
    opacity: .55;
}

.routine-checkin {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
    text-align: center;
    background: rgba(38, 199, 186, .09);
}

.routine-checkin > strong,
.routine-checkin > span { display: block; }
.routine-checkin > span { margin: 4px 0 12px; color: #8fa0b5; font-size: .88rem; }
.routine-checkin-questions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.routine-checkin-question {
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
    background: rgba(4, 15, 24, .34);
}
.routine-checkin-question b { color: #eef9f8; font-size: .92rem; }
.routine-checkin-question small { color: #8296aa; font-size: .75rem; }
.routine-checkin-scale { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.routine-checkin-scale button {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(84, 222, 214, .32);
    border-radius: 50%;
    color: #f3fffd;
    background: rgba(8, 20, 30, .72);
    cursor: pointer;
}
.routine-checkin-scale button[aria-pressed="true"] {
    border-color: #6ff6db;
    color: #051413;
    background: #6ff6db;
    box-shadow: 0 0 18px rgba(111, 246, 219, .24);
}
.routine-checkin-start {
    width: min(100%, 300px);
    margin-top: 16px;
}

.routine-result-summary {
    margin-top: 24px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(53, 216, 181, .1);
}
.routine-result-summary strong { font-size: 1.25rem; }
.routine-result-summary p { margin: 7px 0; line-height: 1.5; }
.routine-result-summary small { color: #9bb2b6; }
.routine-result-summary > .intent-eyebrow { display: block; margin-bottom: 6px; }
.routine-change-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}
.routine-change-grid span {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid rgba(111, 246, 219, .13);
    border-radius: 14px;
    background: rgba(3, 15, 22, .32);
}
.routine-change-grid span strong { color: #e9fffb; font-size: 1.1rem; }
.routine-change-grid span small { color: #8fa9ad; }

@media (max-width: 600px) {
    .routine-checkin-questions,
    .routine-change-grid { grid-template-columns: 1fr; }
    .routine-checkin-scale { gap: 6px; }
    .routine-checkin-scale button { width: 40px; height: 40px; }
}

.routine-presets { margin-top: 44px; }
.routine-section-heading { justify-content: space-between; margin-bottom: 20px; }
.routine-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.routine-preset-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 310px;
    min-width: 0;
    padding: 26px;
    border-radius: 24px;
}

.routine-preset-card.featured {
    border-color: rgba(71, 224, 206, .52);
    background: radial-gradient(circle at 90% 0, rgba(35, 198, 179, .22), transparent 42%), linear-gradient(145deg, rgba(17, 44, 50, .95), rgba(8, 20, 31, .9));
}

.routine-preset-card h3 { margin: 9px 0 8px; font-size: 1.55rem; }
.routine-preset-card p { margin: 0 0 16px; }
.routine-preset-card .glass-button { width: 100%; margin-top: 14px; }

.challenge-mini-path { width: 100%; margin: auto 0 12px; }
.challenge-includes {
    display: grid;
    gap: 2px;
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #b8f1eb;
    background: rgba(39, 199, 186, .08);
}
.challenge-includes span { color: #89aaa9; font-size: .82rem; }
.challenge-launch-date {
    display: grid;
    gap: 4px;
    width: 100%;
    margin: -4px 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 209, 138, .2);
    border-radius: 14px;
    background: rgba(255, 209, 138, .07);
}
.challenge-launch-date b {
    color: #ffd18a;
    font-size: .72rem;
    letter-spacing: .09em;
}
.challenge-launch-date span {
    color: #aeb8c7;
    font-size: .82rem;
    line-height: 1.4;
}
.challenge-test-banner {
    display: grid;
    gap: 4px;
    width: 100%;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid rgba(103, 232, 249, .24);
    border-radius: 14px;
    color: #b8f7ff;
    background: rgba(37, 171, 202, .09);
}
.challenge-test-banner b { font-size: .72rem; letter-spacing: .09em; }
.challenge-test-banner span { color: #9fb8c6; font-size: .82rem; line-height: 1.4; }
.challenge-mini-path span {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
    color: #76e7d9;
    background: rgba(38, 199, 186, .11);
    font-size: .85rem;
    font-weight: 800;
    min-width: 0;
}

.challenge-mini-path span small {
    display: block;
    margin-top: 1px;
    font-size: .56rem;
    color: #9accc8;
}

.challenge-time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: auto;
    min-width: 0;
}

.challenge-time-grid .routine-time-label {
    display: grid;
    gap: 6px;
}

.challenge-time-grid input { width: 100%; min-width: 0; }

.routine-time-label {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    color: #a6b3c4;
    font-size: .9rem;
}

.routine-time-label input,
.routine-builder-row input[type="time"],
.routine-builder-row select {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 11px;
    color: #eef7fb;
    background: rgba(4, 13, 23, .86);
    padding: 10px 12px;
}

.routine-builder {
    margin-top: 24px;
    border-radius: 24px;
    overflow: hidden;
}

.routine-builder summary {
    justify-content: space-between;
    padding: 24px 26px;
    cursor: pointer;
    list-style: none;
}
.routine-builder summary::-webkit-details-marker { display: none; }
.routine-builder summary span,
.routine-builder summary strong,
.routine-builder summary small { display: block; }
.routine-builder summary small { margin-top: 4px; color: #8e9db0; }
.routine-builder summary b { font-size: 1.5rem; color: #4ad6c6; }
.routine-builder[open] summary b { transform: rotate(45deg); }

.routine-builder-days { padding: 0 26px 16px; }
.routine-builder-row {
    display: grid;
    grid-template-columns: 150px minmax(180px, 1fr) 120px;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
}
.routine-day-toggle { display: flex; align-items: center; gap: 9px; }
.routine-builder > .glass-button { margin: 0 26px 26px; }
.routine-notice { margin: 16px 0 0; color: #7fe8dc; }
.routine-empty-note { color: #91a1b6; }
.routine-notification-note { margin: 20px 4px 0; font-size: .88rem; }

@media (max-width: 720px) {
    .routine-planner-view { width: min(100% - 22px, 680px); margin-bottom: 110px; }
    .routine-hero { margin-top: 26px; }
    .routine-section-heading { display: block; }
    .routine-section-heading h2 { margin-top: 8px; }
    .routine-preset-grid { grid-template-columns: 1fr; }
    .routine-active-heading,
    .routine-today-card { align-items: flex-start; flex-direction: column; }
    .routine-reminder-card { align-items: flex-start; flex-direction: column; }
    .routine-reminder-card button { width: 100%; }
    .routine-today-card button { width: 100%; }
    .routine-metrics span { padding: 10px; }
    .routine-metrics strong { font-size: 1.2rem; }
    .routine-metrics small { font-size: .72rem; }
    .routine-week-strip { gap: 4px; }
    .routine-day-dot { min-height: 50px; font-size: .76rem; }
    .routine-builder-row { grid-template-columns: 1fr 1fr; }
    .routine-builder-row select { grid-column: 1 / -1; grid-row: 2; }
    .routine-builder-row input[type="time"] { width: 100%; }
}

/* Preserve the existing interactive layout while giving recording mode one
   explicit unit for copy + safety action + signature. */
.practice-guidance-stack {
    display: contents;
}

/* Wim Hof has three simultaneous guidance lines during the breathing count.
   Reserve their real height so the centered signature never overlaps them. */
body:not(.video-mode) #practice-view[data-technique-id="wimhof"] .guidance-text {
    min-height: 122px;
    height: 122px;
    margin-bottom: 0;
}

body:not(.video-mode) #practice-view[data-technique-id="wimhof"] .creator-badge {
    margin: 12px 0 18px;
}


.breath-education {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 30px;
    margin: -8px 0 22px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    letter-spacing: 0.35px;
    z-index: 2;
}

.breath-education span {
    display: inline-flex;
    align-items: center;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(8, 17, 31, 0.46);
    backdrop-filter: blur(10px);
}

/* Session stats (Cycles, elapsed) */
.session-info {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    z-index: 2;
}

#total-time {
    font-variant-numeric: tabular-nums;
    min-width: 68px;
}

@media (max-width: 600px) {
    .practice-header { margin-bottom: 16px; }
    .journey-progress-panel { margin-bottom: 12px; }
    .breath-education { max-width: 92vw; margin-bottom: 16px; }
    .session-info { margin-bottom: 24px; }
}

.info-block {
    text-align: center;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Practice Controls Bar */
.control-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

.btn-round {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.btn-round:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.05);
}

.btn-round:active {
    transform: scale(0.95);
}

.btn-round.play-pause-btn {
    width: 68px;
    height: 68px;
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-round.play-pause-btn:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: #fff;
}

.btn-round svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.btn-round.play-pause-btn svg {
    width: 28px;
    height: 28px;
}

.music-toggle-btn {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 34%, var(--border-color));
}

.music-toggle-btn.is-muted {
    color: var(--text-muted);
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 420px) {
    .control-bar { gap: 13px; }
    .btn-round { width: 50px; height: 50px; }
    .btn-round.play-pause-btn { width: 64px; height: 64px; }
}

/* Custom Modal/Drawer for Settings */
.settings-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    z-index: 100;
    border-radius: 24px 0 0 24px;
    border-y: none;
    border-right: none;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-drawer:not(.open) {
    visibility: hidden;
    pointer-events: none;
}

.settings-drawer.open {
    right: 0;
    visibility: visible;
    pointer-events: auto;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.language-settings label,
.language-settings small {
    display: block;
    color: var(--text-muted);
}

.language-settings label {
    margin-bottom: 8px;
    font-size: 0.86rem;
}

.language-settings small {
    margin-top: 9px;
    line-height: 1.45;
}

.language-select {
    width: 100%;
    min-height: 44px;
    padding: 0 42px 0 14px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    background: rgba(8, 15, 25, 0.82);
    font: inherit;
    color-scheme: dark;
}

.language-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.settings-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.visual-guidance-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid rgba(125, 211, 252, 0.14);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.08), rgba(45, 212, 191, 0.025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.visual-guidance-card strong {
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 1.35;
}

.visual-guidance-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.visual-guidance-badge {
    width: max-content;
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.12em;
}

.visual-style-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-style-options .option-btn {
    min-height: 46px;
    padding-inline: 10px;
}

.atmosphere-settings {
    display: grid;
    gap: 10px;
    padding-top: 2px;
}

.setting-label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 650;
}

.atmosphere-mode-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atmosphere-mode-options .option-btn {
    min-height: 42px;
    padding-inline: 7px;
    font-size: 0.78rem;
}

/* Customizer Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.custom-visual-settings {
    width: 100%;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-visual-heading h3 { margin: 0 0 5px; font-size: 1.05rem; }
.custom-visual-heading p { margin: 0 0 16px !important; font-size: .82rem !important; }
.custom-visual-group + .custom-visual-group { margin-top: 18px; }
.custom-visual-label { display: block; margin-bottom: 9px; color: var(--text-secondary); font-size: .72rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }

.custom-animation-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.custom-animation-option {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.035);
    text-align: left;
}
.custom-animation-option strong,
.custom-animation-option span { display: block; }
.custom-animation-option span { margin-top: 4px; color: var(--text-muted); font-size: .7rem; line-height: 1.35; }
.custom-animation-option.selected { border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 13%, rgba(255,255,255,.03)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent); }

.practice-animation-choice {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}
.practice-animation-heading span,
.practice-animation-heading strong,
.practice-animation-heading small { display: block; }
.practice-animation-heading strong { color: var(--text-primary); font-size: .88rem; }
.practice-animation-heading small { margin-top: 3px; color: var(--text-muted); font-size: .7rem; line-height: 1.35; }
.practice-animation-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 11px; }
.practice-animation-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    min-height: 66px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    color: var(--text-primary);
    background: rgba(255,255,255,.035);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.practice-animation-option > span { min-width: 0; }
.practice-animation-option strong,
.practice-animation-option small { display: block; }
.practice-animation-option strong { font-size: .8rem; }
.practice-animation-option small { margin-top: 3px; color: var(--text-muted); font-size: .64rem; line-height: 1.3; }
.practice-animation-option em {
    flex: 0 0 auto;
    padding: 4px 6px;
    border-radius: 999px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    font-size: .52rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .07em;
}
.practice-animation-option.selected {
    border-color: color-mix(in srgb, var(--accent) 68%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, rgba(255,255,255,.03));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}
.practice-animation-option.premium-locked:not(.selected) { border-color: rgba(250, 204, 21, .2); }
.practice-animation-option.premium-locked:not(.selected) em { color: #fde68a; background: rgba(250, 204, 21, .1); }

.custom-atmosphere-options {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 112px;
    gap: 9px;
    max-width: 100%;
    padding: 1px 1px 9px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
}
.custom-atmosphere-option {
    position: relative;
    min-height: 148px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    background-image: linear-gradient(180deg, transparent 46%, rgba(2,7,18,.9) 100%), var(--custom-atmosphere-image);
    background-position: center;
    background-size: cover;
    scroll-snap-align: center;
}
.custom-atmosphere-option span { position: absolute; inset: auto 8px 9px; color: white; font-size: .67rem; font-weight: 700; line-height: 1.2; text-align: left; text-shadow: 0 2px 8px rgba(0,0,0,.85); }
.custom-atmosphere-option.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent), 0 10px 26px rgba(0,0,0,.3); }

@media (max-width: 520px) {
    .custom-animation-options { grid-template-columns: 1fr; }
    .practice-animation-options { grid-template-columns: 1fr; }
    .custom-atmosphere-options { grid-auto-columns: 96px; }
    .custom-atmosphere-option { min-height: 128px; }
}

.audio-style-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.audio-style-options .option-btn {
    min-height: 42px;
    padding-inline: 8px;
}

.setting-help {
    margin: 0;
    min-height: 2.8em;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.reminder-time-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 650;
}

.reminder-time-label input {
    min-width: 116px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    background: rgba(8, 15, 25, 0.82);
    color-scheme: dark;
    font: inherit;
}

.reminder-time-label input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.reminder-time-label input:disabled {
    opacity: 0.45;
}

.audio-test-button {
    width: 100%;
    margin-top: 4px;
    padding: 11px 14px;
    border: 1px solid color-mix(in srgb, var(--accent) 32%, rgba(255,255,255,.08));
    border-radius: 14px;
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,.025));
    font: inherit;
    font-size: .86rem;
    font-weight: 650;
    cursor: pointer;
}
.audio-test-button:active { transform: scale(.985); }
.audio-test-status { min-height: 1.25em; margin: 0 2px; }

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.06);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-val {
    width: 32px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Option Grids (Themes & Animations) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.option-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.theme-dot {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.theme-dot:hover {
    transform: scale(1.1);
}

.theme-dot.active {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.td-aurora { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.td-violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.td-forest { background: linear-gradient(135deg, #047857, #34d399); }
.td-ice { background: linear-gradient(135deg, #0369a1, #38bdf8); }
.td-solar { background: linear-gradient(135deg, #c2410c, #fca5a5); }

/* Switch Control */
.switch-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider-switch {
    background: var(--accent-gradient);
    border-color: transparent;
}

input:checked + .slider-switch:before {
    transform: translateX(22px);
}

/* Compact safety action: it occupies its own calm row below the guidance and
   can never cover the phase clock, lungs or geometry track. */
.wimhof-overlay {
    display: flex;
    position: relative;
    width: min(100%, 420px);
    min-height: 44px;
    margin: 2px auto 4px;
    z-index: 3;
    background: transparent;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
}

.wimhof-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

/* This safety action belongs only to the active Wim Hof retention. Outside
   that phase it must not leave an invisible row or a line below the lungs. */
.wimhof-overlay:not(.active) {
    display: none;
}

.wimhof-overlay .info-label,
.wimhof-phase-title,
#wimhof-overlay-timer,
#wimhof-target-display,
.wimhof-overlay > div:last-child {
    display: none !important;
}

#wimhof-overlay-button {
    pointer-events: auto;
    padding: 11px 20px !important;
    border-radius: 999px !important;
    font-size: 0.9rem !important;
    color: rgba(235, 248, 255, 0.92) !important;
    background: rgba(4, 18, 31, 0.64) !important;
    border: 1px solid rgba(34, 211, 238, 0.38) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(14px);
}

#wimhof-overlay-button:hover,
#wimhof-overlay-button:focus-visible {
    border-color: rgba(103, 232, 249, 0.72) !important;
    background: rgba(7, 28, 45, 0.78) !important;
}

.wimhof-phase-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Footer & Extra Info */
footer {
    padding: 20px 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    z-index: 10;
    position: relative;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--accent);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    .logo h2 {
        font-size: 1.25rem;
    }

    .settings-btn {
        padding: 10px; /* Make touch target bigger */
    }
    
    main {
        padding: 10px 20px;
    }
    
    .dashboard-hero h1 {
        font-size: 2.2rem;
    }
    
    .dashboard-hero p {
        font-size: 1rem;
    }
    
    .techniques-grid {
        grid-template-columns: 1fr;
    }
    
    .technique-card {
        height: auto;
        min-height: 280px;
    }
    
    .sphere-container {
        width: 300px;
        height: 300px;
    }
    
    #animation-canvas {
        top: 50%;
        left: 50%;
        width: min(520px, 150vw);
        height: min(520px, 150vw);
    }
    
    .breathing-bubble {
        width: 220px;
        height: 150px;
    }
    
    .bubble-text-phase {
        font-size: 1.3rem;
    }
    
    .bubble-timer {
        font-size: 2.4rem;
    }
    
    .settings-drawer {
        max-width: 100%;
        padding: 25px 20px;
    }
    
    .drawer-header h2 {
        font-size: 1.3rem;
    }
    
    .drawer-close {
        padding: 12px; /* Bigger tap target */
    }
    
    .slider-container input[type=range] {
        height: 12px; /* Thicker slider track for thumb */
    }
    
    .slider-container input[type=range]::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .dashboard-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 10px; /* Space for hidden scrollbar */
        margin-bottom: 25px;
    }
    
    .dashboard-tabs::-webkit-scrollbar {
        display: none; /* Hide scrollbar for cleaner look */
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .practice-header h2 {
        font-size: 1.6rem;
    }

    .creator-badge {
        bottom: auto !important;
        margin: 4px 0 14px !important;
        font-size: 0.62rem !important;
        padding: 4px 9px !important;
    }
}

/* OBS recording mode (H)
   OBS captures the complete desktop. Keep the landscape full-screen and make
   the breathing guide large in the center so the owner can crop that region
   later and place it in one half of a vertical social video. */
body.video-mode {
    --recording-frame-width: 100vw;
    --recording-frame-height: 100dvh;
    background-color: #020711 !important;
    background-image: none !important;
    overflow: hidden !important;
}

body.video-mode.bg-chroma-green {
    background-color: #00ff00 !important;
    --bg-primary: #00ff00 !important;
}

body.video-mode.bg-chroma-blue {
    background-color: #0000ff !important;
    --bg-primary: #0000ff !important;
}

body.video-mode.bg-chroma-black {
    background-color: #000000 !important;
    --bg-primary: #000000 !important;
}

body.video-mode header,
body.video-mode footer,
body.video-mode .practice-header,
body.video-mode .session-info,
body.video-mode .control-bar,
body.video-mode .breath-education {
    display: none !important;
}

body.video-mode .guidance-text {
    width: min(52vw, 680px) !important;
    max-width: min(52vw, 680px) !important;
    min-height: clamp(82px, 9.5dvh, 98px) !important;
    height: clamp(82px, 9.5dvh, 98px) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 4px !important;
    z-index: 10 !important;
    text-align: center !important;
    justify-content: center !important;
    gap: clamp(3px, 0.5dvh, 6px) !important;
    font-size: clamp(1.12rem, 2.15dvh, 1.48rem) !important;
    line-height: 1.22 !important;
    text-wrap: balance;
}

/* Most techniques do not use the Wim Hof safety action. Its invisible row
   must not create a false gap between the guidance and the brand signature. */
body.video-mode .wimhof-overlay:not(.active) {
    display: none !important;
}

/* Wim Hof can display three simultaneous guidance lines, so only that
   technique keeps the taller copy slot required to avoid collisions. */
body.video-mode #practice-view[data-technique-id="wimhof"] .guidance-text {
    min-height: clamp(108px, 13dvh, 126px) !important;
    height: clamp(108px, 13dvh, 126px) !important;
}

body.video-mode .guidance-subtext {
    max-width: 100% !important;
    margin-top: 0 !important;
    font-size: clamp(1rem, 1.9dvh, 1.22rem) !important;
    line-height: 1.3 !important;
    text-wrap: balance;
}

body.video-mode .bubble-text-phase {
    margin-bottom: clamp(4px, 0.7dvh, 8px) !important;
    font-size: clamp(1.35rem, 2.9dvh, 1.8rem) !important;
    letter-spacing: clamp(0.08em, 0.18vw, 0.13em) !important;
}

body.video-mode .bubble-timer {
    font-size: clamp(2.8rem, 5.8dvh, 3.8rem) !important;
}

body.video-mode .creator-badge {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    max-width: 88% !important;
    padding: 5px 11px !important;
    gap: 5px !important;
    font-size: clamp(0.6rem, 1.25dvh, 0.72rem) !important;
    letter-spacing: 0.085em !important;
    background: rgba(4, 12, 25, 0.34) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: blur(8px) !important;
    box-shadow: none !important;
    align-self: center !important;
    margin: clamp(4px, 0.8dvh, 8px) 0 0 !important;
    opacity: 0.88 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    transition: opacity 0.3s, border-color 0.3s !important;
}

body.video-mode .creator-badge .creator-name {
    color: rgba(255, 255, 255, 0.82) !important;
}

body.video-mode .creator-badge .product-name {
    color: color-mix(in srgb, var(--accent) 88%, white) !important;
}

body.video-mode .creator-badge .badge-separator {
    color: rgba(255, 255, 255, 0.42) !important;
}

body.video-mode .creator-badge:hover {
    opacity: 0.85 !important;
    border-color: var(--accent) !important;
}

body.video-mode.bg-chroma-green .creator-badge {
    color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.video-mode.bg-chroma-blue .creator-badge {
    color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

body.video-mode.bg-chroma-black .creator-badge {
    color: rgba(255, 255, 255, 0.4) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.video-mode main {
    padding: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.video-mode #practice-view {
    position: relative !important;
    isolation: isolate;
    flex: 0 0 auto !important;
    width: var(--recording-frame-width) !important;
    max-width: none !important;
    height: var(--recording-frame-height) !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    aspect-ratio: auto;
    padding:
        clamp(24px, 4dvh, 48px)
        clamp(16px, 3.5vw, 34px)
        clamp(32px, 6dvh, 68px) !important;
    justify-content: center !important;
    overflow: hidden !important;
    transform: none !important;
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.52);
}

body.video-mode .sphere-container {
    flex: 0 0 auto !important;
    width: min(62vw, 60dvh, 620px) !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1;
    margin: 0 0 clamp(-18px, -1.5dvh, -10px) !important;
}

body.video-mode #animation-canvas {
    width: min(145%, 80vw) !important;
    height: auto !important;
    aspect-ratio: 1;
}

body.video-mode .breathing-bubble {
    width: 70% !important;
    height: 48% !important;
}

body.video-mode #ola-hud {
    width: clamp(112px, 30%, 132px) !important;
    height: clamp(64px, 9dvh, 76px) !important;
    min-height: 0 !important;
    margin: 0 auto clamp(2px, 0.6dvh, 7px) !important;
    padding: 8px 10px !important;
    gap: 5px !important;
}

body.video-mode #ola-hud-phase {
    font-size: clamp(0.56rem, 1.1dvh, 0.66rem) !important;
}

body.video-mode #ola-hud-timer {
    font-size: clamp(1.7rem, 3.8dvh, 2.15rem) !important;
}

body.video-mode .wimhof-phase-title {
    font-size: clamp(1.05rem, 2.5dvh, 1.5rem) !important;
}

body.video-mode #wimhof-overlay-timer {
    margin-bottom: 10px !important;
    font-size: clamp(2.5rem, 6.5dvh, 4rem) !important;
}

body.video-mode #wimhof-target-display {
    margin-top: -4px !important;
    margin-bottom: 14px !important;
    font-size: clamp(0.76rem, 1.4dvh, 0.92rem) !important;
}

body.video-mode #wimhof-overlay-button {
    padding: 10px 18px !important;
    border-radius: 14px !important;
    font-size: clamp(0.76rem, 1.45dvh, 0.94rem) !important;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 35px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.tab-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Guided Journey Panel */
.journey-progress-panel {
    width: 100%;
    max-width: 480px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-color: var(--accent-glow);
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

.journey-progress-panel .journey-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#journey-step-indicator {
    color: var(--accent);
}

#journey-total-time-left {
    color: var(--text-secondary);
}

.journey-timeline-slider {
    width: 100%;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 10px 0;
    transition: height 0.2s ease, margin 0.2s ease;
}

.journey-timeline-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: transparent;
    border-radius: 3px;
}

.journey-timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform 0.1s ease, opacity 0.2s ease;
    opacity: 0; /* Ocultar por defecto para parecer barra limpia */
    margin-top: -4px; /* Centrar con la pista */
}

/* Firefox */
.journey-timeline-slider::-moz-range-track {
    width: 100%;
    height: 100%;
    cursor: pointer;
    background: transparent;
    border-radius: 3px;
}

.journey-timeline-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: transform 0.1s ease, opacity 0.2s ease;
    opacity: 0;
}

/* Mostrar el slider thumb en hover / active / focus */
.journey-timeline-slider:hover::-webkit-slider-thumb,
.journey-timeline-slider:active::-webkit-slider-thumb,
.journey-timeline-slider:focus::-webkit-slider-thumb {
    opacity: 1;
    transform: scale(1.25);
}

.journey-timeline-slider:hover::-moz-range-thumb,
.journey-timeline-slider:active::-moz-range-thumb,
.journey-timeline-slider:focus::-moz-range-thumb {
    opacity: 1;
    transform: scale(1.25);
}

.journey-timeline-slider:hover {
    height: 8px; /* Crece sutilmente en hover */
}

.journey-step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

#journey-step-name {
    font-weight: 500;
    color: var(--text-primary);
}

#journey-next-step {
    color: var(--text-muted);
    font-size: 0.8rem;
}

#journey-next-step.transition-warning {
    color: #d8fff8;
    font-weight: 750;
    text-shadow: 0 0 12px rgba(45, 212, 191, 0.42);
}

#journey-next-step.interactive-step {
    color: var(--accent);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    user-select: none;
}

#journey-next-step.interactive-step:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Hide Journey Progress Panel in Video Mode */
body.video-mode .journey-progress-panel {
    display: none !important;
}

/* Original nature atmospheres selected automatically for every practice.
   They remain behind the educational animation and never require a choice. */
.practice-atmosphere {
    position: fixed;
    inset: -3vh -3vw;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    background-image: var(--atmosphere-portrait, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    transform: translate3d(0, 0, 0) scale(1.035);
    transition: opacity 900ms ease;
    will-change: transform, opacity;
    backface-visibility: hidden;
    contain: strict;
}

.practice-atmosphere::before,
.practice-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
}

.practice-atmosphere::before {
    background:
        linear-gradient(180deg, rgba(3, 9, 21, 0.62) 0%, rgba(3, 9, 21, 0.5) 42%, rgba(3, 9, 21, 0.7) 100%),
        radial-gradient(circle at 50% 46%, rgba(2, 9, 22, 0.2) 0%, rgba(2, 9, 22, 0.16) 42%, rgba(2, 9, 22, 0.38) 100%);
}

.practice-atmosphere[data-atmosphere-tone="bright"]::before {
    background:
        linear-gradient(180deg, rgba(3, 9, 21, 0.72) 0%, rgba(3, 9, 21, 0.62) 42%, rgba(3, 9, 21, 0.78) 100%),
        radial-gradient(circle at 50% 46%, rgba(2, 9, 22, 0.22) 0%, rgba(2, 9, 22, 0.17) 42%, rgba(2, 9, 22, 0.4) 100%);
}

.practice-atmosphere::after {
    background: radial-gradient(circle at 50% 48%, rgba(24, 199, 221, 0.055), transparent 47%);
}

body.in-practice.atmosphere-nature .practice-atmosphere.is-visible {
    opacity: 0.9;
}

body.in-practice.atmosphere-nature .practice-atmosphere.is-visible {
    animation: atmosphereDrift 24s ease-in-out infinite alternate;
}

body.video-mode .practice-atmosphere {
    inset: auto !important;
    top: 50% !important;
    left: 50% !important;
    width: var(--recording-frame-width) !important;
    height: var(--recording-frame-height) !important;
    translate: -50% -50%;
    background-image: var(--atmosphere-landscape, var(--atmosphere-portrait, none)) !important;
    opacity: 0 !important;
    animation: none !important;
}

/* The selected landscape remains visible in the web and standalone recording
   builds. Chroma options still replace it with a clean solid background. */
body.video-mode.in-practice.atmosphere-nature .practice-atmosphere.is-visible {
    opacity: 0.9 !important;
    animation: atmosphereDrift 24s ease-in-out infinite alternate !important;
}

/* Recording needs more photographic detail than the interactive interface.
   Lift the landscape gently without sacrificing white-text contrast. */
body.video-mode .practice-atmosphere::before {
    background:
        linear-gradient(180deg, rgba(3, 9, 21, 0.52) 0%, rgba(3, 9, 21, 0.4) 42%, rgba(3, 9, 21, 0.62) 100%),
        radial-gradient(circle at 50% 46%, rgba(2, 9, 22, 0.16) 0%, rgba(2, 9, 22, 0.12) 42%, rgba(2, 9, 22, 0.3) 100%);
}

body.video-mode .practice-atmosphere[data-atmosphere-tone="bright"]::before {
    background:
        linear-gradient(180deg, rgba(3, 9, 21, 0.64) 0%, rgba(3, 9, 21, 0.52) 42%, rgba(3, 9, 21, 0.7) 100%),
        radial-gradient(circle at 50% 46%, rgba(2, 9, 22, 0.18) 0%, rgba(2, 9, 22, 0.13) 42%, rgba(2, 9, 22, 0.34) 100%);
}

body.video-mode.bg-chroma-green .practice-atmosphere,
body.video-mode.bg-chroma-blue .practice-atmosphere,
body.video-mode.bg-chroma-black .practice-atmosphere {
    opacity: 0 !important;
    animation: none !important;
}

@media (orientation: landscape) {
    .practice-atmosphere {
        background-image: var(--atmosphere-landscape, var(--atmosphere-portrait, none));
    }
}

body.in-practice .practice-header,
body.in-practice .guidance-text,
body.in-practice .session-info,
body.in-practice .breath-education {
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.78);
}

@keyframes atmosphereDrift {
    from { transform: scale(1.035) translate3d(-0.35%, -0.25%, 0); }
    to { transform: scale(1.075) translate3d(0.35%, 0.25%, 0); }
}

#animation-canvas,
#breathing-bubble,
#ola-hud {
    transition: opacity 140ms ease;
}

#practice-view.visual-style-switching #animation-canvas,
#practice-view.visual-style-switching #breathing-bubble,
#practice-view.visual-style-switching #ola-hud {
    opacity: 0;
}

/* Background Hypnotic Particles Canvas */
#bg-particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

/* Fade out background particles in video chroma mode to keep keying backgrounds completely solid and clean! */
body.video-mode #bg-particles-canvas {
    opacity: 0 !important;
}

/* Journey Prep Overlay */
.journey-prep-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 50 !important;
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    padding: 30px !important;
    background: rgba(10, 15, 24, 0.96) !important;
    border-radius: 24px !important;
    animation: fadeIn 0.4s ease-out !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
}

.journey-prep-overlay.countdown-active {
    overflow: hidden !important;
    background: rgba(3, 10, 20, 0.2) !important;
    backdrop-filter: blur(6px) saturate(0.9) !important;
    -webkit-backdrop-filter: blur(6px) saturate(0.9) !important;
    animation: none !important;
}

.prep-content {
    max-width: 500px !important;
    width: 100% !important;
    display: flex;
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center !important;
    margin-block: auto !important;
}

.prep-countdown { margin-block: auto !important; }

.technique-safety-overlay {
    overflow-y: auto !important;
    justify-content: flex-start !important;
    padding-top: clamp(24px, 7vh, 72px) !important;
}

.technique-safety-overlay .prep-content { margin-block: 0 auto !important; }

.safety-prep-content {
    max-width: 620px !important;
    gap: 16px !important;
    padding-bottom: 32px;
}

.safety-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    text-align: left;
}

.practice-benefits {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border-color));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 5%, rgba(255, 255, 255, .018));
    text-align: left;
}

.practice-benefits-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.practice-benefits h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: .86rem;
}

.practice-benefits small {
    color: var(--text-muted);
    font-size: .68rem;
    line-height: 1.35;
    text-align: right;
}

.benefit-chips span { font-size: .73rem; }

.technique-dose-setup {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 15px 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-color));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 7%, rgba(255, 255, 255, .02));
    text-align: left;
}

.technique-dose-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.technique-dose-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: .9rem;
}

#technique-dose-recommended {
    color: color-mix(in srgb, var(--accent) 80%, white);
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .08em;
}

#technique-dose-help {
    margin: 0;
    color: var(--text-muted);
    font-size: .78rem;
    line-height: 1.45;
}

.technique-dose-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.technique-dose-option {
    min-height: 48px;
    padding: 9px 8px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .025);
    font: inherit;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.technique-dose-option:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-color));
    transform: translateY(-1px);
}

.technique-dose-option[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--accent) 70%, white 8%);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, .025));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent);
}

.technique-dose-option small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .62rem;
    font-weight: 500;
}

.wimhof-fixed-breaths {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(14, 165, 233, .07);
    color: var(--text-secondary);
}

.wimhof-fixed-breaths strong {
    color: #38bdf8;
    font-size: 1.35rem;
    line-height: 1;
}

.wimhof-target-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wimhof-target-opt {
    min-height: 62px;
}

.safety-facts > div {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
}

.safety-facts dt {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.safety-facts dd {
    margin: 0;
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.45;
}

.safety-stop {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    padding: 13px 15px;
    border: 1px solid rgba(248, 113, 113, .25);
    border-radius: 14px;
    background: rgba(248, 113, 113, .08);
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.5;
    text-align: left;
}

.safety-stop strong { color: #fca5a5; }

.prep-content .safety-caution {
    margin: 0;
    color: var(--text-muted) !important;
    font-size: .82rem !important;
    line-height: 1.45 !important;
}

.prep-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 2px;
}

.advanced-safety-gate {
    width: min(100%, 680px);
    margin: 4px auto 2px;
    padding: 16px;
    border: 1px solid rgba(251, 191, 36, 0.24);
    border-radius: 16px;
    background: rgba(120, 53, 15, 0.12);
    display: grid;
    gap: 12px;
    text-align: left;
}

.advanced-safety-gate[hidden] { display: none; }

.advanced-safety-gate legend {
    padding: 0 8px;
    color: #fde68a;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.advanced-safety-gate label {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 10px;
    align-items: start;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
    cursor: pointer;
}

.advanced-safety-gate input {
    width: 19px;
    height: 19px;
    margin-top: 1px;
    accent-color: var(--accent);
}

.glass-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    filter: saturate(0.4);
    box-shadow: none !important;
}

#technique-safety-intensity[data-intensity="activa"] {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, .3) !important;
    background: rgba(251, 191, 36, .08) !important;
}

@media (max-width: 680px) {
    .technique-safety-overlay { padding: 22px 16px !important; }
    .safety-facts { grid-template-columns: 1fr; }
    .safety-stop { grid-template-columns: 1fr; }
    .prep-actions { width: 100%; }
    .prep-actions .glass-button { flex: 1; }
    .practice-benefits-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .practice-benefits small { text-align: left; }
    .technique-dose-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.prep-badge {
    align-self: center !important;
    background: rgba(20, 184, 166, 0.1) !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent-glow) !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
}

.prep-content h2 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.5px !important;
}

.prep-content p {
    color: var(--text-secondary) !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.prep-steps, .prep-tips {
    text-align: left !important;
    background: rgba(255, 255, 255, 0.015) !important;
    border: 1px solid var(--border-color) !important;
    padding: 16px 20px !important;
    border-radius: 16px !important;
}

.prep-steps h4, .prep-tips h4 {
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--text-muted) !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 6px !important;
}

.prep-steps ul, .prep-tips ul {
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    font-size: 0.95rem !important;
    color: var(--text-secondary) !important;
}

.prep-steps li {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.prep-steps li::before {
    content: '•' !important;
    color: var(--accent) !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
}

.prep-steps li.prep-step-detailed {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 3px !important;
    align-items: start !important;
    padding: 4px 0 !important;
}

.prep-steps li.prep-step-detailed::before,
.prep-steps li.prep-step-compact::before {
    display: none !important;
}

.prep-step-detailed strong {
    color: var(--text-primary);
    font-size: .93rem;
    line-height: 1.35;
}

.prep-step-meta {
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.4;
}

.prep-steps ul.compact-journey-outline {
    gap: 7px !important;
}

.prep-steps li.prep-step-compact {
    min-height: 38px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .055);
    border-radius: 11px;
    background: rgba(255, 255, 255, .025);
}

.prep-step-index {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-size: .72rem;
    font-weight: 750;
}

.prep-step-compact strong {
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.3;
}

.prep-tips li {
    line-height: 1.5 !important;
}

#start-journey-btn {
    align-self: center !important;
    padding: 16px 40px !important;
    font-size: 1.1rem !important;
    border-radius: 16px !important;
    margin-top: 15px !important;
}

/* Countdown Visuals */
.prep-countdown {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: min(100%, 360px);
    gap: 14px !important;
    animation: countdownEnter 0.45s ease-out !important;
}

.countdown-label {
    font-size: .78rem !important;
    font-weight: 750;
    color: color-mix(in srgb, var(--accent) 55%, white) !important;
    text-transform: uppercase !important;
    letter-spacing: .16em !important;
}

.countdown-orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 148px;
    height: 148px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 38% 32%, rgba(255,255,255,.58), transparent 12%),
        radial-gradient(circle, color-mix(in srgb, var(--accent) 24%, transparent), transparent 68%);
    box-shadow:
        inset 0 0 36px color-mix(in srgb, var(--accent) 15%, transparent),
        0 0 58px color-mix(in srgb, var(--accent) 28%, transparent);
    animation: countdownAura 3s ease-in-out infinite;
}

.countdown-orb::before,
.countdown-orb::after {
    content: '';
    position: absolute;
    inset: -12px;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
    border-radius: 50%;
}

.countdown-orb::after {
    inset: -25px;
    border-color: color-mix(in srgb, var(--accent) 9%, transparent);
}

.countdown-number {
    font-size: 4.6rem !important;
    font-weight: 350 !important;
    line-height: 1;
    color: #ffffff !important;
    text-shadow: 0 0 20px var(--accent-glow) !important;
    transition: transform 0.1s ease-out;
}

.countdown-cue {
    max-width: 290px;
    color: var(--text-secondary);
    font-size: .92rem;
    line-height: 1.5;
    text-align: center;
}

.countdown-cancel {
    min-height: 40px;
    padding: 8px 15px;
    border: 0;
    color: var(--text-muted);
    background: transparent;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
}

.countdown-cancel:hover,
.countdown-cancel:focus-visible { color: var(--text-primary); }

.countdown-number.pulse {
    animation: countdownPulse 1s ease-out !important;
}

@keyframes countdownPulse {
    0% { transform: scale(1.1); opacity: 0.35; }
    18% { transform: scale(1); opacity: 1; }
    82% { transform: scale(1); opacity: 1; }
    100% { transform: scale(.94); opacity: 0; }
}

@keyframes countdownAura {
    50% { transform: scale(1.045); opacity: .86; }
}

@keyframes countdownEnter {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Progress & Gamification Styles */
.progress-view-container {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
    margin-top: 10px;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
    gap: 18px;
    align-items: stretch;
}

.progress-welcome {
    min-height: 238px;
    justify-content: space-between;
    background:
        radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 42%),
        linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
}

.progress-kicker,
.week-chart-heading small,
.progress-insight small {
    color: var(--accent);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .15em;
}

.progress-welcome h2 {
    max-width: 620px;
    margin: 4px 0 8px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.progress-welcome p,
.progress-insight p {
    max-width: 620px;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.progress-sync-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--text-muted);
    font-size: .82rem;
}

.progress-sync-state::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.progress-today {
    justify-content: space-between;
}

.progress-today-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.progress-today-value strong {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    line-height: 1;
    letter-spacing: -.06em;
}

.progress-today-value span { color: var(--text-secondary); }

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.progress-card {
    padding: clamp(20px, 3vw, 28px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.progress-metric-label {
    color: var(--text-muted);
    font-size: .84rem;
}

.progress-metric-value {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -.04em;
}

.progress-metric-detail {
    color: var(--text-secondary);
    font-size: .88rem;
}

.week-chart-card { gap: 22px; }
.week-chart-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
}
.week-chart-heading h3 { margin: 3px 0 0; }
.week-chart-heading strong { font-size: 1.25rem; }
.week-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(24px, 1fr));
    gap: clamp(7px, 2vw, 16px);
    min-height: 150px;
    align-items: end;
}
.week-day {
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    gap: 9px;
    height: 150px;
}
.week-bar-track {
    display: flex;
    align-items: end;
    width: min(30px, 75%);
    height: 118px;
    border-radius: 999px;
    background: rgba(255,255,255,.045);
    overflow: hidden;
}
.week-bar {
    width: 100%;
    min-height: 4px;
    border-radius: inherit;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, white), var(--accent));
    box-shadow: 0 0 14px var(--accent-glow);
}
.week-day.today .week-label { color: var(--accent); font-weight: 750; }
.week-label { color: var(--text-muted); font-size: .75rem; }

.progress-insight {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
}
.progress-insight-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.progress-insight strong { display: block; margin: 4px 0; font-size: 1.12rem; }

.history-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
}
.history-card-heading h3 { margin: 0; }
.history-manage-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
}
.history-manage-button:hover { color: var(--text-primary); }
.history-empty {
    padding: 34px 12px;
    text-align: center;
    color: var(--text-secondary);
}

.progress-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.progress-card h3 svg {
    color: var(--accent);
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.streak-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.streak-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    text-shadow: 0 0 15px var(--accent-glow);
}

.streak-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-value-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.daily-challenge-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.challenge-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 6px;
    box-shadow: 0 0 8px var(--accent-glow);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.completed {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-fast);
}

.history-item:hover {
    border-color: var(--accent-glow);
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(4px);
}

.history-item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 820px) {
    .progress-hero { grid-template-columns: 1fr; }
    .stats-summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .progress-card { border-radius: 20px; }
    .history-item { padding: 14px 15px; gap: 12px; }
    .history-item-title { font-size: .98rem; }
    .history-item-meta { font-size: .76rem; }
    .history-item:hover { transform: none; }
    .week-chart-heading { align-items: start; }
}

.history-item-time {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

.wimhof-retention-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.wimhof-retention-badge {
    font-size: 0.75rem;
    background: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* In Wave Rider style, the canvas draws labels on the wave itself.
   Show a minimal top HUD outside the sphere-container for phase name + counter */
#ola-hud {
    display: none;
    text-align: center;
    position: relative;
    z-index: 30;
    width: 74px;
    height: 74px;
    min-height: 74px;
    box-sizing: border-box;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    margin: 0 auto 2px;
    flex: 0 0 auto;
}

#ola-hud.visible {
    display: flex;
}

#ola-hud-phase {
    display: none;
}

#ola-hud-timer {
    font-size: 2.45rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    line-height: 1;
    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.82),
        0 0 12px rgba(34, 211, 238, 0.34);
}

/* Remove the center breathing bubble completely in Wave Rider style */
body.style-ola #breathing-bubble {
    display: none !important;
}

/* Hide the practice subtitle in Wave Rider style to give the HUD more breathing room for recordings */
body.style-ola #practice-desc {
    display: none;
}

/* In Wave Rider style, show the minimal top HUD automatically only during practice */
body.style-ola.in-practice #ola-hud {
    display: flex;
}

/* The Flow curve is drawn around the vertical centre of its canvas. Move the
   standalone counter into the clear space above that curve so it feels tied
   to the animation instead of floating at the top of the practice. Relative
   positioning preserves the layout height and therefore does not push the
   guidance or signature down. */
body.style-ola.in-practice:not(.video-mode) #ola-hud {
    top: clamp(48px, 7dvh, 70px);
}

/* Flow has its own phase label attached to the cursor. Keep the external
   counter compact, then place the useful route and body cue close below the
   animation with a clear hierarchy and a dedicated signature slot. */
body.style-ola:not(.video-mode) .sphere-container {
    height: 360px;
    margin: -2px 0 -6px;
}

body.style-ola:not(.video-mode) .guidance-text {
    width: min(100% - 24px, 520px);
    max-width: 520px;
    min-height: 76px;
    height: auto;
    margin: -4px 0 2px !important;
    padding: 0 8px;
    gap: 4px;
    font-size: 1.28rem;
    font-weight: 650;
    line-height: 1.18;
}

body.style-ola:not(.video-mode) .guidance-subtext {
    max-width: 500px;
    font-size: 1.04rem;
    font-weight: 500;
    line-height: 1.25;
}

body.style-ola:not(.video-mode) .creator-badge {
    position: relative;
    inset: auto;
    transform: none;
    align-self: center;
    margin: 4px 0 18px;
}

body.video-mode.style-ola #ola-hud {
    width: clamp(64px, 8dvh, 74px) !important;
    height: clamp(64px, 8dvh, 74px) !important;
    padding: 6px !important;
    margin-bottom: 0 !important;
    top: clamp(32px, 4.5dvh, 46px) !important;
}

/* Flow is a horizontal route, not a square Aura composition. In recording
   mode give it a compact stage so the body cue and signature stay attached
   to the curve instead of being pushed down by an invisible square. */
body.video-mode.style-ola #practice-view {
    justify-content: flex-start !important;
    padding-top: clamp(20px, 3dvh, 34px) !important;
}

body.video-mode.style-ola .sphere-container {
    width: min(72vw, 760px) !important;
    height: clamp(320px, 36dvh, 370px) !important;
    aspect-ratio: auto !important;
    margin: clamp(-2px, -0.3dvh, 0px) 0 clamp(-10px, -0.9dvh, -4px) !important;
}

body.video-mode.style-ola #animation-canvas {
    width: min(108%, 80vw) !important;
    height: auto !important;
    aspect-ratio: 1 !important;
}

body.video-mode.style-ola .guidance-text {
    width: min(62vw, 720px) !important;
    max-width: min(62vw, 720px) !important;
    min-height: clamp(82px, 9.5dvh, 98px) !important;
    height: clamp(82px, 9.5dvh, 98px) !important;
    margin: 0 !important;
    padding: 2px 4px 0 !important;
}

body.video-mode.style-ola .creator-badge {
    margin-top: clamp(2px, 0.6dvh, 6px) !important;
}

/* Recording layout: the signature follows the real text height instead of a
   reserved guidance box. Spare vertical room stays after the signature, so
   short phases can never push the brand label toward the bottom edge. */
body.video-mode #practice-view .practice-guidance-stack {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: clamp(140px, 17dvh, 165px);
}

body.video-mode #practice-view .practice-guidance-stack .guidance-text {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 4px !important;
}

body.video-mode #practice-view .practice-guidance-stack .wimhof-overlay:not(.active) {
    display: none !important;
}

body.video-mode #practice-view .practice-guidance-stack .creator-badge {
    margin: clamp(8px, 1.1dvh, 12px) 0 0 !important;
}

/* Short desktop and laptop viewports need a compact practice stage. Keep the
   complete guidance visible and visually attached to the animation without
   changing the already-audited mobile composition. */
@media (min-width: 721px) and (max-height: 820px) {
    #practice-view {
        justify-content: flex-start;
        padding-top: 6px;
    }

    .practice-header {
        margin-bottom: 8px;
    }

    .sphere-container {
        width: 320px;
        height: 320px;
        margin-bottom: -6px;
    }

    #animation-canvas {
        width: min(540px, 100vw);
        height: min(540px, 100vw);
    }

    .guidance-text {
        min-height: 68px;
        height: 68px;
        margin-bottom: 8px;
    }

    .creator-badge {
        margin: 2px 0 10px;
    }

    .session-info {
        margin-bottom: 16px;
    }

    body.style-ola:not(.video-mode) .sphere-container {
        height: 290px;
        margin: -2px 0 -10px;
    }

    body.style-ola:not(.video-mode) .guidance-text {
        min-height: 68px;
        margin-top: -4px !important;
    }
}

@media (max-width: 720px) {
    #ola-hud {
        width: 66px;
        height: 66px;
        min-height: 66px;
        padding: 7px;
    }

    #ola-hud-timer { font-size: 2.15rem; }
    body.style-ola.in-practice:not(.video-mode) #ola-hud { top: clamp(38px, 5.5dvh, 50px); }
    body.style-ola:not(.video-mode) .sphere-container { height: 272px; margin-bottom: -2px; }
    body.style-ola:not(.video-mode) .guidance-text {
        width: min(100% - 16px, 430px);
        min-height: 82px;
        margin-top: -2px !important;
        font-size: 1.08rem;
    }
    body.style-ola:not(.video-mode) .guidance-subtext { font-size: .94rem; }
    body.style-ola:not(.video-mode) .creator-badge { margin: 2px 0 14px; }
}

/* ==============================================================
   Intention-first experience
   ============================================================== */
[hidden] { display: none !important; }

.intent-view,
.duration-view,
.session-complete-view {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    min-height: calc(100vh - 170px);
    padding: clamp(32px, 6vh, 72px) 0 48px;
}

.intent-view { display: flex; flex-direction: column; align-items: center; }
.intent-hero { max-width: 720px; text-align: center; margin-bottom: 34px; }
.home-week-card {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.4fr) auto;
    align-items: center;
    gap: 22px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background: rgba(255,255,255,.025);
}
.home-week-card > div:first-child { display: grid; gap: 3px; }
.home-week-card .intent-eyebrow { margin-bottom: 3px; }
.home-week-card strong { font-size: .96rem; }
.home-week-card small, .home-streak { color: var(--text-muted); font-size: .74rem; }
.home-week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.home-week-day { display: grid; justify-items: center; gap: 6px; }
.home-week-day i {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04);
}
.home-week-day.completed i { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.home-week-day small { font-size: .64rem; text-transform: uppercase; }
.home-streak { white-space: nowrap; }

.home-recommendation {
    position: relative;
    width: min(860px, 100%);
    min-height: 270px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 28px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,.08));
    border-radius: 28px;
    color: white;
    background-color: #071423;
    background-position: center;
    background-size: cover;
    text-align: left;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 20px 55px rgba(0,0,0,.28);
    transition: transform .25s ease, border-color .25s ease;
}
.home-recommendation:hover { transform: translateY(-3px); border-color: var(--accent); }
.home-recommendation-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,8,16,.08), rgba(2,8,16,.92)); }
.home-recommendation-copy { position: relative; z-index: 1; display: grid; gap: 7px; max-width: 580px; }
.home-recommendation-copy small { color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .13em; }
.home-recommendation-copy strong { font-size: clamp(1.75rem, 4vw, 2.8rem); line-height: 1.02; }
.home-recommendation-copy span { color: rgba(255,255,255,.76); line-height: 1.45; }
.home-recommendation-copy b { width: fit-content; margin-top: 7px; padding: 10px 15px; border-radius: 999px; color: #031215; background: var(--accent); font-size: .84rem; }
.home-shortcuts-heading { width: min(860px,100%); display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 28px 0 12px; color: var(--text-secondary); }
.home-shortcuts-heading button { border: 0; color: var(--accent); background: transparent; font: inherit; font-size: .88rem; font-weight: 750; cursor: pointer; }
.home-shortcuts.intent-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.home-shortcuts .intent-card { min-height: 112px; padding: 15px; flex-direction: column; align-items: flex-start; gap: 11px; }
.home-shortcuts .intent-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 1.1rem; }
.home-shortcuts .intent-copy strong { font-size: .92rem; }
.home-shortcuts .intent-copy small { font-size: .72rem; }
.intent-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    margin-bottom: 12px;
}
.intent-hero h1, .duration-content h1, .session-complete-view h1 {
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.045em;
    margin: 0 0 16px;
}
.intent-hero p, .duration-content > p, .session-complete-view > p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.15rem);
    line-height: 1.6;
    margin: 0;
}
.intent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: min(860px, 100%);
}
.intent-card, .duration-card {
    border: 1px solid rgba(255,255,255,.1);
    background: linear-gradient(135deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
    color: var(--text-primary);
    border-radius: 22px;
    min-height: 108px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
    font: inherit;
}
.technique-card { width: 100%; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.technique-card { position: relative; }
.technique-card.premium-locked { opacity: .82; }
.technique-card.premium-locked:hover { opacity: 1; }
.access-badge {
    position: absolute;
    z-index: 6;
    top: 12px;
    right: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .07em;
    pointer-events: none;
}
.access-badge.free { color: #86efac; background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.22); }
.access-badge.premium { color: #fde68a; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.24); }
.access-badge.premium.preview { color: #d8b4fe; background: rgba(168,85,247,.12); border-color: rgba(192,132,252,.32); }
.access-badge.review.preview { color: #fdba74; background: rgba(249,115,22,.12); border: 1px solid rgba(251,146,60,.34); }

.premium-overlay {
    position: fixed;
    z-index: 150;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3,7,14,.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.premium-overlay[hidden] { display: none; }
.premium-card {
    position: relative;
    width: min(100%, 520px);
    max-height: min(760px, calc(100dvh - 32px));
    overflow-y: auto;
    padding: 32px;
    border-radius: 26px;
}
.premium-card h2 { margin: 9px 0 10px; font-size: clamp(1.7rem, 5vw, 2.3rem); }
.premium-card > p { color: var(--text-secondary); line-height: 1.55; }
.premium-card ul { display: grid; gap: 10px; margin: 22px 0; padding-left: 22px; color: var(--text-secondary); }
.premium-card small { display: block; margin-top: 18px; color: var(--text-muted); line-height: 1.45; }
.premium-card .glass-button { width: 100%; }
.premium-card .glass-button:disabled { opacity: .68; cursor: not-allowed; }
.premium-plan-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.premium-plan-button {
    min-width: 0;
    min-height: 116px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 18px;
    color: var(--text-primary);
    background: rgba(255,255,255,.035);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.premium-plan-button:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.premium-plan-button.recommended { border-color: color-mix(in srgb, var(--accent) 46%, transparent); background: color-mix(in srgb, var(--accent) 12%, rgba(255,255,255,.035)); }
.premium-plan-button:disabled { opacity: .55; cursor: not-allowed; }
.premium-plan-button > span { color: var(--accent); font-size: .66rem; font-weight: 800; letter-spacing: .07em; }
.premium-plan-button > strong { font-size: .98rem; }
.premium-plan-button > small { margin: 0; font-size: .68rem; }
.premium-close {
    position: absolute; top: 12px; right: 14px; width: 40px; height: 40px;
    border: 0; border-radius: 50%; color: var(--text-secondary); background: rgba(255,255,255,.06);
    font-size: 1.5rem;
}
.premium-restore { display: block; margin: 14px auto 0; border: 0; color: var(--accent); background: transparent; font: inherit; }
.premium-status { min-height: 1.4em; margin-top: 10px; font-size: .82rem; text-align: center; }
body.premium-open { overflow: hidden; }
.resume-session-card { max-width: 470px; }
.resume-session-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; margin-top: 24px; }
.resume-session-actions .glass-button { width: 100%; }
@media (max-width: 520px) {
    .premium-plan-options { grid-template-columns: 1fr; }
    .premium-plan-button { min-height: 94px; }
    .resume-session-actions { grid-template-columns: 1fr; }
}
.technique-purpose-label { display: block; margin-bottom: 5px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.safety-notice {
    margin: 14px 0 4px; padding: 13px 15px; border-radius: 14px;
    color: var(--text-secondary); background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2); font-size: .88rem; line-height: 1.5;
}

.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
    body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    body.in-practice { padding-bottom: 0; }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 90;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 10px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 64px;
        padding: 7px 8px;
        border: 1px solid rgba(255,255,255,.1);
        border-radius: 20px;
        background: rgba(10,15,24,.92);
        box-shadow: 0 18px 45px rgba(0,0,0,.35);
        backdrop-filter: blur(22px);
        -webkit-backdrop-filter: blur(22px);
    }

    body.in-practice .mobile-bottom-nav { display: none; }

    .mobile-bottom-nav button {
        min-width: 0;
        min-height: 50px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 3px;
        padding: 4px;
        border: 0;
        border-radius: 14px;
        color: var(--text-muted);
        background: transparent;
        font: inherit;
    }

    .mobile-bottom-nav button.active {
        color: var(--accent);
        background: color-mix(in srgb, var(--accent) 12%, transparent);
    }

    .mobile-bottom-nav svg {
        width: 21px;
        height: 21px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-bottom-nav span { font-size: .68rem; font-weight: 650; }

    #practice-view {
        min-height: 100dvh;
        padding-top: max(14px, env(safe-area-inset-top));
        padding-right: max(14px, env(safe-area-inset-right));
        padding-bottom: max(18px, env(safe-area-inset-bottom));
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .dashboard-tabs {
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }
    .dashboard-tabs::-webkit-scrollbar { display: none; }
    .dashboard-tabs .tab-btn { flex: 0 0 auto; scroll-snap-align: start; }
}
.intent-card:hover, .duration-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
    box-shadow: 0 16px 36px rgba(0,0,0,.18);
}
.intent-card:focus-visible, .duration-card:focus-visible, .intent-explore:focus-visible,
.quiet-back:focus-visible, .feeling-fieldset button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 78%, white);
    outline-offset: 4px;
}
.intent-icon {
    width: 50px; height: 50px; flex: 0 0 50px;
    border-radius: 16px; display: grid; place-items: center;
    font-size: 1.55rem; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.intent-copy { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.intent-copy strong, .duration-card strong { font-size: 1.06rem; }
.intent-copy small, .duration-card small { color: var(--text-muted); font-size: .86rem; }
.intent-premium-note {
    width: fit-content;
    margin-top: 1px;
    color: #fde68a;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .08em;
}

/* Intention lives in the shortcut itself, never in the whole application.
   All four cards share the same midnight material and differ only through a
   restrained emotional accent. */
.home-shortcuts .intent-card {
    --intent-card-accent: #2dd4bf;
    --intent-card-rgb: 45, 212, 191;
    border-color: rgba(56, 189, 248, .24);
    background:
        radial-gradient(circle at 18% 8%, rgba(70, 130, 170, .085), transparent 50%),
        linear-gradient(145deg, rgba(18, 32, 50, .86), rgba(7, 16, 30, .78));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 12px 30px rgba(0,0,0,.12);
}

.home-shortcuts .intent-focus { --intent-card-accent: #38bdf8; --intent-card-rgb: 56, 189, 248; }
.home-shortcuts .intent-energy { --intent-card-accent: #f59e0b; --intent-card-rgb: 245, 158, 11; }
.home-shortcuts .intent-calm { --intent-card-accent: #2dd4bf; --intent-card-rgb: 45, 212, 191; }
.home-shortcuts .intent-sleep { --intent-card-accent: #a78bfa; --intent-card-rgb: 167, 139, 250; }

.home-shortcuts .intent-card .intent-icon {
    color: var(--intent-card-accent);
    background: rgba(56, 189, 248, .075);
    border: 1px solid rgba(56, 189, 248, .18);
    box-shadow: 0 8px 24px rgba(18, 121, 166, .08);
}

.home-shortcuts .intent-card:hover {
    border-color: rgba(56, 189, 248, .46);
    background:
        radial-gradient(circle at 18% 8%, rgba(70, 130, 170, .12), transparent 52%),
        linear-gradient(145deg, rgba(21, 37, 57, .9), rgba(7, 16, 30, .8));
    box-shadow: 0 16px 38px rgba(0,0,0,.2), 0 0 24px rgba(56, 189, 248, .075);
}

.home-shortcuts .intent-card:active {
    border-color: rgba(56, 189, 248, .66);
}

.home-shortcuts .intent-card:focus-visible {
    outline-color: rgba(103, 215, 255, .9);
}
.finder-card { position: relative; width: min(100%, 640px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 30px; border-radius: 27px; }
.finder-card h2 { margin: 2px 0 8px; font-size: clamp(1.6rem,4vw,2.25rem); }
.finder-card > p { margin: 0 0 24px; color: var(--text-secondary); line-height: 1.5; }
.finder-question { margin: 0; padding: 16px 0; border: 0; border-top: 1px solid rgba(255,255,255,.07); }
.finder-question legend { padding: 0 0 11px; color: var(--text-primary); font-weight: 700; }
.finder-options { display: flex; flex-wrap: wrap; gap: 8px; }
.finder-options button,
.experience-filters button,
.prep-soundtrack button {
    padding: 9px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
    color: var(--text-secondary); background: rgba(255,255,255,.035); font: inherit; font-size: .8rem; cursor: pointer;
}
.finder-options button[aria-pressed="true"],
.experience-filters button[aria-pressed="true"] { color: #041416; border-color: var(--accent); background: var(--accent); }
.finder-result { display: grid; gap: 5px; margin: 18px 0 14px; padding: 18px; border: 1px solid color-mix(in srgb,var(--accent) 30%,transparent); border-radius: 18px; background: color-mix(in srgb,var(--accent) 9%,transparent); }
.finder-result small { color: var(--accent); font-size: .63rem; font-weight: 800; letter-spacing: .12em; }
.finder-result strong { font-size: 1.22rem; }
.finder-result span, .finder-result p { color: var(--text-secondary); }
.finder-result p { margin: 3px 0 0; line-height: 1.45; }
.finder-card > .glass-button { width: 100%; }
.intent-arrow { color: var(--text-muted); font-size: 1.35rem; transition: transform .25s ease; }
.intent-card:hover .intent-arrow { transform: translateX(4px); color: var(--accent); }
.intent-explore, .quiet-back {
    margin-top: 28px; padding: 12px 18px; border: 0; background: transparent;
    color: var(--text-secondary); font: inherit; cursor: pointer; border-radius: 12px;
}
.intent-library-card {
    width: min(860px, 100%); min-height: 84px; margin-top: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    color: var(--text-primary); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), rgba(255,255,255,.025));
    border-radius: 20px; padding: 16px 20px; display: flex; align-items: center; gap: 16px;
    font: inherit; text-align: left; cursor: pointer; transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.intent-library-card:hover { transform: translateY(-2px); border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), rgba(255,255,255,.04)); }
.intent-library-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 78%, white); outline-offset: 4px; }
.intent-explore:hover, .quiet-back:hover { color: var(--text-primary); background: rgba(255,255,255,.05); }

.duration-view { position: relative; }
.quiet-back { margin: 0 0 30px; }
.duration-content { max-width: 760px; margin: 0 auto; text-align: center; }
.duration-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 38px; }
.duration-card { min-height: 150px; justify-content: space-between; }
.duration-card > span { display: flex; flex-direction: column; gap: 8px; }
.duration-card b { font-size: 1.35rem; color: var(--accent); white-space: nowrap; }
.duration-card.featured { border-color: color-mix(in srgb, var(--accent) 38%, transparent); }

body.intent-night-mode { background-color: #050812; }
body.intent-night-mode #bg-particles-canvas { opacity: .25; }

/* A breathing session should have almost no cognitive noise. */
body.in-practice header, body.in-practice footer { opacity: 0; pointer-events: none; }
/* Keep familiar controls and settings available during a practice. */
body.in-practice header, body.in-practice footer { opacity: 1; pointer-events: auto; }

.purpose-browser {
    width: min(100%, 1000px); margin: 0 auto 26px; padding: 20px;
    border: 1px solid rgba(255,255,255,.08); border-radius: 22px;
    background: rgba(255,255,255,.025);
}
.purpose-browser-heading h2 { margin: -4px 0 15px; font-size: 1.25rem; }
.purpose-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.purpose-filter,
.difficulty-filter {
    appearance: none; cursor: pointer; color: var(--text-secondary); font: inherit; font-size: .86rem;
    padding: 9px 13px; border-radius: 999px; background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.09); transition: .2s ease;
}
.purpose-filter:hover, .purpose-filter.active,
.difficulty-filter:hover, .difficulty-filter.active { color: #051414; background: var(--accent); border-color: var(--accent); }
.purpose-filter:focus-visible,
.difficulty-filter:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 80%, white); outline-offset: 3px; }
.difficulty-browser {
    margin-top: 18px;
    padding-top: 16px;
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
}
.difficulty-label {
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 760;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.difficulty-filters { display: flex; flex-wrap: wrap; gap: 9px; }
.difficulty-filter { font-size: .8rem; padding-block: 8px; }
.purpose-description { margin: 14px 0 0; color: var(--text-muted); font-size: .9rem; }
.legacy-content-tab,
.legacy-content-panel { display: none !important; }
.experiences-header {
    grid-column: 1 / -1;
    display: block;
    align-items: initial;
    justify-content: initial;
    z-index: auto;
    padding: 8px 2px 4px;
}
.experience-filter-block { display: grid; gap: 9px; margin-top: 18px; }
.experience-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.experience-empty { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 24px; text-align: center; }
.experience-empty span { color: var(--text-muted); }

.prep-soundtrack {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 16px; border: 1px solid color-mix(in srgb,var(--accent) 24%,rgba(255,255,255,.07));
    border-radius: 16px; background: color-mix(in srgb,var(--accent) 7%,rgba(255,255,255,.02));
}
.prep-soundtrack > span { min-width: 0; display: grid; gap: 3px; }
.prep-soundtrack small { color: var(--accent); font-size: .61rem; font-weight: 800; letter-spacing: .1em; }
.prep-soundtrack strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.prep-soundtrack button { flex: 0 0 auto; color: #041416; border-color: var(--accent); background: var(--accent); }
.prep-soundtrack button.is-muted { color: var(--text-secondary); border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.035); }
.experiences-header h2 { margin: 4px 0 8px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.experiences-header p { max-width: 680px; margin: 0; color: var(--text-secondary); line-height: 1.55; }

.session-complete-view {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    max-width: 760px; text-align: center;
}
.complete-orb {
    width: 88px; height: 88px; border-radius: 50%; margin-bottom: 30px;
    background: radial-gradient(circle at 35% 30%, white, var(--accent) 25%, transparent 70%);
    box-shadow: 0 0 50px color-mix(in srgb, var(--accent) 45%, transparent);
    animation: completeBreathe 5s ease-in-out infinite;
}
@keyframes completeBreathe { 50% { transform: scale(1.14); opacity: .76; } }
.feeling-fieldset { border: 0; padding: 0; margin: 34px 0 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.feeling-fieldset legend { width: 100%; margin-bottom: 16px; color: var(--text-secondary); }
.feeling-fieldset button {
    border: 1px solid rgba(255,255,255,.12); color: var(--text-primary); background: rgba(255,255,255,.055);
    border-radius: 999px; padding: 11px 17px; font: inherit; cursor: pointer;
}
.feeling-fieldset button.selected { color: #061413; background: var(--accent); border-color: var(--accent); }
.complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.session-result-card {
    --result-accent: var(--accent);
    position: relative;
    width: min(100%, 620px);
    min-height: 260px;
    margin-top: 28px;
    padding: clamp(22px, 4vw, 34px);
    overflow: hidden;
    text-align: left;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--result-accent) 28%, transparent), transparent 34%),
        radial-gradient(circle at 18% 90%, rgba(61, 213, 180, .14), transparent 36%),
        linear-gradient(145deg, #0b1420, #071019);
    box-shadow: 0 26px 70px rgba(0,0,0,.28);
}
.session-result-card.challenge-morning {
    --result-accent: #ffd18a;
    background:
        radial-gradient(circle at 82% 16%, rgba(255, 190, 102, .32), transparent 38%),
        radial-gradient(circle at 14% 92%, rgba(84, 222, 214, .14), transparent 36%),
        linear-gradient(145deg, #10232a, #071419);
}
.session-result-card.challenge-night {
    --result-accent: #aeb9ff;
    background:
        radial-gradient(circle at 82% 16%, rgba(122, 137, 255, .3), transparent 38%),
        radial-gradient(circle at 16% 92%, rgba(58, 91, 170, .16), transparent 38%),
        linear-gradient(145deg, #0b1530, #050914);
}
.session-result-card::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -100px;
    bottom: -140px;
    border: 1px solid color-mix(in srgb, var(--result-accent) 28%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 50px color-mix(in srgb, var(--result-accent) 12%, transparent);
}
.session-result-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.82);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .17em;
}
.session-result-mark {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, white, var(--result-accent) 38%, transparent 72%);
    box-shadow: 0 0 16px color-mix(in srgb, var(--result-accent) 45%, transparent);
}
.session-result-copy { display: flex; flex-direction: column; margin: 42px 0 44px; }
.session-result-copy small { color: var(--result-accent); font-weight: 800; letter-spacing: .14em; }
.session-result-copy strong {
    margin: 7px 0 4px;
    color: white;
    font-size: clamp(3.3rem, 10vw, 5.2rem);
    line-height: .96;
    letter-spacing: -.065em;
}
.session-result-copy span { color: rgba(255,255,255,.7); font-size: 1rem; }
.session-result-achievement {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(130px, .75fr) minmax(180px, 1.25fr);
    gap: 12px 22px;
    align-items: end;
    margin: -10px 0 34px;
    padding: 18px 20px 16px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 20px;
    background: rgba(255,255,255,.035);
}
.session-result-achievement > div:first-child {
    display: flex;
    flex-direction: column;
    align-self: center;
    gap: 6px;
}
.session-result-achievement small {
    color: color-mix(in srgb, var(--result-accent) 78%, transparent);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .13em;
}
.session-result-achievement strong {
    color: rgba(255,255,255,.88);
    font-size: .87rem;
    line-height: 1.3;
}
.session-result-achievement > span {
    grid-column: 1 / -1;
    color: rgba(255,255,255,.48);
    font-size: .68rem;
}
.session-result-week-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(10px, 1fr));
    gap: 6px;
    align-items: end;
    height: 58px;
}
.session-result-week-day {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
    gap: 4px;
    height: 100%;
}
.session-result-week-bar {
    width: min(12px, 100%);
    min-height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
}
.session-result-week-day.today .session-result-week-bar {
    background: linear-gradient(180deg, white, var(--result-accent));
    box-shadow: 0 0 10px color-mix(in srgb, var(--result-accent) 45%, transparent);
}
.session-result-week-label {
    color: rgba(255,255,255,.32);
    font-size: .48rem;
    text-transform: uppercase;
}
.session-result-week-day.today .session-result-week-label { color: var(--result-accent); }
.session-result-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: rgba(255,255,255,.5);
    font-size: .72rem;
}
.share-result-status {
    min-height: 1.4em;
    margin: -12px 0 14px;
    color: var(--text-secondary);
    font-size: .84rem;
}

@media (max-width: 700px) {
    .intent-grid, .duration-options { grid-template-columns: 1fr; }
    .home-week-card { grid-template-columns: 1fr; gap: 14px; }
    .home-week-card > div:first-child { text-align: center; }
    .home-streak { text-align: center; }
    .home-recommendation { min-height: 300px; padding: 22px; border-radius: 24px; }
    .home-shortcuts-heading { align-items: flex-start; }
    .home-shortcuts.intent-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .home-shortcuts .intent-card { min-height: 120px; }
    .intent-card { min-height: 94px; padding: 16px; }
    .duration-card { min-height: 120px; }
    .intent-view, .duration-view, .session-complete-view { width: min(100% - 24px, 1080px); padding-top: 24px; }
    .session-result-card { min-height: 238px; border-radius: 23px; }
    .session-result-copy { margin: 34px 0 36px; }
    .session-result-achievement {
        grid-template-columns: 1fr;
        align-items: stretch;
        margin-top: -12px;
    }
    .session-result-achievement > span { grid-column: auto; }
    .session-result-footer span:last-child { display: none; }
}

@media (max-width: 420px) {
    .home-shortcuts.intent-grid { grid-template-columns: 1fr; }
    .home-shortcuts .intent-card { min-height: 88px; flex-direction: row; align-items: center; }
    .finder-card { padding: 24px 18px; }
    .prep-soundtrack { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
    .intent-card, .duration-card, .intent-arrow { transition-duration: .001ms !important; }
    #bg-particles-canvas { display: none; }
    .practice-atmosphere { animation: none !important; transform: scale(1.035) !important; }
}

.legal-settings p, .legal-settings small { color: var(--text-muted); line-height: 1.55; }
.legal-settings nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.legal-settings a {
    color: var(--text-primary); text-decoration: none; border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px; padding: 8px 12px; background: rgba(255,255,255,.04);
}
.legal-settings a:hover, .legal-settings a:focus-visible { border-color: var(--accent); color: var(--accent); }

/* Account and cloud sync */
.account-overlay[hidden] { display: none !important; }
.account-overlay {
    position: fixed; inset: 0; z-index: 1200; padding: 24px;
    display: grid; place-items: center; overflow-y: auto;
    background: rgba(3, 8, 16, .78); backdrop-filter: blur(18px);
}
body.account-open { overflow: hidden; }
.account-card {
    position: relative; width: min(520px, 100%); max-height: calc(100dvh - 48px); overflow-y: auto;
    padding: 34px; border-radius: 28px; background: linear-gradient(155deg, rgba(17, 27, 42, .98), rgba(6, 12, 23, .98));
    border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 32px 90px rgba(0, 0, 0, .48);
}
.account-close { position: absolute; top: 18px; right: 18px; font-size: 1.4rem; }
.account-heading { padding-right: 42px; }
.account-heading h2 { margin: 6px 0 8px; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.account-heading p, .account-state-note p { margin: 0; color: var(--text-muted); line-height: 1.55; }
.account-state-note {
    margin-top: 24px; padding: 20px; border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,.02));
}
.account-state-note strong { display: block; margin-bottom: 6px; }
.account-mode-switch {
    display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; margin: 26px 0 20px;
    border-radius: 14px; background: rgba(255,255,255,.045);
}
.account-mode-switch button {
    border: 0; border-radius: 10px; padding: 10px; color: var(--text-muted); background: transparent;
    font: inherit; font-weight: 700; cursor: pointer;
}
.account-mode-switch button.active { color: #051411; background: var(--accent); }
.account-social-auth { display: grid; gap: 10px; margin-bottom: 18px; }
.account-social-auth[hidden] { display: none !important; }
.account-social-button {
    position: relative; width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center;
    gap: 11px; padding: 0 16px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
    color: var(--text-primary); background: rgba(255,255,255,.055); font: inherit; font-weight: 760; cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.account-social-button[hidden] { display: none !important; }
.account-social-button:hover, .account-social-button:focus-visible {
    transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 58%, transparent);
    background: rgba(255,255,255,.085); outline: none;
}
.account-social-button:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.account-social-button:disabled { opacity: .56; cursor: wait; transform: none; }
.account-social-button.apple { color: #07101c; background: #f7f9fc; border-color: #f7f9fc; }
.account-social-button.apple:hover, .account-social-button.apple:focus-visible { background: #fff; border-color: #fff; }
.account-social-button.facebook { border-color: rgba(70,123,255,.38); background: rgba(24,79,190,.18); }
.account-provider-icon, .account-provider-svg { width: 21px; height: 21px; flex: 0 0 21px; }
.account-provider-icon { display: grid; place-items: center; font-size: 1rem; font-weight: 900; }
.account-social-button.google .account-provider-icon {
    color: #fff; border-radius: 50%; background: conic-gradient(from -35deg, #4285f4 0 28%, #34a853 0 47%, #fbbc05 0 68%, #ea4335 0 82%, #4285f4 0);
    box-shadow: inset 0 0 0 4px rgba(8,16,28,.96); font-size: .72rem;
}
.facebook-mark { color: #fff; border-radius: 50%; background: #1877f2; font-family: Arial, sans-serif; font-size: 1.25rem; line-height: 1; }
.account-social-legal { margin: 3px 8px 0; color: var(--text-muted); font-size: .74rem; line-height: 1.45; text-align: center; }
.account-social-legal a { color: var(--text-secondary); }
.account-email-divider { display: flex; align-items: center; gap: 12px; margin: 3px 0 18px; color: var(--text-muted); font-size: .75rem; }
.account-email-divider[hidden] { display: none !important; }
.account-email-divider::before, .account-email-divider::after { content: ''; height: 1px; flex: 1; background: rgba(255,255,255,.1); }
.account-email-divider span { white-space: nowrap; }
.account-form { display: grid; gap: 15px; }
.account-form > label { display: grid; gap: 7px; color: var(--text-secondary); font-size: .88rem; font-weight: 650; }
.account-form input[type="email"], .account-form input[type="password"], .account-form input[type="text"] {
    width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; color: var(--text-primary);
    border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.045); font: inherit;
}
.account-form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.account-consents { display: grid; gap: 12px; padding: 6px 0; }
.account-consents label { display: flex; align-items: flex-start; gap: 10px; color: var(--text-muted); font-size: .8rem; line-height: 1.45; }
.account-consents input { margin-top: 3px; accent-color: var(--accent); }
.account-consents a { color: var(--accent); }
.account-primary {
    min-height: 50px; border: 0; border-radius: 14px; color: #041310; background: var(--accent);
    font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 22%, transparent);
}
.account-primary:disabled, .account-actions button:disabled { opacity: .55; cursor: wait; }
.account-link { border: 0; padding: 8px; color: var(--text-muted); background: transparent; font: inherit; cursor: pointer; }
.account-link:hover { color: var(--accent); }
.account-user-state { margin-top: 26px; }
.account-tier-badge {
    margin-left: 2px; padding: 4px 7px; border: 1px solid rgba(250, 204, 21, .38); border-radius: 999px;
    color: #fde68a; background: rgba(161, 98, 7, .2); font-size: .58rem; line-height: 1; letter-spacing: .08em;
}
.account-tier-badge[hidden] { display: none !important; }
.account-recovery-state { margin-top: 26px; }
.account-recovery-state > p { margin: -6px 0 4px; color: var(--text-muted); line-height: 1.5; }
.account-identity { display: flex; align-items: center; gap: 14px; }
.account-identity > span {
    width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 50%;
    color: #061411; background: var(--accent); font-size: 1.25rem; font-weight: 900;
}
.account-identity div { display: grid; gap: 3px; }
.account-identity small, .account-sync-card small { color: var(--text-muted); }
.account-access-card {
    display: flex; align-items: center; gap: 13px; margin: 20px 0 0; padding: 16px;
    border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
}
.account-access-card div { display: grid; gap: 3px; }
.account-access-card small { color: var(--text-muted); line-height: 1.4; }
.account-access-mark {
    width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%;
    color: var(--text-muted); background: rgba(255,255,255,.06); font-size: 1rem;
}
.account-access-card[data-tier="premium"], .account-access-card[data-tier="owner"] {
    border-color: rgba(250, 204, 21, .3); background: linear-gradient(135deg, rgba(161,98,7,.17), rgba(13,148,136,.08));
}
.account-access-card[data-tier="premium"] strong, .account-access-card[data-tier="owner"] strong,
.account-access-card[data-tier="premium"] .account-access-mark, .account-access-card[data-tier="owner"] .account-access-mark { color: #fde68a; }
.account-access-card[data-tier="premium"] .account-access-mark, .account-access-card[data-tier="owner"] .account-access-mark {
    background: rgba(161,98,7,.2); box-shadow: 0 0 18px rgba(250,204,21,.12);
}
.account-manage-subscription {
    width: 100%; min-height: 46px; margin-top: 10px; justify-content: center;
    border-color: rgba(250,204,21,.26); color: #fde68a; background: rgba(161,98,7,.1);
}
.account-manage-subscription:hover, .account-manage-subscription:focus-visible {
    border-color: rgba(250,204,21,.52); background: rgba(161,98,7,.17);
}
.account-manage-subscription[hidden] { display: none !important; }
.account-sync-card {
    display: flex; align-items: center; gap: 13px; margin: 22px 0; padding: 16px;
    border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08);
}
.account-sync-card div { display: grid; gap: 3px; }
.account-sync-indicator { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); }
.account-sync-indicator.syncing { animation: accountSyncPulse 1s ease-in-out infinite; }
@keyframes accountSyncPulse { 50% { opacity: .35; transform: scale(.72); } }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.account-danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.account-danger-link {
    border: 0; padding: 8px 0; color: #fda4af; background: transparent;
    font: inherit; font-size: .84rem; cursor: pointer;
}
.account-danger-link:hover, .account-danger-link:focus-visible { color: #fecdd3; }
.account-delete-confirmation {
    margin-top: 12px; padding: 16px; border: 1px solid rgba(251,113,133,.22);
    border-radius: 16px; background: rgba(127,29,29,.12);
}
.account-delete-confirmation strong { color: #fecdd3; }
.account-delete-confirmation p { margin: 7px 0 14px; color: var(--text-muted); font-size: .82rem; line-height: 1.5; }
.account-delete-confirmation label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: .78rem; }
.account-delete-confirmation input {
    width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid rgba(251,113,133,.3);
    border-radius: 11px; color: var(--text-primary); background: rgba(5,10,18,.72); font: inherit;
}
.account-delete-confirmation input:focus { outline: 2px solid #fb7185; outline-offset: 2px; }
.account-delete-confirmation > div { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 13px; }
.account-danger-button {
    min-height: 42px; padding: 0 14px; border: 1px solid rgba(251,113,133,.48); border-radius: 11px;
    color: #fff1f2; background: #9f1239; font: inherit; font-weight: 750; cursor: pointer;
}
.account-danger-button:disabled { opacity: .42; cursor: not-allowed; }
.account-admin-panel { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.09); }
.account-admin-panel h3 { margin: 7px 0 16px; }
.account-admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.account-admin-stats > div { display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.04); }
.account-admin-stats strong { font-size: 1.35rem; color: var(--accent); }
.account-admin-stats span { color: var(--text-muted); font-size: .76rem; }
.account-message { min-height: 20px; margin: 18px 0 0; color: var(--text-muted); font-size: .84rem; line-height: 1.45; }
.account-message[data-tone="error"] { color: #fda4af; }
.account-message[data-tone="success"] { color: #6ee7b7; }

@media (max-width: 620px) {
    .account-overlay { padding: 0; align-items: end; }
    .account-card { width: 100%; max-height: 94dvh; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; }
    .header-controls .account-button span { display: none; }
    .account-tier-badge { margin-left: -4px; padding: 4px 6px; font-size: .5rem; }
    .account-admin-stats { grid-template-columns: 1fr 1fr; }
}

/* Public web beta: keyboard access and resilient connection feedback. */
.skip-link {
    position: fixed;
    z-index: 100000;
    top: max(8px, env(safe-area-inset-top));
    left: max(8px, env(safe-area-inset-left));
    padding: 10px 14px;
    border-radius: 12px;
    color: #03111f;
    background: #67e8f9;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.beta-badge {
    flex: 0 0 auto;
    padding: 3px 6px;
    border: 1px solid rgba(103, 232, 249, .45);
    border-radius: 999px;
    color: #67e8f9;
    background: rgba(8, 47, 73, .55);
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .12em;
    line-height: 1;
}

.connection-status {
    position: fixed;
    z-index: 99990;
    top: calc(max(10px, env(safe-area-inset-top)) + 58px);
    left: 50%;
    width: min(92vw, 560px);
    padding: 11px 14px;
    border: 1px solid rgba(103, 232, 249, .35);
    border-radius: 14px;
    color: #dffaff;
    background: rgba(5, 24, 42, .96);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
    font-size: .82rem;
    text-align: center;
    transform: translateX(-50%);
}
.connection-status.offline {
    border-color: rgba(251, 191, 36, .55);
    color: #fef3c7;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #67e8f9;
    outline-offset: 3px;
}

#app-main:focus { outline: none; }

@media (max-width: 620px) {
    .beta-badge { font-size: .5rem; padding: 3px 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .skip-link { transition: none; }
}

/* Technique gallery responsive rules stay last so legacy one-column cards do not override them. */
@media (max-width: 960px) {
    #techniques-grid.technique-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    #dashboard-view .dashboard-hero { margin-bottom: 24px; }
    #dashboard-view .dashboard-hero h1 { font-size: clamp(1.75rem, 8vw, 2.15rem); }
    #dashboard-view .dashboard-hero p { font-size: .92rem; line-height: 1.45; }

    #practice-library-filters { margin-bottom: 18px; padding: 15px 14px; border-radius: 18px; }
    #practice-library-filters .purpose-browser-heading h2 { margin-bottom: 11px; font-size: 1.06rem; }
    #practice-library-filters .purpose-filters,
    #practice-library-filters .difficulty-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 1px 1px 6px;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    #practice-library-filters .purpose-filters::-webkit-scrollbar,
    #practice-library-filters .difficulty-filters::-webkit-scrollbar { display: none; }
    #practice-library-filters .purpose-filter,
    #practice-library-filters .difficulty-filter { flex: 0 0 auto; scroll-snap-align: start; }
    #practice-library-filters .difficulty-browser { margin-top: 10px; padding-top: 11px; gap: 7px; }
    #practice-library-filters .purpose-description { display: none; }

    #techniques-grid.technique-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #techniques-grid .technique-recommendation {
        min-height: 168px;
        padding: 19px 18px;
        align-items: flex-end;
        gap: 12px;
        border-radius: 20px;
    }
    #techniques-grid .recommendation-shade { background: linear-gradient(90deg, rgba(3,8,18,.96), rgba(3,8,18,.66) 72%, rgba(3,8,18,.28)); }
    #techniques-grid .recommendation-copy { gap: 4px; }
    #techniques-grid .recommendation-copy strong { font-size: 1.35rem; }
    #techniques-grid .recommendation-copy > span:not(.recommendation-meta) {
        max-width: 36ch;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: .78rem;
    }
    #techniques-grid .recommendation-action { min-height: 39px; padding: 9px 12px; font-size: .72rem; }

    #techniques-grid .content-card-shell { min-width: 0; }
    #techniques-grid .technique-card { min-height: 244px; height: 100%; padding: 0 12px 12px; border-radius: 18px; }
    #techniques-grid .card-landscape { height: 104px; min-height: 104px; flex-basis: 104px; margin: 0 -12px 11px; border-radius: 18px 18px 0 0; }
    #techniques-grid .card-landscape .card-icon { left: 10px; bottom: 9px; width: 34px; height: 34px; border-radius: 10px; }
    #techniques-grid .card-landscape .card-icon svg { width: 19px; height: 19px; }
    #techniques-grid .technique-purpose-label { margin-bottom: 4px; font-size: .53rem; }
    #techniques-grid .card-info h3 { min-height: 2.35em; margin-bottom: 5px; font-size: .9rem; }
    #techniques-grid .card-info p,
    #techniques-grid .card-benefits { display: none; }
    #techniques-grid .card-metadata { margin-top: auto; padding-top: 9px; display: grid; gap: 5px; }
    #techniques-grid .meta-item { min-width: 0; gap: 5px; font-size: .61rem; }
    #techniques-grid .meta-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    #techniques-grid .meta-item svg { width: 12px; height: 12px; flex: 0 0 12px; }
    #techniques-grid .access-badge { max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 460px) {
    #techniques-grid .technique-recommendation { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    #techniques-grid .recommendation-copy { min-width: 0; }
    #techniques-grid .recommendation-copy > span:not(.recommendation-meta) { display: none; }
    #techniques-grid .recommendation-action { align-self: end; }
}

@media (max-width: 620px) {
    header {
        width: 100%;
        min-width: 0;
        padding-top: max(12px, env(safe-area-inset-top));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
        gap: 10px;
    }
    .logo { min-width: 0; gap: 8px; font-size: 1rem; }
    .logo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-controls { flex: 0 0 auto; gap: 7px; }
    .header-controls .glass-button {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        padding: 0;
        border-radius: 13px;
    }
    .header-controls .glass-button span { display: none; }
    main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }
    #dashboard-view,
    #practice-library-filters,
    #techniques-grid,
    #techniques-grid > *,
    #techniques-grid .recommendation-copy { min-width: 0; max-width: 100%; }
}

/* Mobile layout audit v59: compact music gallery and zoom-free primary surfaces. */
@media (max-width: 768px) {
    main > *,
    #dashboard-view,
    #dashboard-view > *,
    .music-library-view,
    .favorites-view,
    .progress-view-container,
    .custom-session-view,
    .duration-view,
    .session-complete-view,
    .music-grid,
    .favorites-grid,
    .combined-grid {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-tabs {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 24px;
        padding: 2px 1px 8px;
    }

    .dashboard-tabs .tab-btn {
        min-height: 42px;
        padding: 9px 14px;
        font-size: .78rem;
    }

    .journey-prep-overlay {
        padding-right: max(16px, env(safe-area-inset-right)) !important;
        padding-left: max(16px, env(safe-area-inset-left)) !important;
        border-radius: 20px !important;
    }

    .sphere-container {
        width: min(300px, 100%);
        height: min(300px, 78vw);
        min-height: 260px;
    }
}

@media (max-width: 620px) {
    .music-library-view {
        width: 100%;
        min-width: 0;
    }

    .music-library-header {
        margin-bottom: 20px;
        padding: 0 4px;
    }

    .music-library-header h2 {
        font-size: clamp(1.55rem, 8vw, 2rem);
        line-height: 1.08;
    }

    .music-library-header p {
        font-size: .84rem;
        line-height: 1.48;
    }

    .music-filters {
        width: calc(100% + 2px);
        margin: 0 -1px 14px;
        padding: 2px 1px 7px;
        gap: 7px;
        scrollbar-width: none;
    }

    .music-filters::-webkit-scrollbar { display: none; }
    .music-filters button { min-height: 38px; padding: 7px 12px; font-size: .72rem; }

    .music-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .music-card {
        width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
        border-radius: 19px;
        border-color: rgba(255, 255, 255, .1);
        background:
            linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
            rgba(7, 14, 24, .82);
    }

    .music-card.is-playing {
        border-color: color-mix(in srgb, var(--accent) 58%, transparent);
        background:
            linear-gradient(145deg, color-mix(in srgb, var(--accent) 10%, rgba(255,255,255,.05)), rgba(255,255,255,.018)),
            rgba(7, 14, 24, .9);
    }

    .music-art {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        border-radius: 17px;
    }

    .music-art span { font-size: 1rem; }

    .music-card-copy {
        width: 100%;
        min-width: 0;
        padding: 0 2px 2px;
        overflow: hidden;
    }

    .music-card-copy .technique-purpose-label {
        max-width: 100%;
        margin: 0 0 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .56rem;
        letter-spacing: .055em;
    }

    .music-card-copy h3 {
        margin: 0 0 5px;
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        min-height: 2.32em;
        font-size: .9rem;
        line-height: 1.16;
    }

    .music-card-copy > p {
        display: none;
    }

    .music-player-row {
        width: 100%;
        min-width: 0;
        grid-template-columns: 34px minmax(0, 1fr);
        grid-template-rows: 34px auto;
        gap: 4px 7px;
    }

    .music-play-btn {
        width: 34px;
        height: 34px;
        grid-row: 1 / span 2;
        align-self: start;
    }

    .music-progress {
        width: 100%;
        min-width: 0;
        align-self: center;
    }

    .music-time {
        grid-column: 2;
        justify-self: end;
        min-width: 0;
        font-size: .58rem;
        line-height: 1;
        white-space: nowrap;
    }

    .music-favorite-toggle {
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        background: rgba(5, 12, 23, .78);
    }

    .music-library-note,
    .music-library-disclaimer {
        padding: 0 6px;
        font-size: .68rem;
    }
}

@media (max-width: 360px) {
    main {
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .music-card {
        gap: 8px;
        padding: 8px;
        border-radius: 17px;
    }

    .music-art { width: 100%; height: auto; border-radius: 14px; }
    .music-card-copy { padding: 0 1px 1px; }
    .music-card-copy h3 { min-height: 2.32em; font-size: .82rem; }
    .music-player-row { grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: 32px auto; }
    .music-play-btn { width: 32px; height: 32px; }
    .music-favorite-toggle { top: 13px; right: 13px; width: 30px; height: 30px; }

    .sphere-container {
        width: min(280px, 100%);
        height: min(280px, 78vw);
        min-height: 238px;
    }

    .premium-card { padding: 26px 18px 22px; }
    .account-card { padding-right: 16px; padding-left: 16px; }
}
