* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ============================================================
       MOON POST SERVICE — DESIGN SYSTEM
       Editorial brass-on-navy lithograph aesthetic
       Source of truth for color, type, spacing, radius, shadow,
       and motion. Surfaces opt in by using these tokens.
       ============================================================ */

    /* --- Surface & ink --- */
    --bg: #030A18;                              /* Deep midnight, app surface */
    --bg-2: #071327;                            /* Slightly lifted surface */
    --panel: rgba(7, 15, 30, 0.72);             /* Glass panel */
    --panel-strong: rgba(6, 12, 24, 0.88);      /* Opaque panel */
    --line: rgba(208, 180, 137, 0.46);          /* Brass rule */
    --line-soft: rgba(208, 180, 137, 0.20);     /* Soft brass divider */
    --text: #EAD8BF;                            /* Body cream */
    --text-bright: #F0DFC2;                     /* Display cream */
    --muted: rgba(234, 216, 191, 0.72);         /* Secondary copy */
    --muter: rgba(234, 216, 191, 0.46);         /* Tertiary copy */
    --accent: #D4B58A;                          /* Brass primary */
    --accent-bright: #E5C9A0;                   /* Brass hover */
    --accent-deep: #C99D57;                     /* Brass pressed / live */
    --live: #D7B171;                            /* Live indicator */
    --live-dot: #C99D57;                        /* Live dot */
    --on-accent: #0A1422;                       /* Ink on brass */

    /* --- Typography --- */
    --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Garamond', Georgia, serif;
    --sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    --fs-display: clamp(40px, 5.4vw, 76px);
    --fs-h1: clamp(38px, 5vw, 58px);
    --fs-h2: clamp(30px, 3.4vw, 44px);
    --fs-h3: clamp(22px, 2vw, 28px);
    --fs-lead: clamp(17px, 1.6vw, 22px);
    --fs-body: 15px;
    --fs-small: 13px;
    --fs-caption: 11px;
    --lh-tight: 1.05;
    --lh-snug: 1.2;
    --lh-body: 1.55;
    --tracking-label: 2.5px;

    /* --- Spacing scale --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    --space-9: 56px;
    --space-10: 80px;

    /* --- Radius --- */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* --- Shadow --- */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.42);
    --shadow: var(--shadow-lg);

    /* --- Motion --- */
    --dur-fast: 0.2s;
    --dur-normal: 0.4s;
    --dur-slow: 0.9s;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* --- Legacy aliases — redirected to brass-on-navy.
       The light-cream/blue/coral theme is fully retired. These tokens
       remain only so older selectors keep working without churn; they
       all resolve to brass-system values. New code should use the
       canonical tokens above. --- */
    --cream: var(--bg);
    --cream-dark: var(--bg-2);
    --blue: var(--accent);
    --blue-light: var(--accent-bright);
    --coral: var(--accent);
    --coral-light: var(--accent-bright);
    --text-dark: var(--text-bright);
    --text-muted: var(--muted);
    /* Legacy --white was used both for backgrounds and for text on solid
       colored buttons. The brass system uses --bg for panels and
       --on-accent for text-on-brass, so --white now resolves to --bg
       (the most common use was a panel background). The handful of
       legacy `color: var(--white)` sites are already overridden by
       dark-theme rules higher in specificity. */
    --white: var(--bg);
}

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--cream);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* SVG Icon utility classes */
.app-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}
.app-icon.sm { width: 14px; height: 14px; }
.app-icon.md { width: 18px; height: 18px; }
.app-icon.lg { width: 24px; height: 24px; }
.app-icon.xl { width: 32px; height: 32px; }
.app-icon.xxl { width: 40px; height: 40px; }

/* Moon phase icon specific - circular with subtle bg */
.phase-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.phase-icon .app-icon { fill: none; } /* phases use their own fills */

/* ============================================================
   PRIMITIVES — canonical components for new surfaces
   See DESIGN.md for usage. Older surface-specific classes
   (.cta-button, .onboarding-primary, etc.) predate this layer
   and remain in place; new code should use .btn.
   ============================================================ */

/* --- Button primitive ---
   Base + modifiers. Compose with .btn .btn--primary, .btn--ghost, etc. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    transition:
        background var(--dur-fast) ease,
        border-color var(--dur-fast) ease,
        color var(--dur-fast) ease,
        transform var(--dur-fast) ease,
        box-shadow var(--dur-fast) ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

/* Primary: solid brass pill, dark ink. The "do this" CTA. */
.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}
.btn--primary:hover:not(:disabled) {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

/* Ghost: brass outline, transparent, brass text. Secondary actions. */
.btn--ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--accent);
}
.btn--ghost:hover:not(:disabled) {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}

/* Link: text-only, brass. For tertiary "Resend code" etc. */
.btn--link {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
    padding: 8px 16px;
    font-weight: 500;
}
.btn--link:hover:not(:disabled) {
    background: rgba(212, 181, 138, 0.06);
    color: var(--accent-bright);
}

/* Tracked: editorial uppercase label-style ghost. Used for
   "NEW MOON MESSAGE" / "DELETE MY ACCOUNT" style buttons. */
.btn--tracked {
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-size: 12px;
    font-weight: 600;
}

/* Sizes */
.btn--sm { padding: 8px 16px; font-size: 13px; }
.btn--lg { padding: 16px 32px; font-size: 15px; }
.btn--block { width: 100%; }

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.header.scrolled {
    padding: 12px 48px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(8px);
}

.header.scrolled .logo {
    height: 18px;
}

.header-moon {
    display: none;
    width: 32px;
    height: 32px;
    border: 2px solid var(--blue);
    border-radius: 50%;
    padding: 3px;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s;
}

.header.scrolled .header-moon {
    display: block;
}

.header-moon:hover {
    border-color: var(--coral);
}

.header-moon-svg {
    width: 100%;
    height: 100%;
}

.logo {
    height: 24px;
    width: auto;
}

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

.location-selector {
    position: relative;
}

.location {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.location:hover {
    background: rgba(212, 181, 138, 0.1);
}

.location-pin {
    height: 18px;
    width: auto;
}

.dropdown-arrow {
    transition: transform 0.2s;
}

.location-selector.active .dropdown-arrow {
    transform: rotate(180deg);
}

.location-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 16px;
    min-width: 220px;
    display: none;
    z-index: 1000;
}

.location-dropdown.active {
    display: block;
}

.dropdown-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0ebe0;
}

.dropdown-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.dropdown-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--on-accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.dropdown-btn:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

/* Moon phase selector */
.moon-phase-selector {
    position: relative;
}

.moon-phase-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--coral);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.moon-phase-indicator:hover {
    transform: scale(1.1);
}

.moon-phase-svg {
    width: 24px;
    height: 24px;
}

/* User / Settings button */
.user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    overflow: hidden;
    position: relative;
}

.user-btn:hover {
    transform: scale(1.08);
    background: rgba(212, 181, 138, 0.08);
}

.user-initials {
    font-weight: 800;
    font-size: 12px;
    color: var(--blue);
}

.user-avatar-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.settings-arrow {
    font-size: 11px;
    color: var(--blue);
    cursor: pointer;
    margin-left: 2px;
    user-select: none;
    transition: transform 0.2s;
}

.settings-arrow.open {
    transform: rotate(180deg);
}

.settings-dropdown {
    display: none;
    position: fixed;
    top: 60px;
    right: 16px;
    width: 320px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    z-index: 10002;
    padding-bottom: 4px;
}

.settings-dropdown.active {
    display: block;
    animation: dropdownIn 0.18s ease;
}

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

.settings-dropdown .form-group {
    margin-bottom: 10px;
}

.settings-dropdown label {
    font-size: 11px;
    margin-bottom: 3px;
}

.settings-section { margin: 0; }
.settings-section + .settings-section { border-top: 1px solid rgba(128,128,128,0.12); }
.settings-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px; cursor: pointer; user-select: none;
}
.settings-section-header:active { background: rgba(128,128,128,0.08); }
.settings-section-header .section-summary {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--text-primary); flex: 1; min-width: 0;
}
.settings-section-header .section-summary .summary-text {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.settings-section-header .section-chevron {
    transition: transform 0.2s; font-size: 18px; color: var(--accent); margin-left: 8px;
}
.settings-section.open .section-chevron { transform: rotate(180deg); }
.settings-section-body { display: none; padding: 4px 16px 14px; }
.settings-section.open .settings-section-body { display: block; }
.settings-section .section-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(212, 181, 138, 0.16);
    border: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-family: var(--serif); font-size: 14px; font-weight: 500;
    overflow: hidden; flex-shrink: 0;
}
.settings-section .section-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.moon-phase-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 20px;
    min-width: 240px;
    display: none;
    z-index: 1000;
}

.moon-phase-dropdown.active {
    display: block;
}

.dropdown-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.moon-phase-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0ebe0;
}

.phase-visual-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--coral);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.phase-visual-large svg {
    width: 38px;
    height: 38px;
}

.phase-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.phase-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

.phase-percent {
    font-size: 13px;
    color: var(--coral);
}

.phase-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fact-item {
    display: flex;
    justify-content: space-between;
}

.fact-label {
    font-size: 13px;
    color: var(--text-muted);
}

.fact-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================================
   AUTH & ONBOARDING — editorial brass-on-navy
   First-impression surfaces. Mirror landing aesthetic: serif
   display type, brass accents, navy panels with cream ink.
   ============================================================ */

.drift-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 24, 0.78);
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.drift-modal-card {
    max-width: 380px;
    width: 100%;
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    padding: var(--space-7) var(--space-6);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-family: var(--sans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    color: var(--text);
}
/* Twinkling starfield inside onboarding */
.onboarding-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.onboarding-overlay.hidden {
    display: none;
}

.onboarding-card {
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-family: var(--sans);
}

.onboarding-logo {
    height: 64px;
    width: auto;
    margin-bottom: var(--space-5);
    opacity: 0.92;
}

.onboarding-card h1 {
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: var(--space-3);
    line-height: var(--lh-snug);
    letter-spacing: -0.3px;
}

.onboarding-tagline {
    font-size: 15px;
    color: var(--muted);
    margin-bottom: var(--space-7);
    line-height: var(--lh-body);
}

.onboarding-card .onboarding-form {
    text-align: left;
    margin-bottom: var(--space-6);
}

.onboarding-card .onboarding-form label,
.onboarding-card .form-group label {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    margin-bottom: var(--space-2);
    display: block;
}

.onboarding-card .onboarding-form .form-group {
    margin-bottom: var(--space-5);
}

/* Inputs inside the auth/onboarding card — boosted specificity so editorial
   tokens win over the generic .form-group input rules used elsewhere. */
.onboarding-card .form-group input,
.onboarding-card .form-group textarea,
.onboarding-card .location-input-wrapper input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 15px;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    background: rgba(3, 10, 24, 0.6);
    color: var(--text-bright);
}

.onboarding-card .form-group input::placeholder,
.onboarding-card .form-group textarea::placeholder,
.onboarding-card .location-input-wrapper input::placeholder {
    color: var(--muter);
}

.onboarding-card .form-group input:focus,
.onboarding-card .form-group textarea:focus,
.onboarding-card .location-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}

.location-input-wrapper {
    position: relative;
}

.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-md);
}

.city-dropdown.active {
    display: block;
}

.city-option {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background var(--dur-fast) ease;
}

.city-option:hover {
    background: rgba(212, 181, 138, 0.08);
}

.city-option .country {
    color: var(--muter);
    font-size: 12px;
    margin-left: 8px;
}

.location-detect-btn {
    width: 100%;
    margin-top: var(--space-3);
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--accent);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.location-detect-btn:hover {
    background: rgba(212, 181, 138, 0.08);
    color: var(--accent-bright);
    border-color: var(--accent);
}

.onboarding-primary {
    width: 100%;
    padding: 14px 22px;
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--on-accent);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
    margin-bottom: var(--space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.onboarding-primary:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

.onboarding-primary:active {
    transform: translateY(1px);
}

.onboarding-primary:disabled {
    background: rgba(212, 181, 138, 0.25);
    border-color: rgba(212, 181, 138, 0.25);
    color: rgba(10, 20, 34, 0.6);
    cursor: not-allowed;
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--muter);
    font-family: var(--sans);
    font-size: 13px;
    cursor: pointer;
    transition: color var(--dur-fast) ease;
}

.onboarding-skip:hover {
    color: var(--text-bright);
}

/* --- Auth flow steps --- */
.auth-step {
    display: none;
}
.auth-step.active {
    display: block;
}
.onboarding-card .auth-email-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 15px;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    margin-bottom: var(--space-4);
    background: rgba(3, 10, 24, 0.6);
    color: var(--text-bright);
}
.onboarding-card .auth-email-input::placeholder {
    color: var(--muter);
}
.onboarding-card .auth-email-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}
.auth-note {
    font-size: 13px;
    color: var(--muter);
    margin-top: var(--space-2);
    line-height: var(--lh-body);
}
.auth-check-inbox {
    text-align: center;
}
.auth-check-inbox .inbox-icon {
    font-size: 44px;
    margin-bottom: var(--space-4);
    opacity: 0.92;
}
.auth-check-inbox h2 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: var(--space-3);
    letter-spacing: -0.2px;
}
.auth-check-inbox p {
    font-size: 14px;
    color: var(--muted);
    line-height: var(--lh-body);
    margin-bottom: var(--space-2);
}
.auth-email-highlight {
    font-weight: 600;
    color: var(--accent);
    font-style: italic;
    font-family: var(--serif);
    font-size: 16px;
}
.auth-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    margin-top: var(--space-5);
}
.auth-link-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.auth-link-btn:hover {
    background: rgba(212, 181, 138, 0.08);
    color: var(--accent-bright);
}
.auth-error {
    color: #E89B73;
    font-size: 13px;
    margin-top: var(--space-2);
    display: none;
    font-style: italic;
}
.onboarding-card .otp-digit {
    width: 40px;
    height: 52px;
    text-align: center;
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 500;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: rgba(3, 10, 24, 0.7);
    color: var(--text-bright);
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    box-shadow: inset 0 1px 0 rgba(212, 181, 138, 0.04);
}
.onboarding-card .otp-digit:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.18), inset 0 1px 0 rgba(212, 181, 138, 0.04);
}

/* Auth modal close button */
#authModalOverlay .onboarding-card > button[onclick*="closeAuthModal"] {
    color: var(--muter);
    transition: color var(--dur-fast) ease;
}
#authModalOverlay .onboarding-card > button[onclick*="closeAuthModal"]:hover {
    color: var(--accent-bright);
}

/* Brass rule used between sections inside the auth card */
.auth-rule {
    height: 1px;
    background: var(--line-soft);
    margin: var(--space-5) 0;
    border: 0;
}

/* Moon Down Modal */
.moon-down-modal {
    text-align: center;
    max-width: 360px;
    padding: 40px 32px;
}

.moon-down-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(180deg, #d8d4cc 0%, #c0bdb6 100%);
    opacity: 0.6;
}

.moon-down-modal h2 {
    font-size: 20px;
    color: var(--blue);
    margin-bottom: 20px;
}

.moon-down-countdown {
    margin-bottom: 16px;
}

.moon-down-countdown .countdown-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.moon-down-countdown .countdown-value {
    font-size: 32px;
    font-weight: 900;
    color: var(--blue);
}

.moon-down-note {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.countdown-sublabel {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Standby Mode (moon below horizon) */
body.moon-down .cta-button {
    background: #c5c2bb;
    cursor: not-allowed;
}

body.moon-down .cta-button:hover {
    background: #c5c2bb;
}

body.moon-down .moon-orbit {
    opacity: 0.25;
}

body.moon-down .message-dot {
    opacity: 0.35;
    transform: translateX(-50%) scale(0.75);
}

body.moon-down .message-dot.releasing {
    animation: none;
    box-shadow: none;
}

/* Reply gating is now handled by JS in updateReplyRowMoonGate() */

/* Standby center content */
.standby-content {
    text-align: center;
}

.standby-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.standby-countdown {
    font-size: 48px;
    font-weight: 900;
    color: var(--blue);
    line-height: 1;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.standby-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.moon-down-lockout {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 8px;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

.standby-note {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.notify-btn {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--blue);
    color: var(--blue);
    border-radius: 24px;
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.notify-btn:hover {
    background: rgba(212, 181, 138, 0.1);
}

/* Disabled compose tooltip */
.cta-button[data-tooltip] {
    position: relative;
}

body.moon-down .cta-button[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 100;
}

body.moon-down .cta-button[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--blue);
    z-index: 100;
}

/* Shared Sky posting disabled */
.posting-disabled-note {
    text-align: center;
    padding: 14px 16px;
    background: rgba(212, 181, 138, 0.08);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Shared Sky is ALWAYS writable, even when moon is down */
#sharedSkyPage .message-page-footer,
#sharedSkyPage .message-page-input,
#sharedSkyPage .message-page-send,
#sharedSkyPage .reply-row {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: auto !important;
}
#sharedSkyPage .message-page-send {
    cursor: pointer !important;
}

/* ============================================================
   SHARED SKY — editorial brass-on-navy
   Public anonymous thread. Reuses the .message-page shell but
   with a dark editorial palette so it sits next to the landing
   and reveal pages. Scoped to #sharedSkyPage so chat (still
   light cream) is untouched.
   ============================================================ */
#sharedSkyPage.message-page { background: var(--bg); }
#sharedSkyPage .message-page-inner {
    background: var(--bg);
    box-shadow: none;
    color: var(--text);
    font-family: var(--sans);
}
#sharedSkyPage .message-page-header {
    border-bottom: 1px solid var(--line-soft);
    background: rgba(3, 10, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
#sharedSkyPage .message-page-info h3 {
    font-family: var(--serif);
    color: var(--text-bright);
    font-weight: 500;
    letter-spacing: -0.2px;
}
#sharedSkyPage .message-page-info p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
}
#sharedSkyPage .message-page-close {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}
#sharedSkyPage .message-page-close:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}
#sharedSkyPage .message-page-body { background: var(--bg); }
#sharedSkyPage .message-page-footer {
    background: rgba(3, 10, 24, 0.92);
    border-top: 1px solid var(--line-soft);
}
#sharedSkyPage .message-page-input {
    background: rgba(3, 10, 24, 0.6);
    border: 1px solid var(--line-soft);
    color: var(--text-bright);
    font-family: var(--sans);
}
#sharedSkyPage .message-page-input::placeholder { color: var(--muter); }
#sharedSkyPage .message-page-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}
#sharedSkyPage .message-page-send {
    background: var(--accent);
    color: var(--on-accent);
    border: 1px solid var(--accent);
}
#sharedSkyPage .message-page-send:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

/* Feed dividers between signals */
#sharedSkyPage .shared-sky-feed .shared-sky-signal {
    border-bottom: 1px solid var(--line-soft);
}

/* Note-mode toggle (Open / Lunar) inside shared-sky footer */
#sharedSkyPage .note-mode-toggle {
    background: rgba(3, 10, 24, 0.55);
    border: 1px solid var(--line-soft);
}
#sharedSkyPage .note-mode-toggle .toggle-option {
    color: var(--muter);
}
#sharedSkyPage .note-mode-toggle .toggle-option:hover {
    color: var(--text);
}
#sharedSkyPage .note-mode-toggle .toggle-option.active {
    background: rgba(212, 181, 138, 0.16);
    color: var(--accent-bright);
}

/* Plus button in the reply row (photo attachment) */
#sharedSkyPage #sharedSkyPlusBtn {
    border: 1px solid var(--line) !important;
    color: var(--accent) !important;
    background: transparent !important;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
#sharedSkyPage #sharedSkyPlusBtn:hover {
    background: rgba(212, 181, 138, 0.08) !important;
    border-color: var(--accent) !important;
}

/* Photo attachment menu — brass-on-navy popover */
#sharedSkyPage #sharedSkyPhotoMenu {
    background: var(--panel-strong) !important;
    border: 1px solid var(--line-soft) !important;
    box-shadow: var(--shadow-md) !important;
}
#sharedSkyPage .ss-photo-menu-item {
    color: var(--text) !important;
    font-family: var(--sans) !important;
}

/* Lunar Note multi-step composer */
#ssLunarPanel .lunar-step-card {
    background: var(--panel);
    border-color: var(--line-soft);
}
#ssLunarPanel .lunar-step-label {
    color: var(--accent);
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-weight: 600;
}
#ssLunarPanel .lunar-input {
    background: rgba(3, 10, 24, 0.7);
    border-color: var(--line-soft);
    color: var(--text-bright);
    font-family: var(--sans);
}
#ssLunarPanel .lunar-input::placeholder { color: var(--muter); }
#ssLunarPanel .lunar-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}
#ssLunarPanel .lunar-step-next {
    background: var(--accent);
    color: var(--on-accent);
    border-color: var(--accent);
    font-weight: 600;
}
#ssLunarPanel .lunar-step-next:not(:disabled):hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}
#ssLunarPanel .lunar-step-next:disabled {
    background: rgba(212, 181, 138, 0.18);
    color: rgba(10, 20, 34, 0.5);
    border-color: rgba(212, 181, 138, 0.18);
}
#ssLunarPanel .lunar-step-back {
    color: var(--muted);
}
#ssLunarPanel .lunar-step-back:hover {
    color: var(--accent-bright);
}
#ssLunarPanel .lunar-dot { background: rgba(212, 181, 138, 0.22); }
#ssLunarPanel .lunar-dot.active { background: var(--accent); }
#ssLunarPanel .lunar-dot.done { background: rgba(212, 181, 138, 0.55); }
#ssLunarPanel > p {
    font-family: var(--serif) !important;
    font-style: italic !important;
    color: var(--muted) !important;
    font-size: 13px !important;
}

/* Settings Modal Styles */
/* Settings location display */
.settings-location-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(212, 181, 138, 0.05);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.settings-location-pin {
    height: 20px;
    width: auto;
    flex-shrink: 0;
}

.settings-location-name {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-bright);
}

.location-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.location-btn:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.settings-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    font-family: var(--sans);
    font-size: 14px;
    background: rgba(3, 10, 24, 0.6);
    color: var(--text-bright);
    cursor: pointer;
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.settings-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.settings-checkbox label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    margin-bottom: 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 10px 48px 20px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 900;
    color: var(--blue);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.hero .subtitle {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 48px 20px;
}

/* Orbit Container */
.orbit-container {
    position: relative;
    width: 420px;
    height: 420px;
}

/* Stats below orbit - side by side */
.orbit-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.stat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.stat-dot.filled {
    background-color: var(--coral);
}

.stat-dot.outline {
    border: 2px solid var(--coral);
    background: transparent;
}

.orbit-legend {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    font-style: italic;
}

.shared-sky-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    background: none;
    border: none;
    font-family: 'Satoshi', sans-serif;
    cursor: pointer;
    transition: color 0.2s;
    opacity: 0.6;
}

.shared-sky-link:hover {
    color: var(--coral);
    opacity: 1;
}

.orbit-ring {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(212, 181, 138, 0.3);
    border-radius: 50%;
    position: relative;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

/* Double-ring effect: inner faint ring */
.orbit-ring::before {
    content: '';
    position: absolute;
    top: 4%;
    left: 4%;
    width: 92%;
    height: 92%;
    border: 1px solid rgba(212, 181, 138, 0.08);
    border-radius: 50%;
    pointer-events: none;
}

/* Moon illustration background inside the ring */
.orbit-bg-illustration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 95%;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    overflow: hidden;
    filter: sepia(1) saturate(3) hue-rotate(190deg) brightness(0.9);
}

.orbit-bg-illustration img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Moonrise/moonset horizon markers on the orbit stroke */
.horizon-marker {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.horizon-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 1px;
}

.horizon-dot.rise {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(212, 181, 138, 0.55);
}

.horizon-dot.set {
    background: var(--accent);
    opacity: 0.6;
    box-shadow: 0 0 6px rgba(212, 181, 138, 0.35);
}

.horizon-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    pointer-events: none;
    top: -58px;
    left: 50%;
    /* counter-rotation set dynamically by JS */
}

.horizon-title {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    opacity: 0.95;
}

.horizon-time {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}

.rise-label .horizon-title {
    color: var(--accent);
}

.rise-label .horizon-time {
    color: var(--text-bright);
}

.set-label .horizon-title {
    color: var(--accent);
}

.set-label .horizon-time {
    color: var(--text-bright);
    opacity: 0.6;
}

/* On mobile, move labels inside the ring so they don't clip off-screen */
@media (max-width: 900px) {
    .horizon-label {
        top: 16px; /* Below the dot, inside the ring */
    }
    .horizon-title {
        font-size: 8px;
        letter-spacing: 0.5px;
    }
    .horizon-time {
        font-size: 13px;
    }
}

/* ============================================================
   PHILOSOPHY PAGE — editorial brass-on-navy
   Long-form essay. Cormorant serif body for reading rhythm,
   Satoshi for labels. Brass diamond separators.
   ============================================================ */
#philosophyPage {
    font-family: var(--sans);
    line-height: var(--lh-body);
    color: var(--text);
    background: var(--bg);
}
.phil-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 var(--space-7);
    text-align: center;
}
.phil-text {
    font-family: var(--serif);
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 400;
    color: var(--text);
    line-height: 1.55;
    letter-spacing: -0.005em;
    text-align: center;
    margin-bottom: 0;
}
.phil-text + .phil-text { margin-top: var(--space-9); }
.phil-accent {
    display: block;
    text-align: center;
    margin: var(--space-10) 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(30px, 4.6vw, 46px);
    font-weight: 500;
    color: var(--text-bright);
    line-height: var(--lh-snug);
    letter-spacing: -0.01em;
}
.phil-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: var(--space-10) 0;
    color: var(--accent);
    font-size: 14px;
    letter-spacing: 6px;
}
.phil-separator::before, .phil-separator::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: var(--line);
    opacity: 0.7;
}
.phil-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(212, 181, 138, 0.28);
}
.header-philosophy-btn:hover { opacity: 1 !important; }
.phil-signoff {
    text-align: center;
    padding: var(--space-10) var(--space-6) var(--space-8);
    line-height: var(--lh-snug);
}
.phil-signoff-line {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--text);
    font-style: italic;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}
.phil-signoff-names {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}
.phil-signoff-role {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muter);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
}
@media (max-width: 740px) {
    .phil-body { padding: 0 var(--space-5); }
    .phil-text { font-size: 19px; line-height: 1.65; }
    .phil-accent { font-size: 26px; margin: var(--space-8) 0; }
    .phil-signoff-line { font-size: 18px; }
    .phil-signoff-names { font-size: 17px; }
    .phil-signoff-role { font-size: 11px; }
    .phil-separator { margin: var(--space-7) 0; }
    #philosophyPage > div:first-child { padding: 0 16px; }
}

/* Moon on orbit - small crescent moon icon on the stroke */
.moon-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    transition: transform 1s ease-out;
    pointer-events: none;
}

/* Moon comet trail */
.moon-orbit::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 213, 79, 0.3), transparent);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.moon-visible .moon-orbit::before {
    opacity: 1;
}

.moon-icon {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    pointer-events: auto;
    cursor: pointer;
    /* SVG paths inherit currentColor — set the brass tone here */
    color: var(--accent);
}

.moon-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(212, 181, 138, 0.4));
}

/* Message dots on orbit - positioned using rotation like the moon */
.dot-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.message-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
    pointer-events: auto;
    /* Position dot centered on the 3px stroke: stroke center is at 1.5px from top */
    /* Dot is 14px, so top = 1.5 - 7 = -5.5px */
    top: -5.5px;
    left: 50%;
    transform: translateX(-50%);
    /* Larger touch target on mobile */
    -webkit-tap-highlight-color: transparent;
}
/* Hide dots entirely on mobile — screen too small */
@media (max-width: 900px) {
    .message-dot { display: none !important; }
}
/* Larger dots on touch devices (desktop touchscreens) */
@media (pointer: coarse) and (min-width: 901px) {
    .message-dot { width: 22px; height: 22px; top: -9.5px; }
}

/* Dot trailing afterglow */
.message-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    width: 20px;
    height: 4px;
    background: linear-gradient(270deg, rgba(212, 181, 138, 0.45), transparent);
    border-radius: 2px;
    pointer-events: none;
}

.message-dot.incoming::after {
    background: linear-gradient(270deg, rgba(234, 216, 191, 0.45), transparent);
}

.message-dot:hover {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 12px rgba(212, 181, 138, 0.55);
}

/* Tooltip for dot hover - dark glass card */
.dot-tooltip {
    position: fixed;
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(212, 181, 138, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    max-width: 280px;
    color: white;
}
@media (max-width: 900px) {
    .dot-tooltip {
        display: none !important;
    }
}

.dot-tooltip.visible {
    opacity: 1;
}

.dot-tooltip .tooltip-name {
    font-weight: 700;
    color: white;
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.dot-tooltip .tooltip-meta {
    color: rgba(255, 255, 255, 0.6);
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
}

.dot-tooltip .tooltip-phase {
    color: var(--accent);
    font-size: 11px;
    display: block;
}

.dot-tooltip .tooltip-progress {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.dot-tooltip .tooltip-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), #ffd54f);
    transition: width 0.3s ease;
}

.dot-tooltip .tooltip-progress-fill.outgoing {
    background: linear-gradient(90deg, var(--accent), #ffd54f);
}

/* Moon phase detail popup */
.moon-phase-popup {
    position: fixed;
    background: rgba(8, 18, 32, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(212, 181, 138, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    min-width: 200px;
    color: white;
}

.moon-phase-popup.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    max-width: calc(100vw - 32px);
}

.moon-phase-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 181, 138, 0.12);
}

.moon-phase-emoji {
    font-size: 24px;
}

.moon-phase-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
}

.moon-phase-popup-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.moon-phase-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.moon-phase-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.moon-phase-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Moon carrying indicator — orbit center */
.moon-carrying-indicator {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
    line-height: 1.5;
}
.moon-carrying-count {
    color: var(--accent);
    font-weight: 700;
}

/* Moon live indicator */
.moon-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 213, 79, 0.8);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.moon-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd54f;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; box-shadow: 0 0 6px rgba(255, 213, 79, 0.5); }
}

/* Center content */
.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 280px;
}

.visibility-text {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.visibility-time {
    font-weight: 900;
    color: var(--text-dark);
}

.visibility-subtitle {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.cta-button {
    background-color: var(--blue);
    color: var(--white);
    border: none;
    padding: 20px 48px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Satoshi', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    border-radius: 32px;
    box-shadow: 0px 3px 19px 2px rgba(186, 175, 155, 0.79);
}

.cta-button:hover {
    background-color: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: 0px 6px 24px 4px rgba(186, 175, 155, 0.79);
}

.cta-button:disabled {
    background-color: #a0b8c8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.delivery-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 20px;
    line-height: 1.5;
}

/* Countdown state */
.countdown-display {
    font-size: 56px;
    font-weight: 900;
    color: var(--blue);
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.countdown-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.messages-carrying {
    font-size: 15px;
    color: var(--coral);
    font-weight: 600;
    line-height: 1.5;
}

.messages-carrying-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Moon Data Bar - pill with border, smaller text */
.moon-data-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 10px 28px;
    margin: 36px auto 0;
    max-width: 720px;
    border: 1px solid #0075EA;
    border-radius: 32px;
    font-size: 12px;
    text-transform: uppercase;
}

.moon-data-item {
    display: flex;
    align-items: center;
    gap: 0;
    color: var(--blue);
    letter-spacing: 0.3px;
}

.moon-data-label {
    font-weight: 900;
    color: var(--blue);
}

.moon-data-value {
    font-weight: 400;
    color: var(--blue);
    margin-left: 4px;
}

.moon-data-separator {
    display: none;
}

/* Inbox Section */
.inbox-section {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 48px;
}

.inbox-card {
    background: #FCF0D9;
    border: 2px solid var(--blue);
    border-radius: 16px;
    overflow: hidden;
}

.inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 2px solid var(--blue);
}

.inbox-tabs {
    display: flex;
    gap: 0;
    align-items: center;
}

.inbox-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 4px 14px 4px 0;
    margin-right: 14px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    transition: color 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
}
.inbox-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.inbox-tab-btn:not(.active):hover {
    color: rgba(255,255,255,0.6);
}
.roulette-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin-left: 5px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

.inbox-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--blue);
    margin-right: 8px;
}

/* Shared Sky row in inbox */
/* Shared sky feed items (full page) */
.shared-sky-feed .shared-sky-signal {
    border-bottom: 1px solid #e8e4dc;
    margin: 0;
}

.shared-sky-feed .shared-sky-signal:last-child {
    border-bottom: none;
}

.shared-sky-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 2px solid rgba(0, 117, 234, 0.15);
    cursor: pointer;
    transition: background 0.2s;
    background: rgba(212, 181, 138, 0.03);
}

.shared-sky-row:hover {
    background: rgba(212, 181, 138, 0.08);
}

.shared-sky-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212, 181, 138, 0.32), rgba(201, 157, 87, 0.55));
    border: 1px solid var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.shared-sky-row-content {
    flex: 1;
}

.shared-sky-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
}

.shared-sky-row-preview {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-sky-row-badge {
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.inbox-tab {
    font-size: 14px;
    font-weight: 500;
    color: var(--blue);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    font-family: 'Satoshi', sans-serif;
    padding: 0;
    opacity: 0.6;
}

.inbox-tab:hover {
    opacity: 1;
}

.inbox-tab.active {
    opacity: 1;
    text-decoration: underline;
}

.new-message-btn {
    width: 36px;
    height: 36px;
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 10px;
    font-size: 24px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding-bottom: 2px;
}

.new-message-btn:hover {
    background: var(--blue-light);
}
body.moon-down .new-message-btn {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.inbox-new-msg-cta {
    padding: 12px 20px;
    border-top: 1px solid rgba(0, 117, 234, 0.15);
    text-align: center;
}
.inbox-new-msg-cta .inbox-cta-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
}
body.moon-down .inbox-new-msg-cta {
    display: none !important;
}

.message-list {
    list-style: none;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: transparent;
}

.message-list::-webkit-scrollbar-thumb {
    background: var(--blue);
    border-radius: 3px;
    opacity: 0.5;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 117, 234, 0.3);
    cursor: pointer;
    transition: background 0.2s;
}

.message-item:hover {
    background: rgba(212, 181, 138, 0.05);
}

.message-item:last-child {
    border-bottom: none;
}

.message-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 14px;
    flex-shrink: 0;
}

.message-avatar.filled {
    background-color: var(--coral);
}

.message-avatar.outline {
    border: 3px solid var(--coral);
    background: #FCF0D9;
    box-sizing: border-box;
}

.message-direction {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.message-direction.sent-arrow {
    background: rgba(212, 181, 138, 0.12);
    color: var(--coral);
}

.message-direction.recv-arrow {
    background: rgba(212, 181, 138, 0.1);
    color: var(--blue);
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    background: var(--blue);
    position: relative;
}

.message-content {
    flex: 1;
}

.message-sender {
    font-size: 15px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 1px;
    text-transform: capitalize;
}

.message-preview {
    font-size: 13px;
    font-weight: 400;
    color: var(--blue);
    text-transform: capitalize;
    opacity: 0.8;
}

.message-status {
    font-size: 13px;
    font-weight: 400;
    color: var(--blue);
    text-transform: capitalize;
    opacity: 0.8;
}

.message-time {
    font-size: 12px;
    font-weight: 400;
    color: var(--blue);
    text-transform: capitalize;
    opacity: 0.7;
}

/* Moon transit time bar */
.message-item {
    position: relative;
    flex-wrap: wrap;
}
.moon-transit-bar {
    width: 100%;
    height: 3px;
    background: rgba(212, 181, 138, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
    flex-basis: 100%;
}
.moon-transit-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(212, 181, 138, 0.3), rgba(212, 181, 138, 0.7));
    transition: width 2s ease;
}
.moon-transit-fill.active {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.5), rgba(76, 175, 80, 0.9));
}
.moon-transit-label {
    width: 100%;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    flex-basis: 100%;
}

/* Ambient Signals (Global Transmissions redesigned) */
.signals-section {
    padding: 40px 48px;
    text-align: center;
}

.signals-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.4;
}

.signals-divider span {
    letter-spacing: 8px;
}

.signals-intro {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 28px;
    opacity: 0.6;
}

.signals-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 480px;
    margin: 0 auto;
}

.signal-item {
    text-align: center;
    opacity: 0;
    animation: signalFadeIn 0.6s ease forwards;
}

.signal-item:nth-child(1) { animation-delay: 0.1s; }
.signal-item:nth-child(2) { animation-delay: 0.3s; }
.signal-item:nth-child(3) { animation-delay: 0.5s; }

@keyframes signalFadeIn {
    to { opacity: 1; }
}

.signal-location {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    opacity: 0.5;
}

.signal-text {
    font-size: 14px;
    color: var(--blue);
    font-style: italic;
    opacity: 0.7;
    line-height: 1.6;
}

.signals-cta {
    margin-top: 28px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    font-family: 'Satoshi', sans-serif;
    opacity: 0.6;
}

.signals-cta:hover {
    color: var(--coral);
    opacity: 1;
}

.signals-divider-end {
    margin-top: 28px;
    margin-bottom: 0;
}

/* Shared Sky Modal (future-retro cream style) */
.shared-sky-modal .modal {
    background: #FCF0D9;
    border: 2px solid var(--blue);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-width: 620px;
    padding: 34px 34px 28px;
}

.shared-sky-modal h2 {
    color: var(--blue);
    font-size: 22px;
    letter-spacing: 0.6px;
}

.shared-sky-modal .modal-subtitle {
    color: var(--text-muted);
    opacity: 0.9;
}

.shared-sky-modal .modal-close {
    color: var(--text-muted);
}

/* Photo ring */
.shared-sky-ring-wrap {
    margin: 10px auto 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.shared-sky-ring {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 2px solid rgba(212,181,138,0.35);
    box-shadow: inset 0 0 0 6px rgba(212,181,138,0.05);
}

.shared-sky-ring-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    opacity: 0.7;
}

.shared-sky-thumb {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--blue);
    background: var(--cream);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.shared-sky-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Shared sky signals list */
.shared-sky-signals {
    margin: 24px 0;
    max-height: 200px;
    overflow-y: auto;
}

.shared-sky-signal {
    text-align: left;
    padding: 14px 0;
    border-bottom: 1px solid rgba(212,181,138,0.22);
}

.shared-sky-signal:last-child {
    border-bottom: none;
}

.shared-sky-location {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 6px;
    opacity: 0.8;
}

.shared-sky-text {
    font-size: 15px;
    color: var(--blue);
    font-style: italic;
    line-height: 1.6;
    opacity: 0.85;
}

.shared-sky-add {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 16px;
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 8px;
    color: white;
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.shared-sky-add:hover {
    background: var(--blue-light);
}

/* Animations */
@keyframes subtleGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(212, 181, 138, 0.4); }
    50% { box-shadow: 0 0 16px rgba(212, 181, 138, 0.7); }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

/* Releasing dots get subtle glow */
.message-dot.releasing {
    animation: subtleGlow 2s ease-in-out infinite;
}

/* Dots farther away are slightly smaller/dimmer */
.message-dot {
    opacity: 0.85;
}

.message-dot.releasing {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
}

/* Incoming message dots on orbit ring (cream against brass for sent) */
.message-dot.incoming {
    background-color: #EAD8BF;
    animation: incomingPulse 2s ease-in-out infinite;
}

.message-dot.incoming:hover {
    box-shadow: 0 0 12px rgba(234, 216, 191, 0.55);
}

@keyframes incomingPulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Incoming transit progress bar (blue-to-moon gradient) */
.transit-progress-bar.incoming {
    background: linear-gradient(90deg, var(--blue), #8bb8e8);
}

/* Arriving badge style */
.message-status-badge.arriving {
    background: rgba(212, 181, 138, 0.12);
    color: var(--blue);
}

/* Toast notification */
.send-toast {
    font-family: 'Satoshi', sans-serif;
}

.send-toast .toast-text strong {
    display: block;
    color: var(--blue);
    font-size: 14px;
    margin-bottom: 4px;
}

.send-toast .toast-text p {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(212, 181, 138, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--cream);
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
}

.modal h2 {
    font-size: 28px;
    color: var(--blue);
    margin-bottom: 8px;
    font-weight: 900;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-style: italic;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--coral);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0dcd4;
    border-radius: 6px;
    font-family: 'Satoshi', sans-serif;
    font-size: 15px;
    transition: border-color 0.2s;
    background: var(--white);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a8c4db;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* Recipient selector */
.recipient-selector {
    position: relative;
}

.recipient-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 2px solid var(--blue);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.recipient-dropdown.active {
    display: block;
}

.recipient-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipient-option:hover {
    background: var(--cream);
}

.recipient-option .name {
    font-weight: 600;
    color: var(--text-dark);
}

.recipient-option .location {
    font-size: 12px;
    color: var(--text-muted);
}

.recipient-option.new-contact {
    border-top: 1px solid #e0dcd4;
    color: var(--coral);
    font-weight: 600;
}

/* New contact location input */
.location-input-group {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: var(--white);
    border-radius: 6px;
    border: 2px dashed #e0dcd4;
}

.location-input-group.active {
    display: block;
}

.location-input-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.location-input-group input {
    font-size: 14px;
}

/* Attachments */
.attachments {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.attachment-btn {
    flex: 1;
    padding: 16px;
    border: 2px dashed #d0ccc4;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.attachment-btn:hover {
    border-color: var(--blue);
    background: #f8f6f0;
}

.attachment-btn.active {
    border-color: var(--coral);
    border-style: solid;
    background: #fff5f5;
}

.attachment-btn .icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.attachment-btn .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.send-button {
    width: 100%;
    background: var(--coral);
    color: var(--white);
    border: none;
    padding: 18px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Satoshi', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.send-button:hover {
    background: var(--coral-light);
    transform: translateY(-1px);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.delivery-info {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.5;
}

.delivery-info strong {
    color: var(--coral);
}

.new-contact-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    font-family: 'Satoshi', sans-serif;
}

.new-contact-btn:hover {
    text-decoration: underline;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 12px 0;
    margin-top: 8px;
    font-family: 'Satoshi', sans-serif;
    width: 100%;
}

.back-btn:hover {
    color: var(--text);
}

/* Lunar Note — pill toggle, panel, result card */
.lunar-note-toggle-area {
    margin-bottom: 16px;
}

.lunar-note-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(212, 181, 138, 0.06);
    border: 1.5px solid rgba(212, 181, 138, 0.2);
    border-radius: 20px;
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.lunar-note-pill:hover {
    background: rgba(212, 181, 138, 0.12);
    border-color: var(--blue);
}

.lunar-note-pill.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.lunar-pill-icon {
    font-size: 15px;
}

.lunar-note-panel {
    background: linear-gradient(135deg, #f8f5ef 0%, #f0ebe0 100%);
    border: 1.5px solid rgba(212, 181, 138, 0.18);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    animation: lunarPanelIn 0.25s ease;
}

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

.lunar-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.lunar-panel-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 0.2px;
}

.lunar-panel-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 181, 138, 0.1);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.lunar-panel-close:hover {
    background: rgba(212, 181, 138, 0.15);
    color: var(--coral);
}

.lunar-intro {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: center;
    font-style: italic;
}

.lunar-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.lunar-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lunar-input-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: lowercase;
}

.lunar-input {
    padding: 12px 14px;
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    border-radius: 8px;
    font-family: 'Satoshi', sans-serif;
    font-size: 15px;
    background: white;
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.lunar-input:focus {
    outline: none;
    border-color: var(--blue);
}

.lunar-input::placeholder {
    color: #b8cfe0;
    font-style: italic;
}

/* Lunar Note result card — the collectible output */
.lunar-result-card {
    background: white;
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    border-radius: 14px;
    padding: 24px 20px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: lunarCardIn 0.35s ease;
}

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

.lunar-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--coral), var(--blue));
    opacity: 0.5;
}

.lunar-result-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.lunar-result-text {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 500;
    white-space: pre-line;
    margin-bottom: 8px;
}

.lunar-result-closing {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
}

.lunar-result-actions {
    display: flex;
    justify-content: center;
}

.lunar-action-btn {
    background: none;
    border: none;
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s;
}

.lunar-action-btn:hover {
    background: rgba(212, 181, 138, 0.08);
}

/* Lunar Note step-through cards */
.lunar-step-container {
    position: relative;
}

.lunar-step-card {
    display: none;
    background: white;
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    animation: lunarCardIn 0.25s ease;
}

.lunar-step-card.active {
    display: block;
}

.lunar-step-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.lunar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(212, 181, 138, 0.15);
    transition: all 0.2s;
}

.lunar-dot.active {
    background: var(--blue);
    transform: scale(1.2);
}

.lunar-dot.done {
    background: var(--coral);
}

.lunar-step-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 14px;
    line-height: 1.4;
}

.lunar-step-card .lunar-input {
    text-align: center;
    font-size: 17px;
    margin-bottom: 16px;
}

.lunar-step-next {
    width: 100%;
    padding: 12px;
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lunar-step-next:hover:not(:disabled) {
    background: #4a8fd4;
}

.lunar-step-next:disabled {
    background: #d0ccc4;
    cursor: not-allowed;
}

.lunar-step-nav {
    display: flex;
    gap: 8px;
}

.lunar-step-back {
    flex: 0 0 auto;
    padding: 12px 16px;
    background: none;
    color: var(--text-muted);
    border: 1px solid rgba(212, 181, 138, 0.15);
    border-radius: 8px;
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.lunar-step-back:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.lunar-step-nav .lunar-step-next {
    flex: 1;
}

/* Song picker */
.song-toggle-area {
    margin-bottom: 12px;
}

.song-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(212, 181, 138, 0.04);
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    border-radius: 20px;
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.song-pill:hover {
    background: rgba(212, 181, 138, 0.1);
    border-color: var(--blue);
}

.song-pill.active {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

.song-picker {
    margin-bottom: 20px;
    animation: lunarPanelIn 0.2s ease;
}

.song-picker .lunar-input {
    margin-bottom: 10px;
}

.song-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.song-suggestion {
    font-size: 11px;
    padding: 6px 10px;
    background: var(--cream);
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.song-suggestion:hover {
    background: var(--blue);
    color: white;
}

/* Moon carrying messages indicator */
.moon-carrying-indicator {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

.moon-carrying-count {
    color: var(--blue);
    font-weight: 600;
}

#newContactCityDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#newContactCityDropdown.active {
    display: block;
}

#newContactCityDropdown .city-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}

#newContactCityDropdown .city-option:hover {
    background: var(--cream);
}

#composeNewContact .form-group {
    position: relative;
}

/* Public Message Modal */
.public-modal .modal {
    background: var(--coral);
}

.public-modal h2 {
    color: var(--white);
}

.public-modal .modal-subtitle {
    color: rgba(255,255,255,0.8);
}

.public-modal .modal-close {
    color: rgba(255,255,255,0.7);
}

.public-modal .modal-close:hover {
    color: var(--white);
}

.public-modal label {
    color: var(--white);
}

.public-modal .send-button {
    background: var(--white);
    color: var(--coral);
}

.public-modal .send-button:hover {
    background: var(--cream);
}

.public-modal .delivery-info {
    color: rgba(255,255,255,0.8);
}

.public-modal .delivery-info strong {
    color: var(--white);
}

/* Message Detail Modal */
.message-detail-modal .modal {
    max-width: 600px;
    padding: 0;
    overflow: hidden;
}

/* Full-page message view */
.message-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e8e4dc;
    z-index: 500;
    animation: msgPageIn 0.3s ease;
}

.message-page.active {
    display: block;
}

.message-page.closing {
    display: block;
    animation: msgPageOut 0.25s ease forwards;
}

@keyframes msgPageOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes msgPageIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.message-page-inner {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--white);
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
    overflow-y: auto;
}

.message-page-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e0dcd4;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.message-page-back {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 181, 138, 0.08);
    color: var(--blue);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.message-page-back:hover {
    background: rgba(212, 181, 138, 0.15);
}

/* X close button (right side of header) */
.message-page-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(212, 181, 138, 0.2);
    background: rgba(212, 181, 138, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.message-page-close:hover {
    background: rgba(212, 181, 138, 0.15);
    color: white;
    border-color: rgba(212, 181, 138, 0.4);
}

/* Note type toggle bar */
/* Single pill toggle: Open Note ↔ Lunar Note */
.note-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0 4px;
}
.note-mode-toggle {
    display: flex;
    align-items: center;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(212, 181, 138, 0.15);
    border-radius: 20px;
    padding: 2px;
    cursor: pointer;
    gap: 0;
    font-family: var(--font);
}
.note-mode-toggle .toggle-option {
    padding: 5px 14px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.35);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    white-space: nowrap;
}
.note-mode-toggle .toggle-option:hover {
    color: rgba(255, 255, 255, 0.55);
}
.note-mode-toggle .toggle-option.active {
    background: rgba(212, 181, 138, 0.18);
    color: var(--accent);
}

/* Reply input wrapper (+ button inside input) */
.reply-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(212, 181, 138, 0.2);
    border-radius: 24px;
    background: rgba(10, 22, 40, 0.6);
    overflow: hidden;
    transition: border-color 0.2s;
}
.reply-input-wrapper:focus-within {
    border-color: rgba(212, 181, 138, 0.4);
}
.reply-attach-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 22px;
    font-weight: 300;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reply-attach-btn:hover {
    background: rgba(212, 181, 138, 0.1);
}
.reply-input-wrapper .message-page-input {
    border: none !important;
    background: transparent !important;
    outline: none;
    padding-left: 0;
}

/* Attachment menu popover */
.attach-menu {
    display: flex;
    gap: 8px;
    padding: 6px 0;
}
.attach-option {
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid rgba(212, 181, 138, 0.2);
    background: rgba(10, 22, 40, 0.8);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.attach-option:hover {
    background: rgba(212, 181, 138, 0.1);
    border-color: rgba(212, 181, 138, 0.35);
    color: white;
}

.message-page-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--coral);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.message-page-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 1px;
}

.message-page-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.message-page-body {
    flex: 1;
    padding: 20px;
    padding-bottom: 40px;
    overflow-y: auto;
    min-height: 0;
}

.message-page-footer {
    padding: 10px 16px;
    border-top: 1px solid #e0dcd4;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.reply-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.add-lunar-link {
    background: none;
    border: none;
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    color: var(--blue);
    cursor: pointer;
    padding: 6px 0 2px;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.add-lunar-link:hover {
    opacity: 1;
}

.lunar-note-pill-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(212, 181, 138, 0.2);
    background: rgba(212, 181, 138, 0.04);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.lunar-note-pill-sm:hover {
    background: rgba(212, 181, 138, 0.1);
    border-color: var(--blue);
}

.message-page-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e0dcd4;
    border-radius: 24px;
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
}

.message-page-input:focus {
    outline: none;
    border-color: var(--blue);
}

.message-page-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--coral);
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.message-page-send:hover {
    background: #e04448;
}

/* IM-style inbox status badges */
.message-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.message-status-badge.orbiting {
    background: rgba(212, 181, 138, 0.1);
    color: var(--coral);
}

.message-status-badge.released {
    background: rgba(212, 181, 138, 0.1);
    color: var(--blue);
}

/* Delivery info box in send step */
.delivery-info-box {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.delivery-info-box.known {
    background: rgba(212, 181, 138, 0.08);
    border: 1px solid rgba(212, 181, 138, 0.15);
    color: var(--blue);
}

.delivery-info-box.new-user {
    background: rgba(212, 181, 138, 0.06);
    border: 1px solid rgba(212, 181, 138, 0.15);
    color: var(--text-dark);
}

.delivery-info-box .delivery-icon {
    font-size: 16px;
    margin-right: 6px;
}

.message-status-badge.received {
    background: rgba(212, 181, 138, 0.06);
    color: var(--text-muted);
}

/* In-transit message — centered with glow */
.message-bubble-transit-wrap {
    position: relative;
    margin: 0 auto;
    max-width: 75%;
    padding: 8px 0;
}
.message-bubble-transit-wrap .message-bubble.sent {
    background: rgba(18, 35, 58, 0.7);
    border: 1.5px solid transparent;
    margin: 0 auto;
    text-align: center;
    background-clip: padding-box;
    position: relative;
    border-radius: 16px !important;
    border-bottom-right-radius: 16px !important;
}
/* Animated gradient border that travels around the stroke */
.message-bubble-transit-wrap .message-bubble.sent::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: inherit;
    padding: 1.5px;
    background: conic-gradient(
        from var(--border-angle, 0deg),
        transparent 40%,
        rgba(212, 181, 138, 0.6) 50%,
        transparent 60%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 3s linear infinite;
    pointer-events: none;
}
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
@keyframes borderRotate {
    to { --border-angle: 360deg; }
}
/* Fallback glow for browsers without @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    .message-bubble-transit-wrap .message-bubble.sent {
        border: 1.5px solid rgba(212, 181, 138, 0.3);
        animation: transitPulseFallback 3s ease-in-out infinite;
    }
}
@keyframes transitPulseFallback {
    0%, 100% { border-color: rgba(212, 181, 138, 0.2); }
    50% { border-color: rgba(212, 181, 138, 0.5); }
}
/* No reactions or reply on in-transit messages */
.message-bubble-transit-wrap .msg-actions-row {
    display: none !important;
}
.transit-eta-label {
    text-align: center;
    padding: 8px 0 2px;
    font-size: 15px;
    color: rgba(212, 181, 138, 0.7);
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.transit-eta-label svg { width: 16px; height: 16px; fill: rgba(212, 181, 138, 0.7); }
/* Transit zone — starfield background */
.transit-zone {
    position: relative;
    padding: 20px 0;
    background: radial-gradient(ellipse at center, rgba(10, 20, 40, 0.6) 0%, transparent 70%);
    border-radius: 16px;
    overflow: hidden;
}
.transit-zone-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.transit-zone-star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: twinkle var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0;
}
.transit-zone .message-bubble-transit-wrap,
.transit-zone .transit-eta-label {
    position: relative;
    z-index: 1;
}

.transit-progress {
    height: 3px;
    background: rgba(212, 181, 138, 0.15);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.transit-progress-bar {
    height: 100%;
    background: var(--blue);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.message-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0dcd4;
    display: flex;
    align-items: center;
    gap: 16px;
}

.message-detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--coral);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
}

.message-detail-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 2px;
}

.message-detail-info p {
    font-size: 13px;
    color: var(--text-muted);
}

.message-detail-moon-photo {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.message-detail-content {
    padding: 24px;
}

.message-bubble {
    background: rgba(212, 181, 138, 0.1);
    padding: 16px 20px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    margin-bottom: 16px;
}

.message-bubble.sent {
    background: var(--blue);
    color: white;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    max-width: 80%;
}

.message-bubble p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--blue);
}

.message-bubble.sent p {
    color: white;
}

.message-bubble-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

.message-bubble.sent .message-bubble-time {
    color: rgba(255,255,255,0.7);
}

/* Unread badge (brass pill) */
.unread-badge {
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    letter-spacing: 0.2px;
}

/* Unread conversation row styling */
.message-item.unread .message-sender {
    font-weight: 600;
    color: var(--text-bright);
}
.message-item.unread .message-preview {
    color: var(--text);
    font-style: normal;
    font-weight: 500;
}

/* Pulsing unread badge */
.unread-badge.pulse {
    animation: unreadPulse 1.5s ease-in-out infinite;
}
@keyframes unreadPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 181, 138, 0.5); }
    50% { transform: scale(1.15); box-shadow: 0 0 8px 2px rgba(212, 181, 138, 0.35); }
}

/* New message flash animation on conversation row */
.message-item.new-message-flash {
    animation: rowFlash 1.2s ease-out;
}
@keyframes rowFlash {
    0% { background: rgba(212, 181, 138, 0.18); }
    30% { background: rgba(212, 181, 138, 0.10); }
    100% { background: transparent; }
}
/* Unread conversation has subtle brass tint */
.message-item.unread {
    background: rgba(212, 181, 138, 0.04);
}

/* Notification toast */
.notification-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--blue);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    font-family: 'Satoshi', sans-serif;
    box-shadow: 0 4px 20px rgba(212, 181, 138, 0.3);
    max-width: 90%;
    text-align: center;
}
.notification-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Read receipt checkmarks */
.read-receipt {
    font-size: 12px;
    margin-left: 4px;
    letter-spacing: -2px;
}
.read-receipt.delivered {
    color: rgba(255,255,255,0.5);
}
.read-receipt.read {
    color: var(--accent);
}
.read-receipt.seen-label {
    font-size: 10px;
    letter-spacing: 0;
    font-weight: 500;
}
/* For non-sent bubbles (shouldn't appear, but safety) */
.message-bubble:not(.sent) .read-receipt.delivered {
    color: var(--text-muted);
}
.bubble-lunar-note .read-receipt.delivered {
    color: var(--text-muted);
}
.bubble-lunar-note .read-receipt.read {
    color: #2196F3;
}

.message-detail-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0dcd4;
    display: flex;
    gap: 12px;
}

.message-detail-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0dcd4;
    border-radius: 24px;
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
}

.message-detail-input:focus {
    outline: none;
    border-color: var(--blue);
}

.message-detail-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--coral);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reactions */
/* Hover reaction trigger on message bubbles */
.message-bubble,
.bubble-lunar-note {
    position: relative;
}
/* Reactions + reply action row */
.msg-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.msg-react-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(212, 181, 138, 0.25);
    background: rgba(8, 18, 35, 0.85);
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.message-bubble:hover .msg-react-trigger,
.bubble-lunar-note:hover .msg-react-trigger,
.chat-transit-msg:hover .msg-react-trigger {
    opacity: 1;
}
.msg-react-trigger:hover,
.msg-react-trigger:active {
    opacity: 1 !important;
    background: rgba(212, 181, 138, 0.18);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.12);
}
.msg-react-trigger.pulse {
    animation: reactPulse 0.35s ease;
}
@keyframes reactPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
/* On mobile/touch, always show trigger clearly */
@media (hover: none) {
    .msg-react-trigger {
        opacity: 0.85;
    }
}
/* Reaction picker — uses position:fixed to escape scroll container clipping */
.reaction-picker-fixed {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: auto;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(12, 25, 45, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 181, 138, 0.25);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(212, 181, 138, 0.08);
    animation: pickerFadeIn 0.15s ease;
}
@keyframes pickerFadeIn {
    from { opacity: 0; transform: scale(0.92) translateY(4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.reaction-picker-fixed .reaction-picker-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(212, 181, 138, 0.5);
    padding: 2px 4px 6px;
    width: 100%;
}
.reaction-picker-fixed .reaction-option {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.reaction-picker-fixed .reaction-option:hover,
.reaction-picker-fixed .reaction-option:active {
    background: rgba(212, 181, 138, 0.18);
    transform: scale(1.2);
}

.reactions-bar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(18, 32, 55, 0.85);
    border: 1px solid rgba(212, 181, 138, 0.12);
    border-radius: 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    -webkit-tap-highlight-color: transparent;
}

.reaction-chip:hover {
    background: rgba(24, 42, 68, 0.9);
    border-color: rgba(212, 181, 138, 0.3);
}

.reaction-chip.active {
    background: rgba(30, 55, 90, 0.9);
    border-color: rgba(212, 181, 138, 0.5);
    box-shadow: 0 0 8px rgba(212, 181, 138, 0.15);
}

.reaction-chip .reaction-count {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-left: 1px;
}

.reaction-chip.active .reaction-count {
    color: var(--accent);
}

.add-reaction-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px dashed rgba(212, 181, 138, 0.2);
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.add-reaction-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: rgba(212, 181, 138, 0.06);
}

/* Reaction picker popup */
.reaction-picker {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--white);
    border: 1px solid #e0dcd4;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 20;
    gap: 2px;
    flex-wrap: wrap;
    width: 300px;
}

.reaction-picker.active {
    display: flex;
}

.reaction-picker-divider {
    width: 100%;
    height: 1px;
    background: #e0dcd4;
    margin: 4px 0;
}

.reaction-option {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.reaction-option:hover {
    background: rgba(212, 181, 138, 0.1);
    transform: scale(1.15);
}

.reaction-picker-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 4px 6px 2px;
    width: 100%;
}


/* In-thread Lunar Note panel — dark theme */
.thread-lunar-panel {
    padding: 14px 16px;
    border-top: 1px solid rgba(212, 181, 138, 0.15);
    background: rgba(10, 22, 42, 0.95);
    border-radius: 12px 12px 0 0;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
}

.thread-lunar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.thread-lunar-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 181, 138, 0.15);
    color: var(--coral);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thread-lunar-intro {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
    font-style: italic;
}

.thread-lunar-step {
    margin-bottom: 8px;
}

.thread-lunar-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    text-transform: lowercase;
    display: block;
    margin-bottom: 6px;
}

.thread-lunar-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid rgba(212, 181, 138, 0.2);
    border-radius: 10px;
    font-family: 'Satoshi', sans-serif;
    font-size: 16px;
    background: rgba(5, 12, 28, 0.8);
    color: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.thread-lunar-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

.thread-lunar-input:focus {
    outline: none;
    border-color: var(--accent);
}

.thread-lunar-result {
    background: rgba(5, 14, 30, 0.8);
    border-radius: 10px;
    padding: 14px;
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
    border: 1px solid rgba(212, 181, 138, 0.15);
}

.thread-lunar-result .lunar-closing {
    font-size: 14px;
    color: rgba(212, 181, 138, 0.6);
    margin-top: 6px;
    font-style: italic;
}

.thread-lunar-next-btn {
    font-size: 14px !important;
}

.thread-lunar-step .lunar-step-back {
    font-size: 13px !important;
}

.thread-lunar-send {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #050e1e;
    font-family: 'Satoshi', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.thread-lunar-send:disabled {
    opacity: 0.3;
    cursor: default;
}

.thread-lunar-send:not(:disabled):hover {
    background: #6dd5ff;
}

/* Thread lunar Next/Reveal buttons — dark theme */
.thread-lunar-panel .lunar-step-next,
.thread-lunar-panel .thread-lunar-next-btn {
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    background: rgba(212, 181, 138, 0.2);
    color: var(--accent);
    border: 1px solid rgba(212, 181, 138, 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Satoshi', sans-serif;
    transition: all 0.15s;
}
.thread-lunar-panel .lunar-step-next:hover:not(:disabled),
.thread-lunar-panel .thread-lunar-next-btn:hover:not(:disabled) {
    background: rgba(212, 181, 138, 0.3);
    border-color: var(--accent);
}
.thread-lunar-panel .lunar-step-next:disabled,
.thread-lunar-panel .thread-lunar-next-btn:disabled {
    background: rgba(212, 181, 138, 0.08);
    color: rgba(212, 181, 138, 0.3);
    border-color: rgba(212, 181, 138, 0.1);
    cursor: not-allowed;
}
/* Back button in thread lunar panel */
.thread-lunar-panel .lunar-step-back {
    color: rgba(255, 255, 255, 0.45) !important;
}
.thread-lunar-panel .lunar-step-back:hover {
    color: var(--accent) !important;
}
/* Header row: title + cancel link */
.thread-lunar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.thread-lunar-header-row .thread-lunar-intro {
    margin-bottom: 0;
    flex: 1;
}
.thread-lunar-cancel-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
    margin-left: 12px;
    white-space: nowrap;
    transition: color 0.15s;
}
.thread-lunar-cancel-link:hover {
    color: rgba(255, 255, 255, 0.7);
}
/* Progress dots */
.thread-lunar-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}
.thread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: background 0.2s;
}
.thread-dot.active {
    background: var(--accent);
}
.thread-dot.done {
    background: rgba(212, 181, 138, 0.5);
}
/* Step nav row */
.thread-lunar-step-nav {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
/* Result card (matches compose result card style in dark theme) */
.thread-lunar-result-card {
    position: relative;
    background: rgba(5, 14, 30, 0.8);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0 0;
    border: 1px solid rgba(212, 181, 138, 0.15);
    animation: threadLunarCardIn 0.35s ease;
    overflow: hidden;
}
.thread-lunar-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), rgba(212, 181, 138, 0.6), var(--accent));
}
@keyframes threadLunarCardIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.thread-lunar-result-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(212, 181, 138, 0.5);
    margin-bottom: 10px;
    font-weight: 700;
}
.thread-lunar-result-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-line;
}
.thread-lunar-result-closing {
    font-size: 14px;
    color: rgba(212, 181, 138, 0.6);
    margin-top: 8px;
    font-style: italic;
}
.thread-lunar-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}
.thread-lunar-action-btn {
    background: none;
    border: 1px solid rgba(212, 181, 138, 0.2);
    border-radius: 8px;
    padding: 6px 12px;
    font-family: 'Satoshi', sans-serif;
    font-size: 12px;
    color: rgba(212, 181, 138, 0.7);
    cursor: pointer;
    transition: all 0.15s;
}
.thread-lunar-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 181, 138, 0.08);
}


/* ================================================
   MOON CIRCLES
   ================================================ */
.circle-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 117, 234, 0.1);
    cursor: pointer;
    transition: background 0.2s;
}

.circle-row:hover {
    background: rgba(212, 181, 138, 0.04);
}

.circle-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0ebe0 0%, #e8e0d0 100%);
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.circle-row-content {
    flex: 1;
    min-width: 0;
}

.circle-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.circle-row-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.circle-row-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.circle-row-status.awaiting {
    background: rgba(212, 181, 138, 0.1);
    color: var(--coral);
}

.circle-row-status.contributed {
    background: rgba(212, 181, 138, 0.08);
    color: var(--blue);
}

.circle-row-status.revealed {
    background: rgba(212, 181, 138, 0.12);
    color: var(--blue);
}

/* Circle detail page */
.circle-detail-header {
    text-align: center;
    padding: 20px 20px 10px;
}

.circle-detail-emoji {
    font-size: 36px;
    margin-bottom: 6px;
}

.circle-detail-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--blue);
}

.circle-detail-members {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.circle-tonight {
    padding: 16px 20px;
    margin: 0 20px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f5ef 0%, #f0ebe0 100%);
    border: 1.5px solid rgba(212, 181, 138, 0.12);
}

.circle-tonight-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.circle-tonight-prompt {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    line-height: 1.5;
}

.circle-contribute-btn {
    width: calc(100% - 40px);
    margin: 0 20px 16px;
    padding: 12px;
    border-radius: 12px;
    border: 2px dashed rgba(212, 181, 138, 0.2);
    background: rgba(212, 181, 138, 0.03);
    color: var(--blue);
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.circle-contribute-btn:hover {
    border-color: var(--blue);
    background: rgba(212, 181, 138, 0.06);
}

/* Night sections */
.circle-night {
    padding: 16px 20px;
    border-top: 1px solid #e8e4dc;
}

.circle-night-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.circle-note-card {
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--white);
    border: 1px solid rgba(212, 181, 138, 0.08);
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

.circle-note-card:last-child {
    margin-bottom: 0;
}

.circle-note-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 6px;
}

.circle-note-text {
    font-size: 14px;
    color: var(--text-dark);
    line-height: 1.6;
    white-space: pre-line;
}

.circle-note-closing {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    font-style: italic;
}

.circle-note-waiting {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding: 14px 16px;
    text-align: center;
    background: rgba(212, 181, 138, 0.03);
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Create circle */
.create-circle-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 117, 234, 0.1);
    cursor: pointer;
    transition: background 0.2s;
    color: var(--blue);
    font-size: 14px;
    font-weight: 600;
}

.create-circle-option:hover {
    background: rgba(212, 181, 138, 0.04);
}

.create-circle-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px dashed rgba(212, 181, 138, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--blue);
}

/* Circle contribute panel */
.circle-contribute-panel {
    margin: 0 20px 16px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f5ef 0%, #f0ebe0 100%);
    border: 1.5px solid rgba(212, 181, 138, 0.12);
}

.circle-contribute-panel .thread-lunar-step {
    margin-bottom: 8px;
}

.circle-contribute-result {
    background: white;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
    border: 1px solid rgba(212, 181, 138, 0.1);
}

.circle-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(212, 181, 138, 0.06);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dark);
    margin: 3px;
}

.circle-member-chip .remove-member {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 181, 138, 0.15);
    color: var(--coral);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lunar Note card in message thread */
.bubble-lunar-note {
    background: linear-gradient(135deg, #f8f5ef 0%, #f0ebe0 100%);
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    border-radius: 14px;
    padding: 18px 16px 14px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
}

.bubble-lunar-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--coral), var(--blue));
    opacity: 0.4;
    border-radius: 14px 14px 0 0;
}

.bubble-lunar-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.bubble-lunar-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dark);
    font-weight: 500;
    white-space: pre-line;
    margin-bottom: 6px;
}

.bubble-lunar-closing {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* YouTube embed preview */
.yt-embed {
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    border: 1.5px solid rgba(212, 181, 138, 0.15);
    animation: lunarCardIn 0.2s ease;
    position: relative;
}

.yt-embed iframe {
    width: 100%;
    height: 180px;
    display: block;
    border: none;
}

.yt-embed-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #f8f5ef;
}

.yt-embed-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
}

.yt-embed-remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 181, 138, 0.1);
    color: var(--coral);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.yt-embed-remove:hover {
    background: rgba(212, 181, 138, 0.2);
}

/* Orbit dot highlight (from inbox hover) */
.message-dot.highlighted {
    transform: translateX(-50%) scale(1.8);
    box-shadow: 0 0 16px rgba(212, 181, 138, 0.7), 0 0 30px rgba(212, 181, 138, 0.3);
    z-index: 20;
}

/* Inbox message item hover → orbit connection */
.message-item[data-orbiting="true"]:hover {
    background: rgba(212, 181, 138, 0.05);
}

/* New contact section in compose */
.new-contact-section {
    padding: 12px 16px;
    background: rgba(212, 181, 138, 0.08);
    border-radius: 8px;
    margin-top: 8px;
    display: none;
}

.new-contact-section.active {
    display: block;
}

.add-contact-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: none;
    border: 2px dashed var(--blue);
    border-radius: 8px;
    color: var(--blue);
    font-family: 'Satoshi', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s;
}

.add-contact-btn:hover {
    background: rgba(212, 181, 138, 0.1);
}

/* Empty state for new users */
.empty-contacts {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
}

.empty-contacts-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--blue);
    opacity: 0.3;
}

.empty-contacts h4 {
    font-size: 16px;
    color: var(--blue);
    margin-bottom: 8px;
}

.empty-contacts p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* Gentle Reveal Modal */
.gentle-reveal-modal {
    text-align: center;
    padding: 40px;
}

.gentle-reveal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--coral);
    opacity: 0.8;
}

.gentle-reveal-modal h2 {
    font-size: 22px;
    color: var(--blue);
    margin-bottom: 12px;
}

.gentle-reveal-text {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.gentle-reveal-preview {
    background: rgba(212, 181, 138, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.preview-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.preview-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e0dcd4;
}

.preview-subject {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    margin-bottom: 8px;
}

.preview-body {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.preview-no-account {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
}

.preview-button {
    display: inline-block;
    background: var(--coral);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.gentle-reveal-buttons {
    display: flex;
    gap: 12px;
}

.gentle-reveal-buttons .send-button {
    flex: 1;
}

.edit-button {
    flex: 1;
    padding: 18px;
    background: transparent;
    border: 2px solid var(--blue);
    color: var(--blue);
    font-size: 16px;
    font-weight: 700;
    font-family: 'Satoshi', sans-serif;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.edit-button:hover {
    background: rgba(212, 181, 138, 0.1);
}

/* ============================================================
   MOON REVEAL PAGE (recipient landing) — editorial brass-on-navy
   The first surface a recipient sees. Treats the message itself
   like an aged-paper letter sitting under a brass spotlight on
   a midnight desk.
   ============================================================ */
.moon-reveal-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 6000;
    overflow-y: auto;
    color: var(--text);
    font-family: var(--sans);
}

.moon-reveal-page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-7) var(--space-5);
}

.moon-reveal-header {
    text-align: center;
    margin-bottom: var(--space-7);
}

.moon-reveal-logo {
    height: 22px;
    margin-bottom: var(--space-5);
    opacity: 0.85;
}

.moon-reveal-visual {
    width: 132px;
    height: 132px;
    margin: 0 auto var(--space-5);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 32%, #F0DFC2, #C9A874 70%, #8B6F45);
    box-shadow:
        0 0 80px rgba(212, 181, 138, 0.32),
        inset -10px -12px 30px rgba(120, 95, 65, 0.22);
}

.moon-reveal-tagline {
    font-family: var(--serif);
    font-style: italic;
    font-size: 16px;
    color: var(--muted);
    letter-spacing: -0.01em;
}

.moon-reveal-content {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.moon-reveal-sender {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    margin-bottom: var(--space-3);
}
.moon-reveal-sender strong {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    color: var(--accent);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}

.moon-reveal-countdown {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-6);
    margin-bottom: var(--space-5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.countdown-label-reveal {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    margin-bottom: var(--space-3);
}

.countdown-time-reveal {
    font-family: var(--serif);
    font-size: clamp(44px, 8vw, 56px);
    font-weight: 500;
    color: var(--text-bright);
    margin-bottom: var(--space-2);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.countdown-note {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--muted);
    line-height: var(--lh-body);
}

/* The message itself — warm cream "letter paper" on the navy desk.
   Dark navy ink mirrors a hand-written note. */
.moon-reveal-message {
    background: linear-gradient(180deg, #F4E7CD 0%, #EAD8BF 100%);
    border: 1px solid rgba(120, 95, 65, 0.22);
    border-radius: var(--radius-md);
    padding: var(--space-7) var(--space-6);
    margin-bottom: var(--space-5);
    text-align: left;
    box-shadow:
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.reveal-message-text {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.55;
    color: #1a1a2e;
    margin-bottom: var(--space-4);
    letter-spacing: -0.005em;
}

.reveal-message-meta {
    font-family: var(--sans);
    font-size: 11px;
    color: rgba(26, 26, 46, 0.55);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(120, 95, 65, 0.18);
    text-transform: uppercase;
    letter-spacing: 1.6px;
}

.moon-reveal-blurred {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

.reveal-state-toggle {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-5);
    padding: 4px;
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-pill);
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.reveal-state-toggle button {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-pill);
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.reveal-state-toggle button.active {
    background: rgba(212, 181, 138, 0.16);
    color: var(--accent-bright);
}

.reveal-state-toggle button:hover:not(.active) {
    color: var(--text-bright);
}

.moon-reveal-cta {
    margin-top: var(--space-7);
    text-align: center;
}

.moon-reveal-cta p {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    color: var(--muted);
    margin-bottom: var(--space-4);
    line-height: var(--lh-body);
}

.moon-reveal-cta-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.cta-primary {
    padding: 14px 30px;
    background: var(--accent);
    color: var(--on-accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.cta-primary:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    transform: translateY(-1px);
}

.cta-secondary {
    padding: 14px 28px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.cta-secondary:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}

.close-reveal-page {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.close-reveal-page:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}

/* ──── Split-screen layout ──── */

/* Header in split mode: full-width, proper sizing */
.header.split-active {
    position: relative; /* page doesn't scroll, no need for sticky */
    padding: 24px clamp(16px, 4vw, 48px);
}

.header.split-active .logo {
    height: clamp(56px, 7vw, 88px);
}

/* Hero between header and split */
.hero.above-split {
    text-align: left;
    padding: 2px clamp(16px, 4vw, 48px) 0;
}

.hero.above-split h1 {
    font-size: clamp(16px, 2vw, 22px);
    margin-bottom: 0;
    text-align: left;
}

.hero.above-split .subtitle {
    font-size: clamp(13px, 1.4vw, 16px);
}

.split-layout {
    display: flex;
    /* viewport minus header+hero (~120px) minus bottom gap (48px) */
    height: calc(100vh - 168px);
    overflow: hidden;           /* no page scroll */
    max-width: 1600px;
    margin: 0 auto;
}

.split-left {
    width: 33%;
    min-width: 280px;
    overflow-y: hidden;
    border-right: none;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 200; /* Above chat so it visually covers the slide animation */
}

.split-left .inbox-section {
    max-width: none;
    margin: 0;
    padding: 12px clamp(12px, 2vw, 24px) 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.split-left .inbox-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Tab content divs must grow so CTA is pinned at bottom of card */
.split-left #inboxTabContent,
.split-left #rouletteTabContent {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.split-left .roulette-list {
    flex: 1;
    overflow-y: auto;
}

.split-left .message-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.split-right {
    width: 67%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 8px;
    padding: 8px;
}

.ring-title {
    font-family: var(--serif);
    font-style: italic;
    color: var(--text-bright);
    font-size: clamp(18px, 2.6vw, 26px);
    font-weight: 500;
    text-align: center;
    align-self: center;
    padding: 0 clamp(16px, 3vw, 32px);
    margin: 0 0 clamp(8px, 2vh, 32px) 0;
    line-height: 1.3;
    letter-spacing: -0.2px;
    flex-shrink: 0;
}

/* New Moon Warning Banner */
.new-moon-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    margin: 0 24px 16px;
    background: rgba(212, 181, 138, 0.08);
    border: 1px solid rgba(212, 181, 138, 0.2);
    border-radius: 12px;
    animation: newMoonPulse 4s ease-in-out infinite;
}
.new-moon-warning.hidden { display: none; }
.new-moon-warning-text {
    color: rgba(232, 244, 253, 0.7);
    font-size: 13px;
    font-style: italic;
}
.new-moon-warning-dismiss {
    background: none;
    border: none;
    color: rgba(232, 244, 253, 0.4);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
}
.new-moon-warning-dismiss:hover { color: rgba(232, 244, 253, 0.8); }
@keyframes newMoonPulse {
    0%, 100% { border-color: rgba(212, 181, 138, 0.15); }
    50% { border-color: rgba(212, 181, 138, 0.3); }
}

/* Inbox-top wipe heads-up banner (≤5 days before the new moon) */
.inbox-wipe-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 14px 16px 6px;
    padding: 14px 16px;
    background:
        radial-gradient(80% 140% at 0% 0%, rgba(212, 181, 138, 0.14), transparent 70%),
        linear-gradient(135deg, rgba(10, 22, 40, 0.85), rgba(19, 39, 68, 0.85));
    border: 1px solid rgba(212, 181, 138, 0.22);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.inbox-wipe-banner.hidden { display: none; }
.inbox-wipe-banner::before {
    /* thin moonlight sweep across the top edge */
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 181, 138, 0.55), transparent);
    opacity: 0.7;
    animation: inboxWipeSheen 6s ease-in-out infinite;
}
@keyframes inboxWipeSheen {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.75; }
}
.inbox-wipe-banner-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-top: 2px;
    background:
        radial-gradient(circle at 35% 35%, rgba(232, 244, 253, 0.15), transparent 60%),
        #0a1628;
    border: 1px solid rgba(212, 181, 138, 0.35);
    box-shadow:
        inset 0 0 10px rgba(10, 22, 40, 0.9),
        0 0 14px rgba(212, 181, 138, 0.25);
    animation: inboxWipeMoonBreathe 5s ease-in-out infinite;
}
@keyframes inboxWipeMoonBreathe {
    0%, 100% { box-shadow: inset 0 0 10px rgba(10, 22, 40, 0.9), 0 0 10px rgba(212, 181, 138, 0.18); }
    50%      { box-shadow: inset 0 0 10px rgba(10, 22, 40, 0.9), 0 0 22px rgba(212, 181, 138, 0.45); }
}
.inbox-wipe-banner-body {
    flex: 1;
    min-width: 0;
}
.inbox-wipe-banner-title {
    color: rgba(232, 244, 253, 0.92);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.inbox-wipe-banner-sub {
    color: rgba(232, 244, 253, 0.58);
    font-size: 12px;
    line-height: 1.5;
    font-style: italic;
}
.inbox-wipe-banner-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(232, 244, 253, 0.35);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    line-height: 1;
    align-self: flex-start;
    transition: color 0.2s ease;
}
.inbox-wipe-banner-dismiss:hover { color: rgba(232, 244, 253, 0.85); }

/* Vaporize Animation — messages dissolving at new moon */
@keyframes vaporize {
    0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
    30% { opacity: 0.8; transform: translateY(-8px) scale(0.99); filter: blur(0.5px); }
    60% { opacity: 0.4; transform: translateY(-25px) scale(0.96); filter: blur(2px); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.9); filter: blur(6px); }
}
@keyframes vaporizeParticle {
    0% { opacity: 0.8; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--vx, 10px), var(--vy, -40px)) scale(0.3); }
}
.vaporizing .message-bubble,
.vaporizing .bubble-lunar-note {
    animation: vaporize 1.8s ease-out forwards;
}
.vaporizing .message-bubble:nth-child(2) { animation-delay: 0.15s; }
.vaporizing .message-bubble:nth-child(3) { animation-delay: 0.3s; }
.vaporizing .message-bubble:nth-child(4) { animation-delay: 0.45s; }
.vaporizing .message-bubble:nth-child(5) { animation-delay: 0.6s; }
.vaporizing .message-bubble:nth-child(6) { animation-delay: 0.75s; }

/* Empty state after new moon cleanup */
.new-cycle-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 32px;
    text-align: center;
    gap: 12px;
}
.new-cycle-empty-icon {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 8px;
}
.new-cycle-empty-title {
    color: rgba(212, 181, 138, 0.7);
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.5px;
}
.new-cycle-empty-subtitle {
    color: rgba(232, 244, 253, 0.35);
    font-size: 13px;
}

/* --- "Wiped by the new moon" empty state ---
   Shown when conversations.wiped_at is set: the conversation shell survives
   but all messages were removed at the last new moon. Ghostly silhouettes
   of the gone messages dissolve into particles around a dark moon. */
.new-cycle-empty.wiped {
    position: relative;
    padding-top: 56px;
    overflow: hidden;
}
.new-cycle-empty.wiped .wiped-silhouettes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-bottom: 24px;
}
.new-cycle-empty.wiped .wiped-silhouette-row {
    display: flex;
}
.new-cycle-empty.wiped .wiped-silhouette-row.right { justify-content: flex-end; }
.new-cycle-empty.wiped .wiped-silhouette-row.left  { justify-content: flex-start; }
.new-cycle-empty.wiped .wiped-silhouette-row span {
    display: block;
    height: 28px;
    border-radius: 14px;
    background: linear-gradient(90deg,
        rgba(212, 181, 138, 0.08),
        rgba(212, 181, 138, 0.18),
        rgba(212, 181, 138, 0.04));
    filter: blur(0.5px);
    animation: wiped-dissolve 4.5s ease-in-out infinite;
}
.new-cycle-empty.wiped .wiped-silhouette-row.right span {
    width: 62%;
    animation-delay: 0s;
}
.new-cycle-empty.wiped .wiped-silhouette-row.left span {
    width: 48%;
    animation-delay: 1.2s;
}
.new-cycle-empty.wiped .wiped-silhouette-row:nth-child(3) span {
    width: 72%;
    animation-delay: 2.4s;
}
@keyframes wiped-dissolve {
    0%   { opacity: 0.55; transform: translateY(0) scaleX(1); filter: blur(0.5px); }
    55%  { opacity: 0.15; transform: translateY(-6px) scaleX(1.02); filter: blur(2px); }
    100% { opacity: 0;    transform: translateY(-14px) scaleX(0.92); filter: blur(5px); }
}
.new-cycle-empty.wiped .wiped-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.new-cycle-empty.wiped .wiped-particle {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(232, 244, 253, 0.7);
    box-shadow: 0 0 6px rgba(212, 181, 138, 0.6);
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: wiped-particle-drift 3.8s ease-out infinite;
    animation-delay: calc(var(--i) * 0.35s);
}
@keyframes wiped-particle-drift {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20%  { opacity: 0.9; }
    100% {
        opacity: 0;
        transform: translate(
            calc(-50% + (var(--i) - 3) * 32px),
            calc(-180% + (var(--i) * -8px))
        ) scale(0.3);
    }
}
.new-cycle-empty.wiped .wiped-moon {
    opacity: 0.55;
    filter: drop-shadow(0 0 18px rgba(212, 181, 138, 0.35));
    animation: wiped-moon-breathe 5s ease-in-out infinite;
}
@keyframes wiped-moon-breathe {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 0.7;  transform: scale(1.04); }
}
.new-cycle-empty.wiped .new-cycle-empty-title {
    color: rgba(232, 244, 253, 0.82);
    letter-spacing: 1px;
}
.new-cycle-empty.wiped .new-cycle-empty-subtitle {
    color: rgba(232, 244, 253, 0.5);
    max-width: 280px;
    line-height: 1.5;
}

.split-right .main-content {
    padding: 0;
    width: 100%;
    align-items: center;
}

.split-right .moon-data-bar {
    margin: clamp(8px, 2vh, 36px) auto 0;
    flex-shrink: 0;
}

/* Scale orbit ring for available space — account for title, data bar, gaps */
.split-right .orbit-container {
    width: min(420px, calc(100vh - 320px));
    height: min(420px, calc(100vh - 320px));
    min-width: 220px;
    min-height: 220px;
    flex-shrink: 1;
}

/* ====================================== */
/* INLINE CHAT — Desktop only            */
/* When a conversation is open, the chat  */
/* replaces the ring in the right panel   */
/* ====================================== */
@media (min-width: 901px) {
    /* Hide ring elements when chat is open */
    body.chat-open .ring-title,
    body.chat-open .main-content,
    body.chat-open .moon-data-bar,
    body.chat-open .app-horizon {
        display: none !important;
    }
    /* Horizontal connecting line from active inbox item to chat */
    body.chat-open .message-item.active {
        background: rgba(212, 181, 138, 0.10);
        border-left: 3px solid var(--accent);
        position: relative;
    }
    body.chat-open .message-item.active::after {
        content: '';
        position: absolute;
        right: -24px;
        top: 50%;
        width: 24px;
        height: 1.5px;
        background: rgba(212, 181, 138, 0.25);
    }
    /* Reposition chat overlay into right panel with margin.
       Layout shared between chat-detail (cyan border) and shared-sky
       (brass border). Visual borders/shadows split below. */
    body.chat-open #messagePageView.active,
    body.chat-open #sharedSkyPage.active {
        position: fixed;
        z-index: 100;
        animation: msgPageInDesktop 0.2s ease;
        border-radius: 16px;
        overflow: hidden;
        margin-right: 24px;
    }
    body.chat-open #messagePageView.active,
    body.chat-open #sharedSkyPage.active {
        border: 1px solid var(--line-soft);
        box-shadow: 0 0 24px rgba(212, 181, 138, 0.06);
    }
    body.chat-open #messagePageView .message-page-inner,
    body.chat-open #sharedSkyPage .message-page-inner {
        max-width: none;
        margin: 0;
        height: 100%;
    }
    /* Chat header — editorial dark glass */
    body.chat-open #messagePageView .message-page-header {
        background: rgba(3, 10, 24, 0.92);
        border-bottom: 1px solid var(--line-soft);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    /* Chat footer — editorial dark glass */
    body.chat-open #messagePageView .message-page-footer {
        background: rgba(3, 10, 24, 0.92);
        border-top: 1px solid var(--line-soft);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    /* Close animation */
    body.chat-open #messagePageView.closing,
    body.chat-open #sharedSkyPage.closing {
        animation: msgPageOutDesktop 0.2s ease forwards;
    }
    /* Elevate header above chat so settings dropdown renders on top */
    body.chat-open .header {
        z-index: 10001;
    }
}

@keyframes msgPageInDesktop {
    from { opacity: 0; transform: translateX(-80px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes msgPageOutDesktop {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-80px); }
}

/* Responsive — tablet landscape (901-1100px) */
@media (min-width: 901px) and (max-width: 1100px) {
    .split-left {
        width: 38%;
        min-width: 260px;
    }
    .split-right {
        width: 62%;
    }
    .split-right .orbit-container {
        width: min(340px, calc(100vh - 320px));
        height: min(340px, calc(100vh - 320px));
        min-width: 220px;
        min-height: 220px;
        flex-shrink: 1;
    }
}

/* Responsive — mobile & tablets */
@media (max-width: 900px) {
    .header.split-active {
        position: sticky;
        top: 0;
        padding: 12px 16px;
    }

    .hero.above-split {
        padding: 8px 16px 4px;
    }

    .hero.above-split h1 {
        font-size: 22px;
    }

    .hero.above-split .subtitle {
        font-size: 13px;
    }

    .split-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .split-left {
        width: 100%;
        min-width: unset;
        overflow-y: visible;
        border-right: none;
        order: 2; /* inbox below orbit on mobile */
        margin-top: 32px;
    }

    .split-left .inbox-section {
        padding: 0;
        margin: 0;
        max-width: none;
        display: block;
        min-height: unset;
    }

    .split-left .inbox-card {
        flex: unset;
        display: block;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .split-left .message-list {
        flex: unset;
        overflow-y: visible;
    }

    .split-right {
        width: 100%;
        overflow: visible;
        order: 1; /* orbit on top on mobile */
        padding: 0;
    }

    .split-right .main-content {
        padding: 32px 16px 10px;
    }

    .split-right .orbit-container {
        width: min(220px, 60vw);
        height: min(220px, 60vw);
    }

    /* Shrink countdown inside ring on mobile */
    .standby-countdown {
        font-size: 22px !important;
        letter-spacing: -0.5px !important;
        margin-bottom: 2px !important;
    }
    .standby-label {
        font-size: 8px !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 6px !important;
    }
    .moon-live-indicator, .moon-status-live, .moon-status-down {
        font-size: 10px !important;
    }
    .messages-carrying, .moon-carrying-indicator {
        font-size: 10px !important;
    }

    /* Moonrise/moonset labels: ON the ring stroke */
    .horizon-label {
        top: -48px !important;
    }
    .horizon-title {
        font-size: 9px !important;
    }
    .horizon-time {
        font-size: 15px !important;
        font-weight: 800 !important;
    }

    /* Inbox message fonts bigger on mobile */
    .message-item .message-sender {
        font-size: 16px !important;
    }
    .message-item .message-preview {
        font-size: 14px !important;
    }
    .message-item .message-time {
        font-size: 12px !important;
    }
    .unread-badge {
        font-size: 12px !important;
        min-width: 22px !important;
        height: 22px !important;
    }
    .shared-sky-row-name {
        font-size: 16px !important;
    }
    .shared-sky-row-preview {
        font-size: 13px !important;
    }

    /* Contacts & Philosophy page headers on mobile */
    #contactsPage > div:first-child,
    #philosophyPage > div:first-child {
        padding: 0 16px !important;
        height: 64px !important;
    }
    #contactsPage > div:first-child img.logo,
    #philosophyPage > div:first-child img.logo {
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
    }
    #contactsPage > div:first-child span,
    #philosophyPage > div:first-child span {
        font-size: 8px !important;
        letter-spacing: 1.5px !important;
    }
    #contactsPage > div:first-child button,
    #philosophyPage > div:first-child button {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }

    /* Contacts page content bigger fonts on mobile */
    #contactsPage > div:nth-child(2) {
        padding: 32px 20px !important;
    }
    #contactsPage #contactSearchInput {
        font-size: 16px !important;
        padding: 14px 16px !important;
    }
    #contactsPage #contactsListBody {
        font-size: 16px;
    }
    #contactsPage #contactsListBody .msg-avatar {
        width: 48px !important;
        height: 48px !important;
    }

    /* Hero greeting text */
    .ring-title {
        font-size: 16px !important;
        margin-top: 28px !important;
        margin-bottom: 16px !important;
        padding: 0 12px !important;
    }

    /* Moon data bar bigger on mobile */
    .moon-data-bar {
        display: none !important;
    }

    /* Settings: full-screen on mobile */
    .settings-dropdown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        z-index: 100000 !important;
        padding-top: 70px !important;
    }
    .settings-dropdown .settings-close-btn {
        display: flex !important;
    }
    .settings-section-header .section-chevron {
        font-size: 22px !important;
    }

    .header {
        padding: 12px 16px;
    }

    /* Hide desktop nav, show hamburger on mobile */
    .header-desktop-nav {
        display: none !important;
    }
    .mobile-menu-btn {
        display: flex !important;
    }

    .main-content {
        padding: 10px 16px;
    }

    .inbox-section {
        padding: 0 16px;
    }

    .orbit-stats {
        gap: 16px;
    }

    .stat-item {
        font-size: 12px;
    }

    .inbox-tabs {
        flex-wrap: wrap;
        gap: 8px 16px;
    }
}
/* ============================== */
/* COMPOSE PAGE — DARK REDESIGN   */
/* ============================== */

/* New message picker — dark theme + right panel on desktop */
#newMessagePicker .message-page-inner {
    background: rgba(10, 22, 40, 0.95);
}
#newMessagePicker .message-page-header {
    border-bottom: 1px solid rgba(212, 181, 138, 0.12);
}
@media (min-width: 901px) {
    body.chat-open #newMessagePicker.active {
        position: fixed;
        z-index: 200;
        right: 24px;
        animation: msgPageInDesktop 0.2s ease;
        border: 2px solid rgba(212, 181, 138, 0.3);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 0 20px rgba(212, 181, 138, 0.06);
    }
    body.chat-open #newMessagePicker .message-page-inner {
        max-width: none;
        margin: 0;
        height: 100%;
    }
    body.chat-open #newMessagePicker .message-page-header {
        background: rgba(8, 18, 35, 0.95);
        border-bottom: 1px solid rgba(212, 181, 138, 0.18);
        backdrop-filter: blur(16px);
    }
    body.chat-open #newMessagePicker.closing {
        animation: msgPageOutDesktop 0.2s ease forwards;
    }
    body.chat-open #newMessagePicker .message-page-back {
        display: none;
    }
    body.chat-open #newMessagePicker .message-page-close {
        display: flex !important;
    }
}
#newMsgContactSearch::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
#newMsgContactSearch:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}

/* Dark starfield background for compose modal */
#messageModal.active {
    background: #050a14;
    background-image:
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.08), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.08), transparent);
    background-size: 200px 200px;
}
#messageModal .message-page-inner {
    background: transparent;
    box-shadow: none;
    max-width: 720px;
}
#messageModal .message-page-header {
    border-bottom: none;
    padding: 16px 20px;
}
#messageModal .message-page-body {
    padding: 0 20px 40px;
}
@media (min-width: 901px) {
    body.chat-open #messageModal.active {
        position: fixed;
        z-index: 200;
        right: 24px;
        background: transparent;
        animation: msgPageInDesktop 0.2s ease;
        border: 2px solid rgba(212, 181, 138, 0.3);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 0 20px rgba(212, 181, 138, 0.06);
    }
    body.chat-open #messageModal .message-page-inner {
        max-width: none;
        margin: 0;
        height: 100%;
        background: rgba(5, 10, 20, 0.97);
    }
    body.chat-open #messageModal .message-page-header {
        background: rgba(8, 18, 35, 0.95);
        border-bottom: 1px solid rgba(212, 181, 138, 0.18);
        backdrop-filter: blur(16px);
    }
    body.chat-open #messageModal.closing {
        animation: msgPageOutDesktop 0.2s ease forwards;
    }
}

/* Compose header (dark theme) */
.compose-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.compose-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ffd54f;
    padding: 2px;
    position: relative;
    flex-shrink: 0;
}
.compose-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}
.compose-avatar-sparkle {
    position: absolute;
    top: -4px;
    right: -4px;
}
.compose-recipient-name {
    font-weight: 700;
    font-size: 17px;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}
.compose-recipient-badge {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 2px 8px;
    background: rgba(255, 213, 79, 0.15);
    color: #ffd54f;
    border-radius: 4px;
    border: 1px solid rgba(255, 213, 79, 0.3);
}
.compose-arrival-time {
    font-size: 12px;
    color: rgba(212, 181, 138, 0.6);
    font-weight: 500;
}
.compose-header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}
.compose-header-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Glass Card */
.compose-glass-card {
    background: rgba(18, 35, 58, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 181, 138, 0.5);
    border-radius: 24px;
    padding: 28px;
    box-shadow: inset 0 0 10px rgba(212, 181, 138, 0.1), 0 0 15px rgba(212, 181, 138, 0.2), 0 0 20px rgba(0,0,0,0.4);
}

/* Segmented Toggle */
.compose-toggle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}
.compose-toggle {
    display: flex;
    align-items: center;
    background: rgba(10, 22, 40, 0.6);
    padding: 4px;
    border-radius: 9999px;
    border: 1px solid rgba(212, 181, 138, 0.15);
}
.compose-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.45);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}
.compose-toggle-btn.active {
    background: var(--accent);
    color: #0a1628;
    box-shadow: 0 0 15px rgba(212, 181, 138, 0.4);
}
.compose-toggle-btn:not(.active):hover {
    color: rgba(255,255,255,0.7);
}

/* Open Note textarea */
.compose-textarea {
    width: 100%;
    min-height: 260px;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 18px;
    color: white;
    line-height: 1.7;
    resize: none;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}
.compose-textarea::placeholder {
    color: rgba(255,255,255,0.18);
}
.compose-transmit-label {
    text-align: right;
    color: rgba(212, 181, 138, 0.25);
    font-size: 10px;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
}

/* Go Lunar overrides (dark theme) */
#messageModal .lunar-note-panel {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}
#messageModal .lunar-panel-header { display: none; }
#messageModal .lunar-intro {
    color: rgba(212, 181, 138, 0.5);
    font-size: 12px;
}
#messageModal .lunar-step-card {
    background: rgba(10, 22, 40, 0.4);
    border-color: rgba(212, 181, 138, 0.15);
    color: white;
}
#messageModal .lunar-step-label {
    color: rgba(212, 181, 138, 0.5);
}
#messageModal .lunar-input {
    background: rgba(10, 22, 40, 0.6);
    border-color: rgba(255,255,255,0.1);
    color: white;
}
#messageModal .lunar-input:focus {
    border-color: rgba(212, 181, 138, 0.5);
}
#messageModal .lunar-input::placeholder {
    color: rgba(255,255,255,0.2);
}
#messageModal .lunar-step-next {
    background: rgba(212, 181, 138, 0.1);
    border: 1px solid rgba(212, 181, 138, 0.4);
    color: var(--accent);
}
#messageModal .lunar-step-next:hover:not(:disabled) {
    background: var(--accent);
    color: #0a1628;
}
#messageModal .lunar-step-back {
    color: rgba(255,255,255,0.4);
}
#messageModal .lunar-dot {
    background: rgba(255,255,255,0.15);
}
#messageModal .lunar-dot.active {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(212, 181, 138, 0.8);
}
#messageModal .lunar-dot.done {
    background: rgba(212, 181, 138, 0.4);
}
#messageModal .lunar-result-card {
    background: rgba(18, 35, 58, 0.8);
    border-color: rgba(212, 181, 138, 0.2);
    color: white;
}
#messageModal .lunar-result-card::before {
    background: linear-gradient(90deg, var(--accent), var(--accent), var(--accent));
}
#messageModal .lunar-result-label {
    color: rgba(212, 181, 138, 0.5);
}
#messageModal .lunar-result-text { color: white; }
#messageModal .lunar-result-closing { color: rgba(255,255,255,0.4); }
#messageModal .lunar-action-btn { color: var(--accent); }
#messageModal .lunar-action-btn:hover { background: rgba(212, 181, 138, 0.1); }

/* ADD: row */
.compose-add-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 0 4px;
}
.compose-add-label {
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.compose-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(212, 181, 138, 0.5);
    background: #050a14;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.compose-add-btn:hover { background: rgba(212, 181, 138, 0.1); }
.compose-add-btn.active {
    background: var(--accent);
    color: #050a14;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(212, 181, 138, 0.4);
}

/* Music expansion panel */
.compose-music-panel {
    background: rgba(18, 35, 58, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 181, 138, 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-top: 16px;
    animation: composePanelIn 0.25s ease;
}
@keyframes composePanelIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.compose-music-search {
    position: relative;
}
.compose-music-search input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9999px;
    padding: 12px 16px 12px 44px;
    color: white;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.compose-music-search input::placeholder { color: rgba(255,255,255,0.35); }
.compose-music-search input:focus { border-color: rgba(212, 181, 138, 0.5); }
.compose-music-yt-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
}
/* Song suggestions inside music panel (dark theme) */
#messageModal .song-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}
#messageModal .song-suggestion {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}
#messageModal .song-suggestion:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.compose-music-note {
    text-align: center;
    color: rgba(255,255,255,0.25);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 14px;
}
/* Song search results dark theme */
#messageModal #songSearchResults {
    background: transparent;
}
#messageModal #songSearchResults div {
    color: rgba(255,255,255,0.7);
}
#messageModal #songSearchResults a {
    color: var(--accent);
}

/* Photo panel */
.compose-photo-panel {
    background: rgba(18, 35, 58, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 181, 138, 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-top: 16px;
    animation: composePanelIn 0.25s ease;
}
.compose-photo-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 2px dashed rgba(212, 181, 138, 0.3);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.compose-photo-dropzone:hover {
    border-color: rgba(212, 181, 138, 0.6);
    background: rgba(212, 181, 138, 0.05);
}
.compose-photo-dropzone svg { color: rgba(212, 181, 138, 0.4); }
.compose-photo-dropzone-text {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}
#messageModal #moonPhotoPreview {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
}
#messageModal #moonPhotoPreview img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 14px;
}
.compose-photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Send button (coral glow) */
.compose-send-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 36px;
}
.compose-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 40px;
    background: var(--accent);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 0 25px rgba(212, 181, 138, 0.4);
    transition: all 0.2s;
}
.compose-send-btn:hover {
    background: rgba(212, 181, 138, 0.9);
    box-shadow: 0 0 35px rgba(212, 181, 138, 0.5);
}
.compose-send-btn:active { transform: scale(0.97); }
.compose-send-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.compose-footer-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Dark theme overrides for new contact / step2 forms inside compose */
#messageModal .form-group label { color: rgba(212, 181, 138, 0.7); }
#messageModal .form-group input,
#messageModal .form-group textarea {
    background: rgba(10, 22, 40, 0.6);
    border-color: rgba(255,255,255,0.1);
    color: white;
}
#messageModal .form-group input:focus,
#messageModal .form-group textarea:focus {
    border-color: rgba(212, 181, 138, 0.5);
}
#messageModal .form-group input::placeholder { color: rgba(255,255,255,0.25); }
#messageModal .modal-header h2 { color: white; }
#messageModal .modal-subtitle { color: rgba(255,255,255,0.4) !important; }
#messageModal .new-contact-btn { color: var(--accent); border-color: rgba(212, 181, 138, 0.3); }
#messageModal .send-button {
    background: var(--accent);
    box-shadow: 0 0 20px rgba(212, 181, 138, 0.3);
}
#messageModal .send-button:hover { background: rgba(212, 181, 138, 0.9); }
#messageModal .recipient-selector input { background: rgba(10, 22, 40, 0.6); color: white; border-color: rgba(255,255,255,0.1); }
#messageModal .recipient-dropdown { background: rgba(18, 35, 58, 0.95); border-color: rgba(212, 181, 138, 0.2); }
#messageModal #newContactCityDropdown { background: rgba(18, 35, 58, 0.95); border-color: rgba(212, 181, 138, 0.2); }
#messageModal #newContactCityDropdown .city-option { color: rgba(255,255,255,0.7); }
#messageModal #newContactCityDropdown .city-option:hover { background: rgba(212, 181, 138, 0.1); }
#messageModal .delivery-info-box { background: rgba(212, 181, 138, 0.08); border-color: rgba(212, 181, 138, 0.2); color: rgba(255,255,255,0.6); }
/* Compose steps 2/3 — dark form overrides */
#messageModal .modal-header h2 { color: rgba(255,255,255,0.9); }
#messageModal .modal-subtitle { color: rgba(255,255,255,0.45); }
#messageModal .form-group label { color: rgba(255,255,255,0.5); }
#messageModal .form-group input,
#messageModal .form-group textarea {
    background: rgba(10, 22, 40, 0.6);
    color: rgba(255,255,255,0.9);
    border-color: rgba(212, 181, 138, 0.15);
}
#messageModal .form-group input::placeholder { color: rgba(255,255,255,0.2); }
#messageModal .form-group input:focus {
    border-color: rgba(212, 181, 138, 0.4);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.08);
}
#messageModal .new-contact-btn {
    color: var(--accent);
    border-color: rgba(212, 181, 138, 0.2);
    background: rgba(212, 181, 138, 0.06);
}
#messageModal .new-contact-btn:hover { background: rgba(212, 181, 138, 0.12); }
#messageModal .recipient-dropdown .recipient-option { color: rgba(255,255,255,0.7); }
#messageModal .recipient-dropdown .recipient-option:hover { background: rgba(212, 181, 138, 0.1); }

/* ====================================== */
/* CONTACTS PAGE — DARK THEME             */
/* ====================================== */
#contactsPage {
    background: #050a14;
    background-image:
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.08), transparent),
        radial-gradient(1.5px 1.5px at 90px 40px, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.06), transparent);
    background-size: 200px 100px;
}
#contactsPage .message-page-inner {
    background: transparent;
    box-shadow: none;
    max-width: 600px;
}
#contactsPage .message-page-header {
    background: rgba(8, 18, 35, 0.9);
    border-bottom: 1px solid rgba(212, 181, 138, 0.12);
    backdrop-filter: blur(12px);
}
#contactsPage .message-page-header span {
    color: var(--accent) !important;
}
#contactsPage .message-page-header button {
    color: var(--accent) !important;
}
#contactsPage .message-page-body {
    background: transparent;
}

/* Contacts search bar */
#contactsPage #contactSearchInput {
    background: rgba(10, 22, 40, 0.6) !important;
    color: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(212, 181, 138, 0.15) !important;
}
#contactsPage #contactSearchInput::placeholder {
    color: rgba(255,255,255,0.25) !important;
}
#contactsPage #contactSearchInput:focus {
    border-color: rgba(212, 181, 138, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.08);
    outline: none;
}

/* Contacts search container (overrides inline styles) */
#contactsPage .message-page-header + div {
    background: rgba(10, 22, 40, 0.4) !important;
    border-bottom-color: rgba(212, 181, 138, 0.1) !important;
}

/* Compose mobile responsive */
@media (max-width: 640px) {
    .compose-glass-card { padding: 20px; border-radius: 18px; }
    .compose-toggle-btn { padding: 8px 16px; font-size: 12px; }
    .compose-textarea { min-height: 200px; font-size: 16px; }
    .compose-send-btn { padding: 16px 32px; font-size: 15px; }
}

/* ====================================== */
/* MAIN PAGE — DARK RETRO-FUTURISTIC     */
/* Unified theme across entire app        */
/* ====================================== */

/* Body starfield background */
body {
    background: #050a14;
    position: relative;
    overflow: hidden;
    height: 100vh;
}
@media (max-width: 900px) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        font-size: 1rem; /* Respect user's system font size setting */
        -webkit-text-size-adjust: 100%;
    }

    /* Mobile inbox: bigger text for readability */
    .message-sender { font-size: 17px !important; }
    .message-preview { font-size: 15px !important; }
    .message-time { font-size: 13px !important; }
    .inbox-header .inbox-title, .inbox-header span { font-size: 20px !important; }
    .unread-badge { font-size: 13px !important; min-width: 22px !important; height: 22px !important; }
    .message-item { padding: 14px 16px !important; }
    .shared-sky-row { padding: 14px 16px !important; }
    .msg-avatar { width: 48px !important; height: 48px !important; font-size: 18px !important; }
}

/* Static star layers — scattered tiny dots */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        /* Bright prominent stars */
        radial-gradient(1.8px 1.8px at 5% 8%, rgba(255,255,255,0.50), transparent 65%),
        radial-gradient(1.6px 1.6px at 18% 42%, rgba(255,255,255,0.45), transparent 65%),
        radial-gradient(1.8px 1.8px at 33% 15%, rgba(255,255,255,0.48), transparent 65%),
        radial-gradient(1.5px 1.5px at 47% 71%, rgba(255,255,255,0.42), transparent 65%),
        radial-gradient(1.6px 1.6px at 62% 5%, rgba(255,255,255,0.46), transparent 65%),
        radial-gradient(1.8px 1.8px at 76% 55%, rgba(255,255,255,0.44), transparent 65%),
        radial-gradient(1.5px 1.5px at 88% 28%, rgba(255,255,255,0.47), transparent 65%),
        radial-gradient(1.6px 1.6px at 95% 82%, rgba(255,255,255,0.42), transparent 65%),
        radial-gradient(1.8px 1.8px at 12% 90%, rgba(255,255,255,0.45), transparent 65%),
        radial-gradient(1.5px 1.5px at 55% 38%, rgba(255,255,255,0.43), transparent 65%),
        /* Medium stars */
        radial-gradient(1.3px 1.3px at 2% 25%, rgba(255,255,255,0.16), transparent),
        radial-gradient(1.2px 1.2px at 8% 58%, rgba(255,255,255,0.13), transparent),
        radial-gradient(1.3px 1.3px at 14% 3%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.2px 1.2px at 21% 76%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1.3px 1.3px at 27% 34%, rgba(255,255,255,0.14), transparent),
        radial-gradient(1.2px 1.2px at 35% 62%, rgba(255,255,255,0.11), transparent),
        radial-gradient(1.3px 1.3px at 41% 9%, rgba(255,255,255,0.16), transparent),
        radial-gradient(1.2px 1.2px at 48% 85%, rgba(255,255,255,0.13), transparent),
        radial-gradient(1.3px 1.3px at 54% 47%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.2px 1.2px at 61% 19%, rgba(255,255,255,0.12), transparent),
        radial-gradient(1.3px 1.3px at 68% 73%, rgba(255,255,255,0.14), transparent),
        radial-gradient(1.2px 1.2px at 74% 41%, rgba(255,255,255,0.11), transparent),
        radial-gradient(1.3px 1.3px at 81% 93%, rgba(255,255,255,0.16), transparent),
        radial-gradient(1.2px 1.2px at 87% 16%, rgba(255,255,255,0.13), transparent),
        radial-gradient(1.3px 1.3px at 93% 65%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.2px 1.2px at 99% 48%, rgba(255,255,255,0.12), transparent),
        /* Dim tiny stars — dense fill */
        radial-gradient(0.8px 0.8px at 1% 12%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 4% 37%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 7% 68%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 10% 95%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 13% 22%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 16% 51%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 19% 83%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 23% 7%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 26% 44%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 30% 71%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 34% 18%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 37% 55%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 40% 88%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 44% 31%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 47% 63%, rgba(255,255,255,0.04), transparent),
        radial-gradient(0.8px 0.8px at 51% 2%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 54% 40%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 58% 77%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 62% 14%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 65% 52%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 69% 86%, rgba(255,255,255,0.04), transparent),
        radial-gradient(0.8px 0.8px at 72% 29%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 76% 60%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 79% 9%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 83% 45%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.8px 0.8px at 86% 79%, rgba(255,255,255,0.04), transparent),
        radial-gradient(0.8px 0.8px at 90% 21%, rgba(255,255,255,0.08), transparent),
        radial-gradient(0.8px 0.8px at 93% 56%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.8px 0.8px at 97% 38%, rgba(255,255,255,0.07), transparent),
        radial-gradient(0.8px 0.8px at 99% 74%, rgba(255,255,255,0.06), transparent),
        /* Extra-bright big stars */
        radial-gradient(2.5px 2.5px at 10% 33%, rgba(255,255,255,0.65), transparent 70%),
        radial-gradient(2px 2px at 42% 78%, rgba(255,255,255,0.58), transparent 70%),
        radial-gradient(2.2px 2.2px at 71% 12%, rgba(255,255,255,0.62), transparent 70%),
        radial-gradient(2px 2px at 85% 67%, rgba(255,255,255,0.55), transparent 70%),
        radial-gradient(2.5px 2.5px at 28% 91%, rgba(255,255,255,0.60), transparent 70%),
        /* Additional bright stars */
        radial-gradient(2.5px 2.5px at 3% 72%, rgba(255,255,255,0.28), transparent),
        radial-gradient(2.3px 2.3px at 22% 18%, rgba(255,255,255,0.26), transparent),
        radial-gradient(2.5px 2.5px at 39% 52%, rgba(255,255,255,0.30), transparent),
        radial-gradient(2px 2px at 58% 89%, rgba(255,255,255,0.24), transparent),
        radial-gradient(2.3px 2.3px at 81% 4%, rgba(255,255,255,0.27), transparent),
        radial-gradient(2.5px 2.5px at 67% 42%, rgba(255,255,255,0.25), transparent),
        radial-gradient(2px 2px at 92% 31%, rgba(255,255,255,0.28), transparent),
        radial-gradient(2.3px 2.3px at 15% 61%, rgba(255,255,255,0.22), transparent),
        /* Additional medium stars */
        radial-gradient(1.5px 1.5px at 6% 45%, rgba(255,255,255,0.18), transparent),
        radial-gradient(1.5px 1.5px at 22% 62%, rgba(255,255,255,0.16), transparent),
        radial-gradient(1.5px 1.5px at 39% 28%, rgba(255,255,255,0.17), transparent),
        radial-gradient(1.5px 1.5px at 57% 85%, rgba(255,255,255,0.15), transparent),
        radial-gradient(1.5px 1.5px at 73% 8%, rgba(255,255,255,0.18), transparent),
        radial-gradient(1.5px 1.5px at 91% 51%, rgba(255,255,255,0.16), transparent),
        /* More dim fill */
        radial-gradient(0.6px 0.6px at 3% 56%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.6px 0.6px at 17% 29%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.6px 0.6px at 31% 83%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.6px 0.6px at 46% 11%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.6px 0.6px at 60% 68%, rgba(255,255,255,0.06), transparent),
        radial-gradient(0.6px 0.6px at 75% 35%, rgba(255,255,255,0.05), transparent),
        radial-gradient(0.6px 0.6px at 89% 92%, rgba(255,255,255,0.06), transparent),
        /* Colored stars — yellow */
        radial-gradient(2.2px 2.2px at 15% 22%, rgba(255,213,79,0.28), transparent),
        radial-gradient(1.5px 1.5px at 55% 68%, rgba(255,213,79,0.18), transparent),
        radial-gradient(1.8px 1.8px at 88% 14%, rgba(255,213,79,0.22), transparent),
        /* Colored stars — pink/rose */
        radial-gradient(2px 2px at 82% 35%, rgba(255,138,128,0.22), transparent),
        radial-gradient(1.5px 1.5px at 38% 88%, rgba(255,138,128,0.16), transparent),
        radial-gradient(1.8px 1.8px at 8% 72%, rgba(255,138,128,0.20), transparent),
        /* Colored stars — light blue */
        radial-gradient(1.8px 1.8px at 64% 26%, rgba(128,216,255,0.20), transparent),
        radial-gradient(1.5px 1.5px at 29% 54%, rgba(128,216,255,0.15), transparent);
    background-size: 200px 200px;
}

/* Twinkling stars overlay */
.starfield-twinkle {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: white;
    animation: twinkle var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0;
}
.star.cross {
    border-radius: 0;
    background: transparent;
    overflow: visible;
}
.star.cross::before, .star.cross::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 1px;
}
.star.cross::before {
    width: 1px; height: 100%;
    left: 50%; top: 0;
    transform: translateX(-50%);
}
.star.cross::after {
    width: 100%; height: 1px;
    top: 50%; left: 0;
    transform: translateY(-50%);
}
@keyframes twinkle {
    0%, 100% { opacity: calc(var(--peak, 0.7) * 0.3); transform: scale(0.95); }
    50% { opacity: var(--peak, 0.7); transform: scale(1); box-shadow: 0 0 3px rgba(255,255,255,0.3); }
}
@keyframes twinkleFlash {
    0%, 100% { opacity: calc(var(--peak, 0.8) * 0.25); transform: scale(0.9); }
    40% { opacity: var(--peak, 0.8); transform: scale(1.05); box-shadow: 0 0 5px rgba(255,255,255,0.4); }
    70% { opacity: calc(var(--peak, 0.8) * 0.4); transform: scale(0.95); }
}
@keyframes twinkleRandom {
    0%, 100% { opacity: 0; }
    50% { opacity: var(--peak, 0.7); }
}

/* ============================================================
   APP HEADER — editorial brass-on-navy
   Sticky header used across all logged-in surfaces. Transparent
   over starfield, glass on scroll.
   ============================================================ */
.header {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    font-family: var(--sans);
}
.header.scrolled {
    background: rgba(3, 10, 24, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--line-soft);
}

/* Header brand (logo + tagline) */
.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.header-brand .logo {
    height: 100px;
    width: auto;
    display: block;
}
.header.scrolled .header-brand .logo {
    height: 68px;
}
.header-tagline {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
}

/* Desktop nav wrapper */
.header-desktop-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile hamburger button — hidden on desktop */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.mobile-menu-btn:hover, .mobile-menu-btn:active {
    border-color: var(--accent);
    background: rgba(212, 181, 138, 0.06);
}
.hamburger-line {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--accent);
    border-radius: 1px;
    transition: transform var(--dur-fast) ease;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 10, 24, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99998;
}
.mobile-menu-overlay.open {
    display: block;
}

/* Mobile menu drawer — slides in from right */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100%;
    background: var(--panel-strong);
    border-left: 1px solid var(--line-soft);
    z-index: 99999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.mobile-menu-drawer.open {
    right: 0;
}
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--line-soft);
}
.mobile-menu-items {
    display: flex;
    flex-direction: column;
    padding: 12px 0;
}
.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}
.mobile-menu-item:hover, .mobile-menu-item:active {
    background: rgba(212, 181, 138, 0.08);
    color: var(--accent-bright);
}

/* Header contacts button */
.header-contacts-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    cursor: pointer;
    color: var(--accent);
    padding: 0;
    border-radius: 50%;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) ease, color var(--dur-fast) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.header-contacts-btn:hover {
    border-color: var(--accent);
    background: rgba(212, 181, 138, 0.08);
    color: var(--accent-bright);
    transform: scale(1.06);
}

/* Header moon — dark theme */
.header-moon {
    border-color: var(--line);
}
.header-moon:hover {
    border-color: var(--accent);
}

/* User button — brass ghost */
.user-btn {
    border: 1px solid var(--line);
    color: var(--text-bright);
}
.user-btn:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
}
.user-initials {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 14px;
    color: var(--accent);
}
.settings-arrow { color: var(--accent); }

/* ============================================================
   SETTINGS DROPDOWN — editorial brass-on-navy
   ============================================================ */
.settings-dropdown {
    background: var(--panel-strong);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-family: var(--sans);
}
.settings-section + .settings-section { border-top-color: var(--line-soft); }
.settings-section-header:active { background: rgba(212, 181, 138, 0.06); }
.settings-section-header .section-summary { color: var(--text); }
.settings-section-header .section-chevron { color: var(--accent); }
.settings-dropdown label {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
}
.settings-dropdown input,
.settings-dropdown select,
.settings-select {
    background: rgba(3, 10, 24, 0.6) !important;
    border: 1px solid var(--line-soft) !important;
    color: var(--text-bright) !important;
    border-radius: var(--radius-sm);
    font-family: var(--sans);
}
.settings-dropdown input::placeholder { color: var(--muter); }
.settings-dropdown input:focus,
.settings-dropdown select:focus,
.settings-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}
.settings-dropdown p {
    color: var(--muted) !important;
    font-family: var(--sans);
}
.settings-dropdown .send-button {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--on-accent);
}
.settings-dropdown .send-button:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}
.settings-dropdown a { color: var(--accent) !important; }
.settings-dropdown a:hover { color: var(--accent-bright) !important; }
.settings-location-name {
    color: var(--text-bright) !important;
    font-family: var(--serif);
    font-style: italic;
}

/* ============================================================
   APP HERO (above split) — editorial brass-on-navy
   The salutation line above the orbit + inbox split.
   ============================================================ */
.hero h1 {
    font-family: var(--serif);
    font-style: italic;
    color: var(--text-bright);
    font-size: clamp(20px, 2.8vw, 26px);
    font-weight: 500;
    text-align: left;
    letter-spacing: -0.2px;
    line-height: var(--lh-snug);
    margin-top: 24px;
}
.hero .subtitle { color: var(--muted); font-family: var(--serif); font-style: italic; }

/* ============================================================
   INBOX (split-left column) — editorial brass-on-navy
   ============================================================ */
.split-left {
    border-right: none;
}

/* Inbox card — dark glass with brass-soft border */
.inbox-card {
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line-soft);
}
.inbox-header {
    border-bottom: 1px solid var(--line-soft);
}
.inbox-title {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: -0.2px;
    text-transform: none;
}

/* "New Moon Message" full-width pill at bottom of inbox */
.new-transmission-bar {
    padding: 12px clamp(12px, 2vw, 24px);
    flex-shrink: 0;
}
.new-transmission-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.new-transmission-btn:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
    box-shadow: 0 0 16px rgba(212, 181, 138, 0.12);
}
.new-transmission-btn.moon-up {
    background: rgba(212, 181, 138, 0.12);
    border-color: var(--accent);
    color: var(--accent-bright);
}

/* Compact new-message icon button (compose pencil in inbox header) */
.new-message-btn {
    background: rgba(212, 181, 138, 0.08);
    border: 1px solid var(--line-soft);
    color: var(--accent);
}
.new-message-btn:hover {
    background: rgba(212, 181, 138, 0.16);
    border-color: var(--accent);
    color: var(--accent-bright);
}

/* Shared-sky row in inbox — top of the conversation list */
.shared-sky-row {
    background: rgba(212, 181, 138, 0.04);
    border-bottom-color: var(--line-soft);
}
.shared-sky-row:hover { background: rgba(212, 181, 138, 0.10); }
.shared-sky-row-title {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: -0.1px;
}
.shared-sky-row-preview {
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
}

/* Create-circle option (legacy) — dark */
.create-circle-option { color: var(--muted); }
.create-circle-option:hover { background: rgba(212, 181, 138, 0.06); }

/* Conversation list items — dark */
.message-item {
    border-bottom-color: var(--line-soft);
}
.message-item:hover { background: rgba(212, 181, 138, 0.06); }
.message-sender {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: -0.1px;
}
.message-preview {
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
}
.message-time, .message-meta {
    color: var(--muter) !important;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 10px;
}
.msg-avatar {
    background: rgba(212, 181, 138, 0.12);
    border: 1px solid var(--line-soft);
    color: var(--accent);
    font-family: var(--serif);
    font-weight: 500;
}
.msg-avatar img[src=""], .msg-avatar img:not([src]) {
    display: none !important;
}
.message-avatar.outline {
    background: transparent;
    border-color: var(--line);
}
/* Direction chips: outgoing = brass primary, incoming = brass-soft */
.message-direction.sent-arrow {
    background: rgba(212, 181, 138, 0.20);
    color: var(--accent-bright);
}
.message-direction.recv-arrow {
    background: rgba(212, 181, 138, 0.10);
    color: var(--accent);
}
.message-list::-webkit-scrollbar-thumb { background: rgba(212, 181, 138, 0.3); }

/* Circle rows — dark */
.circle-row { border-bottom-color: var(--line-soft) !important; }
.circle-row:hover { background: rgba(212, 181, 138, 0.06) !important; }

/* ============================================================
   ORBIT RING + MAIN CONTENT — editorial brass-on-navy
   The signature visual: a brass orbital ring with the moon
   tracking its phase. Message dots are warm brass envelopes
   sitting on the ring; ambient brass glow when moon is above
   the horizon.
   ============================================================ */
.orbit-ring {
    border-color: var(--line-soft);
    box-shadow: 0 0 12px rgba(212, 181, 138, 0.04), inset 0 0 12px rgba(212, 181, 138, 0.02);
}

.orbit-ring.moon-visible {
    border-color: var(--line);
    box-shadow: 0 0 24px rgba(212, 181, 138, 0.10), inset 0 0 24px rgba(212, 181, 138, 0.04);
}

.orbit-ring::before {
    border-color: rgba(212, 181, 138, 0.06);
}

.orbit-ring.moon-visible::before {
    border-color: rgba(212, 181, 138, 0.10);
}

/* Orbit illustration — solid dark, darker than page bg */
.orbit-bg-illustration {
    opacity: 1;
    filter: none;
    background: #050c16;
}
.orbit-bg-illustration img {
    display: none;
}

/* Orbit center text — serif numerals, brass labels */
.orbit-center { color: var(--text-bright); font-family: var(--serif); }
.visibility-text {
    color: var(--accent) !important;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-size: 11px !important;
    font-weight: 600;
}
.standby-countdown {
    color: var(--text-bright) !important;
    font-family: var(--serif) !important;
    font-weight: 500;
}
.standby-label {
    color: var(--accent) !important;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-family: var(--sans);
    font-size: 11px !important;
    font-weight: 600;
}
.moon-down-lockout {
    color: var(--muter) !important;
    font-size: 11px !important;
    font-family: var(--serif);
    font-style: italic;
}

/* Message dots on orbit — brass for sent, brass-soft for incoming */
.message-dot { box-shadow: 0 0 8px rgba(212, 181, 138, 0.50); }
.message-dot:hover { box-shadow: 0 0 16px rgba(212, 181, 138, 0.75); }
.message-dot.releasing { box-shadow: 0 0 14px rgba(212, 181, 138, 0.65); }
.message-dot.incoming { box-shadow: 0 0 8px rgba(234, 216, 191, 0.45); }
.message-dot.incoming:hover { box-shadow: 0 0 16px rgba(234, 216, 191, 0.65); }

/* Roulette dots — diamond shape, moonlight blue-white */
.message-dot.roulette-dot {
    background-color: rgba(210, 228, 255, 0.95);
    border-radius: 2px;
    width: 10px;
    height: 10px;
    top: -3.5px;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 0 0 8px rgba(160, 200, 255, 0.55);
}
.message-dot.roulette-dot::after { display: none; }
.message-dot.roulette-dot:hover {
    transform: translateX(-50%) rotate(45deg) scale(1.35);
    box-shadow: 0 0 18px rgba(160, 200, 255, 0.80);
}
.message-dot.roulette-dot.releasing {
    transform: translateX(-50%) rotate(45deg) scale(1.1);
    animation: rouletteGlow 2s ease-in-out infinite;
}
@keyframes rouletteGlow {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 8px rgba(160, 200, 255, 0.45); }
    50%       { opacity: 1;   box-shadow: 0 0 20px rgba(160, 200, 255, 0.85); }
}

/* Moon data bar — brass-bordered glass pill */
.moon-data-bar {
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line-soft);
}
.moon-data-item { color: var(--muted); }
.moon-data-label {
    color: var(--accent);
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-size: 10px;
    font-weight: 600;
}
.moon-data-value {
    color: var(--text-bright);
    font-family: var(--serif);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Moon Down modal — editorial */
.moon-down-modal { background: var(--panel-strong); border: 1px solid var(--line-soft); }
.moon-down-modal h2 {
    color: var(--text-bright);
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.2px;
}
.moon-down-countdown .countdown-value {
    color: var(--accent);
    font-family: var(--serif);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Moon-down standby overrides for dark theme */
body.moon-down .cta-button {
    background: rgba(212, 181, 138, 0.18);
    border-color: var(--line-soft);
    color: var(--muter);
    box-shadow: none;
}
body.moon-down .new-message-btn {
    opacity: 0.2;
}

/* ============================================================
   MOON GLOW — when above horizon
   Brass-toned glow drop-shadows, pulsing breath
   ============================================================ */
.moon-icon.moon-glow svg {
    filter:
        drop-shadow(0 0 6px rgba(212, 181, 138, 0.70))
        drop-shadow(0 0 16px rgba(212, 181, 138, 0.42))
        drop-shadow(0 0 32px rgba(212, 181, 138, 0.22));
    animation: moonPulseGlow 4s ease-in-out infinite;
}

@keyframes moonPulseGlow {
    0%, 100% {
        filter:
            drop-shadow(0 0 6px rgba(212, 181, 138, 0.70))
            drop-shadow(0 0 16px rgba(212, 181, 138, 0.42))
            drop-shadow(0 0 32px rgba(212, 181, 138, 0.22));
    }
    50% {
        filter:
            drop-shadow(0 0 10px rgba(212, 181, 138, 0.90))
            drop-shadow(0 0 24px rgba(212, 181, 138, 0.55))
            drop-shadow(0 0 40px rgba(212, 181, 138, 0.32));
    }
}

/* Orbit ring glows when moon is visible (brass) */
.orbit-ring.moon-visible {
    border-color: rgba(212, 181, 138, 0.45);
    box-shadow:
        0 0 20px rgba(212, 181, 138, 0.10),
        inset 0 0 20px rgba(212, 181, 138, 0.05);
}

/* Onboarding overlay — dark theme (already styled in base) */

/* Modal overlays — editorial dark glass */
.modal-overlay { background: rgba(3, 10, 24, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal {
    background: var(--panel-strong);
    border: 1px solid var(--line-soft);
    color: var(--text);
    font-family: var(--sans);
}

/* "New Moon Message" CTA pill — brass on navy */
.cta-button {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--on-accent);
    font-family: var(--sans);
    font-weight: 600;
    letter-spacing: 0.4px;
    box-shadow: 0 0 24px rgba(212, 181, 138, 0.18);
}
.cta-button:hover {
    background: var(--accent-bright);
    border-color: var(--accent-bright);
    box-shadow: 0 0 32px rgba(212, 181, 138, 0.26);
}
.delivery-note { color: var(--muter); font-family: var(--serif); font-style: italic; }
.moon-carrying-indicator { color: var(--muted) !important; }
.moon-carrying-count { color: var(--accent-bright) !important; font-family: var(--serif); font-weight: 500; }

/* Responsive — tagline hidden on small screens */
@media (max-width: 768px) {
    .header-tagline { display: none; }
    .header-brand .logo { height: 64px; }
}

/* ============================== */
/* CHAT VIEW — DARK THEME         */
/* Matches compose page aesthetic  */
/* ============================== */

/* Dark starfield background */
/* NOTE: shared-sky was previously bundled into this chat dark-theme
   block. It now has its own editorial overrides higher up; these
   rules are scoped to #messagePageView only. */
#messagePageView.active {
    background: #050a14;
    background-image:
        radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.08), transparent),
        radial-gradient(2px 2px at 50px 160px, rgba(255,255,255,0.15), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.12), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.08), transparent);
    background-size: 200px 200px;
}
#messagePageView .message-page-inner {
    background: transparent;
    box-shadow: none;
}

/* ============================================================
   CHAT DETAIL (#messagePageView) — editorial brass-on-navy
   The conversation view. Received notes sit as dark glass cards
   on the night sky; sent notes carry a brass-warm tint to mark
   them as "what you wrote." Lunar notes are framed by brass
   diamond seams.
   ============================================================ */
#messagePageView .message-page-header {
    border-bottom: 1px solid var(--line-soft);
    background: rgba(3, 10, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
#messagePageView .message-page-back {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--accent);
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
#messagePageView .message-page-back:hover {
    background: rgba(212, 181, 138, 0.08);
    border-color: var(--accent);
    color: var(--accent-bright);
}
#messagePageView .message-page-avatar {
    border: 1px solid var(--line);
    padding: 2px;
    background: rgba(212, 181, 138, 0.16);
    color: var(--accent);
    font-family: var(--serif);
    font-weight: 500;
}
#messagePageView .message-page-info h3 {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--text-bright);
    letter-spacing: -0.2px;
}
#messagePageView .message-page-info p {
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
}

/* Chat body */
#messagePageView .message-page-body {
    padding: 20px;
    padding-bottom: 20px;
    color: var(--text);
    font-family: var(--sans);
}

/* Date separators in chat — brass tracked uppercase */
#messagePageView .message-page-body .chat-date-sep {
    color: var(--accent);
    background: rgba(212, 181, 138, 0.08);
    font-family: var(--sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-weight: 600;
}

/* Received bubbles — dark glass with brass-soft seam */
#messagePageView .message-bubble {
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line-soft);
    max-width: 80%;
}
#messagePageView .message-bubble p {
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-bright);
    letter-spacing: -0.005em;
}
#messagePageView .message-bubble-time {
    color: var(--muter);
    font-family: var(--sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Sent bubbles — warm brass-tinted glass for "your letters" */
#messagePageView .message-bubble.sent {
    background: rgba(212, 181, 138, 0.16);
    border: 1px solid var(--line);
}
#messagePageView .message-bubble.sent p {
    color: var(--text-bright);
}
#messagePageView .message-bubble.sent .message-bubble-time {
    color: rgba(212, 181, 138, 0.6);
}

/* Lunar Note bubbles — special editorial frame */
#messagePageView .bubble-lunar-note {
    background: var(--panel-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    box-shadow:
        inset 0 0 12px rgba(212, 181, 138, 0.06),
        0 0 24px rgba(212, 181, 138, 0.10);
}
#messagePageView .bubble-lunar-note::before {
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.65;
    height: 1.5px;
}
#messagePageView .bubble-lunar-label {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-weight: 600;
}
#messagePageView .bubble-lunar-text {
    font-family: var(--serif);
    font-style: italic;
    color: var(--text-bright);
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: -0.005em;
}
#messagePageView .bubble-lunar-closing {
    font-family: var(--serif);
    font-style: italic;
    color: var(--muted);
    font-size: 14px;
}
#messagePageView .bubble-lunar-note .message-bubble-time {
    color: var(--muter);
}
#messagePageView .bubble-lunar-note .read-receipt.delivered {
    color: var(--muter);
}
#messagePageView .bubble-lunar-note .read-receipt.read {
    color: var(--accent);
}

/* Read receipts — brass-toned */
#messagePageView .read-receipt.delivered {
    color: var(--muter);
}
#messagePageView .read-receipt.read {
    color: var(--accent);
}

/* Reactions — brass-tinted chips */
#messagePageView .reaction-chip {
    background: rgba(3, 10, 24, 0.7);
    border-color: var(--line-soft);
}
#messagePageView .reaction-chip:hover {
    background: rgba(212, 181, 138, 0.10);
    border-color: var(--line);
}
#messagePageView .reaction-chip.active {
    background: rgba(212, 181, 138, 0.16);
    border-color: var(--accent);
}
#messagePageView .reaction-chip .reaction-count {
    color: var(--muted);
    font-family: var(--sans);
}
#messagePageView .reaction-chip.active .reaction-count {
    color: var(--accent-bright);
}

/* Reaction picker popup — editorial dark panel */
#messagePageView .reaction-picker {
    background: var(--panel-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-md);
}
#messagePageView .reaction-picker-divider {
    background: var(--line-soft);
}
#messagePageView .reaction-picker-label {
    color: var(--accent);
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-size: 10px;
    font-weight: 600;
}
#messagePageView .reaction-option:hover {
    background: rgba(212, 181, 138, 0.10);
}

/* Chat footer — editorial dark glass */
#messagePageView .message-page-footer {
    border-top: 1px solid var(--line-soft);
    background: rgba(3, 10, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
#sharedSkyPhotoMenu { display: none; }
#sharedSkyPhotoMenu.active { display: block; }

/* Chat input */
#messagePageView .message-page-input {
    background: rgba(3, 10, 24, 0.6);
    border: 1px solid var(--line-soft);
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 14px;
}
#messagePageView .message-page-input::placeholder {
    color: var(--muter);
}
#messagePageView .message-page-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}

/* Send button — brass pill */
#messagePageView .message-page-send {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 16px rgba(212, 181, 138, 0.22);
}
#messagePageView .message-page-send:hover {
    background: var(--accent-bright);
    box-shadow: 0 0 24px rgba(212, 181, 138, 0.32);
}

/* Photo label emoji in reply row */
#messagePageView #replyPhotoLabel {
    filter: none;
}

/* Lunar Note pill button (in composer) */
#messagePageView .lunar-note-pill-sm {
    border-color: var(--line);
    background: rgba(212, 181, 138, 0.04);
    color: var(--accent);
    font-family: var(--sans);
}
#messagePageView .lunar-note-pill-sm:hover {
    background: rgba(212, 181, 138, 0.12);
    border-color: var(--accent);
    color: var(--accent-bright);
}

/* Add Lunar link */
#messagePageView .add-lunar-link {
    color: var(--accent);
    font-family: var(--sans);
}
#messagePageView .add-lunar-link:hover {
    color: var(--accent-bright);
}

/* Moon gate — disabled state copy */
#messagePageView #replyMoonGate {
    color: var(--muter);
    font-family: var(--serif);
    font-style: italic;
}
#messagePageView #replyMoonGate svg {
    color: var(--accent) !important;
}

/* Thread Lunar Note panel — editorial dark glass */
#messagePageView .thread-lunar-panel {
    background: var(--panel-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
#messagePageView .thread-lunar-header {
    color: var(--accent);
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-weight: 600;
    font-size: 11px;
}
#messagePageView .thread-lunar-close {
    background: rgba(212, 181, 138, 0.08);
    border: 1px solid var(--line-soft);
    color: var(--muted);
}
#messagePageView .thread-lunar-close:hover {
    background: rgba(212, 181, 138, 0.16);
    color: var(--accent-bright);
}
#messagePageView .thread-lunar-intro {
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
}
#messagePageView .thread-lunar-label {
    color: var(--accent);
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: var(--tracking-label);
    font-weight: 600;
    font-size: 11px;
}
#messagePageView .thread-lunar-input {
    background: rgba(3, 10, 24, 0.6);
    border-color: var(--line-soft);
    color: var(--text-bright);
    font-family: var(--sans);
}
#messagePageView .thread-lunar-input::placeholder {
    color: var(--muter);
}
#messagePageView .thread-lunar-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 181, 138, 0.15);
}
#messagePageView .thread-lunar-result {
    background: rgba(212, 181, 138, 0.06);
    border-color: var(--line-soft);
    color: var(--text-bright);
    font-family: var(--serif);
    font-style: italic;
}
#messagePageView .thread-lunar-result .lunar-closing {
    color: var(--muted);
}
#messagePageView .thread-lunar-send {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 0 16px rgba(212, 181, 138, 0.22);
}
#messagePageView .thread-lunar-send:not(:disabled):hover {
    background: var(--accent-bright);
    box-shadow: 0 0 24px rgba(212, 181, 138, 0.32);
}

/* Reply photo preview */
#messagePageView #replyPhotoPreview img {
    border: 1px solid var(--line-soft);
}

/* Transit/arriving messages — italic serif waiting state */
#messagePageView .chat-transit-msg {
    background: rgba(212, 181, 138, 0.04);
    border: 1px dashed var(--line-soft);
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
}

/* ============================================================
   Typing indicator (used in chat) — editorial brass
   ============================================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 8px;
}
.typing-indicator-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
}
.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: typingPulse 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}
.typing-indicator-label {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
}

/* Comment thread on messages */
.msg-comments-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--accent);
    cursor: pointer;
    margin-top: 4px;
    padding: 2px 0;
    opacity: 0.85;
    transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
    background: none;
    border: none;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}
.msg-comments-link:hover {
    opacity: 1;
    color: var(--accent-bright);
}
.msg-comments-thread {
    margin-top: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--line-soft);
}
.msg-comment-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.msg-comment-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(212, 181, 138, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}
.msg-comment-body {
    flex: 1;
}
.msg-comment-name {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}
.msg-comment-text {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
}
.msg-comment-time {
    font-size: 10px;
    color: rgba(255,255,255,0.25);
}
.msg-comment-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.msg-comment-input {
    flex: 1;
    padding: 6px 12px;
    background: rgba(10, 22, 40, 0.5);
    border: 1px solid rgba(212, 181, 138, 0.15);
    border-radius: 16px;
    color: white;
    font-size: 12px;
    font-family: inherit;
    outline: none;
}
.msg-comment-input::placeholder {
    color: rgba(255,255,255,0.2);
}
.msg-comment-input:focus {
    border-color: rgba(212, 181, 138, 0.4);
}
.msg-comment-send {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(212, 181, 138, 0.15);
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.msg-comment-send:hover {
    background: rgba(212, 181, 138, 0.25);
}

/* Chat mobile responsive */
@media (max-width: 640px) {
    #messagePageView .message-bubble,
    #messagePageView .bubble-lunar-note { max-width: 88%; }
}

/* ============================================ */
/* EDITORIAL LANDING PAGE — LUNAR / NOCTURNAL   */
/* ============================================ */

/* Editorial landing inherits all tokens from :root.
   Color is set on the scope so cream text applies inside the landing
   without affecting the rest of the (still light-themed) app. */
.editorial-landing { color: var(--text); }

/* Override base onboarding-overlay bg to deeper midnight */
.onboarding-overlay:has(.editorial-landing) {
    background: #030A18;
}
/* Subtle atmospheric grain over the entire landing */
.editorial-landing::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(212,181,138,0.05) 0%, rgba(212,181,138,0) 55%),
        radial-gradient(ellipse at 50% 110%, rgba(212,181,138,0.04) 0%, rgba(212,181,138,0) 55%);
    mix-blend-mode: screen;
}

/* Subtle entrance — content is always visible (opacity 1); only a small lift animates */
.editorial-landing .fade-in-up {
    opacity: 1;
    transform: translateY(10px);
    transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.editorial-landing .fade-in-up.visible {
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .editorial-landing .fade-in-up {
        transform: none;
        transition: none;
    }
}

/* ---- LANDING NAV ---- */
.landing-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 22px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(3,10,24,0.85) 0%, rgba(3,10,24,0.55) 70%, rgba(3,10,24,0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    flex-shrink: 0;
    transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.landing-nav.scrolled {
    padding: 14px 48px;
    background: rgba(3, 10, 24, 0.82);
    border-bottom: 1px solid var(--line-soft);
}
.landing-nav-brand {
    display: flex;
    align-items: center;
}
.landing-wordmark {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: 0.3px;
    color: var(--text-bright);
}
.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 36px;
}
.landing-nav-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
}
.landing-nav-link:hover {
    color: var(--text-bright);
}
.landing-nav-login {
    color: var(--text-bright);
}
.landing-nav-signup {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 9px 22px;
    color: #0A1422;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    margin-left: 6px;
}
.landing-nav-signup:hover {
    background: #E5C9A0;
    border-color: #E5C9A0;
}
.landing-nav-mobile-actions {
    display: none;
    align-items: center;
    gap: 14px;
}
.landing-nav-mobile-login {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-bright);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
    cursor: pointer;
}
.landing-nav-mobile-login:hover { color: var(--accent-bright); }
.landing-nav-mobile-btn {
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 8px 20px;
    color: #0A1422;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
}

@media (max-width: 880px) {
    .landing-nav { padding: 16px 22px; }
    .landing-nav.scrolled { padding: 12px 22px; }
    .landing-nav-actions { display: none; }
    .landing-nav-mobile-actions { display: inline-flex; }
}

/* ---- LANDING SCROLL CONTAINER ---- */
.moonrise-scroll {
    position: relative;
    flex: 1;
}
.moonrise-content {
    position: relative;
    z-index: 2;
}

/* ---- HERO ---- */
.ed-hero {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 56px 32px;
}
.ed-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
    min-height: min(78vh, 720px);
}
.ed-hero-text {
    position: relative;
    z-index: 2;
}
.ed-hero-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(40px, 5.4vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.8px;
    color: var(--text-bright);
    margin: 0 0 28px;
}
.ed-hero-sub {
    font-family: var(--sans);
    font-size: clamp(17px, 1.6vw, 22px);
    font-weight: 400;
    line-height: 1.55;
    color: var(--muted);
    max-width: 540px;
    margin: 0 0 44px;
}
.ed-hero-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

/* Hero art (right side) */
.ed-hero-art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}
.ed-hero-moon-svg {
    width: min(460px, 48vw);
    height: auto;
    filter: drop-shadow(0 0 80px rgba(212,181,138,0.10));
    overflow: visible;
}
.ed-hero-moon-grp {
    transform-origin: 180px 180px;
    transform-box: fill-box;
    animation: edMoonDrift 28s ease-in-out infinite;
}
@keyframes edMoonDrift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(0, -6px); }
}
.ed-hero-moon-orbit {
    transform-origin: 180px 180px;
    transform-box: fill-box;
    animation: edSlowSpin 110s linear infinite;
}
@keyframes edSlowSpin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .ed-hero-moon-grp,
    .ed-hero-moon-orbit { animation: none; }
}

/* HERO COUNTDOWN + CTA */
.ed-countdown-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.ed-countdown-label {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--muter);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}
/* Retro-style brass digit counter */
.ed-counter {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.ed-counter-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.ed-counter-digits {
    display: flex;
    align-items: center;
    gap: 4px;
}
.ed-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 60px;
    background: rgba(7, 15, 30, 0.85);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: var(--serif);
    font-size: 32px;
    font-weight: 500;
    color: var(--text-bright);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(212,181,138,0.06), 0 2px 6px rgba(0,0,0,0.4);
}
.ed-digit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0,0,0,0.45);
    pointer-events: none;
}
.ed-digit-label {
    font-family: var(--sans);
    font-size: 9px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--muter);
}
.ed-counter-sep {
    font-family: var(--serif);
    font-size: 26px;
    color: var(--accent);
    margin: 12px 2px 0;
    line-height: 1;
}
@media (max-width: 480px) {
    .ed-digit { width: 38px; height: 52px; font-size: 28px; }
    .ed-counter-sep { font-size: 22px; margin-top: 10px; }
}
.ed-live-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    width: min(420px, 100%);
}
.ed-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live-dot);
    box-shadow: 0 0 10px rgba(212,181,138,0.55);
    animation: edPulse 2.4s ease-in-out infinite;
}
@keyframes edPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.18); }
}
.ed-live-label {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--live);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ed-cta-subline {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    color: var(--muter);
    margin: 0 0 0 4px;
    letter-spacing: 0.3px;
}

/* Capsule CTA button — filled brass, restrained, no glow */
.ed-cta-link {
    appearance: none;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 14px 32px;
    color: #0A1422;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.ed-cta-link::after {
    content: '\2192';
    display: inline-block;
    color: #0A1422;
    font-weight: 600;
    transition: transform 0.25s ease;
    font-size: 16px;
    line-height: 1;
}
.ed-cta-link:hover {
    background: #E5C9A0;
    border-color: #E5C9A0;
    color: #0A1422;
}
.ed-cta-link:hover::after {
    transform: translateX(4px);
}

@media (max-width: 880px) {
    .ed-hero { padding: 24px 24px 48px; }
    .ed-hero-grid { grid-template-columns: 1fr; gap: 0; min-height: auto; text-align: center; }
    .ed-hero-art { min-height: 200px; order: -1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 0; }
    .ed-hero-moon-svg { width: 180px; }
    .ed-hero-title { font-size: clamp(32px, 10vw, 64px); line-height: 1.04; }
    .ed-hero-sub { font-size: clamp(15px, 4vw, 19px); line-height: 1.55; max-width: 100%; }
    .ed-hero-cta { align-items: center; }
}

/* ---- HORIZON / ROLLING-HILL DIVIDER ---- */
.ed-horizon {
    width: 100%;
    line-height: 0;
    margin-top: -160px;
    margin-bottom: -40px;
    pointer-events: none;
    position: relative;
    z-index: 3;
}
.ed-horizon svg {
    width: 100%;
    height: clamp(200px, 22vw, 280px);
    display: block;
    /* Fade the very bottom into transparent so the hill silhouette never shows
       a hard edge against the page bg, even if anti-aliasing creates one. */
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 78%, transparent 100%);
            mask-image: linear-gradient(to bottom, black 0%, black 78%, transparent 100%);
}
@media (max-width: 640px) {
    .ed-horizon { margin-top: -20px; margin-bottom: -20px; }
    .ed-horizon svg { height: 200px; }
}

/* ---- APP HORIZON DIVIDER (fixed to bottom of viewport) ---- */
.app-horizon {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    pointer-events: none;
    z-index: 3;
}
.app-horizon svg {
    width: 100%;
    height: 120px;
    display: block;
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
            mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}
@media (max-width: 900px) {
    .app-horizon { display: none; }
}

/* ---- HOW IT WORKS ---- */
.ed-hiw {
    max-width: 1240px;
    margin: 0 auto;
    padding: 80px 56px 60px;
}
.ed-section-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(38px, 5vw, 58px);
    color: var(--text-bright);
    letter-spacing: -0.5px;
    text-align: center;
    margin: 0 0 56px;
}
.ed-hiw-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.ed-hiw-step {
    padding: 36px 28px;
    text-align: center;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ed-hiw-step:last-child { border-right: none; }
.ed-hiw-num {
    font-family: var(--sans);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--muter);
    margin: 18px 0 10px;
}
.ed-hiw-text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(15px, 1.3vw, 18px);
    line-height: 1.55;
    color: var(--muted);
    max-width: 280px;
    margin: 0 auto;
}

@media (max-width: 880px) {
    .ed-hiw { padding: 56px 24px 40px; }
    .ed-hiw-grid { grid-template-columns: 1fr; }
    .ed-hiw-step {
        border-right: none;
        border-bottom: 1px solid var(--line-soft);
        padding: 36px 12px;
    }
    .ed-hiw-step:last-child { border-bottom: none; }
    .ed-hiw-text {
        font-size: 21px;
        line-height: 1.5;
        max-width: 480px;
    }
    .ed-hiw-num { font-size: 13px; letter-spacing: 3.5px; }
}

/* ---- LUNAR LINEWORK ILLUSTRATIONS ---- */
.ed-illo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ed-illo svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Section 1 — moon rises from behind the horizon and sets back (faster) */
.ed-illo-horizon .ed-illo-moon-rise {
    animation: edMoonRiseSet 5.5s ease-in-out infinite;
}
@keyframes edMoonRiseSet {
    0%, 100% { transform: translateY(22px); }   /* below horizon, hidden by clip */
    50%      { transform: translateY(-32px); }  /* peak above horizon */
}

/* Section 2 — sparkle symbol being SENT to the moon (rises from sender to moon) */
.ed-illo-window .ed-illo-sending {
    transform: translate(60px, 92px);
    animation: edSendUp 4.5s ease-in-out infinite;
    transform-box: fill-box;
}
@keyframes edSendUp {
    0%   { transform: translate(60px, 92px); opacity: 0; }
    8%   { opacity: 1; }
    78%  { transform: translate(60px, 36px); opacity: 1; }
    90%  { transform: translate(60px, 36px); opacity: 0; }
    100% { transform: translate(60px, 92px); opacity: 0; }
}

/* Section 3 — single moon travelling along the orbit ring.
   IMPORTANT: no `transform-box: fill-box` here — that would resolve transform-origin
   to the moon's tiny bounding box (centered on the moon itself) instead of the SVG
   viewBox center (60, 60), which is what we need to rotate around the orbit. */
.ed-illo-delivery .ed-illo-orbit-moon {
    transform-origin: 60px 60px;
    animation: edSlowSpin 12s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .ed-illo-delivery .ed-illo-orbit-moon { animation: none; }
}

/* Daily ritual — subtle, super slow sinking moon */
.ed-illo-ritual .ed-illo-soft {
    animation: edSinkingMoon 22s ease-in-out infinite;
}
@keyframes edSinkingMoon {
    0%, 100% { transform: translateY(-10px); opacity: 0.95; }
    50%      { transform: translateY(10px);  opacity: 0.78; }
}

/* Slow orbit — traveler follows the ellipse path (motion-path) */
.ed-illo-slow .ed-illo-orbit-slow {
    stroke-dasharray: 2 4;
    animation: edDashShift 12s linear infinite;
}

/* Quiet constellation — pronounced pulse + size + brass-to-ivory color shift */
.ed-illo-quiet .ed-illo-star {
    transform-origin: center;
    transform-box: fill-box;
}
@media (prefers-reduced-motion: reduce) {
    .ed-illo-ritual .ed-illo-soft { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ed-illo *, .ed-illo svg * {
        animation: none !important;
    }
}

/* ---- TRANSIT CANVAS ---- */
.ed-transit {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 0;
    text-align: center;
}
.ed-transit-caption {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(15px, 1.3vw, 18px);
    color: var(--muter);
    letter-spacing: 0.4px;
    margin: 0 0 6px;
    position: relative;
    z-index: 2;
}
.ed-transit-frame {
    position: relative;
    width: min(82vw, 860px);
    height: min(82vw, 860px);
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
}
.ed-transit-frame canvas {
    width: 100%;
    height: 100%;
}
.ed-transit-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 80px rgba(3,10,24,0.7);
    pointer-events: none;
}
@media (max-width: 480px) {
    .ed-transit-frame { width: 340px; height: 340px; }
}

/* ---- BENEFITS ---- */
.ed-benefits {
    max-width: 1240px;
    margin: 0 auto;
    padding: 60px 56px 80px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
.ed-benefit-card {
    background: var(--panel);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    padding: 36px 30px 32px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.4s ease, transform 0.4s ease;
}
.ed-benefit-card:hover {
    border-color: var(--line);
    transform: translateY(-2px);
}
.ed-benefit-card .ed-illo {
    margin: 0 0 24px;
    width: 160px;
    height: 160px;
}
.ed-benefit-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1.2;
    color: var(--text-bright);
    margin: 0 0 14px;
}
.ed-benefit-body {
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0;
}

@media (max-width: 1000px) {
    .ed-benefits { grid-template-columns: 1fr; padding: 40px 24px 60px; gap: 18px; }
    .ed-benefit-card { padding: 32px 28px 30px; }
    .ed-benefit-title {
        font-size: 30px;
        line-height: 1.18;
    }
    .ed-benefit-body { font-size: 16.5px; line-height: 1.7; }
    .ed-section-title { font-size: clamp(34px, 8.5vw, 46px); line-height: 1.05; }
    .ed-positioning-title { font-size: clamp(26px, 7vw, 36px); line-height: 1.18; }
    .ed-positioning-body { font-size: 16px; line-height: 1.7; }
}

/* ---- POSITIONING ---- */
.ed-positioning {
    max-width: 760px;
    margin: 24px auto 0;
    padding: 60px 32px 40px;
    text-align: center;
}
.ed-positioning-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(30px, 3.4vw, 44px);
    line-height: 1.15;
    color: var(--text-bright);
    margin: 0 0 18px;
    letter-spacing: -0.2px;
}
.ed-positioning-body {
    font-family: var(--sans);
    font-size: clamp(15px, 1.2vw, 17px);
    line-height: 1.75;
    color: var(--muted);
    margin: 0 auto;
    max-width: 580px;
}

/* ---- RULE / DIAMOND ROW ---- */
.ed-rule-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 0 auto 32px;
    max-width: 460px;
    color: var(--accent);
}
.ed-rule {
    flex: 1;
    height: 1px;
    background: var(--line);
    opacity: 0.7;
}
.ed-diamond {
    font-size: 14px;
    color: var(--accent);
    line-height: 1;
}

/* ---- FINAL CTA ---- */
.ed-final-cta {
    max-width: 760px;
    margin: 24px auto 0;
    padding: 60px 32px 40px;
    text-align: center;
}
.ed-final-cta-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(34px, 4.6vw, 60px);
    color: var(--text-bright);
    letter-spacing: -0.4px;
    margin: 0 0 14px;
    line-height: 1.05;
}
.ed-final-cta-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.ed-final-cta-area .ed-countdown-row,
.ed-final-cta-area .ed-live-row {
    width: auto;
    align-items: center;
}
.ed-final-cta-area .ed-cta-link { align-self: center; }
.ed-final-cta-area .ed-countdown-label {
    text-align: center;
}

/* ---- FOOTER ---- */
.ed-footer {
    padding: 60px 32px 56px;
    text-align: center;
    border-top: 1px solid var(--line-soft);
    margin-top: 40px;
}
.ed-footer-signoff {
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
    color: var(--muter);
    line-height: 1.7;
    margin: 0;
}
.ed-footer-signoff span {
    font-style: normal;
    color: var(--muted);
    font-weight: 500;
}

/* ============================================
   MOON ROULETTE
   ============================================ */


/* Page shell */
.roulette-page-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px 80px;
    width: 100%;
}

/* Header */
.roulette-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    background: rgba(3,10,24,0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 24px;
}
.roulette-title-wrap { flex: 1; }
.roulette-title {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--text-bright);
    margin: 0 0 2px;
}
.roulette-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.roulette-close-btn {
    background: none;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    flex-shrink: 0;
    transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.roulette-close-btn:hover { border-color: var(--accent); color: var(--accent-bright); }

.roulette-compose-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 16px;
}

/* Tabs */
.roulette-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line-soft);
    margin-bottom: 24px;
}
.roulette-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 20px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
    margin-bottom: -1px;
}
.roulette-tab.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
}
.roulette-tab-count {
    display: inline-block;
    background: rgba(212,181,138,0.12);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 700;
}

/* Empty state */
.roulette-empty {
    text-align: center;
    padding: 64px 0;
    color: var(--muted);
    font-family: var(--serif);
    font-style: italic;
    font-size: 15px;
}

/* Cards */
.roulette-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 12px;
    background: rgba(255,255,255,0.02);
    position: relative;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.roulette-card:hover { border-color: var(--line); background: rgba(255,255,255,0.04); }

/* Distinct shimmer border for recipient cards (mystery feel) */
.roulette-card--recipient {
    border-color: rgba(212,181,138,0.18);
    background: rgba(212,181,138,0.03);
}
.roulette-card--recipient:hover { border-color: rgba(212,181,138,0.35); }

/* Returned state: subtle warm tint */
.roulette-card--declined { border-color: rgba(212,181,138,0.28); }

/* Revealed state: accent border */
.roulette-card--revealed { border-color: var(--accent); }

.roulette-card-moon {
    flex-shrink: 0;
    width: 44px;
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
}
.roulette-card-moon .app-icon { width: 36px; height: 36px; }

.roulette-card-body { flex: 1; min-width: 0; }

.roulette-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.roulette-tag {
    font-family: var(--sans);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(212,181,138,0.1);
    border-radius: 4px;
    padding: 2px 7px;
}
.roulette-status {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.status-transit    { color: var(--muted); }
.status-delivered  { color: #7ec8a0; }
.status-returned   { color: rgba(212,181,138,0.7); }
.status-relaunched { color: var(--muted); }
.status-revealed   { color: var(--accent-bright); }

.roulette-release-time {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
}

.roulette-destination,
.roulette-anon-sender {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 6px;
}
.roulette-destination strong,
.roulette-anon-sender strong { color: var(--text-bright); font-weight: 500; }

.roulette-preview {
    font-family: var(--serif);
    font-size: 15px;
    color: var(--text);
    margin: 6px 0 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.roulette-attempt {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 8px;
}

.roulette-photo {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
}

.roulette-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.roulette-card-time {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

/* Action buttons */
.roulette-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.roulette-btn {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    padding: 7px 16px;
    cursor: pointer;
    transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.roulette-btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--bg);
}
.roulette-btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.roulette-btn-ghost {
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
}
.roulette-btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }
.roulette-btn-danger {
    background: none;
    border: 1px solid rgba(220,80,80,0.35);
    color: rgba(220,100,100,0.8);
}
.roulette-btn-danger:hover { border-color: rgba(220,80,80,0.7); color: rgba(220,80,80,1); }

/* Reveal button */
.roulette-reveal-btn {
    background: none;
    border: 1px dashed rgba(212,181,138,0.4);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.roulette-reveal-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(212,181,138,0.08);
}
.roulette-reveal-btn:disabled { opacity: 0.5; cursor: default; }
.roulette-reveal-btn.revealed {
    border-style: solid;
    border-color: var(--accent);
    color: var(--accent-bright);
}
.roulette-reveal-complete {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--accent-bright);
    font-weight: 600;
}

/* Opt-out link */
.roulette-optout-link {
    background: none;
    border: none;
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.6;
    transition: opacity var(--dur-fast) ease;
}
.roulette-optout-link:hover { opacity: 1; }

/* Revealed sender chip */
.roulette-revealed-sender {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--text-bright);
    font-weight: 600;
    margin-bottom: 6px;
}
.roulette-revealed-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}
.roulette-revealed-city {
    font-weight: 400;
    color: var(--muted);
    font-size: 12px;
}

/* Compose modal */
.roulette-compose-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3,10,24,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.roulette-compose-modal.open { opacity: 1; }

.roulette-compose-inner {
    background: var(--surface, #0d1829);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roulette-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.roulette-compose-header h3 {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-bright);
    margin: 0;
}
.roulette-compose-hint {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}
.roulette-compose-textarea {
    width: 100%;
    min-height: 140px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    font-family: var(--serif);
    font-size: 15px;
    color: var(--text);
    resize: vertical;
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--dur-fast) ease;
}
.roulette-compose-textarea:focus { border-color: var(--accent); }
.roulette-compose-textarea::placeholder { color: var(--muted); opacity: 0.6; }

.roulette-compose-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.roulette-char-count {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--muted);
}
.roulette-send-btn {
    font-size: 13px;
    padding: 10px 22px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
    .roulette-page-inner { padding: 0 16px 80px; }
    .roulette-header { padding: 16px 0; gap: 10px; }
    .roulette-title { font-size: 18px; }
    .roulette-card { padding: 14px; gap: 12px; }
    .roulette-card-time { position: static; margin-top: 8px; }
}
