/* === AuraBot Cosmic Theme === */

:root {
    --cosmic-primary: #7c4dff;
    --cosmic-secondary: #ffd740;
    --cosmic-bg: #0a0e27;
    --cosmic-surface: #141832;
    --cosmic-text: #e0e0e0;
    --cosmic-text-muted: #9090a0;
    --cosmic-text-accent: #d0c0f0;
    --cosmic-border: rgba(124, 77, 255, 0.2);
    --cosmic-border-hover: rgba(124, 77, 255, 0.35);
    --cosmic-border-strong: rgba(124, 77, 255, 0.5);
}

/* === Page Content Wrapper === */
.page-content {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding-top: 8px;
}

/* === Section Header === */
.section-header {
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #0a0e27;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Starfield Background === */
body::before,
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 40% 70%, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(1px 1px at 55% 20%, rgba(255,255,255,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 70% 55%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 85% 40%, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(1px 1px at 15% 80%, rgba(255,255,255,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 5% 50%, rgba(255,255,255,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 35% 5%, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(1px 1px at 75% 85%, rgba(255,255,255,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(1px 1px at 20% 60%, rgba(255,255,255,0.3) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 95% 75%, rgba(255,255,255,0.5) 50%, transparent 50%);
    animation: starTwinkle 4s ease-in-out infinite alternate;
}

body::after {
    background-image:
        radial-gradient(1px 1px at 8% 45%, rgba(200,180,255,0.5) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 22% 78%, rgba(255,215,64,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 48% 12%, rgba(200,180,255,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 62% 65%, rgba(255,255,255,0.3) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 78% 30%, rgba(200,180,255,0.5) 50%, transparent 50%),
        radial-gradient(1px 1px at 92% 88%, rgba(255,215,64,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 33% 42%, rgba(255,255,255,0.4) 50%, transparent 50%),
        radial-gradient(1px 1px at 55% 75%, rgba(200,180,255,0.3) 50%, transparent 50%),
        radial-gradient(1px 1px at 82% 58%, rgba(255,255,255,0.4) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 18% 22%, rgba(255,215,64,0.4) 50%, transparent 50%);
    animation: starTwinkle2 6s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    0%   { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes starTwinkle2 {
    0%   { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Ensure content appears above stars */
.mud-layout,
#blazor-error-ui {
    position: relative;
    z-index: 1;
}

/* === Glass-morphism Card === */
.cosmic-card {
    background: rgba(20, 24, 50, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cosmic-border) !important;
    border-radius: 16px !important;
    animation: fadeInUp 0.4s ease-out;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
    .cosmic-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 32px rgba(124, 77, 255, 0.15);
    }
}

/* === Hero Card (profile) === */
.cosmic-hero-card {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.25), rgba(255, 215, 64, 0.1)) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--cosmic-border-hover) !important;
    border-radius: 20px !important;
    animation: fadeInScale 0.5s ease-out;
}

/* Compatibility score placeholder while final result is streaming */
.compat-score-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.compat-score-orbit {
    width: 92px;
    height: 92px;
    position: relative;
    display: grid;
    place-items: center;
}

.compat-score-core {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe082 0%, #ffd740 45%, #ffb300 100%);
    box-shadow: 0 0 16px rgba(255, 215, 64, 0.7), 0 0 28px rgba(124, 77, 255, 0.35);
    animation: compatCorePulse 1.8s ease-in-out infinite;
}

.compat-score-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.compat-score-ring::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd740;
    box-shadow: 0 0 10px rgba(255, 215, 64, 0.7);
}

.compat-score-ring.ring-a {
    width: 48px;
    height: 48px;
    animation: compatOrbitSpin 2.4s linear infinite;
}

.compat-score-ring.ring-b {
    width: 68px;
    height: 68px;
    border-color: rgba(124, 77, 255, 0.35);
    animation: compatOrbitSpinReverse 3.2s linear infinite;
}

.compat-score-ring.ring-c {
    width: 86px;
    height: 86px;
    border-color: rgba(130, 177, 255, 0.28);
    animation: compatOrbitSpin 4.3s linear infinite;
}

@keyframes compatOrbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes compatOrbitSpinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes compatCorePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === Sign Badge === */
.cosmic-sign-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.25);
    font-size: 0.85rem;
    font-weight: 600;
    color: #d0c0f0;
    white-space: nowrap;
}

.cosmic-sign-badge .sign-emoji {
    font-size: 1.1rem;
}

.cosmic-sign-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.cosmic-sign-badge.clickable:hover {
    background: rgba(124, 77, 255, 0.3);
    border-color: rgba(124, 77, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.2);
}

.cosmic-sign-badge.clickable:active {
    transform: translateY(0);
}

/* === Transit Card === */
.cosmic-transit-card {
    background: rgba(20, 24, 50, 0.7) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(124, 77, 255, 0.15) !important;
    border-radius: 12px !important;
    border-left: 4px solid rgba(124, 77, 255, 0.4) !important;
    transition: transform 0.2s ease;
}

.cosmic-transit-card.influence-high {
    border-left-color: #ff5252 !important;
}

.cosmic-transit-card.influence-medium {
    border-left-color: #ffd740 !important;
}

.cosmic-transit-card.influence-low {
    border-left-color: #69f0ae !important;
}

/* === Action Button === */
.cosmic-action-btn {
    background: rgba(20, 24, 50, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--cosmic-border) !important;
    border-radius: 14px !important;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-align: center;
}

@media (hover: hover) {
    .cosmic-action-btn:hover {
        transform: translateY(-2px);
        border-color: var(--cosmic-border-strong) !important;
        box-shadow: 0 4px 20px rgba(124, 77, 255, 0.15);
    }
}

.cosmic-action-btn.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* === Onboarding Step Indicator === */
.onboarding-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 1.5rem;
}

.onboarding-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid rgba(124, 77, 255, 0.3);
    background: rgba(20, 24, 50, 0.6);
    color: rgba(176, 176, 192, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.onboarding-step.active {
    border-color: #7c4dff;
    background: rgba(124, 77, 255, 0.2);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(124, 77, 255, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
}

.onboarding-step.completed {
    border-color: #69f0ae;
    background: rgba(105, 240, 174, 0.15);
    color: #69f0ae;
}

.onboarding-step-line {
    width: 48px;
    height: 2px;
    background: rgba(124, 77, 255, 0.2);
    flex-shrink: 0;
}

.onboarding-step-line.completed {
    background: linear-gradient(90deg, #69f0ae, #7c4dff);
}

/* === Gradient Heading === */
.cosmic-heading {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* === Gradient Button with Glow === */
.cosmic-btn {
    background: linear-gradient(135deg, var(--cosmic-primary), #651fff) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4) !important;
    transition: box-shadow 0.3s ease, transform 0.2s ease !important;
}

.cosmic-btn .mud-progress-circular,
.cosmic-btn svg {
    color: #ffffff !important;
}

.cosmic-btn:hover {
    box-shadow: 0 6px 25px rgba(124, 77, 255, 0.6) !important;
    transform: translateY(-1px);
}

/* === Cosmic Table === */
.cosmic-table {
    background: transparent !important;
}

.cosmic-table tr {
    border-bottom: 1px solid rgba(124, 77, 255, 0.1) !important;
}

.cosmic-table td {
    color: #e0e0e0 !important;
    background: transparent !important;
}

/* === Planet Symbol === */
.cosmic-planet-symbol {
    color: #ffd740;
    font-size: 1.1em;
    margin-right: 0.3rem;
}

/* === Aspect Symbol (astrological glyphs) === */
.cosmic-aspect-symbol {
    font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', sans-serif;
    margin: 0 0.15rem;
}

/* === Search Results === */
.cosmic-search-results {
    background: rgba(20, 24, 50, 0.6) !important;
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* === Selected Place === */
.cosmic-selected-place {
    background: rgba(124, 77, 255, 0.1) !important;
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 8px;
}

/* === House Card === */
.cosmic-house-card {
    background: rgba(20, 24, 50, 0.5) !important;
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 8px;
}

/* === MudBlazor Input Overrides === */
.mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(124, 77, 255, 0.3) !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: var(--cosmic-border-strong) !important;
}

.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--cosmic-primary) !important;
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.25);
}

.mud-input.mud-input-underline:after {
    border-color: var(--cosmic-primary) !important;
}

/* === MudBlazor Chip/Button Contrast Overrides === */

/* Outlined primary: lighten text from #7c4dff to #b388ff */
.mud-chip--outlined.mud-chip-color-primary {
    color: #b388ff !important;
    border-color: rgba(179, 136, 255, 0.4) !important;
}

.mud-button-outlined.mud-button-outlined-primary {
    color: #b388ff !important;
    border-color: rgba(179, 136, 255, 0.4) !important;
}

/* Outlined warning: lighten from pure yellow */
.mud-chip--outlined.mud-chip-color-warning {
    color: #ffe082 !important;
    border-color: rgba(255, 224, 130, 0.4) !important;
}

.mud-button-outlined.mud-button-outlined-warning {
    color: #ffe082 !important;
    border-color: rgba(255, 224, 130, 0.4) !important;
}

/* Filled chips: dark text on bright backgrounds for readability */
.mud-chip--filled.mud-chip-color-success {
    color: #1b3a1b !important;
}

.mud-chip--filled.mud-chip-color-warning {
    color: #3e2700 !important;
}

.mud-chip--filled.mud-chip-color-info {
    color: #0a1a3a !important;
}

.mud-chip--filled.mud-chip-color-secondary {
    color: #3e2700 !important;
}

/* Filled buttons: dark text on bright backgrounds for readability */
.mud-button-filled.mud-button-filled-success {
    color: #1b3a1b !important;
}

.mud-button-filled.mud-button-filled-warning {
    color: #3e2700 !important;
}

.mud-button-filled.mud-button-filled-info {
    color: #0a1a3a !important;
}

.mud-button-filled.mud-button-filled-secondary {
    color: #3e2700 !important;
}

/* Snackbar: ensure readable text on colored backgrounds */
.mud-snackbar.mud-alert-filled-success {
    color: #1b3a1b !important;
}

.mud-snackbar.mud-alert-filled-warning {
    color: #3e2700 !important;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cosmic-bg);
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cosmic-border-strong);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 16px rgba(124, 77, 255, 0.4);
    }
    50% {
        box-shadow: 0 0 24px rgba(124, 77, 255, 0.6);
    }
}

/* === Staggered Card Appearance === */
.cosmic-card-stagger:nth-child(1) { animation: fadeInScale 0.4s ease-out 0.05s both; }
.cosmic-card-stagger:nth-child(2) { animation: fadeInScale 0.4s ease-out 0.1s both; }
.cosmic-card-stagger:nth-child(3) { animation: fadeInScale 0.4s ease-out 0.15s both; }
.cosmic-card-stagger:nth-child(4) { animation: fadeInScale 0.4s ease-out 0.2s both; }
.cosmic-card-stagger:nth-child(5) { animation: fadeInScale 0.4s ease-out 0.25s both; }
.cosmic-card-stagger:nth-child(6) { animation: fadeInScale 0.4s ease-out 0.3s both; }

/* === Premium Paywall Card === */
.paywall-card {
    position: relative;
    background: linear-gradient(165deg, rgba(30, 20, 70, 0.95) 0%, rgba(15, 12, 45, 0.98) 100%);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

.paywall-header {
    position: relative;
    padding: 24px 20px 16px;
    text-align: center;
    background: linear-gradient(180deg, rgba(124, 77, 255, 0.12) 0%, transparent 100%);
}

.paywall-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(135deg, #7c4dff, #e040fb);
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(124, 77, 255, 0.4);
}

.paywall-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 16px 16px;
}

.paywall-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.paywall-feature:hover {
    background: rgba(255, 255, 255, 0.04);
}

.paywall-feature-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.paywall-divider {
    height: 1px;
    margin: 0 20px;
    background: linear-gradient(90deg, transparent, rgba(124, 77, 255, 0.25), transparent);
}

.paywall-anatomy {
    padding: 16px 20px;
}

.paywall-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.paywall-cta {
    margin: 8px 16px 20px;
    width: calc(100% - 32px) !important;
    padding: 14px 24px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.3px;
    text-transform: none !important;
    color: #fff !important;
    background: linear-gradient(135deg, #7c4dff 0%, #e040fb 100%) !important;
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.45), 0 0 40px rgba(224, 64, 251, 0.15) !important;
    transition: box-shadow 0.3s ease, transform 0.2s ease !important;
}

.paywall-cta:hover {
    box-shadow: 0 6px 30px rgba(124, 77, 255, 0.6), 0 0 60px rgba(224, 64, 251, 0.25) !important;
    transform: translateY(-1px);
}

/* === Paywall Dialog === */
.paywall-dialog-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.paywall-dialog .mud-dialog {
    background: linear-gradient(165deg, rgba(30, 20, 70, 0.98) 0%, rgba(12, 10, 40, 0.99) 100%) !important;
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-radius: 24px !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(124, 77, 255, 0.15);
    overflow: hidden;
}

.paywall-dialog .mud-dialog-content {
    padding: 0 !important;
    overflow: visible !important;
}

.paywall-dialog-content {
    position: relative;
    padding: 28px 20px 20px;
    overflow: hidden;
}

.paywall-dialog-orb {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 77, 255, 0.25) 0%, rgba(224, 64, 251, 0.08) 50%, transparent 70%);
    pointer-events: none;
    animation: paywall-orb-pulse 4s ease-in-out infinite;
}

@keyframes paywall-orb-pulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.paywall-dialog-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.paywall-dialog-features {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}

.paywall-dialog-feature {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.paywall-dialog-feature:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* === Link Transitions === */
a {
    transition: color 0.2s ease;
}

/* === Blazor Error Boundary === */
.blazor-error-boundary {
    background: #1a1045;
    padding: 1rem 1rem 1rem 1.5rem;
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* === Form Validation === */
.validation-message {
    color: #ff5252;
    font-size: 0.75rem;
    margin-top: 4px;
}

h1:focus {
    outline: none;
}

/* === Cosmic Expansion Panels === */
.cosmic-expansion-panels {
    background: transparent !important;
}

.cosmic-expansion-panels .mud-expand-panel {
    background: rgba(20, 24, 50, 0.6) !important;
    border: 1px solid rgba(124, 77, 255, 0.15) !important;
    border-radius: 8px !important;
    margin-bottom: 4px;
    transition: border-color 0.2s ease;
}

.cosmic-expansion-panels .mud-expand-panel:hover {
    border-color: var(--cosmic-border-hover) !important;
}

.cosmic-expansion-panels .mud-expand-panel-header {
    padding: 8px 16px !important;
}

.cosmic-expansion-panels .mud-expand-panel-content {
    padding: 0 16px 12px !important;
}

.cosmic-expansion-panels .mud-expand-panel .mud-expand-panel-header .mud-expand-panel-icon {
    color: var(--cosmic-border-strong);
}

/* === Transit Influence Borders (Expansion Panels) === */
.cosmic-expansion-panels .mud-expand-panel.influence-high {
    border-left: 4px solid #ff5252 !important;
}

.cosmic-expansion-panels .mud-expand-panel.influence-medium {
    border-left: 4px solid #ffd740 !important;
}

.cosmic-expansion-panels .mud-expand-panel.influence-low {
    border-left: 4px solid #69f0ae !important;
}

/* === AI Interpretation Container === */
.cosmic-interpretation {
    background: rgba(20, 24, 50, 0.6) !important;
    border: 1px solid var(--cosmic-border);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* === AI Markdown Content === */
.ai-markdown-content {
    line-height: 1.8;
    color: #e0e0e0;
    font-size: 0.875rem;
}

.ai-markdown-content h1,
.ai-markdown-content h2,
.ai-markdown-content h3,
.ai-markdown-content h4 {
    background: linear-gradient(135deg, #7c4dff, #ffd740);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    margin: 1.2em 0 0.5em 0;
}

.ai-markdown-content h1 { font-size: 1.4rem; }
.ai-markdown-content h2 { font-size: 1.25rem; }
.ai-markdown-content h3 { font-size: 1.1rem; }
.ai-markdown-content h4 { font-size: 1rem; }

.ai-markdown-content h1:first-child,
.ai-markdown-content h2:first-child,
.ai-markdown-content h3:first-child,
.ai-markdown-content h4:first-child {
    margin-top: 0;
}

.ai-markdown-content p {
    margin: 0.6em 0;
}

.ai-markdown-content strong {
    color: #d0c0f0;
    font-weight: 600;
}

.ai-markdown-content em {
    color: #c0b0e0;
    font-style: italic;
}

.ai-markdown-content ul,
.ai-markdown-content ol {
    padding-left: 1.5em;
    margin: 0.5em 0;
}

.ai-markdown-content li {
    margin: 0.3em 0;
}

.ai-markdown-content li::marker {
    color: #7c4dff;
}

.ai-markdown-content hr {
    border: none;
    border-top: 1px solid rgba(124, 77, 255, 0.25);
    margin: 1em 0;
}

.ai-markdown-content blockquote {
    border-left: 3px solid rgba(124, 77, 255, 0.4);
    padding-left: 1em;
    margin: 0.8em 0;
    color: #b0a0d0;
    font-style: italic;
}

.ai-markdown-content code {
    background: rgba(124, 77, 255, 0.15);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Markdown tables */
.ai-markdown-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0.6em 0;
    table-layout: auto;
}

.ai-markdown-content th,
.ai-markdown-content td {
    border: 1px solid rgba(124, 77, 255, 0.2);
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.ai-markdown-content thead th {
    background: rgba(124, 77, 255, 0.08);
    color: #d8c8f2;
    font-weight: 600;
}

.ai-markdown-content tbody tr:nth-child(even) {
    background: rgba(124, 77, 255, 0.04);
}

@media (max-width: 720px) {
    .ai-markdown-content table {
        display: block;
        overflow-x: auto;
    }
}

/* === Timeline (transit history) === */
.cosmic-timeline-day {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(124, 77, 255, 0.2);
    margin-left: 8px;
}

.cosmic-timeline-dot {
    position: absolute;
    left: -6px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7c4dff;
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.5);
}

/* === Typing Cursor (streaming) === */
.typing-cursor {
    display: inline;
    color: #7c4dff;
    font-weight: bold;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* === Oracle Page Layout (sidebar + chat) === */
.oracle-page-layout {
    display: flex;
    height: calc(100vh - 52px - 68px - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 52px - 68px - env(safe-area-inset-bottom, 0px));
    margin: -16px -24px -80px; /* break out of MudContainer padding */
    overflow: hidden;
}

@media (max-width: 959px) {
    .oracle-page-layout {
        position: fixed;
        top: 52px;
        right: 0;
        left: 0;
        bottom: calc(68px + env(safe-area-inset-bottom, 0px));
        height: auto;
        margin: 0;
    }
}

@media (min-width: 960px) {
    .oracle-page-layout {
        height: calc(100vh - 56px - 32px);
        height: calc(100dvh - 56px - 32px);
        margin: -16px -24px;
    }
}

/* === Oracle Sidebar === */
.oracle-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: none;
    flex-direction: column;
    background: rgba(13, 18, 48, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(124, 77, 255, 0.15);
    overflow: hidden;
}

@media (min-width: 960px) {
    .oracle-sidebar {
        display: flex;
    }
}

.oracle-sidebar-header {
    padding: 12px;
    flex-shrink: 0;
}

.oracle-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.oracle-sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(176, 160, 208, 0.6);
    padding: 12px 12px 4px;
}

.oracle-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

.oracle-sidebar-item:hover {
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(124, 77, 255, 0.15);
}

.oracle-sidebar-item.active {
    background: rgba(124, 77, 255, 0.18);
    border-color: rgba(124, 77, 255, 0.3);
}

.oracle-sidebar-item-title {
    flex: 1;
    font-size: 0.82rem;
    color: #d0c0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.oracle-sidebar-item.active .oracle-sidebar-item-title {
    color: #e8e0ff;
}

.oracle-sidebar-item .oracle-sidebar-delete {
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.oracle-sidebar-item:hover .oracle-sidebar-delete {
    opacity: 0.6;
}

.oracle-sidebar-item .oracle-sidebar-delete:hover {
    opacity: 1;
}

/* === Oracle Mobile Sidebar === */
.oracle-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1299;
}

.oracle-mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: rgba(13, 18, 48, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(124, 77, 255, 0.15);
    z-index: 1300;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: env(safe-area-inset-top, 0px);
}

.oracle-mobile-sidebar.open {
    transform: translateX(0);
}

/* === Oracle Chat === */
.oracle-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 960px) {
    .oracle-chat-container {
        max-width: none;
        padding: 0 16px;
    }
}

.oracle-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(124, 77, 255, 0.15);
    flex-shrink: 0;
}

.oracle-chat-header-info {
    display: flex;
    flex-direction: column;
}

.oracle-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.oracle-msg {
    display: flex;
    animation: fadeInUp 0.3s ease-out;
}

.oracle-msg-user {
    justify-content: flex-end;
}

.oracle-msg-assistant {
    justify-content: flex-start;
    gap: 8px;
}

.oracle-msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(124, 77, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.oracle-msg-bubble {
    max-width: 85%;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.oracle-msg-bubble-user {
    background: rgba(124, 77, 255, 0.25);
    border: 1px solid rgba(124, 77, 255, 0.3);
    border-bottom-right-radius: 4px;
    color: #e8e0ff;
}

.oracle-msg-bubble-user .mud-typography {
    white-space: pre-wrap;
}

.oracle-msg-bubble-assistant {
    background: rgba(20, 24, 50, 0.6);
    border: 1px solid rgba(124, 77, 255, 0.12);
    border-bottom-left-radius: 4px;
}

.oracle-msg-bubble-assistant .ai-markdown-content {
    font-size: 0.85rem;
}

.oracle-msg-bubble-assistant .ai-markdown-content h2 {
    font-size: 1.05rem;
    margin: 0.8em 0 0.3em 0;
}

.oracle-msg-bubble-assistant .ai-markdown-content h3 {
    font-size: 0.95rem;
    margin: 0.7em 0 0.3em 0;
}

.oracle-msg-bubble-assistant .ai-markdown-content p {
    margin: 0.4em 0;
}

.oracle-tarot-spread { padding: 12px 4px; }
.oracle-tarot-cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px; margin: 0 -14px; -webkit-overflow-scrolling: touch; justify-content: safe center; }
.oracle-tarot-card { text-align: center; flex-shrink: 0; width: 80px; }
.oracle-tarot-card img { width: 80px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.oracle-tarot-card.reversed img { transform: rotate(180deg); }
.oracle-tarot-card-name { font-size: 0.6rem; margin-top: 2px; line-height: 1.2; color: var(--mud-palette-text-secondary); transition: visibility 0s 0.3s; }
.oracle-tarot-card-position { font-size: 0.55rem; line-height: 1.2; color: var(--mud-palette-text-disabled); }

/* Tarot card flip animation */
.oracle-tarot-card-flip { text-align: center; flex-shrink: 0; width: 80px; perspective: 400px; }
.oracle-tarot-card-flip-inner {
    width: 80px; height: 120px; position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}
.oracle-tarot-card-flip.flipped .oracle-tarot-card-flip-inner { transform: rotateY(180deg); }
.oracle-tarot-card-back,
.oracle-tarot-card-front {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden;
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.oracle-tarot-card-back img { width: 100%; height: 100%; object-fit: cover; }
.oracle-tarot-card-front { transform: rotateY(180deg); }
.oracle-tarot-card-front img { width: 100%; height: 100%; object-fit: cover; }
.oracle-tarot-card-front.reversed img { transform: rotate(180deg); }

/* Tarot spread layouts — simple (row/wrap) */
.tarot-layout-simple { flex-wrap: wrap; justify-content: center; max-width: 440px; }

/* Tarot spread layouts — Balance of Choice (2×2 grid: A vs B) */
.oracle-spread-balance {
    display: grid !important;
    grid-template-columns: repeat(2, 80px);
    gap: 10px;
    justify-content: center;
    overflow: visible;
    padding: 8px 12px;
}

/* Tarot spread layouts — Dialog of Two (2 columns + bottom row) */
.oracle-spread-dialog {
    display: grid !important;
    grid-template-columns: repeat(3, 80px);
    gap: 10px;
    justify-content: center;
    overflow: visible;
    padding: 8px 12px;
}

/* Tarot spread layouts — Cross of Fate (5-card cross) */
.oracle-spread-cross5 {
    display: grid !important;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: auto auto auto;
    gap: 8px;
    justify-items: center;
    align-items: start;
    justify-content: center;
    overflow: visible;
    padding: 8px 12px;
}
.oracle-spread-cross5 .oracle-pos-1 { grid-column: 2; grid-row: 2; }
.oracle-spread-cross5 .oracle-pos-2 { grid-column: 2; grid-row: 1; }
.oracle-spread-cross5 .oracle-pos-3 { grid-column: 2; grid-row: 3; }
.oracle-spread-cross5 .oracle-pos-4 { grid-column: 1; grid-row: 2; }
.oracle-spread-cross5 .oracle-pos-5 { grid-column: 3; grid-row: 2; }

/* Tarot spread layouts — Celtic Cross (10-card grid) */
.oracle-spread-celtic {
    display: grid !important;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: auto auto auto;
    gap: 16px;
    justify-items: center;
    align-items: start;
    justify-content: center;
    overflow: visible;
    padding: 16px;
}
/* Pos 1 & 2 share the same cell — pos-1 keeps its text, pos-2 (crossing) hides text */
.oracle-spread-celtic .oracle-pos-1 { grid-column: 2; grid-row: 2; position: relative; z-index: 1; }

.oracle-spread-celtic .oracle-pos-2 { grid-column: 2; grid-row: 2; position: relative; z-index: 2; }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card { position: relative; }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card img { transform: rotate(90deg) scale(0.8); }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card.reversed img { transform: rotate(270deg) scale(0.8); }
/* Celtic cross pos-2 flip variant (crossing card rotated 90deg) */
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-flip { position: relative; }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-flip-inner { transform: rotate(90deg) scale(0.8); }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-flip.flipped .oracle-tarot-card-flip-inner { transform: rotate(90deg) scale(0.8) rotateY(180deg); }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-front.reversed img { transform: rotate(180deg); }
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-name,
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-position {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 140%;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
    margin: 0;
}
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-name {
    top: calc(50% - 4px);
    background: rgba(10, 8, 28, 0.3);
    color: #f0eaff;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px 4px 0 0;
}
.oracle-spread-celtic .oracle-pos-2 .oracle-tarot-card-position {
    display: block;
    top: calc(50% + 10px);
    background: rgba(10, 8, 28, 0.3);
    color: #d4c8f0;
    font-size: 0.5rem;
    padding: 1px 6px;
    border-radius: 0 0 4px 4px;
}
.oracle-spread-celtic .oracle-pos-3 { grid-column: 2; grid-row: 1; }
.oracle-spread-celtic .oracle-pos-4 { grid-column: 2; grid-row: 3; }
.oracle-spread-celtic .oracle-pos-5 { grid-column: 1; grid-row: 2; }
.oracle-spread-celtic .oracle-pos-6 { grid-column: 3; grid-row: 2; }
.oracle-spread-celtic .oracle-pos-7 { grid-column: 4; grid-row: 3; }
.oracle-spread-celtic .oracle-pos-8 { grid-column: 4; grid-row: 2; }
.oracle-spread-celtic .oracle-pos-9 { grid-column: 4; grid-row: 1; }
.oracle-spread-celtic .oracle-pos-10 { grid-column: 3; grid-row: 1; }

@media (max-width: 600px) {
    .oracle-spread-celtic {
        grid-template-columns: repeat(3, 72px);
        grid-template-rows: auto auto auto auto;
        gap: 6px;
    }
    .oracle-spread-celtic .oracle-pos-7 { grid-column: 3; grid-row: 4; }
    .oracle-spread-celtic .oracle-pos-8 { grid-column: 2; grid-row: 4; }
    .oracle-spread-celtic .oracle-pos-9 { grid-column: 1; grid-row: 4; }
    .oracle-spread-celtic .oracle-pos-10 { grid-column: 1; grid-row: 1; }
    .oracle-spread-celtic .oracle-tarot-card { width: 72px; }
    .oracle-spread-celtic .oracle-tarot-card img { width: 72px; }
    .oracle-spread-celtic .oracle-tarot-card-flip { width: 72px; }
    .oracle-spread-celtic .oracle-tarot-card-flip-inner { width: 72px; height: 108px; }

    .oracle-spread-cross5 {
        grid-template-columns: repeat(3, 72px);
    }
    .oracle-spread-cross5 .oracle-tarot-card { width: 72px; }
    .oracle-spread-cross5 .oracle-tarot-card img { width: 72px; }
    .oracle-spread-cross5 .oracle-tarot-card-flip { width: 72px; }
    .oracle-spread-cross5 .oracle-tarot-card-flip-inner { width: 72px; height: 108px; }
}

/* Layout: Yes/No (3 cards, verdict accent on position 3) */
.oracle-spread-yesno {
    display: flex !important;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.oracle-spread-yesno .oracle-pos-3 .oracle-tarot-card-flip {
    border: 2px solid rgba(255, 215, 0, 0.6);
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

/* Layout: Twelve Houses (12 cards in a circle) */
.oracle-spread-twelve-houses {
    position: relative !important;
    display: block !important;
    width: 320px;
    height: 320px;
    margin: 0 auto;
}

.oracle-spread-twelve-houses .oracle-tarot-card-wrapper {
    position: absolute;
    left: 50%;
    top: 50%;
}

.oracle-spread-twelve-houses .oracle-pos-1  { transform: translate(-50%, -50%) rotate(0deg)   translateY(-130px) rotate(0deg); }
.oracle-spread-twelve-houses .oracle-pos-2  { transform: translate(-50%, -50%) rotate(30deg)  translateY(-130px) rotate(-30deg); }
.oracle-spread-twelve-houses .oracle-pos-3  { transform: translate(-50%, -50%) rotate(60deg)  translateY(-130px) rotate(-60deg); }
.oracle-spread-twelve-houses .oracle-pos-4  { transform: translate(-50%, -50%) rotate(90deg)  translateY(-130px) rotate(-90deg); }
.oracle-spread-twelve-houses .oracle-pos-5  { transform: translate(-50%, -50%) rotate(120deg) translateY(-130px) rotate(-120deg); }
.oracle-spread-twelve-houses .oracle-pos-6  { transform: translate(-50%, -50%) rotate(150deg) translateY(-130px) rotate(-150deg); }
.oracle-spread-twelve-houses .oracle-pos-7  { transform: translate(-50%, -50%) rotate(180deg) translateY(-130px) rotate(-180deg); }
.oracle-spread-twelve-houses .oracle-pos-8  { transform: translate(-50%, -50%) rotate(210deg) translateY(-130px) rotate(-210deg); }
.oracle-spread-twelve-houses .oracle-pos-9  { transform: translate(-50%, -50%) rotate(240deg) translateY(-130px) rotate(-240deg); }
.oracle-spread-twelve-houses .oracle-pos-10 { transform: translate(-50%, -50%) rotate(270deg) translateY(-130px) rotate(-270deg); }
.oracle-spread-twelve-houses .oracle-pos-11 { transform: translate(-50%, -50%) rotate(300deg) translateY(-130px) rotate(-300deg); }
.oracle-spread-twelve-houses .oracle-pos-12 { transform: translate(-50%, -50%) rotate(330deg) translateY(-130px) rotate(-330deg); }

@media (max-width: 400px) {
    .oracle-spread-twelve-houses {
        width: 260px;
        height: 260px;
    }
    .oracle-spread-twelve-houses .oracle-pos-1  { transform: translate(-50%, -50%) rotate(0deg)   translateY(-105px) rotate(0deg); }
    .oracle-spread-twelve-houses .oracle-pos-2  { transform: translate(-50%, -50%) rotate(30deg)  translateY(-105px) rotate(-30deg); }
    .oracle-spread-twelve-houses .oracle-pos-3  { transform: translate(-50%, -50%) rotate(60deg)  translateY(-105px) rotate(-60deg); }
    .oracle-spread-twelve-houses .oracle-pos-4  { transform: translate(-50%, -50%) rotate(90deg)  translateY(-105px) rotate(-90deg); }
    .oracle-spread-twelve-houses .oracle-pos-5  { transform: translate(-50%, -50%) rotate(120deg) translateY(-105px) rotate(-120deg); }
    .oracle-spread-twelve-houses .oracle-pos-6  { transform: translate(-50%, -50%) rotate(150deg) translateY(-105px) rotate(-150deg); }
    .oracle-spread-twelve-houses .oracle-pos-7  { transform: translate(-50%, -50%) rotate(180deg) translateY(-105px) rotate(-180deg); }
    .oracle-spread-twelve-houses .oracle-pos-8  { transform: translate(-50%, -50%) rotate(210deg) translateY(-105px) rotate(-210deg); }
    .oracle-spread-twelve-houses .oracle-pos-9  { transform: translate(-50%, -50%) rotate(240deg) translateY(-105px) rotate(-240deg); }
    .oracle-spread-twelve-houses .oracle-pos-10 { transform: translate(-50%, -50%) rotate(270deg) translateY(-105px) rotate(-270deg); }
    .oracle-spread-twelve-houses .oracle-pos-11 { transform: translate(-50%, -50%) rotate(300deg) translateY(-105px) rotate(-300deg); }
    .oracle-spread-twelve-houses .oracle-pos-12 { transform: translate(-50%, -50%) rotate(330deg) translateY(-105px) rotate(-330deg); }
}

/* Layout: Annual Forecast (4x3 calendar grid) */
.oracle-spread-annual {
    display: grid !important;
    grid-template-columns: repeat(3, 80px);
    gap: 10px;
    justify-content: center;
}

@media (max-width: 400px) {
    .oracle-spread-annual {
        grid-template-columns: repeat(3, 72px);
        gap: 6px;
    }
}

/* Tarot shuffle animation */
.tarot-shuffle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 140px;
    position: relative;
    margin: 16px 0;
}

.tarot-shuffle-card {
    position: absolute;
    width: 70px;
    height: 105px;
    border-radius: 6px;
    background: url('/images/tarot/card-back.svg') center/cover no-repeat;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.tarot-shuffle-card:nth-child(1) { animation: shuffleCard1 0.6s ease-in-out infinite; }
.tarot-shuffle-card:nth-child(2) { animation: shuffleCard2 0.6s ease-in-out infinite 0.15s; }
.tarot-shuffle-card:nth-child(3) { animation: shuffleCard3 0.6s ease-in-out infinite 0.3s; }

@keyframes shuffleCard1 {
    0%, 100% { transform: translateX(-30px) rotate(-5deg); }
    50%      { transform: translateX(30px) rotate(5deg); }
}

@keyframes shuffleCard2 {
    0%, 100% { transform: translateX(20px) rotate(8deg); z-index: 2; }
    50%      { transform: translateX(-20px) rotate(-8deg); z-index: 0; }
}

@keyframes shuffleCard3 {
    0%, 100% { transform: translateX(0) rotate(-3deg); z-index: 1; }
    50%      { transform: translateX(10px) rotate(10deg); z-index: 3; }
}

.tarot-shuffle-stop-btn {
    position: absolute;
    bottom: -8px;
    z-index: 10;
}

/* Oracle generated images */
.oracle-generated-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}
.oracle-generated-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.suggestions-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 0.75rem;
    color: rgba(124, 77, 255, 0.6);
    background: rgba(10, 14, 39, 0.95);
    border-top: 1px solid rgba(124, 77, 255, 0.1);
    flex-shrink: 0;
    transition: color 0.2s;
}

.suggestions-toggle:hover {
    color: rgba(124, 77, 255, 0.9);
}

.suggestions-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.suggestions-toggle-icon.expanded {
    transform: rotate(90deg);
}

.oracle-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    justify-content: center;
    animation: fadeInUp 0.4s ease-out;
    flex-shrink: 0;
    background: rgba(10, 14, 39, 0.95);
}

.oracle-chat-input {
    flex-shrink: 0;
    padding: 8px 12px 12px;
    border-top: 1px solid rgba(124, 77, 255, 0.15);
    background: rgba(10, 14, 39, 0.95);
}

.oracle-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.oracle-input-field {
    flex: 1;
}

.oracle-input-field .mud-input-outlined {
    border-radius: 16px !important;
}

.oracle-input-field .mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(124, 77, 255, 0.3) !important;
    border-radius: 16px !important;
}

.oracle-input-field textarea {
    resize: none !important;
    max-height: 120px;
}

.oracle-input-field .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(124, 77, 255, 0.5) !important;
}

.oracle-input-field .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: #7c4dff !important;
}

/* === Natal Chart Wheel Container === */
.natal-chart-wheel-container {
    width: 100%;
    aspect-ratio: 1;
    animation: fadeInScale 0.5s ease-out;
}

.natal-chart-wheel-container svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(124, 77, 255, 0.15));
}

/* === Star Sky Container === */
.star-sky-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    animation: fadeInScale 0.5s ease-out 0.2s both;
}

.star-sky-container svg {
    width: 100%;
    height: auto;
}

/* === Chart Style Editor Theme Cards === */
.theme-preset-card {
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background 0.2s;
    text-align: center;
    min-width: 72px;
}

.theme-preset-card:hover {
    border-color: rgba(124, 77, 255, 0.4);
    background: rgba(124, 77, 255, 0.06);
}

.theme-preset-card.selected {
    border-color: var(--mud-palette-primary);
    background: rgba(124, 77, 255, 0.1);
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Natal Chart Tabs === */
.page-content .mud-tabs {
    background: transparent !important;
}

.page-content .mud-tab {
    color: rgba(176, 160, 208, 0.7) !important;
}

.page-content .mud-tab.mud-tab-active {
    color: #d0c0f0 !important;
}

.page-content .mud-tabs-toolbar {
    background: rgba(20, 24, 50, 0.6) !important;
    border: 1px solid rgba(124, 77, 255, 0.15);
    border-radius: 12px;
}

.page-content .mud-tab-slider {
    background: #7c4dff !important;
}

/* === Thinking Indicator (AI generation) === */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.thinking-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.thinking-dots span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7c4dff;
    animation: thinkingBounce 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.thinking-text {
    color: #d0c0f0;
    font-size: 0.85rem;
    font-style: italic;
    animation: thinkingFadeIn 0.4s ease-out;
}

@keyframes thinkingFadeIn {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === Tracker Calendar === */
.tracker-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: rgba(20, 24, 50, 0.5);
    border: 1px solid var(--cosmic-border);
    border-radius: 12px;
    padding: 12px;
}

.tracker-calendar-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--cosmic-text-muted);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tracker-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 40px;
    background: rgba(20, 24, 50, 0.4);
    border: 1px solid transparent;
}

.tracker-day:hover {
    transform: scale(1.05);
    border-color: var(--cosmic-border-hover);
}

.tracker-day-empty {
    cursor: default;
    background: transparent;
}

.tracker-day-empty:hover {
    transform: none;
    border-color: transparent;
}

.tracker-day-favorable {
    background: rgba(105, 240, 174, 0.08);
    border-color: rgba(105, 240, 174, 0.15);
}

.tracker-day-challenging {
    background: rgba(255, 82, 82, 0.08);
    border-color: rgba(255, 82, 82, 0.15);
}

.tracker-day-neutral {
    background: rgba(20, 24, 50, 0.4);
}

.tracker-day-today {
    border: 2px solid var(--cosmic-primary) !important;
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.3);
}

.tracker-day-selected {
    border-color: var(--cosmic-secondary) !important;
    box-shadow: 0 0 12px rgba(255, 215, 64, 0.3);
}

.tracker-day-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cosmic-text);
    line-height: 1;
}

.tracker-dots {
    display: flex;
    gap: 2px;
    margin-top: 3px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.tracker-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tracker-dot-red {
    background: #ff5252;
    box-shadow: 0 0 4px rgba(255, 82, 82, 0.5);
}

.tracker-dot-green {
    background: #69f0ae;
    box-shadow: 0 0 4px rgba(105, 240, 174, 0.5);
}

.tracker-dot-yellow {
    background: #ffd740;
    box-shadow: 0 0 4px rgba(255, 215, 64, 0.5);
}

/* Tracker banner link */
.tracker-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(255, 215, 64, 0.08));
    border: 1px solid rgba(124, 77, 255, 0.25);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.tracker-banner:hover {
    border-color: rgba(124, 77, 255, 0.4);
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(255, 215, 64, 0.12));
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.15);
}

/* ==================== AI Charts & Mermaid ==================== */

.ai-chart-container {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.08), rgba(15, 10, 30, 0.4));
    border: 1px solid rgba(179, 136, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    justify-content: center;
}

.ai-chart-container svg {
    max-width: 100%;
    height: auto;
}

.ai-chart-error {
    background: rgba(255, 50, 50, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 8px 0;
    color: #ff8080;
    font-family: monospace;
    font-size: 0.8rem;
}

.mermaid {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.08), rgba(15, 10, 30, 0.4));
    border: 1px solid rgba(179, 136, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    justify-content: center;
}

.mermaid svg {
    max-width: 100%;
    height: auto;
}

/* Compact charts inside Oracle chat bubbles */
.oracle-msg-bubble-assistant .ai-chart-container,
.oracle-msg-bubble-assistant .mermaid {
    padding: 10px;
    margin: 8px 0;
}

/* === Reconnect Modal === */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 14, 39, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal > div {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-show > .components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed > .components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected > .components-reconnect-rejected {
    display: block;
}

.cosmic-reconnect-content {
    text-align: center;
    animation: fadeInScale 0.4s ease-out;
}

.cosmic-reconnect-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    line-height: 1;
    animation: reconnectIconGlow 2s ease-in-out infinite;
}

.cosmic-reconnect-title {
    font-size: 1.15rem;
    font-weight: 600;
    background: linear-gradient(135deg, #7c4dff, #ffd740);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.cosmic-reconnect-sub {
    color: var(--cosmic-text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.cosmic-reconnect-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.cosmic-reconnect-dots span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7c4dff;
    animation: thinkingBounce 1.4s ease-in-out infinite;
}

.cosmic-reconnect-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.cosmic-reconnect-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.cosmic-reconnect-btn {
    display: inline-block;
    padding: 10px 28px;
    background: linear-gradient(135deg, #7c4dff, #651fff);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.cosmic-reconnect-btn:hover {
    box-shadow: 0 6px 25px rgba(124, 77, 255, 0.6);
    transform: translateY(-1px);
}

/* Responsive calendar */
@media (max-width: 480px) {
    .tracker-calendar {
        gap: 2px;
        padding: 8px;
    }

    .tracker-day {
        min-height: 34px;
        border-radius: 6px;
    }

    .tracker-day-number {
        font-size: 0.7rem;
    }

    .tracker-dot {
        width: 3px;
        height: 3px;
    }
}

/* === Heatmap Calendar (Long Forecasts) === */

.tracker-heatmap-month-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cosmic-text);
    margin: 16px 0 6px 0;
    text-transform: capitalize;
}

.tracker-heatmap-month-label:first-child {
    margin-top: 0;
}

.tracker-heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    background: rgba(20, 24, 50, 0.5);
    border: 1px solid var(--cosmic-border);
    border-radius: 10px;
    padding: 8px;
}

.tracker-heatmap-header {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--cosmic-text-muted);
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tracker-heatmap-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    position: relative;
    height: 36px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tracker-heatmap-cell:hover {
    transform: scale(1.08);
    z-index: 1;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.tracker-heatmap-cell-empty {
    background: transparent;
}

.tracker-heatmap-cell-empty:hover {
    transform: none;
    box-shadow: none;
}

.tracker-heatmap-cell-today {
    outline: 2px solid var(--cosmic-primary);
    outline-offset: -1px;
    box-shadow: 0 0 8px rgba(124, 77, 255, 0.4);
}

.tracker-heatmap-day-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1;
}

/* Heatmap color classes — classic green/yellow/red with per-category text contrast */

.heatmap-favorable {
    background: rgba(105, 240, 174, 0.25);
    border: 1px solid rgba(105, 240, 174, 0.35);
}

.heatmap-neutral {
    background: rgba(255, 215, 64, 0.18);
    border: 1px solid rgba(255, 215, 64, 0.3);
}

.heatmap-challenging {
    background: rgba(255, 82, 82, 0.22);
    border: 1px solid rgba(255, 82, 82, 0.35);
}

/* Legend swatches */
.heatmap-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
}

.heatmap-legend-dot.heatmap-favorable {
    background: rgba(105, 240, 174, 0.6);
    border: 1px solid rgba(105, 240, 174, 0.8);
}

.heatmap-legend-dot.heatmap-neutral {
    background: rgba(255, 215, 64, 0.55);
    border: 1px solid rgba(255, 215, 64, 0.75);
}

.heatmap-legend-dot.heatmap-challenging {
    background: rgba(255, 82, 82, 0.55);
    border: 1px solid rgba(255, 82, 82, 0.75);
}

/* 10-year decade grid */
.tracker-heatmap-decade {
    display: grid;
    grid-template-columns: auto repeat(12, 1fr);
    gap: 3px;
    background: rgba(20, 24, 50, 0.5);
    border: 1px solid var(--cosmic-border);
    border-radius: 8px;
    padding: 10px;
}

.tracker-heatmap-decade-header {
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--cosmic-text-muted);
    padding: 2px 0;
}

.tracker-heatmap-decade-year {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--cosmic-text);
    display: flex;
    align-items: center;
    padding-right: 6px;
}

.tracker-heatmap-decade-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    min-height: 28px;
    font-size: 0.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.15s ease;
}

.tracker-heatmap-decade-cell:hover {
    transform: scale(1.1);
    z-index: 1;
}

@media (max-width: 480px) {
    .tracker-heatmap {
        gap: 2px;
        padding: 5px;
    }

    .tracker-heatmap-cell {
        height: 28px;
        border-radius: 4px;
    }

    .tracker-heatmap-day-number {
        font-size: 0.6rem;
    }

    .tracker-heatmap-decade {
        gap: 2px;
        padding: 6px;
    }

    .tracker-heatmap-decade-cell {
        min-height: 24px;
        font-size: 0.5rem;
    }

    .tracker-heatmap-decade-year {
        font-size: 0.55rem;
    }
}

/* === Tracking & Calibration === */

/* Save confirmation green glow */
@keyframes pulseGreen {
    0%   { box-shadow: 0 0 0 0 rgba(105, 240, 174, 0.4); }
    50%  { box-shadow: 0 0 20px 4px rgba(105, 240, 174, 0.2); }
    100% { box-shadow: 0 0 0 0 rgba(105, 240, 174, 0); }
}

/* Gold glow for streak 14+ */
@keyframes pulseGlow {
    0%   { box-shadow: 0 0 4px rgba(255, 215, 64, 0.3); }
    50%  { box-shadow: 0 0 12px rgba(255, 215, 64, 0.5); }
    100% { box-shadow: 0 0 4px rgba(255, 215, 64, 0.3); }
}

/* Tracking widget enter animation */
.tracking-widget-enter {
    animation: fadeInUp 0.4s ease-out;
}

/* Smooth widget state transitions */
.tracking-widget-transition {
    transition: all 0.3s ease;
}

/* Save confirmation glow on card */
.tracking-saved {
    animation: pulseGreen 1.5s ease-out;
}

/* Calendar cell tracking enrichment */
.tracker-mood-energy {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
    margin-top: 1px;
}

.tracker-feedback-check {
    font-size: 0.5rem;
    color: #69f0ae;
    position: absolute;
    bottom: 2px;
    right: 3px;
}

.tracker-no-tracking {
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.15);
    line-height: 1;
    margin-top: 1px;
}

/* Trend chart responsive container */
.trend-chart-container {
    width: 100%;
    overflow-x: auto;
}

.trend-chart-container svg {
    min-width: 400px;
}

@media (max-width: 480px) {
    .tracker-mood-energy {
        font-size: 0.45rem;
    }

    .tracker-feedback-check {
        font-size: 0.4rem;
    }
}

/* ========================= */
/* === Tarot Card Styles === */
/* ========================= */

.tarot-card {
    width: 140px;
    perspective: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.tarot-card.clickable {
    cursor: pointer;
}

.tarot-card-inner {
    width: 140px;
    height: 210px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
    position: relative;
}

.tarot-card-inner.flipped {
    transform: rotateY(180deg);
}

.tarot-card-back,
.tarot-card-front {
    backface-visibility: hidden;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.25);
}

.tarot-card-back img,
.tarot-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.tarot-card-front {
    transform: rotateY(180deg);
}

.tarot-card-front.reversed img {
    transform: rotate(180deg);
}

.tarot-card-label {
    margin-top: 8px;
    text-align: center;
    max-width: 140px;
    min-height: 48px;
}

/* Three-card spread */
.tarot-spread-three {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

@keyframes reconnectIconGlow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(124, 77, 255, 0.45);
    }
    50% {
        text-shadow: 0 0 14px rgba(124, 77, 255, 0.65);
    }
}

/* Celtic Cross layout */
.tarot-spread-celtic {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    justify-items: center;
    align-items: center;
    max-width: 620px;
    margin: 0 auto;
}

.celtic-pos-1 { grid-column: 2; grid-row: 2; position: relative; z-index: 1; }
.celtic-pos-2 { grid-column: 2; grid-row: 2; transform: scale(0.85); position: relative; z-index: 3; margin-top: -24px; }
.celtic-pos-3 { grid-column: 2; grid-row: 1; }
.celtic-pos-4 { grid-column: 2; grid-row: 3; }
.celtic-pos-5 { grid-column: 1; grid-row: 2; }
.celtic-pos-6 { grid-column: 3; grid-row: 2; }
.celtic-pos-7 { grid-column: 4; grid-row: 3; }
.celtic-pos-8 { grid-column: 4; grid-row: 2; }
.celtic-pos-9 { grid-column: 4; grid-row: 1; }
.celtic-pos-10 { grid-column: 3; grid-row: 1; }

.celtic-pos-2 .tarot-card-inner {
    transform: rotate(90deg);
}

.celtic-pos-2 .tarot-card-inner.flipped {
    transform: rotate(90deg) rotateY(180deg);
}

.celtic-pos-2 .tarot-card-label {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: calc(100% + 10px);
    background: rgba(16, 12, 38, 0.82);
    border: 1px solid rgba(255, 215, 64, 0.35);
    border-radius: 8px;
    padding: 6px 8px;
    min-width: 140px;
    margin-top: 0;
    transform: translateY(-50%);
}

.celtic-pos-2 .tarot-card-label .mud-typography {
    color: #f4f1ff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.celtic-pos-2 .tarot-card-label .mud-typography:last-child {
    color: #ffd740 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* Mobile responsive tarot */
@media (max-width: 600px) {
    .tarot-card {
        width: 100px;
    }

    .tarot-card-inner {
        width: 100px;
        height: 150px;
    }

    .tarot-card-label {
        max-width: 100px;
        min-height: 44px;
    }

    .tarot-spread-three {
        gap: 8px;
    }

    .tarot-spread-celtic {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 8px;
    }

    .celtic-pos-1 { grid-column: 2; grid-row: 2; }
    .celtic-pos-2 { grid-column: 2; grid-row: 2; }
    .celtic-pos-3 { grid-column: 2; grid-row: 1; }
    .celtic-pos-4 { grid-column: 2; grid-row: 3; }
    .celtic-pos-5 { grid-column: 1; grid-row: 2; }
    .celtic-pos-6 { grid-column: 3; grid-row: 2; }
    .celtic-pos-7 { grid-column: 3; grid-row: 4; }
    .celtic-pos-8 { grid-column: 2; grid-row: 4; }
    .celtic-pos-9 { grid-column: 1; grid-row: 4; }
    .celtic-pos-10 { grid-column: 1; grid-row: 1; }

    .celtic-pos-2 .tarot-card-label {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin-top: 12px;
        min-width: 120px;
    }
}

/* Admin prompt editor */
.admin-prompt-dialog .mud-dialog {
    max-width: min(1200px, 96vw);
}

.admin-prompt-dialog-content {
    max-height: 76vh;
    overflow-y: auto;
    padding-right: 8px;
}

.admin-prompt-editor-field textarea {
    min-height: 360px;
    max-height: 62vh;
    overflow-y: auto !important;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.45;
}

/* === Voice Recording === */
.voice-recording-pulse {
    animation: pulse-red 1.2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* === Personal Expert Section === */

.expert-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #69f0ae;
    display: inline-block;
    box-shadow: 0 0 6px rgba(105, 240, 174, 0.6);
    animation: expertPulse 2s ease-in-out infinite;
}

@keyframes expertPulse {
    0%, 100% { box-shadow: 0 0 6px rgba(105, 240, 174, 0.6); }
    50% { box-shadow: 0 0 12px rgba(105, 240, 174, 0.9); }
}

.expert-bubble-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding-left: 20px;
    position: relative;
}

.expert-bubble-tail {
    position: absolute;
    left: 14px;
    top: 12px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid rgba(124, 77, 255, 0.15);
}

.expert-bubble {
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.25);
    border-radius: 4px 16px 16px 16px;
    padding: 12px 16px;
    max-width: 100%;
    flex: 1;
}

/* Typing indicator (three bouncing dots) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b388ff;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick question chips */
.quick-question-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(124, 77, 255, 0.1);
    transition: all 0.2s ease;
}

.quick-question-chip:hover {
    background: rgba(124, 77, 255, 0.1);
    border-color: rgba(124, 77, 255, 0.3);
    transform: translateX(4px);
}

/* === Expert Chat Bottom Sheet Drawer === */

.expert-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1300;
    pointer-events: none;
    transition: background 0.3s ease;
}

.expert-drawer-backdrop.open {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.expert-drawer-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 88vh;
    height: 88dvh;
    z-index: 1301;
    background: var(--mud-palette-surface, #1e1e2e);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.expert-drawer-panel.open {
    transform: translateY(0);
}

@media (max-width: 959px) {
    .expert-drawer-panel {
        height: 100%;
        height: 100dvh;
        border-radius: 0;
    }
}

/* Hide bottom nav when expert drawer is open */
body:has(.expert-drawer-backdrop.open) .bottom-nav {
    display: none !important;
}

/* Embedded layout — fills the drawer panel */
.oracle-embedded-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.oracle-embedded-layout .oracle-sidebar {
    display: none;
}

@media (min-width: 960px) {
    .oracle-embedded-layout .oracle-sidebar {
        display: flex;
    }
}

.oracle-embedded-layout .oracle-chat-container {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.oracle-embedded-layout .oracle-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.oracle-embedded-layout .oracle-chat-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(255,255,255,0.1));
}

.oracle-embedded-layout .oracle-chat-input {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* === Admin Tools Panel === */

.admin-tools-fab {
    position: fixed !important;
    bottom: 140px;
    right: 16px;
    z-index: 10001;
    background: rgba(255, 165, 0, 0.15) !important;
    border: 1px solid rgba(255, 165, 0, 0.3);
    width: 40px;
    height: 40px;
}

.admin-tools-fab:hover {
    background: rgba(255, 165, 0, 0.25) !important;
}

.admin-tools-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10001;
}

.admin-tools-panel {
    position: fixed !important;
    bottom: 190px;
    right: 16px;
    z-index: 10002;
    width: 280px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    border: 1px solid rgba(255, 165, 0, 0.25);
    background: var(--cosmic-surface, #141832) !important;
    border-radius: 12px !important;
}

/* === Debug Mode Styles === */

.debug-block,
.debug-thinking {
    border-left: 3px solid orange;
    background: rgba(255, 165, 0, 0.05);
    border-radius: 4px;
    margin: 8px 0;
    font-size: 0.75rem;
}

.debug-block summary,
.debug-thinking summary {
    cursor: pointer;
    padding: 4px 8px;
    font-weight: 600;
    color: orange;
    opacity: 0.8;
    font-size: 0.75rem;
}

.debug-block pre,
.debug-thinking pre {
    white-space: pre-wrap;
    word-break: break-word;
    padding: 4px 8px 8px;
    margin: 0;
    opacity: 0.8;
    max-height: 300px;
    overflow-y: auto;
}

.debug-system-prompt {
    border-radius: 8px;
}

.debug-system-prompt .mud-expand-panel {
    border-radius: 8px !important;
}

.debug-system-prompt .mud-expand-panel-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: orange;
    min-height: 36px !important;
    padding: 4px 12px !important;
}

/* === Agent Catalog Cards === */
.agent-catalog-card {
    background: rgba(20, 24, 50, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--cosmic-border) !important;
    border-radius: 16px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

@media (hover: hover) {
    .agent-catalog-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 32px rgba(124, 77, 255, 0.2);
        border-color: var(--cosmic-border-hover) !important;
    }
}

/* === Transit Calendar Day Colors === */
.calendar-day-good .mud-picker-calendar-day {
    background: rgba(76, 175, 80, 0.15) !important;
    color: #4caf50 !important;
    border-radius: 50%;
}

.calendar-day-ok .mud-picker-calendar-day {
    background: rgba(38, 198, 218, 0.15) !important;
    color: #26c6da !important;
    border-radius: 50%;
}

.calendar-day-mixed .mud-picker-calendar-day {
    background: rgba(255, 152, 0, 0.15) !important;
    color: #ff9800 !important;
    border-radius: 50%;
}

.calendar-day-challenging .mud-picker-calendar-day {
    background: rgba(158, 158, 158, 0.15) !important;
    color: #9e9e9e !important;
    border-radius: 50%;
}

/* ============================================================= */
/* === Insights UI — catalog, cards, reader                  === */
/* ============================================================= */

/* Load a refined serif pair for long-form reading + display.
   Cormorant Garamond supports Cyrillic; Fraunces used for display. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap&subset=cyrillic,cyrillic-ext,latin,latin-ext');

:root {
    --insight-serif: 'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
    --insight-display: 'Fraunces', 'Cormorant Garamond', 'Georgia', serif;
    --insight-violet: #9d7bff;
    --insight-violet-dim: rgba(157, 123, 255, 0.55);
    --insight-gold: #ffd166;
    --insight-amber: #ffb25a;
    --insight-teal: #6bdcc7;
    --insight-moss: #8fc49a;
    --insight-rose: #ff7fa3;
    --insight-ink: #ece6ff;
}

/* --- Catalog hero --- */
.insight-catalog-hero {
    text-align: center;
    padding: 28px 8px 12px;
    position: relative;
}
.insight-catalog-hero::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(157,123,255,0.18), transparent 70%);
    filter: blur(12px);
    pointer-events: none;
    z-index: -1;
}
.insight-catalog-eyebrow {
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--insight-violet);
    font-weight: 600;
    margin-bottom: 6px;
}
.insight-catalog-title {
    font-family: var(--insight-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 6vw, 3.2rem);
    line-height: 1.05;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff 0%, var(--insight-violet) 55%, var(--insight-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    letter-spacing: -0.01em;
}
.insight-catalog-sub {
    font-family: var(--insight-serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--cosmic-text-accent);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.55;
}

/* --- Catalog loading skeleton --- */
.insight-catalog-skeleton {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) {
    .insight-catalog-skeleton { grid-template-columns: 1fr; }
}
.insight-skeleton-card {
    height: 160px;
    border-radius: 18px;
    background: linear-gradient(100deg,
        rgba(124,77,255,0.06) 0%,
        rgba(124,77,255,0.16) 50%,
        rgba(124,77,255,0.06) 100%);
    background-size: 200% 100%;
    animation: insightSkeletonShimmer 1.6s ease-in-out infinite;
    border: 1px solid var(--cosmic-border);
}
@keyframes insightSkeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Chapter header --- */
.insight-chapter { position: relative; }
.insight-chapter-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 4px 18px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--cosmic-border);
    position: relative;
}
.insight-chapter-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, var(--insight-gold), transparent);
}
.insight-chapter-marker {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    background:
        radial-gradient(circle at 35% 35%, rgba(255,215,64,0.2), transparent 60%),
        linear-gradient(145deg, rgba(124,77,255,0.25), rgba(10,14,39,0.6));
    border: 1px solid var(--cosmic-border-strong);
    box-shadow:
        inset 0 0 16px rgba(124,77,255,0.2),
        0 0 24px rgba(124,77,255,0.15);
}
.insight-chapter-glyph {
    font-size: 22px;
    color: var(--insight-gold);
    line-height: 1;
    position: absolute;
    top: 8px;
}
.insight-chapter-numeral {
    font-family: var(--insight-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--insight-ink);
    margin-top: 14px;
    letter-spacing: 0.05em;
}
.insight-chapter-meta { flex: 1 1 auto; min-width: 0; }
.insight-chapter-kicker {
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--cosmic-text-muted);
    font-weight: 600;
}
.insight-chapter-title {
    font-family: var(--insight-display);
    font-weight: 600;
    font-size: 1.55rem;
    line-height: 1.15;
    margin: 2px 0 10px;
    color: var(--insight-ink);
}
.insight-chapter-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.insight-progress-segments {
    display: inline-flex;
    gap: 4px;
    flex: 0 1 auto;
}
.insight-progress-seg {
    width: 26px;
    height: 6px;
    border-radius: 3px;
    background: rgba(124,77,255,0.12);
    border: 1px solid var(--cosmic-border);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.insight-progress-seg.filled {
    background: linear-gradient(90deg, var(--insight-violet), var(--insight-gold));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(157,123,255,0.5);
}
.insight-chapter-count {
    font-size: 12px;
    color: var(--cosmic-text);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.insight-chapter-count .mute { color: var(--cosmic-text-muted); font-weight: 400; }
.insight-chapter-crown {
    font-size: 14px;
    color: var(--insight-gold);
    text-shadow: 0 0 8px rgba(255,209,102,0.7);
    animation: crownGlow 2.4s ease-in-out infinite alternate;
}
@keyframes crownGlow {
    from { text-shadow: 0 0 6px rgba(255,209,102,0.4); }
    to   { text-shadow: 0 0 14px rgba(255,209,102,0.9); }
}

/* --- Insight card --- */
.insight-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: rgba(20, 24, 50, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--cosmic-border);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    min-height: 170px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
    cursor: pointer;
}
.insight-card.state-available {
    border-color: var(--cosmic-border-hover);
    box-shadow: 0 0 0 1px rgba(157,123,255,0.1), 0 8px 28px rgba(10,14,39,0.45);
}
.insight-card.state-available:hover {
    transform: translateY(-3px);
    border-color: var(--cosmic-border-strong);
    box-shadow: 0 0 0 1px rgba(157,123,255,0.25), 0 14px 40px rgba(124,77,255,0.22);
}
.insight-card.state-read {
    border-color: rgba(255,209,102,0.22);
    background: rgba(20,24,50,0.55);
    opacity: 0.86;
}
.insight-card.state-read:hover {
    opacity: 1;
    transform: translateY(-2px);
    border-color: rgba(255,209,102,0.4);
}
.insight-card.state-locked {
    border-color: rgba(144,144,160,0.2);
    background: rgba(15, 18, 36, 0.6);
    filter: saturate(0.35);
    cursor: not-allowed;
}
.insight-card.state-locked:hover { transform: none; }

.insight-card-synthesis {
    background:
        linear-gradient(145deg, rgba(255,215,64,0.08), rgba(124,77,255,0.12)),
        rgba(20,24,50,0.72);
    border-color: rgba(255,215,64,0.28);
}
.insight-card-ribbon {
    position: absolute;
    top: 14px;
    right: -34px;
    transform: rotate(30deg);
    background: linear-gradient(135deg, var(--insight-gold), var(--insight-amber));
    color: #1a1330;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    padding: 3px 36px;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.insight-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.seal {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex: 0 0 auto;
}
.seal-read {
    background: linear-gradient(135deg, #ffd166, #ffb25a);
    color: #1a1330;
    box-shadow: 0 0 12px rgba(255,209,102,0.5);
}
.seal-locked {
    background: rgba(144,144,160,0.15);
    color: #9090a0;
    border: 1px solid rgba(144,144,160,0.3);
    width: 36px;
    height: 36px;
}
.seal-available {
    background: radial-gradient(circle at 35% 35%, rgba(157,123,255,0.35), rgba(10,14,39,0.4));
    color: var(--insight-gold);
    font-size: 16px;
    border: 1px solid var(--cosmic-border-strong);
    animation: sealPulse 3s ease-in-out infinite;
}
@keyframes sealPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(157,123,255,0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(157,123,255,0); }
}
.insight-card-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}
.insight-card-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--cosmic-text-muted);
    letter-spacing: 0.04em;
}

.insight-card-title {
    font-family: var(--insight-display);
    font-weight: 600;
    font-size: 1.18rem;
    line-height: 1.25;
    margin: 2px 0 0;
    color: var(--insight-ink);
}
.insight-card-teaser {
    font-family: var(--insight-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--cosmic-text-accent);
    margin: 0;
    flex: 1 1 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.insight-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 6px;
    margin-top: auto;
    border-top: 1px dashed rgba(124,77,255,0.15);
}
.insight-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--insight-violet);
    letter-spacing: 0.02em;
    transition: gap 0.2s ease, color 0.2s ease;
}
.insight-card:hover .insight-card-cta { gap: 10px; color: var(--insight-gold); }
.insight-card-lock-reason {
    font-size: 12px;
    color: var(--cosmic-text-muted);
    font-style: italic;
}
.insight-card.state-read .insight-card-cta { color: var(--cosmic-text-muted); }
.insight-card.state-read .insight-card-cta:hover { color: var(--insight-gold); }

/* --- Reader --- */
.insight-reader-breadcrumbs { margin-bottom: 16px; opacity: 0.85; }
.insight-reader-header {
    text-align: left;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--cosmic-border);
    margin-bottom: 20px;
    position: relative;
}
.insight-reader-header::after {
    content: '';
    position: absolute;
    left: 0; bottom: -1px;
    width: 80px; height: 2px;
    background: linear-gradient(90deg, var(--insight-gold), transparent);
}
.insight-reader-eyebrow {
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--insight-violet);
    font-weight: 700;
    margin-bottom: 6px;
}
.insight-reader-title {
    font-family: var(--insight-display);
    font-weight: 600;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.1;
    margin: 0 0 8px;
    color: var(--insight-ink);
    letter-spacing: -0.01em;
}
.insight-reader-sub {
    font-family: var(--insight-serif);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--cosmic-text-accent);
    margin: 0;
    max-width: 560px;
}

/* --- Style tabs --- */
.insight-style-switcher {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px;
    background: rgba(20,24,50,0.55);
    border: 1px solid var(--cosmic-border);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}
@media (max-width: 560px) {
    .insight-style-switcher { grid-template-columns: repeat(2, 1fr); }
}
.insight-style-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--cosmic-text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.insight-style-tab:hover { color: var(--insight-ink); background: rgba(124,77,255,0.08); }
.insight-style-tab:active { transform: scale(0.98); }
.insight-style-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.3s ease;
}
.insight-style-tab:hover .insight-style-icon { transform: scale(1.15); }
.insight-style-tab.active {
    color: var(--insight-ink);
    background: linear-gradient(145deg, rgba(124,77,255,0.22), rgba(10,14,39,0.4));
    border-color: var(--cosmic-border-strong);
    box-shadow: inset 0 0 14px rgba(124,77,255,0.22);
}
.insight-style-tab.style-psychological .insight-style-icon { color: var(--insight-violet); }
.insight-style-tab.style-traditional   .insight-style-icon { color: var(--insight-gold); }
.insight-style-tab.style-evolutionary  .insight-style-icon { color: var(--insight-teal); }
.insight-style-tab.style-practical     .insight-style-icon { color: var(--insight-moss); }
.insight-style-tab.active.style-psychological { border-color: var(--insight-violet-dim); }
.insight-style-tab.active.style-traditional   { border-color: rgba(255,209,102,0.45); }
.insight-style-tab.active.style-evolutionary  { border-color: rgba(107,220,199,0.4); }
.insight-style-tab.active.style-practical     { border-color: rgba(143,196,154,0.4); }

/* --- Reader body / long-form prose --- */
.insight-reader-body { min-height: 240px; position: relative; }
.insight-reader-prose {
    font-family: var(--insight-serif);
    font-size: 1.15rem;
    line-height: 1.78;
    color: var(--insight-ink);
    letter-spacing: 0.005em;
}
.insight-reader-prose p { margin: 0 0 1em; }
.insight-reader-prose h2,
.insight-reader-prose h3 {
    font-family: var(--insight-display);
    font-weight: 600;
    color: var(--insight-ink);
    letter-spacing: -0.005em;
    margin: 1.4em 0 0.5em;
}
.insight-reader-prose strong { color: var(--insight-gold); font-weight: 600; }
.insight-reader-prose em { color: var(--cosmic-text-accent); }
.insight-reader-prose blockquote {
    border-left: 2px solid var(--insight-violet-dim);
    padding-left: 18px;
    margin: 1em 0;
    font-style: italic;
    color: var(--cosmic-text-accent);
}

/* --- Reader loader (orbit + skeleton lines) --- */
.insight-reader-loader {
    padding: 32px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.insight-loader-orbit {
    position: relative;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
}
.orbit-core {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--insight-gold), var(--insight-amber));
    box-shadow: 0 0 18px var(--insight-gold), 0 0 30px rgba(124,77,255,0.4);
    animation: orbitPulse 1.6s ease-in-out infinite;
}
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--insight-violet-dim);
    border-top-color: transparent;
}
.ring-1 { width: 44px; height: 44px; animation: orbitSpin 2.2s linear infinite; }
.ring-2 { width: 68px; height: 68px; animation: orbitSpin 3.6s linear infinite reverse; border-color: rgba(255,209,102,0.45); border-right-color: transparent; }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes orbitPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px var(--insight-gold); }
    50%      { transform: scale(1.3); box-shadow: 0 0 24px var(--insight-gold), 0 0 40px rgba(124,77,255,0.5); }
}
.insight-loader-hint {
    font-family: var(--insight-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--cosmic-text-accent);
    letter-spacing: 0.02em;
}
.insight-skeleton-lines {
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}
.skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(100deg,
        rgba(157,123,255,0.08) 0%,
        rgba(157,123,255,0.22) 50%,
        rgba(157,123,255,0.08) 100%);
    background-size: 200% 100%;
    animation: insightSkeletonShimmer 1.6s ease-in-out infinite;
}
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-85 { width: 85%; }
.skeleton-line.w-90 { width: 90%; }

/* --- Next insight card --- */
.next-insight-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    margin-top: 28px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(124,77,255,0.16), rgba(255,215,64,0.06)),
        rgba(20,24,50,0.7);
    border: 1px solid var(--cosmic-border-strong);
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.next-insight-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,209,102,0.4);
    box-shadow: 0 12px 36px rgba(124,77,255,0.22);
}
.next-insight-glyph {
    font-size: 26px;
    color: var(--insight-gold);
    text-shadow: 0 0 12px rgba(255,209,102,0.5);
    flex: 0 0 auto;
}
.next-insight-body { flex: 1 1 auto; min-width: 0; }
.next-insight-eyebrow {
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--insight-violet);
    font-weight: 700;
    margin-bottom: 4px;
}
.next-insight-title {
    font-family: var(--insight-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--insight-ink);
    line-height: 1.25;
    margin-bottom: 4px;
}
.next-insight-teaser {
    font-family: var(--insight-serif);
    font-size: 0.98rem;
    color: var(--cosmic-text-accent);
    line-height: 1.45;
}
.next-insight-cta {
    flex: 0 0 auto;
    color: var(--insight-violet);
    transition: transform 0.25s ease, color 0.25s ease;
}
.next-insight-card:hover .next-insight-cta {
    transform: translateX(4px);
    color: var(--insight-gold);
}

/* Chapter 2 (dignities): double concentric ring marker using existing gold token. */
.insight-chapter-block[data-chapter="dignities"] .insight-chapter-marker {
    box-shadow:
        inset 0 0 0 2px var(--insight-gold),
        inset 0 0 0 6px rgba(0, 0, 0, 0.35),
        inset 0 0 0 8px color-mix(in srgb, var(--insight-gold) 60%, transparent);
}

/* ============================================================
   REDESIGN 2026-04-21 — shared tokens for journey pages
   See docs/REDESIGN_SPEC.md for category palette + rationale.
   ============================================================ */

:root {
    --acc-transits: #ffd27a;
    --acc-progressions: #b894ff;
    --acc-returns: #c8a8ff;
    --acc-directions: #7ee0c0;
    --acc-synthesis: #ffc14d;
    --acc-psycho: #ff9ec4;
    --acc-oracle: #c8a8ff;
    --acc-electional: #ffd27a;
    --acc-composite: #ff9ec4;
}

/* ---- Page hero (used on /daily, /astrology/forecast, /astrology/portrait-diff, /oracle, /oracle/horary) ---- */
.page-hero {
    --hero-accent: var(--acc-progressions);
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "glyph body meta";
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    border-radius: 20px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--hero-accent) 18%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, rgba(124, 77, 255, 0.22), rgba(255, 215, 64, 0.08));
    border: 1px solid color-mix(in srgb, var(--hero-accent) 32%, rgba(124, 77, 255, 0.18));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--hero-accent) 14%, rgba(0,0,0,0.25));
    margin-bottom: 18px;
    animation: fadeInScale 0.45s ease-out;
}

.page-hero-glyph {
    grid-area: glyph;
    font-size: 2.4rem;
    line-height: 1;
    color: var(--hero-accent);
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--hero-accent) 55%, transparent));
}

.page-hero-body { grid-area: body; min-width: 0; }

.page-hero-kicker {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--hero-accent) 80%, #b8a8d8);
    opacity: 0.85;
    margin-bottom: 4px;
}

.page-hero-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 6px;
    line-height: 1.25;
}

.page-hero-subtitle {
    color: rgba(240, 232, 255, 0.82);
    font-size: 0.98rem;
    margin: 0 0 12px;
    line-height: 1.45;
}

.page-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-hero-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    color: #b8a8d8;
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .page-hero {
        grid-template-columns: auto 1fr;
        grid-template-areas: "glyph body" "meta meta";
        padding: 16px 16px;
        gap: 14px;
    }
    .page-hero-glyph { font-size: 2rem; }
    .page-hero-title { font-size: 1.35rem; }
    .page-hero-meta { align-items: flex-start; }
}

/* ---- Forecast journey grouping (tier-ordered rows inside tab) ---- */
.forecast-group {
    margin-bottom: 22px;
}

.forecast-group-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px 10px;
    color: #c8a8ff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.forecast-group-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.25) 0%, transparent 100%);
}

/* ---- Journey card (per-category accent stripe on left) ---- */
.journey-card {
    --jc-accent: var(--acc-progressions);
    position: relative;
    padding-left: 14px;
}

.journey-card::before {
    content: '';
    position: absolute;
    left: 0; top: 12px; bottom: 12px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--jc-accent) 90%, transparent) 0%,
        color-mix(in srgb, var(--jc-accent) 35%, transparent) 100%);
}

.journey-card[data-tab="transits"] { --jc-accent: var(--acc-transits); }
.journey-card[data-tab="progressions"] { --jc-accent: var(--acc-progressions); }
.journey-card[data-tab="returns"] { --jc-accent: var(--acc-returns); }
.journey-card[data-tab="directions"] { --jc-accent: var(--acc-directions); }
.journey-card[data-tab="synthesis"] { --jc-accent: var(--acc-synthesis); }

/* Locked = dimmed + lock glyph visible */
.journey-card.locked { opacity: 0.72; }
.journey-card.locked::before {
    background: linear-gradient(180deg, rgba(180,150,220,0.35), rgba(180,150,220,0.1));
}

/* ---- Pill tab nav override (soft on dark theme) ---- */
.forecast-page .mud-tabs-toolbar {
    background: transparent !important;
}
.forecast-page .mud-tab {
    color: #b8a8d8 !important;
    text-transform: none !important;
    font-weight: 500 !important;
}
.forecast-page .mud-tab.mud-tab-active {
    color: #f0e8ff !important;
    font-weight: 600 !important;
}
.forecast-page .mud-tabs-tabbar-inner .mud-tab-slider,
.forecast-page .mud-tabs-tabbar-inner .mud-tabs-tabbar-slider {
    background: linear-gradient(90deg, #c8a8ff, #ffd27a) !important;
    height: 2px !important;
    border-radius: 2px;
}

/* ---- Teaser (two-line ellipsis) ---- */
.journey-teaser {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(224, 216, 240, 0.78);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* ---- Journey card glyph (per-category accent) ---- */
.journey-card-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--jc-accent);
    background: color-mix(in srgb, var(--jc-accent) 12%, transparent);
    border-radius: 10px;
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--jc-accent) 45%, transparent));
}

/* ---- Grand synthesis hero card ---- */
.grand-synthesis-hero {
    position: relative;
    padding: 22px 24px;
    border-radius: 22px;
    background:
        radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--acc-synthesis) 22%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, rgba(255, 193, 77, 0.16), rgba(124, 77, 255, 0.18));
    border: 1px solid color-mix(in srgb, var(--acc-synthesis) 40%, rgba(124, 77, 255, 0.22));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 14px 48px color-mix(in srgb, var(--acc-synthesis) 18%, rgba(0,0,0,0.3));
    animation: fadeInScale 0.45s ease-out;
}
.grand-synthesis-hero.locked { opacity: 0.75; }
.grand-synthesis-hero::before { display: none; }

.grand-synthesis-glyph {
    font-size: 2.2rem;
    line-height: 1;
    color: var(--acc-synthesis);
    filter: drop-shadow(0 0 14px color-mix(in srgb, var(--acc-synthesis) 60%, transparent));
    flex-shrink: 0;
}

.grand-synthesis-kicker {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--acc-synthesis) 85%, #b8a8d8);
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .grand-synthesis-hero { padding: 18px 16px; }
    .grand-synthesis-glyph { font-size: 1.8rem; }
}

/* ---- Forecast empty state ---- */
.forecast-empty {
    text-align: center;
    padding: 36px 20px;
    color: #b8a8d8;
}
.forecast-empty-glyph {
    font-size: 2.4rem;
    line-height: 1;
    color: #c8a8ff;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(200, 168, 255, 0.4));
}

/* ---- Timeline event per-kind accent ---- */
.forecast-timeline-wrap { border-radius: 20px; }
.timeline-event {
    position: relative;
    padding: 10px 12px 10px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--acc-progressions) 6%, rgba(255,255,255,0.02));
    border-left: 3px solid var(--jc-accent, var(--acc-progressions));
}
.timeline-event[data-tab="transits"]    { --jc-accent: var(--acc-transits);    background: color-mix(in srgb, var(--acc-transits) 7%, rgba(255,255,255,0.02)); }
.timeline-event[data-tab="progressions"]{ --jc-accent: var(--acc-progressions);background: color-mix(in srgb, var(--acc-progressions) 7%, rgba(255,255,255,0.02)); }
.timeline-event[data-tab="returns"]     { --jc-accent: var(--acc-returns);     background: color-mix(in srgb, var(--acc-returns) 7%, rgba(255,255,255,0.02)); }
.timeline-event[data-tab="directions"]  { --jc-accent: var(--acc-directions);  background: color-mix(in srgb, var(--acc-directions) 7%, rgba(255,255,255,0.02)); }
.timeline-event[data-tab="synthesis"]   { --jc-accent: var(--acc-synthesis);   background: color-mix(in srgb, var(--acc-synthesis) 7%, rgba(255,255,255,0.02)); }

/* ============================================================
   Overflow safety net — catch grid-blowout where a long label
   pushes a flex/grid cell past its container on narrow screens.
   Caught by LayoutAuditTests at 375px.
   ============================================================ */

/* Home service tiles (xs=4 on mobile): long header caption must not blow the cell.
   Only the HEADER caption (inside the icon-row flex) truncates; body captions wrap. */
.svc-card { min-width: 0; overflow: hidden; }
.svc-card > .d-flex .mud-typography-caption {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
}
.svc-card .svc-card-body .mud-typography-caption,
.svc-card .svc-card-body .mud-typography {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
}

/* MudTabs scroll-safe (applies to every .mud-tabs, not just forecast):
   when the tab row is wider than its container, make it scroll instead of
   overflowing the page. Fixed for /astrology/forecast, /natal-chart, etc. */
.mud-tabs .mud-tabs-toolbar,
.mud-tabs .mud-tabs-tabbar-wrapper,
.mud-tabs .mud-tabs-tabbar-inner,
.mud-tabs .mud-tabs-tabbar {
    max-width: 100% !important;
    min-width: 0 !important;
}
.mud-tabs .mud-tabs-tabbar-wrapper {
    overflow-x: auto !important;
    scrollbar-width: thin;
}
.mud-tabs .mud-tabs-tabbar-wrapper::-webkit-scrollbar { height: 4px; }
.mud-tabs .mud-tabs-tabbar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.35);
    border-radius: 2px;
}

/* Generic page container: prevent silent horizontal scroll on any page. */
.page-content { max-width: 100%; }

/* Numerology Pythagorean grid: cell title must wrap, not overflow */
.cosmic-transit-card .mud-typography-caption {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
    display: block;
}

/* MudButton labels: wrap when the parent is narrower than the label */
.mud-button-root { max-width: 100%; }
.mud-button-label {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: keep-all;
}

/* Header-extras row (used on Tarot/Oracle): wrap controls on narrow screens */
.mud-card-header .d-flex.align-center,
.ms-auto.d-flex.align-center {
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 8px;
}

/* Global typography safety: caption/subtitle/body/h6 never force horizontal overflow */
.mud-typography-caption,
.mud-typography-subtitle1,
.mud-typography-subtitle2,
.mud-typography-body1,
.mud-typography-body2,
.mud-typography-h6 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}
/* ============================================================
   Forecast master-detail (2026-04-22)
   Desktop: 320px rail + fluid reader (+ optional 320px inspector on xl).
   Mobile/tablet: rail becomes horizontal tier-chip selector above reader.
   ============================================================ */

.forecast-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 4px;
}

@media (min-width: 1680px) {
    .forecast-layout { grid-template-columns: 300px minmax(0, 1fr) 300px; }
}

@media (max-width: 1023px) {
    .forecast-layout { grid-template-columns: 1fr; gap: 16px; }
}

/* ---- Rail (left nav) ---- */
.forecast-rail {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 77, 255, 0.35) transparent;
    animation: fadeInUp 300ms ease-out;
}
.forecast-rail::-webkit-scrollbar { width: 4px; }
.forecast-rail::-webkit-scrollbar-thumb { background: rgba(124, 77, 255, 0.35); border-radius: 2px; }
@media (max-width: 1023px) {
    .forecast-rail { position: static; max-height: none; overflow: visible; padding-right: 0; }
}

.rail-search {
    position: relative;
    margin-bottom: 14px;
}
.rail-search input {
    width: 100%;
    background: rgba(20, 24, 50, 0.6);
    border: 1px solid rgba(124, 77, 255, 0.18);
    border-radius: 10px;
    color: #f0e8ff;
    font: 400 14px/1.4 Inter, system-ui, sans-serif;
    padding: 9px 34px 9px 12px;
    outline: none;
    transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}
.rail-search input:focus {
    border-color: color-mix(in srgb, var(--acc-progressions) 50%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc-progressions) 18%, transparent);
}
.rail-search input::placeholder { color: rgba(184, 168, 216, 0.55); }
.rail-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font: 500 10px/1 Inter, system-ui, sans-serif;
    color: rgba(184, 168, 216, 0.6);
    background: rgba(124, 77, 255, 0.12);
    border: 1px solid rgba(124, 77, 255, 0.18);
    border-radius: 4px;
    padding: 3px 5px;
    pointer-events: none;
}

.rail-group { margin-bottom: 18px; }
.rail-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px 6px;
    font: 600 10px/1.2 Inter, system-ui, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(200, 168, 255, 0.75);
}
.rail-group-head .rail-group-count {
    margin-left: auto;
    color: rgba(184, 168, 216, 0.6);
    font-weight: 500;
}

.rail-beads {
    display: flex;
    gap: 4px;
    padding: 0 4px 8px;
}
.rail-bead {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(124, 77, 255, 0.12);
    transition: background 200ms ease-out;
}
.rail-bead.is-read { background: color-mix(in srgb, var(--jc-accent, #b894ff) 80%, transparent); }

.rail-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rail-item {
    --jc-accent: var(--acc-progressions);
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 10px 9px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(224, 216, 240, 0.82);
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: background 180ms ease-out, transform 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
    font-family: inherit;
    min-height: 44px;
}
.rail-item[data-tab="transits"]     { --jc-accent: var(--acc-transits); }
.rail-item[data-tab="progressions"] { --jc-accent: var(--acc-progressions); }
.rail-item[data-tab="returns"]      { --jc-accent: var(--acc-returns); }
.rail-item[data-tab="directions"]   { --jc-accent: var(--acc-directions); }
.rail-item[data-tab="synthesis"]    { --jc-accent: var(--acc-synthesis); }

.rail-item::before {
    content: '';
    position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: 3px;
    border-radius: 2px;
    background: var(--jc-accent);
    opacity: 0;
    transform: scaleY(0.4);
    transform-origin: center;
    transition: opacity 180ms ease-out, transform 220ms ease-out;
}

.rail-item:hover {
    background: color-mix(in srgb, var(--jc-accent) 6%, transparent);
    color: #f0e8ff;
    transform: translateX(2px);
}
.rail-item:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--jc-accent) 55%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--jc-accent) 20%, transparent);
}
.rail-item.is-active {
    background: color-mix(in srgb, var(--jc-accent) 12%, transparent);
    color: #f0e8ff;
    transform: translateX(3px);
}
.rail-item.is-active::before { opacity: 1; transform: scaleY(1); }

.rail-item-glyph {
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    color: var(--jc-accent);
    background: color-mix(in srgb, var(--jc-accent) 10%, transparent);
    border-radius: 8px;
    flex-shrink: 0;
}
.rail-item-title {
    font: 500 13.5px/1.35 Inter, system-ui, sans-serif;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rail-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 500 11px/1 Inter, system-ui, sans-serif;
    color: rgba(184, 168, 216, 0.7);
}
.rail-item-check {
    color: color-mix(in srgb, var(--jc-accent) 80%, transparent);
    font-size: 13px;
    line-height: 1;
}
.rail-item-lock {
    opacity: 0.6;
    font-size: 13px;
    line-height: 1;
}

.rail-item.is-locked { opacity: 0.65; }
.rail-item.is-locked .rail-item-glyph {
    background: rgba(184, 168, 216, 0.08);
    color: rgba(184, 168, 216, 0.55);
}

/* stagger entrance for list items on tab switch */
.rail-list .rail-item { animation: railItemIn 280ms ease-out backwards; }
.rail-list .rail-item:nth-child(1) { animation-delay: 0ms; }
.rail-list .rail-item:nth-child(2) { animation-delay: 25ms; }
.rail-list .rail-item:nth-child(3) { animation-delay: 50ms; }
.rail-list .rail-item:nth-child(4) { animation-delay: 75ms; }
.rail-list .rail-item:nth-child(5) { animation-delay: 100ms; }
.rail-list .rail-item:nth-child(6) { animation-delay: 125ms; }
.rail-list .rail-item:nth-child(7) { animation-delay: 150ms; }
.rail-list .rail-item:nth-child(8) { animation-delay: 175ms; }
.rail-list .rail-item:nth-child(n+9) { animation-delay: 200ms; }

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

/* ---- Reader (center pane) ---- */
.forecast-reader {
    min-width: 0;
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    animation: readerSwap 260ms ease-out;
}
@keyframes readerSwap {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reader-hero {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--jc-accent, #b894ff) 12%, rgba(20, 24, 50, 0.7)) 0%,
        rgba(20, 24, 50, 0.55) 100%);
    border: 1px solid color-mix(in srgb, var(--jc-accent, #b894ff) 22%, rgba(124, 77, 255, 0.18));
}
.reader-hero-glyph {
    width: 44px; height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--jc-accent, #b894ff);
    background: color-mix(in srgb, var(--jc-accent, #b894ff) 15%, transparent);
    border-radius: 12px;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--jc-accent, #b894ff) 35%, transparent));
}
.reader-hero-body { min-width: 0; }
.reader-hero-title {
    font: 600 18px/1.3 Inter, system-ui, sans-serif;
    color: #f0e8ff;
    margin: 0 0 4px;
}
.reader-hero-teaser {
    font: 400 13.5px/1.5 Inter, system-ui, sans-serif;
    color: rgba(224, 216, 240, 0.78);
    margin: 0;
    max-width: 680px;
}

.reader-body {
    background: rgba(20, 24, 50, 0.55);
    border: 1px solid rgba(124, 77, 255, 0.14);
    border-radius: 16px;
    padding: 22px 26px;
    min-height: 180px;
    backdrop-filter: blur(10px);
}
@media (max-width: 640px) {
    .reader-hero { grid-template-columns: 40px 1fr; padding: 14px 16px; gap: 12px; }
    .reader-hero > :nth-child(3) { grid-column: 1 / -1; margin-top: 4px; }
    .reader-body { padding: 18px 16px; }
}

.reader-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    padding: 0 4px;
}

.reader-meta-caption {
    font: 500 11.5px/1.4 Inter, system-ui, sans-serif;
    color: rgba(184, 168, 216, 0.65);
    margin-left: auto;
}

.reader-empty {
    padding: 48px 32px;
    text-align: center;
    background: rgba(20, 24, 50, 0.4);
    border: 1px dashed rgba(124, 77, 255, 0.22);
    border-radius: 20px;
    animation: readerSwap 260ms ease-out;
}
.reader-empty-glyph {
    font-size: 48px;
    line-height: 1;
    color: var(--jc-accent, #b894ff);
    filter: drop-shadow(0 0 18px color-mix(in srgb, var(--jc-accent, #b894ff) 40%, transparent));
    margin-bottom: 14px;
    animation: emptyPulse 3.2s ease-in-out infinite;
}
@keyframes emptyPulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.05); }
}
.reader-empty-title {
    font: 600 18px/1.3 Inter, system-ui, sans-serif;
    color: #f0e8ff;
    margin: 0 0 6px;
}
.reader-empty-subtitle {
    font: 400 14px/1.55 Inter, system-ui, sans-serif;
    color: rgba(224, 216, 240, 0.72);
    margin: 0 auto 18px;
    max-width: 440px;
}
.reader-empty-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.reader-empty-suggestion {
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.22);
    border-radius: 10px;
    padding: 10px 14px;
    color: #e0d0ff;
    cursor: pointer;
    font: 500 13px/1.35 Inter, system-ui, sans-serif;
    transition: background 180ms ease-out, border-color 180ms ease-out, transform 180ms ease-out;
}
.reader-empty-suggestion:hover {
    background: rgba(124, 77, 255, 0.18);
    border-color: rgba(124, 77, 255, 0.4);
    transform: translateY(-1px);
}

.forecast-inspector {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 18px 16px;
    background: rgba(20, 24, 50, 0.45);
    border: 1px solid rgba(124, 77, 255, 0.14);
    border-radius: 16px;
    font: 400 12.5px/1.5 Inter, system-ui, sans-serif;
    color: rgba(224, 216, 240, 0.72);
    animation: fadeInUp 360ms ease-out;
}
@media (max-width: 1679px) { .forecast-inspector { display: none; } }
.inspector-label {
    font: 600 10px/1.2 Inter, system-ui, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(200, 168, 255, 0.8);
    margin: 0 0 6px;
}
.inspector-section { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
    .forecast-reader,
    .reader-empty,
    .rail-list .rail-item,
    .forecast-rail,
    .forecast-inspector,
    .rail-item::before,
    .rail-item.is-active,
    .reader-empty-glyph { animation: none !important; transition: none !important; }
}

/* Page hero meta chips: never clip text */
.page-hero-meta .mud-chip-content,
.page-hero-meta .mud-chip {
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap;
}

/* Hero-meta chips tighter override — defeat MudBlazor chip-size-small clipping */
.page-hero-meta .mud-chip-container,
.page-hero-meta .mud-chip-container > .mud-chip,
.page-hero-meta .mud-chip,
.page-hero-meta .mud-chip .mud-chip-content {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    flex: 0 0 auto !important;
}

/* Native meta chip (replaces MudChip in page-hero-meta for reliable sizing) */
.meta-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font: 500 11.5px/1.4 Inter, system-ui, sans-serif;
    border: 1px solid rgba(124, 77, 255, 0.3);
    color: #e0d0ff;
    background: rgba(124, 77, 255, 0.08);
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.meta-chip-free    { border-color: rgba(126, 224, 192, 0.5); color: #7ee0c0; background: rgba(126, 224, 192, 0.08); }
.meta-chip-basic   { border-color: rgba(184, 148, 255, 0.5); color: #b894ff; background: rgba(184, 148, 255, 0.08); }
.meta-chip-premium { border-color: rgba(255, 210, 122, 0.5); color: #ffd27a; background: rgba(255, 210, 122, 0.08); }

/* Reader-hero tier chip: prevent inner-content clipping on mobile */
.reader-hero .mud-chip-container,
.reader-hero .mud-chip,
.reader-hero .mud-chip-content {
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
}
