/* ═══════════════════════════════════════════════════════════════════════════
   RITUAL CALENDAR PAGE STYLES
   DSP-07 Temporal Healing Engine Frontend
   ═══════════════════════════════════════════════════════════════════════════ */

/* Enable scrolling for this page */
body.ritual-calendar-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body.ritual-calendar-page #app {
    height: auto;
    min-height: 100vh;
}

/* Page Layout */
.ritual-calendar-page {
    background: linear-gradient(135deg, #0a0a12 0%, #12121a 50%, #0d1117 100%);
    min-height: 100vh;
}

.ritual-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
    padding-top: calc(60px + 1rem);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WEEKLY THEME BANNER
   ═══════════════════════════════════════════════════════════════════════════ */

.weekly-theme-banner {
    background: linear-gradient(135deg, rgba(100, 180, 160, 0.15) 0%, rgba(80, 140, 180, 0.1) 100%);
    border: 1px solid rgba(100, 180, 160, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.theme-content {
    flex: 1;
}

.theme-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(100, 180, 160, 0.8);
    margin-bottom: 0.5rem;
    display: block;
}

.theme-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.5rem 0;
}

.theme-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.theme-progress {
    flex-shrink: 0;
}

.progress-ring {
    width: 80px;
    height: 80px;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring .progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.progress-ring .progress-fill {
    fill: none;
    stroke: #64b4a0;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    font-weight: 600;
    color: #64b4a0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem;
    border-radius: 12px;
}

.ritual-tabs .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ritual-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.ritual-tabs .tab-btn.active {
    background: rgba(100, 180, 160, 0.15);
    color: #64b4a0;
}

.tab-icon {
    font-size: 1.1rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.title-icon {
    font-size: 1.2rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DAILY RITUAL CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.daily-ritual-card {
    background: linear-gradient(135deg, rgba(100, 140, 180, 0.08) 0%, rgba(80, 120, 160, 0.05) 100%);
    border-color: rgba(100, 140, 180, 0.2);
}

.ritual-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.ritual-info {
    flex: 1;
}

.ritual-companion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.companion-emoji {
    font-size: 1rem;
}

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

.ritual-name {
    font-size: 1.3rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.5rem 0;
}

.ritual-duration {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.ritual-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
}

.ritual-status .status-icon {
    color: var(--text-muted);
}

.ritual-status.completed .status-icon {
    color: #64b4a0;
}

.ritual-status .status-text {
    color: var(--text-secondary);
}

/* Ritual Phases */
.ritual-phases {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.phase-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.phase-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.phase-item.completed {
    border-color: rgba(100, 180, 160, 0.3);
}

.phase-number-badge {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.phase-item.completed .phase-number-badge {
    background: rgba(100, 180, 160, 0.2);
    color: #64b4a0;
}

.phase-item.completed .phase-number-badge::after {
    content: '✓';
}

.phase-details {
    flex: 1;
}

.phase-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.25rem 0;
}

.phase-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.phase-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Ritual Actions */
.ritual-actions {
    display: flex;
    gap: 1rem;
}

.ritual-start-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MICRO RITUALS
   ═══════════════════════════════════════════════════════════════════════════ */

.micro-ritual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.micro-ritual-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.micro-ritual-btn:hover {
    background: rgba(100, 180, 160, 0.1);
    border-color: rgba(100, 180, 160, 0.3);
    transform: translateY(-2px);
}

.micro-icon {
    font-size: 1.5rem;
}

.micro-name {
    font-size: 0.85rem;
    color: #e8e8e8;
    font-weight: 500;
}

.micro-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   REFLECTION CARD
   ═══════════════════════════════════════════════════════════════════════════ */

.reflection-prompt {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 3px solid rgba(100, 180, 160, 0.5);
}

.prompt-text {
    font-family: 'Crimson Pro', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
}

.reflection-input {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.reflection-input:focus {
    outline: none;
    border-color: rgba(100, 180, 160, 0.4);
}

.reflection-input::placeholder {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WEEKLY SCHEDULE
   ═══════════════════════════════════════════════════════════════════════════ */

.weekly-schedule {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.day-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.day-card.today {
    border-color: rgba(100, 180, 160, 0.5);
    background: rgba(100, 180, 160, 0.1);
}

.day-card.completed {
    background: rgba(100, 180, 160, 0.15);
}

.day-card.completed::after {
    content: '✓';
    display: block;
    color: #64b4a0;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.day-name {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8e8e8;
}

.day-type {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.day-card.today .day-number {
    color: #64b4a0;
}

/* Week Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.stat-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #64b4a0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Theme Selection */
.theme-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.theme-option.selected {
    border-color: rgba(100, 180, 160, 0.5);
    background: rgba(100, 180, 160, 0.1);
}

.theme-option-icon {
    font-size: 1.5rem;
}

.theme-option-info {
    flex: 1;
}

.theme-option-name {
    font-weight: 500;
    color: #e8e8e8;
    margin-bottom: 0.25rem;
}

.theme-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.theme-option-check {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-option.selected .theme-option-check {
    background: #64b4a0;
    border-color: #64b4a0;
}

.theme-option.selected .theme-option-check::after {
    content: '✓';
    color: #0a0a12;
    font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR (History)
   ═══════════════════════════════════════════════════════════════════════════ */

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

.calendar-month {
    font-size: 1.1rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0;
}

.calendar-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-day.today {
    border: 1px solid rgba(100, 180, 160, 0.5);
}

.calendar-day.completed {
    background: rgba(100, 180, 160, 0.2);
    color: #64b4a0;
}

.calendar-day.empty {
    opacity: 0;
    pointer-events: none;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.history-date {
    flex-shrink: 0;
    text-align: center;
    padding: 0.5rem;
    background: rgba(100, 180, 160, 0.1);
    border-radius: 8px;
    min-width: 50px;
}

.history-date-day {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #64b4a0;
}

.history-date-month {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.history-info {
    flex: 1;
}

.history-ritual-name {
    font-weight: 500;
    color: #e8e8e8;
    margin-bottom: 0.25rem;
}

.history-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RITUAL ACTIVE OVERLAY
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-active-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 18, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.ritual-active-overlay.active {
    display: flex;
}

.ritual-active-card {
    width: 100%;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(100, 140, 180, 0.1) 0%, rgba(80, 120, 160, 0.05) 100%);
    border: 1px solid rgba(100, 140, 180, 0.3);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
}

.ritual-active-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.active-companion {
    font-size: 2rem;
}

.active-ritual-name {
    font-size: 1.3rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0;
}

.close-ritual-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
}

.close-ritual-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6b6b;
}

.ritual-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.ritual-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #64b4a0, #508cb4);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.ritual-phase-display {
    margin-bottom: 2rem;
}

.phase-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.phase-name {
    font-size: 1.5rem;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0 0 0.75rem 0;
}

.phase-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    min-height: 60px;
}

.phase-timer {
    font-size: 3rem;
    font-weight: 300;
    color: #64b4a0;
    font-variant-numeric: tabular-nums;
}

.ritual-controls {
    display: flex;
    gap: 1rem;
}

.ritual-controls button {
    flex: 1;
}

/* Ritual Complete Screen */
.ritual-complete-screen {
    display: none;
}

.ritual-complete-screen.active {
    display: block;
}

.ritual-phase-display.hidden {
    display: none;
}

.ritual-controls.hidden {
    display: none;
}

.complete-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.ritual-complete-screen h3 {
    font-size: 1.5rem;
    color: #64b4a0;
    margin: 0 0 0.5rem 0;
}

.complete-message {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.mood-check {
    margin-bottom: 1.5rem;
}

.mood-check p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.mood-options {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.mood-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mood-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.mood-btn.selected {
    border-color: #64b4a0;
    background: rgba(100, 180, 160, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-primary {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #64b4a0 0%, #508cb4 100%);
    border: none;
    border-radius: 12px;
    color: #0a0a12;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 180, 160, 0.3);
}

.btn-secondary {
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #e8e8e8;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

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

@media (max-width: 768px) {
    .weekly-theme-banner {
        flex-direction: column;
        text-align: center;
    }

    .weekly-schedule {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.25rem;
    }

    .day-card {
        padding: 0.5rem;
    }

    .day-name {
        font-size: 0.6rem;
    }

    .day-number {
        font-size: 0.9rem;
    }

    .day-type {
        display: none;
    }

    .micro-ritual-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ritual-container {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
    }

    .ritual-tabs .tab-label {
        display: none;
    }

    .ritual-tabs .tab-btn {
        padding: 0.75rem;
    }

    .tab-icon {
        font-size: 1.3rem;
    }

    .ritual-active-card {
        padding: 1.5rem;
    }

    .phase-timer {
        font-size: 2.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   REDESIGN v2 — twin-evolution-style warm-gold dashboard
   All the rules below are appended intentionally so they override the
   earlier stylesheet without touching it. Same palette, same typographic
   approach as the twin page — so the two pages feel like siblings.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Full-viewport container, same as twin page ── */
.ritual-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1.5rem clamp(1rem, 4vw, 3rem);
    padding-top: 1.5rem;
}

@media (max-width: 900px) { .ritual-container { padding: 1rem 1.25rem; } }
@media (max-width: 600px) { .ritual-container { padding: 0.75rem; } }

/* ── Section rhythm ── */
.ritual-container > section:not(.tab-content) {
    padding: 2rem 0;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
}
.ritual-container > section:first-of-type,
.ritual-hero-grid + .ritual-tabs {
    border-top: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO GRID — Weekly Theme + Rhythm Story side-by-side on wide
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1000px) {
    .ritual-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 1.5rem;
    }
}

/* Weekly Theme — warm gold instead of teal */
.weekly-theme-banner {
    background:
        radial-gradient(ellipse at top right,
            rgba(196, 167, 125, 0.12) 0%,
            transparent 60%),
        var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.theme-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.theme-title {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: clamp(1.4rem, 2.3vw, 1.9rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    margin: 0 0 0.6rem;
}

.theme-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Progress ring — bigger, accent gold */
.progress-ring {
    width: 90px;
    height: 90px;
    position: relative;
    flex-shrink: 0;
}
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-bg {
    fill: none;
    stroke: rgba(255,255,255,0.06);
    stroke-width: 6;
}
.progress-fill {
    fill: none;
    stroke: var(--accent, #C4A77D);
    stroke-width: 6;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(196, 167, 125, 0.35));
    transition: stroke-dashoffset 0.8s cubic-bezier(.25,.1,.25,1);
}
.progress-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 0.95rem;
    color: var(--accent, #C4A77D);
    font-variant-numeric: tabular-nums;
}

/* Rhythm story — narrative card */
.rhythm-story .story-card {
    background:
        radial-gradient(ellipse at top left, rgba(196, 167, 125, 0.06), transparent 60%),
        var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}
.rhythm-story .story-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
        var(--accent, #C4A77D) 0%,
        rgba(196, 167, 125, 0.2) 100%);
}

.rhythm-story .story-text {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
}
.rhythm-story .story-text strong {
    font-weight: 500;
    color: var(--accent, #C4A77D);
}

.rhythm-story .story-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
}
.rhythm-story .story-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.rhythm-story .story-stat-value {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent, #C4A77D);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.rhythm-story .story-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABS — bigger, accent-gold active underline
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-tabs {
    display: flex;
    gap: 0;
    background: transparent;
    border-bottom: 1px solid var(--border-color, #3a3a42);
    margin: 1rem 0 1.5rem;
    padding: 0;
}

.ritual-tabs .tab-btn {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 0.85rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.ritual-tabs .tab-btn:hover {
    color: var(--text-primary);
}
.ritual-tabs .tab-btn.active {
    color: var(--accent, #C4A77D);
    border-bottom-color: var(--accent, #C4A77D);
}
.ritual-tabs .tab-btn .tab-icon {
    width: 18px; height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ritual-tabs .tab-btn .tab-icon svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS — unified aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-container .card {
    background: var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 14px;
    padding: 1.5rem;
    transition: border-color 0.15s;
}
.ritual-container .card:hover { border-color: rgba(196, 167, 125, 0.3); }

.ritual-container .card-title {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}
.ritual-container .card-title .title-icon { color: var(--accent, #C4A77D); }
.ritual-container .card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TODAY TAB — 2-column grid on wide
   ═══════════════════════════════════════════════════════════════════════════ */

.today-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1000px) {
    .today-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        column-gap: 1.5rem;
        align-items: start;
    }
    .today-secondary {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }
}

/* Daily ritual card — primary focus */
.daily-ritual-card {
    position: relative;
    overflow: hidden;
}

.ritual-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
}

.ritual-companion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 4px 10px;
    background: rgba(196, 167, 125, 0.12);
    border: 1px solid rgba(196, 167, 125, 0.25);
    border-radius: 999px;
    color: var(--accent, #C4A77D);
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}
.ritual-companion-badge [data-icon] svg { width: 14px; height: 14px; }

.ritual-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 400;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
    letter-spacing: 0.005em;
}

.ritual-duration {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}
.duration-icon [data-icon], .duration-icon {
    display: inline-flex;
    align-items: center;
}
.ritual-duration [data-icon] svg { width: 14px; height: 14px; }

.ritual-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 12px;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.status-icon { color: var(--text-muted); }

/* Ritual phases */
.ritual-phases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.ritual-phases .phase-card {
    padding: 1rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
}
.ritual-phases .phase-card .phase-number {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent, #C4A77D);
    font-weight: 600;
}
.ritual-phases .phase-card .phase-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0.25rem 0;
}
.ritual-phases .phase-card .phase-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ritual-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 1rem;
}

.btn-primary.ritual-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent, #C4A77D);
    color: var(--bg-dark, #0a0a0f);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.2s;
}
.btn-primary.ritual-start-btn:hover {
    background: var(--accent-gold, #D4B896);
    transform: translateY(-1px);
}
.btn-primary.ritual-start-btn [data-icon] svg { width: 14px; height: 14px; }

/* Quick grounding / micro-rituals */
.micro-rituals-card .micro-ritual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}
.micro-ritual-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.85rem 0.9rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
    text-align: left;
    font-family: inherit;
}
.micro-ritual-btn:hover {
    border-color: var(--accent, #C4A77D);
    transform: translateY(-2px);
    background: rgba(196, 167, 125, 0.05);
}
.micro-icon {
    color: var(--accent, #C4A77D);
    display: inline-flex;
}
.micro-icon svg { width: 18px; height: 18px; }
.micro-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 0.95rem;
    color: var(--text-primary);
}
.micro-duration {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* Reflection card */
.reflection-card .reflection-prompt {
    padding: 0.9rem 1rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border-left: 2px solid var(--accent, #C4A77D);
    border-radius: 6px;
    margin-bottom: 0.9rem;
}
.reflection-card .reflection-prompt .prompt-text {
    margin: 0;
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-style: italic;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}
.reflection-input {
    width: 100%;
    min-height: 90px;
    padding: 0.75rem 0.9rem;
    background: var(--bg-dark, #0a0a0f);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.15s;
}
.reflection-input:focus {
    outline: none;
    border-color: var(--accent, #C4A77D);
}
.btn-secondary.save-reflection-btn {
    margin-top: 0.75rem;
    padding: 0.6rem 1.25rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-secondary.save-reflection-btn:hover {
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border-color: var(--accent, #C4A77D);
    color: var(--accent, #C4A77D);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WEEK TAB — 7-day timeline + bottom dashboard grid
   ═══════════════════════════════════════════════════════════════════════════ */

.weekly-schedule {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 2rem 0 1rem;
    margin-bottom: 1.25rem;
    background: var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 14px;
    padding: 1.5rem 1rem;
    overflow-x: auto;
}

.weekly-schedule .day-card {
    flex: 1 1 0;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 0.25rem;
    text-align: center;
}

.weekly-schedule .day-card::after {
    content: '';
    position: absolute;
    top: calc(0.5rem + 18px);
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--border-color, #3a3a42);
    z-index: 0;
}
.weekly-schedule .day-card:last-child::after { display: none; }
.weekly-schedule .day-card.completed::after { background: var(--accent, #C4A77D); }
.weekly-schedule .day-card.today::after {
    background: linear-gradient(to right,
        var(--accent, #C4A77D) 0%,
        var(--accent, #C4A77D) 50%,
        var(--border-color, #3a3a42) 50%, 100%);
}

.weekly-schedule .day-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.weekly-schedule .day-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 2px solid var(--border-color, #3a3a42);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.weekly-schedule .day-card.completed .day-dot {
    background: rgba(196, 167, 125, 0.12);
    border-color: var(--accent, #C4A77D);
    color: var(--accent, #C4A77D);
}
.weekly-schedule .day-card.today .day-dot {
    background: var(--accent, #C4A77D);
    border-color: var(--accent, #C4A77D);
    color: var(--bg-dark, #0a0a0f);
    box-shadow: 0 0 0 4px rgba(196, 167, 125, 0.18);
}
.weekly-schedule .day-dot svg { width: 16px; height: 16px; }

.weekly-schedule .day-ritual {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 0.25rem;
}

/* Week bottom grid: Stats + Focus Area side-by-side */
.week-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 800px) {
    .week-bottom-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Stats grid inside card */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
}
.stat-value {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--accent, #C4A77D);
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Theme options */
.theme-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.theme-option:hover, .theme-option.selected {
    border-color: var(--accent, #C4A77D);
    background: rgba(196, 167, 125, 0.05);
}
.theme-option .theme-option-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    color: var(--text-primary);
    font-size: 0.95rem;
}
.theme-option .theme-option-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY TAB — 2-col calendar + recent list
   ═══════════════════════════════════════════════════════════════════════════ */

.history-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 1000px) {
    .history-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.calendar-card .calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--border-color, #3a3a42);
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.calendar-nav-btn:hover { border-color: var(--accent, #C4A77D); color: var(--accent, #C4A77D); }
.calendar-month {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-elevated, rgba(255,255,255,0.02));
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
.calendar-day.completed {
    background: rgba(196, 167, 125, 0.15);
    color: var(--accent, #C4A77D);
    font-weight: 600;
}
.calendar-day.today {
    border-color: var(--accent, #C4A77D);
}
.calendar-day.empty { background: transparent; color: var(--text-muted); opacity: 0.3; }

.history-list-card .history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 480px;
    overflow-y: auto;
}
.history-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
}
.history-item .history-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(196, 167, 125, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.history-item .history-icon svg { width: 16px; height: 16px; color: var(--accent); }
.history-item .history-title {
    font-family: var(--font-display, 'Crimson Pro', serif);
    color: var(--text-primary);
    font-size: 0.95rem;
}
.history-item .history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.history-item .history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACTIVE RITUAL OVERLAY — modal polish
   ═══════════════════════════════════════════════════════════════════════════ */

.ritual-active-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.ritual-active-overlay.active { display: flex; }

.ritual-active-card {
    background: var(--bg-card, #12121a);
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ritual-active-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.active-companion {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(196, 167, 125, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #C4A77D);
}
.active-companion svg { width: 22px; height: 22px; }
.active-ritual-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}
.close-ritual-btn {
    background: transparent;
    border: 1px solid var(--border-color, #3a3a42);
    color: var(--text-secondary);
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
}
.close-ritual-btn:hover { border-color: var(--accent, #C4A77D); color: var(--accent, #C4A77D); }
.close-ritual-btn svg { width: 16px; height: 16px; }

.ritual-progress-bar {
    height: 6px;
    background: var(--border-subtle, rgba(255,255,255,0.06));
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.ritual-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent, #C4A77D), var(--accent-gold, #D4B896));
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 8px rgba(196, 167, 125, 0.4);
}

.ritual-phase-display {
    text-align: center;
    padding: 1rem 0 1.5rem;
}
.phase-number {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent, #C4A77D);
    font-weight: 600;
}
.phase-name {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0.5rem 0 0.75rem;
}
.phase-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 1.25rem;
}
.phase-timer {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 2.5rem;
    color: var(--accent, #C4A77D);
    font-weight: 300;
    font-variant-numeric: tabular-nums;
}

.ritual-controls {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}
.ritual-controls .btn-primary,
.ritual-controls .btn-secondary {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}
.ritual-controls .btn-primary {
    background: var(--accent, #C4A77D);
    color: var(--bg-dark, #0a0a0f);
    border: 1px solid var(--accent, #C4A77D);
}
.ritual-controls .btn-primary:hover { background: var(--accent-gold, #D4B896); }
.ritual-controls .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color, #3a3a42);
}
.ritual-controls .btn-secondary:hover {
    border-color: var(--accent, #C4A77D);
    color: var(--accent, #C4A77D);
}

.ritual-complete-screen {
    display: none;
    text-align: center;
}
.ritual-complete-screen.visible { display: block; }
.complete-icon {
    width: 48px; height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(196, 167, 125, 0.12);
    color: var(--accent, #C4A77D);
    margin-bottom: 1rem;
}
.complete-icon svg { width: 28px; height: 28px; }

.mood-check {
    margin: 1.5rem 0;
}
.mood-check p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}
.mood-options {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.mood-btn {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.3rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-width: 60px;
}
.mood-btn:hover, .mood-btn.selected {
    border-color: var(--accent, #C4A77D);
    background: rgba(196, 167, 125, 0.06);
}
.mood-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
}
.mood-btn[data-mood="1"] .mood-dot { background: #7a5b5b; }
.mood-btn[data-mood="2"] .mood-dot { background: #8b7355; }
.mood-btn[data-mood="3"] .mood-dot { background: #87a889; }
.mood-btn[data-mood="4"] .mood-dot { background: #c4a77d; }
.mood-btn[data-mood="5"] .mood-dot { background: #d4b896; box-shadow: 0 0 8px rgba(196, 167, 125, 0.5); }
.mood-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* Stacked animations — cards fade-in on load */
@media (prefers-reduced-motion: no-preference) {
    .weekly-theme-banner,
    .rhythm-story .story-card,
    .today-grid > *,
    .today-secondary > *,
    .week-bottom-grid > *,
    .history-grid > *,
    .weekly-schedule {
        opacity: 0;
        transform: translateY(12px);
        animation: ritual-card-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }
    .rhythm-story .story-card { animation-delay: 0.08s; }
    .today-grid > *:nth-child(2) { animation-delay: 0.12s; }
    .today-secondary > *:nth-child(2) { animation-delay: 0.18s; }

    @keyframes ritual-card-in {
        to { opacity: 1; transform: translateY(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR FIX — 7-col grid including weekday headers
   The renderer emits 7 weekday-header spans + day spans all inside
   #calendarGrid. Earlier rules assumed two nested divs, which left the
   layout stacked as text. Force a proper grid on the container.
   ═══════════════════════════════════════════════════════════════════════════ */

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-grid .calendar-day {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-elevated, rgba(255,255,255,0.02));
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.calendar-grid .calendar-header-cell {
    aspect-ratio: auto;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    padding: 0.4rem 0;
}

.calendar-grid .calendar-day.empty {
    background: transparent;
    color: transparent;
    pointer-events: none;
}

.calendar-grid .calendar-day.past {
    color: var(--text-muted);
}

.calendar-grid .calendar-day.completed {
    background: rgba(196, 167, 125, 0.15);
    color: var(--accent, #C4A77D);
    font-weight: 600;
    border-color: rgba(196, 167, 125, 0.3);
}

.calendar-grid .calendar-day.today {
    border-color: var(--accent, #C4A77D);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(196, 167, 125, 0.15);
}

/* Completions list item row layout (renderHistoryList emits this shape) */
.history-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 10px;
    transition: border-color 0.15s;
}
.history-item:hover { border-color: var(--accent, #C4A77D); }

.history-item .history-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(196, 167, 125, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, #C4A77D);
}
.history-item .history-icon svg { width: 16px; height: 16px; }

.history-item .history-title {
    font-family: var(--font-display, 'Crimson Pro', serif);
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.3;
}
.history-item .history-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.history-item .history-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WEEK SCHEDULE: drop the connecting rail
   The Evolution Journey rail doesn't translate well here — weekdays
   aren't a progression, they're peers. Remove the rail so the row
   reads as a neat strip of day cards instead of a timeline.
   ═══════════════════════════════════════════════════════════════════════════ */

.weekly-schedule .day-card::after {
    content: none !important;
}

.weekly-schedule {
    gap: 0.6rem;
    padding: 1.5rem;
}

.weekly-schedule .day-card {
    min-width: 90px;
    padding: 0.75rem 0.5rem;
    background: var(--bg-elevated, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, #3a3a42);
    border-radius: 12px;
    transition: border-color 0.15s, background 0.15s;
}
.weekly-schedule .day-card.completed {
    background: rgba(196, 167, 125, 0.08);
    border-color: rgba(196, 167, 125, 0.3);
}
.weekly-schedule .day-card.today {
    background: rgba(196, 167, 125, 0.14);
    border-color: var(--accent, #C4A77D);
    box-shadow: 0 0 0 3px rgba(196, 167, 125, 0.12);
}
.weekly-schedule .day-card.future { opacity: 0.65; }
