@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: var(--glow-safe-top) max(16px, env(safe-area-inset-right, 0px)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    overscroll-behavior-y: contain;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--theme-glow);
    pointer-events: none;
    z-index: 0;
    transition: background 0.6s ease;
}

.container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

/* Header Container */
header {
    position: relative;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 14px 20px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--surface-border), transparent);
}

.header-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.theme-toggle-slider {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.theme-toggle-slider:active {
    transform: scale(0.96);
}

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

.slider-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 54px;
    height: 28px;
    background: var(--inset);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    padding: 3px 6px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html[data-theme="light"] .slider-track {
    background: var(--inset);
}

.slider-icon {
    font-size: 0.75rem;
    z-index: 2;
    transition: color 0.3s ease;
    width: 14px;
    text-align: center;
    line-height: 1;
}

.sun-icon {
    color: var(--accent-gold);
}

.moon-icon {
    color: var(--accent-iris);
}

.slider-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--panel);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease;
}

html[data-theme="dark"] .slider-thumb {
    transform: translateX(26px);
    background: var(--panel);
}

html[data-theme="light"] .slider-thumb {
    transform: translateX(0px);
    background: var(--on-accent);
}

/* Streak Chips */
.streak-chips {
    display: flex;
    align-items: center;
    gap: 6px;
}

.streak-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--inset);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s, border-color 0.2s;
    user-select: none;
}

html[data-theme="light"] .streak-chip {
    background: var(--inset);
}

.streak-chip:active {
    transform: scale(0.93);
}

.streak-icon {
    font-size: 0.8rem;
    line-height: 1;
}

.streak-am-icon { color: var(--accent-gold); }
.streak-pm-icon { color: var(--accent-iris); }
.streak-fire-icon { color: var(--secondary); }

.streak-val {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Greeting & Titles */
.greeting {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-gold);
    font-weight: 700;
    margin-bottom: 4px;
    transition: color 0.4s ease;
}

body.view-pm .greeting {
    color: var(--accent-iris);
}

.title-row {
    display: flex;
    align-items: flex-start;
}

h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.85rem;
    line-height: 1.18;
    font-weight: 600;
    font-style: italic;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    flex: 1;
}

.date-line {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

/* Weather Strip */
.weather-strip {
    margin-top: 10px;
    border-top: 1px dashed var(--surface-border);
    padding-top: 10px;
    display: none;
}

.weather-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.weather-location {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 0 auto;
}

.weather-chips {
    display: flex;
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
    overflow: visible;
}

.weather-chip {
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: var(--inset);
    padding: 5px 10px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    flex: 0 0 auto;
    font-weight: 500;
}

@media (max-width: 420px) {
    .weather-chip {
        padding: 4px 8px;
        font-size: 0.7rem;
    }
}

html[data-theme="light"] .weather-chip {
    background: var(--inset);
}

/* AM / PM Segmented Control */
.view-toggle {
    display: flex;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    gap: 4px;
    box-shadow: var(--shadow-card);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.view-toggle button {
    flex: 1;
    min-height: 44px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 11px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-toggle button .toggle-icon {
    font-size: 0.95rem;
}

.view-toggle button:active {
    transform: scale(0.97);
}

#toggle-am.active {
    background: var(--accent-gold-soft);
    border-color: var(--secondary);
    color: var(--accent-gold);
}

#toggle-pm.active {
    background: var(--accent-iris-soft);
    border-color: var(--primary);
    color: var(--accent-iris);
}

/* Progress Card */
.progress-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    padding: 14px 18px;
    border-radius: 18px;
    margin-bottom: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 7px;
    background: var(--inset);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

html[data-theme="dark"] .progress-bar {
    background: var(--inset);
}

.progress-fill {
    height: 100%;
    background: var(--progress-gradient);
    border-radius: 999px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step Cards */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
}

.step-item {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    min-height: 64px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
    position: relative;
}

.step-item:hover {
    border-color: var(--surface-hover-border);
    transform: translateY(-1px);
}

.step-item:active {
    transform: scale(0.985);
}

.step-num {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 1;
    min-width: 22px;
    text-align: center;
    transition: opacity 0.25s ease, color 0.25s ease;
}

.step-item.completed .step-num {
    color: var(--accent-emerald);
    opacity: 1;
}

.checkbox {
    width: 26px;
    height: 26px;
    border: 2px solid var(--surface-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--inset);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.check-icon {
    width: 13px;
    height: 13px;
    stroke: var(--on-accent);
    opacity: 0;
    transform: scale(0.4) rotate(-10deg);
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.step-item.completed {
    background: var(--accent-emerald-soft);
    border-color: var(--success);
}

.step-item.completed .checkbox {
    background: var(--accent-emerald);
    border-color: var(--accent-emerald);
    box-shadow: 0 0 14px var(--accent-emerald-soft);
}

.step-item.completed .check-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.step-item.just-checked {
    animation: step-pop 280ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes step-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); }
    100% { transform: scale(1); }
}

.step-info {
    flex: 1;
    min-width: 0;
}

.step-name {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    transition: color 0.25s ease;
}

.step-item.completed .step-name {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--text-muted);
}

.step-product {
    display: inline-block;
    background: var(--inset);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 5px;
}

html[data-theme="dark"] .step-product {
    background: var(--inset);
}

.step-instructions {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.92rem;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
}

/* Footer & App Meta */
footer {
    position: relative;
    z-index: 1;
}

.app-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--surface-bg);
    backdrop-filter: blur(16px);
}

.app-meta[hidden] {
    display: none;
}

.app-status {
    flex: 1 1 200px;
    min-height: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.app-status[data-tone="offline"] { color: var(--secondary); }
.app-status[data-tone="pending"] { color: var(--primary); }
.app-status[data-tone="ready"] { color: var(--success); }

.install-btn {
    border: 1px solid var(--surface-border);
    background: var(--inset);
    color: var(--text-primary);
    border-radius: 9999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.install-help {
    margin: 8px 4px 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Particle FX Layer */
.emoji-fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.emoji-pop {
    position: fixed;
    font-size: 24px;
    line-height: 1;
    animation: emoji-pop-up 980ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes emoji-pop-up {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translate(calc(-50% + (var(--dx, 0px) * 0.35)), calc(-10px + (var(--dy, 0px) * 0.25))) scale(1.1) rotate(-8deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx, 0px)), calc(-56px + var(--dy, 0px))) scale(1.12) rotate(14deg);
    }
}

.emoji-rain {
    position: fixed;
    top: -30px;
    font-size: 26px;
    line-height: 1;
    animation: emoji-rain-fall linear forwards;
    will-change: transform, opacity;
}

@keyframes emoji-rain-fall {
    0% { opacity: 0; transform: translateY(0) rotate(0deg); }
    8% { opacity: 1; }
    100% { opacity: 0; transform: translateY(105vh) rotate(280deg); }
}

/* Pull to Refresh */
#pull-to-refresh {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    width: 100%;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    gap: 8px;
    transition: transform 0.22s ease, opacity 0.2s ease;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-54px);
}

#pull-to-refresh .arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0.9;
    transition: transform 0.2s ease;
}

#pull-to-refresh .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--surface-border);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
    display: none;
}

@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

body.ptr-pulling #pull-to-refresh {
    opacity: 1;
    transform: translateY(calc(-54px + var(--ptr-dist, 0px)));
}

body.ptr-armed #pull-to-refresh .arrow { transform: rotate(180deg); }

body.ptr-refreshing #pull-to-refresh {
    opacity: 1;
    transform: translateY(0);
}

body.ptr-refreshing #pull-to-refresh .spinner { display: block; }
body.ptr-refreshing #pull-to-refresh .arrow { display: none; }

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: var(--glow-safe-top) max(12px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left, 0px));
    }
    header {
        padding: 16px 16px 16px;
        border-radius: 20px;
    }
    h1 {
        font-size: 1.6rem;
    }
    .greeting {
        font-size: 0.68rem;
    }
    .streak-chip {
        padding: 4px 8px;
        font-size: 0.78rem;
    }
    .step-item {
        padding: 12px 14px;
        border-radius: 16px;
    }
    .step-name {
        font-size: 0.94rem;
    }
}

/* Keyboard access is shared by real and sample routines. */
.step-item:focus-visible {
    outline: 2px solid var(--accent-iris);
    outline-offset: 3px;
}

.empty-state p { margin: 0; line-height: 1.6; }
.empty-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 16px; padding: 10px 18px; border: 1px solid var(--surface-border); border-radius: 10px; background: var(--surface-bg); color: var(--accent-iris); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.empty-action:disabled { opacity: .6; cursor: wait; }


.header-top-bar { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.header-controls { flex: 0 0 auto; }
.streak-chip { cursor: default; }
.streak-chip:active { transform: none; }

html[data-theme="light"] .app-status[data-tone="offline"] { color: var(--accent-gold); }
html[data-theme="light"] .app-status[data-tone="pending"] { color: var(--accent-iris); }
html[data-theme="light"] .app-status[data-tone="ready"] { color: var(--accent-emerald); }
html[data-theme="light"] .step-item.completed { border-color: color-mix(in srgb, var(--accent-emerald) 25%, transparent); }

/* One ordered checklist on phones; a daily overview when there is room. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.routine-panel { min-width: 0; }
.routine-panel[data-period="PM"] { display: none; }
body.view-pm .routine-panel[data-period="AM"] { display: none; }
body.view-pm .routine-panel[data-period="PM"] { display: block; }
.progress-label { margin: 0; font-family: var(--font-sans); }
.header-intro { min-width: 0; }

@media (min-width: 520px) {
    .container { max-width: 680px; }
    header { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px 20px; }
    .header-top-bar { grid-column: 1 / -1; margin-bottom: 0; }
    .header-intro { align-self: center; }
    .weather-strip { align-self: center; margin-top: 0 !important; padding-top: 0; border-top: 0; }
    .weather-line { align-items: flex-start; flex-direction: column; gap: 8px; }
    .weather-location { max-width: 100%; }
    .weather-chips { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; }
    h1 { font-size: clamp(1.35rem, 2.6vw, 1.65rem); }
}

@media (min-width: 860px) and (orientation: landscape) {
    .container { max-width: 1120px; }
    header { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 16px 20px; }
    .header-top-bar { grid-column: 1 / -1; }
    .header-intro { grid-column: 1; grid-row: 2; }
    .weather-strip { grid-column: 2; grid-row: 2; }
    .weather-line { flex-direction: column; align-items: flex-start; gap: 6px; }
    .routine-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
    body.view-am .routine-panel[data-period],
    body.view-pm .routine-panel[data-period] { display: block; border: 1px solid var(--surface-border); border-radius: 20px; padding: 14px; }
    body.view-am .routine-panel[data-period="AM"] { border-color: var(--accent-gold); }
    body.view-pm .routine-panel[data-period="PM"] { border-color: var(--accent-iris); }
    .routine-panel .progress-card { padding: 2px 2px 14px; margin-bottom: 12px; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; }
    .routine-panel[data-period="PM"] .progress-fill { background: linear-gradient(90deg, var(--accent-iris), var(--accent-emerald)); }
    .routine-panel[data-period="PM"] .progress-label { color: var(--accent-iris); }
    .routine-panel[data-period="AM"] .progress-label { color: var(--accent-gold); }
    .routine-panel .step-list { padding-bottom: 0; }
    .routine-panel .step-item { padding: 12px; gap: 10px; }
    .step-name, .step-product, .step-instructions { overflow-wrap: anywhere; }
    .view-toggle { width: 320px; margin-inline: auto; padding: 2px; }
    .view-toggle button { min-height: 44px; padding: 8px; font-size: .8rem; }
    /* Quiet the other ritual without reducing instruction text contrast. */
    body.view-am .routine-panel[data-period="PM"],
    body.view-pm .routine-panel[data-period="AM"] {
        --routine-step-text: var(--text-secondary);
        --routine-step-surface: color-mix(in srgb, var(--surface-bg) 65%, var(--bg-color));
        filter: saturate(.5);
    }
    .routine-panel .step-name { color: var(--routine-step-text, var(--text-primary)); }
    .routine-panel .step-item:not(.completed) { background: var(--routine-step-surface, var(--surface-bg)); }
    body:is(.view-am, .view-pm) .routine-panel:is(:hover, :focus-within) {
        --routine-step-text: var(--text-primary);
        --routine-step-surface: var(--surface-bg);
        filter: none;
    }
}

/* The app viewport already excludes native controls; both hero and checklist
   use the same available width. Weather wraps without hidden chips. */
@media (max-width: 519px) {
    .weather-line { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (min-width: 520px) and (orientation: landscape) {
    .container { max-width: 1120px; }
}

/* Sign out remains available for retry if its request fails. */
.logout-btn { border: 0; padding: 0; background: transparent; cursor: pointer; }
.logout-btn:disabled { cursor: wait; opacity: 0.65; }
#logout-error { color: var(--text-primary); font-size: 0.875rem; }

@media (max-width: 420px) {
    header { padding-inline: 12px; }
    .header-controls { gap: 4px; }
    .slider-track { width: 44px; }
    html[data-theme="dark"] .slider-thumb { transform: translateX(16px); }
}

/* Short landscape screens need the checklist close to its context. */
@media (min-width: 520px) and (max-height: 520px) and (orientation: landscape) {
    header { padding-block: 12px; margin-bottom: 12px; }
    .view-toggle, .progress-card { margin-bottom: 12px; }
}

/* Keep the routine calm: one menu trigger, with labelled utility actions in
   a native modal drawer on every screen size. */
.header-top-bar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 8px; }
.streak-chips { justify-self: end; }
.glow-menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--surface-border); border-radius: 12px; background: var(--surface-bg); color: var(--text-primary); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; }
.glow-menu { position: fixed; inset: 0 0 0 auto; width: min(340px,calc(100vw - 24px)); max-width: none; height: 100dvh; max-height: none; margin: 0; padding: max(16px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) max(24px,env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px)); border: 0; border-left: 1px solid var(--surface-border); background: var(--bg-color); color: var(--text-primary); overflow-y: auto; overscroll-behavior: contain; font-family: var(--font-sans); }
.glow-menu[open] { animation: glow-menu-in 220ms cubic-bezier(.16,1,.3,1) both; }
.glow-menu::backdrop { background: rgba(0,0,0,.55); }
html:has(.glow-menu[open]), body:has(.glow-menu[open]) { overflow: hidden; }
.glow-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.glow-menu-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
#glow-menu-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--surface-border); border-radius: 12px; background: var(--surface-bg); color: inherit; font: inherit; cursor: pointer; }
.glow-menu-links, .glow-menu-actions { display: flex; flex-direction: column; gap: 4px; }
.glow-menu-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--surface-border); }
.glow-menu .glow-menu-link { position: static; display: flex; flex: none; align-items: center; gap: 12px; width: 100%; min-height: 48px; margin: 0; padding: 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text-primary); font: inherit; font-size: .92rem; font-weight: 500; line-height: 1.5; text-align: left; text-decoration: none; cursor: pointer; }
.glow-menu .glow-menu-link:hover { background: var(--surface-bg); }
.glow-menu-link > i, .glow-menu-link > svg { flex: none; width: 20px; height: 20px; text-align: center; }
.glow-menu-state { margin-left: auto; color: var(--text-secondary); font-size: .8rem; }
.glow-menu-link[aria-pressed="true"] { background: var(--accent-gold-soft); }
.glow-menu-link[aria-pressed="true"] .glow-menu-state { color: var(--accent-gold); font-weight: 700; }
@keyframes glow-menu-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (max-width: 360px) {
    .glow-menu-toggle { width: 44px; padding: 0; }
    .glow-menu-toggle > span { display: none; }
    .streak-chips { gap: 4px; }
    .streak-chip { padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) { .glow-menu[open] { animation: none; } }

