@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700&display=swap');

/* ============================================================
   LIGHT Companion - Design System
   Calming, minimal, RTL mobile-first
   ============================================================ */

:root {
    /* Calming palette */
    --cream: #FFF8F0;
    --cream-dark: #F5EDDF;
    --soft-green: #A8D5BA;
    --soft-green-dark: #8BC4A4;
    --warm-peach: #F5C7A1;
    --warm-peach-dark: #EDB07A;
    --muted-teal: #7EBFB5;
    --muted-teal-dark: #5EA99E;
    --soft-lavender: #D4C5E2;
    --soft-lavender-dark: #BBA8D4;
    --warm-rose: #E8B4B8;
    --text-primary: #3D3D3D;
    --text-secondary: #6B6B6B;
    --text-light: #8A8A8A;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.10);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50%;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--cream);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ── App Container ── */
#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--cream);
}

/* ── Views ── */
.view {
    display: none;
    padding: 24px 20px 100px;
    animation: fadeIn 0.35s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ── */
.app-header {
    text-align: center;
    padding: 32px 0 8px;
}

.app-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* ── Main Question ── */
.main-question {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    margin: 24px 0 20px;
}

/* ── Situation Grid & Category Grid ── */
.situation-grid,
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.category-description {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 0 10px;
}

.situation-btn {
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}

.situation-btn:hover,
.situation-btn:focus {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--soft-green);
}

.situation-btn:active {
    transform: scale(0.97);
}

.situation-btn .icon {
    font-size: 2.2rem;
    line-height: 1;
}

.situation-btn .label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Parent Emergency Button ── */
.emergency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--soft-lavender), var(--warm-rose));
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Heebo', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: 28px;
}

.emergency-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.emergency-btn:active {
    transform: scale(0.97);
}

/* ── Main Child Emergency Button ── */
.main-child-emergency-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 22px;
    background: linear-gradient(135deg, #FFEBEB, #FFD6D6);
    color: #D32F2F;
    border: 2px solid #FFC2C2;
    border-radius: var(--radius-md);
    font-family: 'Heebo', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    margin-bottom: 24px;
}

.main-child-emergency-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #FFDFDF, #FFCBCB);
}

.main-child-emergency-btn:active {
    transform: scale(0.96);
}

/* ── Daily Tip Card ── */
.daily-tip-card {
    background: linear-gradient(135deg, var(--muted-teal), var(--soft-green));
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--white);
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
}

.daily-tip-card .tip-header {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.daily-tip-card .tip-sentence {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 14px;
}

.daily-tip-card .tip-example {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.92;
    margin-bottom: 10px;
}

.daily-tip-card .tip-practice {
    font-size: 0.85rem;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

/* ── Bottom Navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
    z-index: 100;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 12px;
    color: var(--text-light);
    transition: var(--transition);
    font-family: 'Heebo', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
    color: var(--muted-teal-dark);
}

.nav-tab .nav-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.nav-tab .nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* ── Guidance View ── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    font-family: 'Heebo', sans-serif;
    font-size: 0.95rem;
    color: var(--muted-teal-dark);
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 8px;
    font-weight: 500;
}

.guidance-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.guidance-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s ease both;
}

.guidance-card:nth-child(2) {
    animation-delay: 0.05s;
}

.guidance-card:nth-child(3) {
    animation-delay: 0.10s;
}

.guidance-card:nth-child(4) {
    animation-delay: 0.15s;
}

.guidance-card:nth-child(5) {
    animation-delay: 0.20s;
}

.guidance-card:nth-child(6) {
    animation-delay: 0.25s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
    display: block;
}

.card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-primary);
}

.dynamic-phrase {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    font-style: italic;
    color: var(--muted-teal-dark);
    margin-top: 8px;
    background: rgba(126, 191, 181, 0.1);
    padding: 10px 14px;
    border-right: 4px solid var(--muted-teal);
    border-radius: var(--radius-sm);
}

.card-list {
    list-style: none;
    padding: 0;
}

.card-list li {
    font-size: 0.95rem;
    line-height: 1.65;
    padding: 3px 0;
    padding-right: 18px;
    position: relative;
}

.card-list li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--muted-teal);
    font-weight: 700;
}

/* Card color accents */
.guidance-card.what-happens {
    border-right: 4px solid var(--muted-teal);
}

.guidance-card.what-to-say {
    border-right: 4px solid var(--soft-green);
}

.guidance-card.dont-do {
    border-right: 4px solid var(--warm-peach-dark);
}

.guidance-card.do-do {
    border-right: 4px solid var(--soft-green-dark);
}

.guidance-card.parent-reminder {
    border-right: 4px solid var(--soft-lavender);
}

/* ── Action Buttons ── */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: 'Heebo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 10px;
    border: none;
}

.action-btn.primary {
    background: var(--muted-teal);
    color: var(--white);
}

.action-btn.secondary {
    background: var(--cream-dark);
    color: var(--text-primary);
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-btn:active {
    transform: scale(0.98);
}

/* ── Star Button ── */
.star-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    position: absolute;
    left: 12px;
    top: 12px;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.saved {
    color: #F5C518;
}

/* ── Emergency Screen ── */
.emergency-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
    padding: 40px 24px;
}

.breathing-circle {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--soft-lavender), var(--muted-teal));
    animation: breathe 8s ease-in-out infinite;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(126, 191, 181, 0.3);
}

.breathing-text {
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.85;
    }

    25% {
        transform: scale(1.25);
        opacity: 1;
    }

    50% {
        transform: scale(1);
        opacity: 0.85;
    }

    75% {
        transform: scale(1.25);
        opacity: 1;
    }
}


.emergency-message {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.emergency-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ── Learning Section ── */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.module-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 14px;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.module-card:active {
    transform: scale(0.98);
}

.module-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
}

.module-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.module-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Progress Bar ── */
.progress-container {
    margin-top: 8px;
}

.progress-bar {
    height: 6px;
    background: var(--cream-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--soft-green), var(--muted-teal));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── Lesson Card ── */
.lesson-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lesson-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.lesson-item .lesson-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.lesson-item .lesson-status {
    font-size: 1.2rem;
    color: var(--text-light);
}

.lesson-item.completed .lesson-status {
    color: var(--soft-green-dark);
}

/* ── Lesson Detail ── */
.lesson-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.lesson-section-icon {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.lesson-section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.lesson-section-text {
    font-size: 0.95rem;
    line-height: 1.65;
}

.lesson-section.core-idea {
    border-right: 4px solid var(--muted-teal);
}

.lesson-section.life-example {
    border-right: 4px solid var(--warm-peach);
}

.lesson-section.dont-do {
    border-right: 4px solid var(--warm-peach-dark);
}

.lesson-section.do-do {
    border-right: 4px solid var(--soft-green-dark);
}

.lesson-section.practice {
    border-right: 4px solid var(--soft-lavender);
}

/* ── Personal Area ── */
.personal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.personal-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: none;
    border: none;
    font-family: 'Heebo', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.personal-tab.active {
    background: var(--white);
    color: var(--muted-teal-dark);
    box-shadow: var(--shadow-sm);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state .empty-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Share Modal ── */
.share-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.share-modal-overlay.show {
    display: flex;
}

.share-modal {
    background: var(--white);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    animation: slideModalUp 0.3s ease;
}

@keyframes slideModalUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.share-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
    color: var(--text-primary);
}

.share-option .share-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: var(--transition);
}

.share-option:hover .share-icon {
    transform: scale(1.1);
}

.share-option .share-icon.whatsapp {
    background: #25D366;
    color: white;
}

.share-option .share-icon.sms {
    background: var(--muted-teal);
    color: white;
}

.share-option .share-icon.copy {
    background: var(--cream-dark);
    color: var(--text-primary);
}

.share-option .share-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ── Reinforcement Toast ── */
.reinforcement-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--muted-teal-dark);
    color: var(--white);
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-lg);
    z-index: 150;
    opacity: 0;
    transition: all 0.4s ease;
    max-width: 90%;
    pointer-events: none;
}

.reinforcement-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Utility ── */
.text-center {
    text-align: center;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.relative {
    position: relative;
}

/* ── Responsive ── */
@media (min-width: 481px) {
    .situation-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Copied toast ── */
.copied-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--soft-green-dark);
    color: var(--white);
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.copied-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Intro & End Screens ── */
.intro-screen,
.end-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 0 24px;
    animation: fadeIn 0.8s ease;
}

.intro-logo {
    width: min(280px, 80%);
    height: auto;
    object-fit: contain;
    margin-bottom: 32px;
}

.intro-title,
.end-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.3;
}

.intro-text,
.end-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.end-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ── Guidance Wizard Navigation ── */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    padding: 0 10px;
}

.wizard-nav::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--cream-dark);
    z-index: 0;
}

.wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--white);
    border: 3px solid var(--cream-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-light);
    z-index: 1;
    transition: var(--transition);
}

.wizard-step-circle.active {
    background: var(--muted-teal);
    border-color: var(--white);
    color: var(--white);
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.wizard-step-circle.completed {
    background: var(--soft-green);
    border-color: var(--white);
    color: var(--white);
}

.wizard-stage-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--muted-teal-dark);
    margin-bottom: 12px;
}

.wizard-explanation {
    background: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    border-right: 4px solid var(--muted-teal);
}

.wizard-footer {
    animation: slideUp 0.4s ease both;
    animation-delay: 0.1s;
    margin-top: 24px;
}

/* ═══════════════════════════════════════════
   COMMERCIAL ENHANCEMENTS
   ═══════════════════════════════════════════ */

/* ── Header with Settings Button ── */
.app-header {
    position: relative;
}

.header-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
}

.header-btn:hover {
    background: var(--cream-dark);
    color: var(--muted-teal-dark);
}

#search-btn {
    left: 40px;
}

/* ── Greeting Strip ── */
.greeting-strip {
    text-align: center;
    padding: 8px 0 4px;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    animation: fadeIn 0.6s ease;
}

.greeting-strip strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Stats Strip ── */
.stats-strip {
    display: flex;
    gap: 10px;
    margin: 12px 0 20px;
    justify-content: center;
}

.stat-pill {
    background: var(--white);
    border-radius: 999px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.stat-pill:hover {
    box-shadow: var(--shadow-md);
}

.stat-pill .stat-icon {
    font-size: 1rem;
}

.stat-pill .stat-value {
    font-weight: 700;
    color: var(--muted-teal-dark);
}

/* ── Onboarding ── */
.onboarding-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 24px;
    animation: fadeIn 0.5s ease;
}

.onboarding-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.onboarding-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    text-align: center;
    line-height: 1.5;
}

.profile-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-bottom: 24px;
}

.profile-card {
    background: var(--white);
    border: 2.5px solid transparent;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    text-align: right;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--muted-teal);
}

.profile-card.selected {
    border-color: var(--muted-teal-dark);
    background: rgba(126, 191, 181, 0.08);
}

.profile-card-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.profile-card-info {
    flex: 1;
}

.profile-card-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.profile-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Settings ── */
.settings-section {
    margin-bottom: 28px;
}

.settings-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.settings-item {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}

.settings-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.settings-item:active {
    transform: scale(0.98);
}

.settings-item-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.settings-item-content {
    flex: 1;
}

.settings-item-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.settings-item-arrow {
    color: var(--text-light);
    font-size: 1rem;
}

.settings-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(126, 191, 181, 0.15);
    color: var(--muted-teal-dark);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Quick Reference ── */
.quick-ref-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quick-ref-card {
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s ease both;
}

/* Situation-Aware Quick Card */
.quick-ref-situation-title {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}
.quick-ref-situation {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.qr-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    border-right: 4px solid var(--muted-teal);
    box-shadow: var(--shadow-sm);
}
.qr-section-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.qr-section-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 4px;
}

.quick-ref-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.quick-ref-letter {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.quick-ref-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.quick-ref-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-ref-col-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-ref-list {
    list-style: none;
    padding: 0;
}

.quick-ref-list li {
    font-size: 0.88rem;
    padding: 3px 0 3px 0;
    color: var(--text-primary);
    line-height: 1.4;
    padding-right: 14px;
    position: relative;
}

.quick-ref-list li::before {
    content: '·';
    position: absolute;
    right: 0;
    font-weight: 700;
    color: var(--text-light);
}

.quick-ref-list.avoid li::before {
    content: '✕';
    font-size: 0.7rem;
    color: #e06060;
}

/* ── Glossary ── */
.glossary-entry {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    animation: slideUp 0.4s ease both;
}

.glossary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.glossary-letter-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.glossary-term {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.glossary-definition {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.glossary-example {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 10px 14px;
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    line-height: 1.5;
}

.glossary-tip {
    font-size: 0.82rem;
    color: var(--muted-teal-dark);
    font-weight: 500;
}

/* ── Learn View Category Entries ── */
.learn-feature-entry {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 14px;
}

.learn-feature-entry:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ── Journal ── */
.journal-entry {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border-right: 4px solid var(--cream-dark);
}

.journal-entry:hover {
    box-shadow: var(--shadow-md);
}

.journal-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.journal-entry-date {
    font-size: 0.78rem;
    color: var(--text-light);
}

.journal-rating {
    display: flex;
    gap: 2px;
    font-size: 0.85rem;
}

.journal-entry-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.journal-entry-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Journal Form */
.journal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.journal-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.journal-field input,
.journal-field textarea {
    width: 100%;
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: 'Heebo', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    resize: none;
    direction: rtl;
}

.journal-field input:focus,
.journal-field textarea:focus {
    outline: none;
    border-color: var(--muted-teal);
    box-shadow: 0 0 0 3px rgba(126, 191, 181, 0.15);
}

.rating-selector {
    display: flex;
    gap: 10px;
}

.rating-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Heebo', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.rating-btn:hover {
    border-color: var(--muted-teal);
}

.rating-btn.selected {
    border-color: var(--muted-teal-dark);
    background: rgba(126, 191, 181, 0.1);
    color: var(--muted-teal-dark);
}

/* ── Search Overlay ── */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--cream);
    z-index: 200;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.search-overlay.show {
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-md);
    padding: 12px 40px 12px 14px;
    font-family: 'Heebo', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    direction: rtl;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--muted-teal);
}

.search-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-light);
    pointer-events: none;
}

.search-cancel {
    background: none;
    border: none;
    font-family: 'Heebo', sans-serif;
    font-size: 0.95rem;
    color: var(--muted-teal-dark);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px;
}

.search-results {
    flex: 1;
    overflow-y: auto;
}

.search-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 4px;
    margin-bottom: 4px;
}

.search-result-item {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-item:hover {
    box-shadow: var(--shadow-md);
}

.search-result-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.search-result-type {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

.search-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ── About ── */
.about-hero {
    text-align: center;
    padding: 24px 0 32px;
}

.about-logo {
    width: min(240px, 70%);
    height: auto;
    object-fit: contain;
    margin-bottom: 8px;
}

.about-tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

.about-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.about-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--muted-teal-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.about-section-text {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.about-version {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-light);
    padding: 16px 0 8px;
}

/* ── Category Color Accents ── */
.cat-overwhelm { border-color: #E8A0A0 !important; }
.cat-anxiety    { border-color: #BBA8D4 !important; }
.cat-transitions{ border-color: #F5C7A1 !important; }
.cat-frustration{ border-color: #F5A67A !important; }
.cat-sensory    { border-color: #7EBFB5 !important; }
.cat-sleep      { border-color: #A8D5BA !important; }

/* ── Guidance Card Accents by Stage ── */
.guidance-card.listen-card  { border-right: 4px solid var(--muted-teal); }
.guidance-card.interpret-card { border-right: 4px solid var(--soft-lavender-dark); }
.guidance-card.givevoice-card { border-right: 4px solid var(--soft-green-dark); }
.guidance-card.hold-card    { border-right: 4px solid var(--warm-peach-dark); }
.guidance-card.trust-card   { border-right: 4px solid var(--warm-rose); }

/* ── Auth Landing Gate ── */
.auth-landing {
    text-align: center;
    padding: 32px 16px 8px;
}

.auth-landing .intro-logo {
    max-width: 220px;
    margin-bottom: 16px;
}

.auth-landing-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ── Auth Form ── */
.auth-field {
    margin-bottom: 14px;
}

.auth-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: 'Heebo', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--muted-teal);
    box-shadow: 0 0 0 3px rgba(126, 191, 181, 0.15);
}

.auth-field input[dir="ltr"] {
    text-align: left;
}

/* ── Gender Selection Popup ── */
.gender-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: genderFadeIn 0.3s ease;
}
.gender-popup-overlay.gender-popup-closing {
    animation: genderFadeOut 0.3s ease forwards;
}
@keyframes genderFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes genderFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.gender-popup {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.gender-popup-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}
.gender-popup-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.gender-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-md);
    background: var(--cream);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: right;
}
.gender-card:hover, .gender-card:focus {
    border-color: var(--muted-teal);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
.gender-card:active {
    transform: scale(0.97);
}
.gender-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}
.gender-card-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}
.gender-card-example {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* ── Gender Setting in Settings Page ── */
.gender-setting-options {
    display: flex;
    gap: 8px;
}
.gender-setting-btn {
    flex: 1;
    padding: 10px 6px;
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    background: var(--cream);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: center;
}
.gender-setting-btn:hover {
    border-color: var(--muted-teal);
}
.gender-setting-btn.active {
    border-color: var(--muted-teal);
    background: var(--muted-teal);
    color: var(--white);
    font-weight: 700;
}

/* ═══════ CHILD PROFILE MODE BUTTONS ═══════ */
.child-mode-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.child-mode-btn {
    padding: 12px 16px;
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    background: var(--cream);
    cursor: pointer;
    font-family: inherit;
    text-align: right;
    transition: all 0.2s ease;
}
.child-mode-btn:hover {
    border-color: var(--muted-teal);
}
.child-mode-btn.active {
    border-color: var(--muted-teal);
    background: rgba(126, 191, 181, 0.12);
    box-shadow: 0 0 0 1px var(--muted-teal);
}

/* ═══════ UNIFIED FLOW ENGINE ═══════ */

/* Mode Selection */
.flow-mode-select {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 0;
}
.mode-select-card {
    padding: 28px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
}
.mode-select-card:active {
    transform: scale(0.97);
}
#mode-fast {
    background: linear-gradient(135deg, #fff0ec, #ffe4dd);
    border-color: var(--warm-peach);
}
#mode-deep {
    background: linear-gradient(135deg, #eef7f5, #ddf0ec);
    border-color: var(--muted-teal);
}
.mode-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
}
.mode-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.mode-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Sticky Flow Header */
.flow-sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--cream);
    padding: 12px 20px 4px;
    margin: -24px -20px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Progress Bar */
.flow-progress-bar {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
    padding: 4px 0 8px;
    direction: ltr;
}
.flow-step-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    width: 44px;
    padding: 6px 2px 4px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg-soft);
    transition: all 0.2s ease;
}
.flow-step-circle.active {
    background: var(--muted-teal);
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(126, 191, 181, 0.35);
}
.flow-step-circle.completed {
    background: rgba(126, 191, 181, 0.2);
    color: var(--muted-teal-dark);
}
.flow-step-letter {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
}
.flow-step-label {
    font-size: 0.55rem;
    font-weight: 500;
    direction: rtl;
    line-height: 1;
    white-space: nowrap;
}
.flow-step-circle.active .flow-step-label {
    font-weight: 700;
}
.flow-step-line {
    width: 12px;
    height: 2px;
    background: var(--cream-dark);
    margin-top: 14px;
    flex-shrink: 0;
}
.flow-step-line.completed {
    background: var(--muted-teal);
}

/* Stage Container */
.flow-stage {
    animation: flowFadeIn 0.3s ease;
}
@keyframes flowFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.flow-stage-header {
    text-align: center;
    margin-bottom: 20px;
}
.flow-stage-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 8px;
}
.flow-stage-name {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.flow-stage-subtitle {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 2px;
}

/* Child Mode Banner */
.flow-child-mode-banner {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted-teal-dark);
    background: rgba(126, 191, 181, 0.12);
    padding: 6px 16px;
    border-radius: 20px;
    margin: 0 auto 12px;
    max-width: fit-content;
    cursor: pointer;
    transition: background 0.15s ease;
}
.flow-child-mode-banner:hover {
    background: rgba(126, 191, 181, 0.2);
}

/* Profile Prompt Card */
.flow-profile-prompt {
    margin-top: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--cream-dark);
    text-align: center;
}

/* Flow Navigation */
.flow-nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-bottom: 24px;
}

/* Behavior & Trigger Grid */
.flow-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.flow-select-btn {
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--cream-dark);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.flow-select-btn:active {
    transform: scale(0.96);
}
.flow-select-btn.selected {
    border-color: var(--muted-teal);
    background: rgba(126, 191, 181, 0.1);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--muted-teal);
}
.flow-select-btn .flow-select-icon {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
}

/* Interpretation Card */
.flow-interpretation-card {
    background: linear-gradient(135deg, #f5f0ff, #ede6ff);
    border-right: 4px solid var(--soft-lavender);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 16px 0;
    line-height: 1.7;
    font-size: 1.02rem;
    color: var(--text-primary);
}
.flow-interpretation-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.flow-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.7);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
}
.flow-interpretation-headline {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.6;
}
.flow-interpretation-card .flow-interpretation-text {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.flow-interpretation-card .interpretation-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--soft-lavender);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Reflection Cards */
.flow-reflection-card {
    background: var(--white);
    border-right: 4px solid var(--soft-green);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 14px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    animation: flowCardIn 0.35s ease both;
}
@keyframes flowCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.flow-reflection-card:nth-child(2) { animation-delay: 0.08s; }
.flow-reflection-card:nth-child(3) { animation-delay: 0.16s; }
.flow-reflection-card .copy-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
}
.flow-reflection-card .copy-btn:hover {
    opacity: 1;
}

/* Phrase Card (L/T stages) */
.flow-phrase-card {
    background: rgba(126, 191, 181, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 10px;
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Avoid Section */
.flow-avoid-section {
    background: rgba(255, 100, 80, 0.06);
    border-right: 4px solid #e06060;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 16px 0;
}
.flow-avoid-section .avoid-title {
    font-weight: 700;
    color: #c04040;
    margin-bottom: 8px;
    font-size: 0.92rem;
}
.flow-avoid-section .avoid-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Delivery Guidance */
.flow-delivery-guidance {
    background: rgba(126, 191, 181, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.88rem;
    color: var(--muted-teal-dark);
    font-weight: 500;
}

/* Refinement */
/* Refinement Section */
.flow-refinement-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--cream-dark);
}
.flow-refinement-header {
    text-align: center;
    margin-bottom: 12px;
}
.flow-rerandom-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 20px;
    border: 2px solid var(--muted-teal);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted-teal-dark);
    transition: all 0.15s ease;
}
.flow-rerandom-btn:hover,
.flow-rerandom-btn:active {
    background: var(--muted-teal);
    color: var(--white);
}
.flow-refinement-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.flow-refine-pill {
    padding: 8px 14px;
    border-radius: 16px;
    border: 1.5px solid var(--cream-dark);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.flow-refine-pill:hover {
    border-color: var(--muted-teal);
    background: rgba(126, 191, 181, 0.06);
}
.flow-refine-pill.active {
    border-color: var(--muted-teal);
    background: var(--muted-teal);
    color: var(--white);
}

/* Decision Cards (H stage) */
.flow-decisions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}
.flow-decision-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--white);
    border: 1.5px solid var(--cream-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    animation: flowCardIn 0.3s ease both;
}
.flow-decision-card:nth-child(2) { animation-delay: 0.06s; }
.flow-decision-card:nth-child(3) { animation-delay: 0.12s; }
.flow-decision-card:nth-child(4) { animation-delay: 0.18s; }
.flow-decision-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.flow-decision-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
}
.flow-decision-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--muted-teal-dark);
    margin-bottom: 2px;
}

/* Action Cards (H stage) */
.flow-action-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 16px 0;
}
.flow-action-card {
    padding: 16px 14px;
    border-radius: 12px;
    background: rgba(126, 191, 181, 0.06);
    border: 1.5px solid rgba(126, 191, 181, 0.2);
    text-align: center;
    animation: flowCardIn 0.3s ease both;
}
.flow-action-card:nth-child(2) { animation-delay: 0.06s; }
.flow-action-card:nth-child(3) { animation-delay: 0.12s; }
.flow-action-card:nth-child(4) { animation-delay: 0.18s; }
.flow-action-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}
.flow-action-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Trust Tabs (T stage) */
.flow-trust-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.flow-trust-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-radius: calc(var(--radius-sm) - 2px);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s ease;
    text-align: center;
}
.flow-trust-tab.active {
    background: var(--white);
    color: var(--muted-teal-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.flow-trust-content {
    animation: flowFadeIn 0.2s ease;
}

/* Fast mode compact styling */
.flow-fast .flow-stage-header {
    margin-bottom: 14px;
}
.flow-fast .flow-reflection-card {
    padding: 14px 16px;
    font-size: 1rem;
}
.flow-fast .flow-nav {
    margin-top: 20px;
}

/* ═══════ JOURNAL UPGRADE ═══════ */

/* Flow-linked tags */
.journal-flow-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.journal-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(126, 191, 181, 0.12);
    color: var(--muted-teal-dark);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Time selector */
.journal-time-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.time-btn {
    padding: 8px 14px;
    border-radius: 16px;
    border: 1.5px solid var(--cream-dark);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.time-btn.selected {
    border-color: var(--muted-teal);
    background: var(--muted-teal);
    color: var(--white);
}

/* Accuracy toggle */
.journal-accuracy-toggle {
    display: flex;
    gap: 8px;
}
.accuracy-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--cream-dark);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.accuracy-btn.selected {
    border-color: var(--muted-teal);
    background: rgba(126, 191, 181, 0.12);
    color: var(--muted-teal-dark);
}

/* Reflections used in journal */
.journal-reflections-used {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.journal-reflection-item {
    padding: 8px 12px;
    background: rgba(126, 191, 181, 0.06);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-style: italic;
}

/* Pattern insights */
.journal-insights-card {
    background: linear-gradient(135deg, #f5f0ff, #ede6ff);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
}
.journal-insights-title {
    font-weight: 700;
    color: var(--soft-lavender);
    margin-bottom: 10px;
    font-size: 0.92rem;
}
.journal-insight-item {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.journal-insight-item:last-child {
    border-bottom: none;
}

/* Insight cards (used in journal header + dedicated insights tab) */
.insight-card {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft, #f8f5f0);
    border-right: 4px solid var(--muted-teal);
    margin-bottom: 10px;
    align-items: flex-start;
}
.insight-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
}
.insight-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.insight-content strong {
    font-size: 0.9rem;
    color: var(--text-primary);
}
.insight-content span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.insights-tab-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Supplementary content */
.flow-supplement {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--cream-dark);
}
.flow-supplement-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.flow-supplement .flow-phrase-card {
    font-size: 0.92rem;
}

/* ═══════ MISSING FLOW CLASSES ═══════ */

.flow-stage-content {
    margin-bottom: 8px;
}
.flow-card {
    background: var(--white);
    border-right: 4px solid var(--muted-teal);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    line-height: 1.7;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.flow-select-label {
    font-size: 0.82rem;
    line-height: 1.3;
}
.flow-interpretation-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
}
.flow-interpretation-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
}
.flow-context-card {
    background: rgba(126, 191, 181, 0.06);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.flow-interpretation-mini {
    background: rgba(200, 180, 220, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}
.flow-reflection-text {
    font-size: 1.02rem;
    line-height: 1.7;
}
.flow-copy-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 4px;
}
.flow-copy-btn:hover {
    opacity: 1;
}
.flow-harmonize-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    text-align: center;
}
.flow-decision-content {
    flex: 1;
}
.flow-trust-intro {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

/* ═══════ PREMIUM POLISH ═══════ */

/* Touch feedback on interactive elements */
.flow-refine-pill:active,
.flow-rerandom-btn:active,
.flow-trust-tab:active,
.mode-select-card:active,
.action-btn:active {
    transform: scale(0.97);
}
.flow-action-card:active,
.flow-phrase-card:active {
    transform: scale(0.98);
    opacity: 0.85;
}

/* Subtle gradient on stage headers based on step color */
.flow-stage-header {
    padding: 12px 0;
}

/* Interpretation card polish */
.flow-interpretation-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

/* Phrase card hover/active polish */
.flow-phrase-card {
    transition: background 0.15s ease;
}

/* Avoid section polish */
.flow-avoid-section {
    animation: flowCardIn 0.35s ease both;
    animation-delay: 0.1s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .flow-stage,
    .flow-reflection-card,
    .flow-decision-card,
    .flow-action-card,
    .flow-trust-content,
    .flow-avoid-section {
        animation: none !important;
    }
    .breathing-circle {
        animation: none !important;
    }
    .flow-select-btn:active,
    .flow-refine-pill:active,
    .flow-rerandom-btn:active,
    .flow-trust-tab:active,
    .mode-select-card:active,
    .action-btn:active,
    .flow-action-card:active,
    .flow-phrase-card:active {
        transform: none !important;
    }
}