/* ==========================================================
   MENTRO — home page stylesheet (v4)
   Tokens → base → header → hero/greeting → rings → quick
   actions → chat (+ menu) → invite → modal → nav. Guest hero
   cards, phone mockup and onboarding quiz are carried over below.
   Orange is reserved for: primary actions, active states,
   ring progress. Everything else is neutral.
========================================================== */

:root {
    --bg-base: #0a0a0a;
    --bg-surface: #121212;
    --bg-surface-2: #1a1a1a;
    --bg-raised: #222222;
    --accent-1: #FF5A1F;
    --accent-2: #FF7A47;
    --accent-gradient: linear-gradient(135deg, #FF5A1F 0%, #FF7A47 100%);
    --text-hi: #ffffff;
    --text-mid: rgba(255, 255, 255, 0.62);
    --text-low: rgba(255, 255, 255, 0.4);
    --border-soft: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent-border-soft: rgba(255, 90, 31, 0.2);
    --accent-border-strong: rgba(255, 90, 31, 0.45);
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 20px;
    --pad: 16px;
    --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-base);
    color: var(--text-hi);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
body.has-nav { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }

img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button {
    background: none;
    border: 0;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

.i {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }

@keyframes pageEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes messageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- layout ---------- */
.main-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px var(--pad) 28px;
    animation: pageEnter .45s cubic-bezier(.16, 1, .3, 1);
}

/* ---------- header ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: grid; place-items: center;
    flex: none;
}
.brand-glyph { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-tag {
    font-family: var(--font-mono);
    font-size: .6rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--text-low);
    margin-top: 4px;
    white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-strong);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: .85rem;
}

.btn-sm {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color .2s, color .2s, transform .15s;
}
.btn-sm.ghost { border: 1px solid var(--border-strong); color: var(--text-mid); }
.btn-sm.ghost:hover { color: var(--text-hi); border-color: rgba(255, 255, 255, .28); }
.btn-sm.primary { background: var(--accent-gradient); color: #fff; }
.btn-sm:active { transform: scale(.97); }

/* ---------- greeting (signed in) ---------- */
.greeting { padding: 12px 0 18px; }
.eyebrow {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-low);
}
.greeting h2 {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 6.4vw, 2rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    margin-top: 6px;
    overflow-wrap: anywhere;
}
.greeting p { color: var(--text-mid); font-size: .92rem; margin-top: 6px; }

/* ---------- hero (guest) ---------- */
.hero { text-align: center; padding: 14px 0 22px; }
.hero h2 {
    font-family: var(--font-head);
    font-size: clamp(1.85rem, 7.4vw, 2.7rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.08;
    text-wrap: balance;
}
.hero h2 span { display: block; color: var(--accent-1); }
.hero p {
    color: var(--text-mid);
    font-size: clamp(.92rem, 3.8vw, 1.02rem);
    max-width: 30em;
    margin: 14px auto 0;
    text-wrap: balance;
}
.trust-row {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px 18px;
    margin-top: 18px;
    color: var(--text-mid);
    font-size: .8rem;
}
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-item .i { width: 14px; height: 14px; color: var(--accent-1); stroke-width: 2.4; }

/* ---------- progress rings ---------- */
.rings-dashboard {
    --ring: 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 18px 8px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    margin-bottom: 12px;
}
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; min-width: 0; }
.ring-svg { width: var(--ring); height: var(--ring); transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 7; }
.ring-progress {
    fill: none;
    stroke: var(--accent-1);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1s cubic-bezier(.16, 1, .3, 1);
}
.ring-center {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: var(--ring); height: var(--ring);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    line-height: 1;
}
.ring-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; }
.ring-unit { font-size: .58rem; color: var(--text-low); margin-top: 3px; }
.ring-label { font-size: .72rem; color: var(--text-mid); text-align: center; }
.ring-log-item { cursor: pointer; }
.ring-log-btn {
    width: var(--ring); height: var(--ring);
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-gradient);
    color: #fff;
    transition: transform .15s;
}
.ring-log-btn .i { width: 26px; height: 26px; stroke-width: 2.2; }
.ring-log-item:active .ring-log-btn { transform: scale(.94); }

/* ---------- quick actions ---------- */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.qa-card {
    display: flex; align-items: center; gap: 10px;
    min-width: 0;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    text-align: left;
    transition: border-color .2s, background .2s, transform .15s;
}
.qa-card:hover { border-color: var(--border-strong); background: var(--bg-surface-2); }
.qa-card:active { transform: scale(.98); }
.qa-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--bg-surface-2);
    display: grid; place-items: center;
    color: var(--text-hi);
    flex: none;
    transition: color .2s;
}
.qa-card:hover .qa-icon { color: var(--accent-1); }
.qa-label { font-size: .86rem; font-weight: 600; line-height: 1.2; min-width: 0; }
.qa-lock { width: 14px; height: 14px; color: var(--text-low); margin-left: auto; }

/* ---------- guest bar ---------- */
.guest-bar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    margin-bottom: 12px;
    font-size: .86rem;
    color: var(--text-mid);
}
.guest-bar strong { color: var(--text-hi); }

/* ---------- chat card ---------- */
.chat-card {
    background: #101010;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--r-lg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}
.chat-card::before {
    content: "";
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-1), transparent);
    opacity: .8;
    z-index: 2;
}
.chat-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent);
    border-bottom: 1px solid var(--border-soft);
}
.chat-status { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; min-width: 0; }
.chat-status-sub { color: var(--text-low); font-weight: 400; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex: none; }
.head-tools { display: flex; align-items: center; gap: 8px; }

.icon-toggle {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    border: 1px solid var(--border-strong);
    color: var(--text-mid);
    transition: color .2s, border-color .2s, background .2s;
}
.icon-toggle span { display: grid; place-items: center; }
.icon-toggle .ico-on { display: none; }
.icon-toggle.on { color: var(--accent-1); border-color: var(--accent-border-strong); background: rgba(255, 90, 31, .08); }
.icon-toggle.on .ico-on { display: grid; }
.icon-toggle.on .ico-off { display: none; }

.select-wrap { position: relative; }
.lang-select {
    appearance: none; -webkit-appearance: none;
    height: 34px;
    padding: 0 30px 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface-2);
    color: var(--text-hi);
    font-size: .82rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}
.lang-select:focus-visible { border-color: var(--accent-1); outline: none; }
.lang-select option { background: #141414; color: #fff; }
.select-wrap .i { position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); pointer-events: none; color: var(--text-mid); }

.chat-box {
    /* grows with the conversation instead of reserving a big empty box */
    min-height: 150px;
    max-height: clamp(320px, 56vh, 520px);
    max-height: clamp(320px, 56dvh, 520px);
    overflow-y: auto;
    background-color: #0c0c0c;
    background-image: radial-gradient(80% 50% at 50% 0%, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 70%);
    padding: 18px 16px;
    display: flex; flex-direction: column; gap: 18px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}
.chat-box::-webkit-scrollbar { width: 4px; }
.chat-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 10px; }

.message { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; animation: messageIn .3s cubic-bezier(.16, 1, .3, 1); }
.bot-message { align-self: flex-start; }
.user-message { align-self: flex-end; flex-direction: row-reverse; }
.bot-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: #f2f2f2;
    color: #0a0a0a;
    display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 700; font-size: .8rem;
    flex: none;
}
.message-content {
    padding: 12px 15px;
    border-radius: 16px;
    font-size: .9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.bot-message .message-content { background: #171717; border: 1px solid rgba(255, 255, 255, .09); border-top-left-radius: 6px; }
.user-message .message-content { background: var(--accent-gradient); color: #fff; border-top-right-radius: 6px; }
.message-content strong { font-weight: 600; }
.message-content ul, .message-content ol { margin: 6px 0; padding-left: 20px; }
.message-content li { margin: 3px 0; line-height: 1.6; }
.user-image { display: block; max-width: 160px; border-radius: 10px; }

.typing {
    align-self: flex-start;
    display: flex; gap: 5px;
    margin-left: 40px;
    padding: 14px 16px;
    background: #171717;
    border-radius: 16px;
    border-top-left-radius: 6px;
    animation: messageIn .3s ease;
}
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-mid); animation: typingBounce 1.2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }

.chat-suggestions { margin-top: 2px; }
.suggest-label {
    font-family: var(--font-mono);
    font-size: .64rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-low);
    margin-bottom: 10px;
}
.suggest-row {
    display: flex; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 4px;
    scrollbar-width: none;
}
.suggest-row::-webkit-scrollbar { display: none; }
.suggest-chip {
    flex: none;
    white-space: nowrap;
    padding: 9px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #161616;
    color: var(--text-hi);
    font-size: .78rem;
    line-height: 1.2;
    transition: border-color .2s, background .2s, transform .15s;
}
.suggest-chip:hover { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
.suggest-chip:active { transform: scale(.97); }

/* AI follow-up questions under the latest reply */
.followups { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 0 40px; animation: messageIn .3s cubic-bezier(.16, 1, .3, 1); }
.followup-chip {
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #161616;
    color: var(--text-hi);
    font-size: .78rem;
    line-height: 1.25;
    text-align: left;
    transition: border-color .2s, background .2s, transform .15s;
}
.followup-chip:hover { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); }
.followup-chip:active { transform: scale(.97); }

.image-preview { padding: 10px 14px; border-top: 1px solid var(--border-soft); }
.image-preview img { max-width: 120px; max-height: 120px; border-radius: 10px; vertical-align: middle; margin-right: 10px; }

/* PDF export (states are swapped into #pdf-card by script.js; hidden while empty) */
.pdf-card:empty { display: none; }
.pdf-card:not(:empty) { padding: 4px 14px 12px; background: #0c0c0c; }
.pdf-btn {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-mid);
    font-size: .8rem; font-weight: 500;
    transition: color .2s, border-color .2s;
}
.pdf-btn .i { width: 16px; height: 16px; }
.pdf-btn:hover { color: var(--text-hi); border-color: rgba(255, 255, 255, .28); }
.pdf-btn:disabled { opacity: .75; cursor: default; }
.pdf-spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--accent-1); border-radius: 50%; animation: spin .7s linear infinite; }
.pdf-file-ready {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-sm);
}
.pdf-file-icon {
    width: 36px; height: 40px;
    border-radius: 8px;
    background: rgba(255, 90, 31, .12);
    color: var(--accent-1);
    display: grid; place-items: center;
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    flex: none;
}
.pdf-file-info { display: flex; flex-direction: column; min-width: 0; }
.pdf-file-name { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-meta { font-size: .72rem; color: var(--text-low); }
.pdf-file-download-btn { margin-left: auto; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--accent-gradient); color: #fff; font-size: .8rem; font-weight: 600; }

/* composer */
.input-area { display: flex; align-items: center; gap: 8px; padding: 12px 14px 14px; background: #101010; border-top: 1px solid var(--border-soft); }
.input-pill {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 2px;
    height: 48px;
    padding: 0 6px;
    background: #181818;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    transition: border-color .2s;
}
.input-pill:focus-within { border-color: var(--accent-border-strong); }
.pill-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text-mid);
    flex: none;
    transition: color .2s, background .2s;
}
.pill-btn:hover { color: var(--text-hi); }
.pill-btn.recording { color: #fff; background: var(--accent-1); animation: pulse 1s infinite; }
#user-input {
    flex: 1; min-width: 0;
    height: 100%;
    padding: 0 10px;
    background: none;
    border: 0;
    outline: none;
    color: var(--text-hi);
    font-size: 1rem;
}
#user-input::placeholder { color: var(--text-low); }
.send-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    display: grid; place-items: center;
    flex: none;
    transition: transform .15s;
}
.send-btn:active { transform: scale(.94); }

/* "+" menu (photo / PDF) */
.plus-wrap { position: relative; flex: none; }
.plus-btn {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-hi);
    transition: transform .2s, background .2s;
}
.plus-btn.open { transform: rotate(45deg); background: var(--bg-raised); }
.plus-menu {
    position: absolute; left: 0; bottom: calc(100% + 10px);
    min-width: 200px;
    padding: 6px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
    opacity: 0; visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s, transform .18s, visibility .18s;
    z-index: 5;
}
.plus-menu.open { opacity: 1; visibility: visible; transform: none; }
.plus-menu button {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: .9rem; font-weight: 500;
    text-align: left;
    color: var(--text-hi);
}
.plus-menu button:hover, .plus-menu button:active { background: var(--bg-raised); }
.plus-menu .i { width: 18px; height: 18px; color: var(--text-mid); }

/* ---------- invite + premium ---------- */
.invite-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    padding: 14px;
    margin-bottom: 12px;
}
.invite-head { display: flex; gap: 12px; align-items: center; }
.invite-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-surface-2); color: var(--accent-1); display: grid; place-items: center; flex: none; }
.invite-body { flex: 1; min-width: 0; }
.invite-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.invite-sub { color: var(--text-mid); font-size: .84rem; line-height: 1.45; margin-top: 2px; }
.invite-link {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px;
    padding: 6px 6px 6px 14px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
}
#referral-link-display {
    flex: 1; min-width: 0;
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text-mid);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invite-copy {
    width: 34px; height: 34px;
    border-radius: 9px;
    display: grid; place-items: center;
    background: var(--bg-raised);
    flex: none;
    transition: background .2s;
}
.invite-copy.copied { background: var(--accent-1); color: #fff; }
.invite-share {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    flex: none;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    color: #0a0a0a;
    font-weight: 600; font-size: .82rem;
}
.invite-share .i { width: 16px; height: 16px; }
.invite-share:active { transform: scale(.98); }

.premium-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
    margin-bottom: 12px;
}
.premium-row > .i { color: var(--text-mid); }
.premium-text { flex: 1; min-width: 0; }
.premium-title { font-weight: 600; font-size: .9rem; }
.premium-sub { color: var(--text-low); font-size: .78rem; }
.waitlist-btn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: .8rem; font-weight: 600;
    white-space: nowrap;
}
.waitlist-btn:disabled { color: var(--text-low); border-color: var(--border-soft); cursor: default; }

/* ---------- signup modal ---------- */
.signup-modal {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.signup-modal.open { opacity: 1; visibility: visible; }
.signup-modal-content {
    width: 100%; max-width: 380px;
    max-height: 92vh; overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    padding: 28px 24px 20px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px) scale(.97);
    transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .3s;
}
.signup-modal.open .signup-modal-content { opacity: 1; transform: none; }
.signup-modal-icon { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; background: var(--accent-gradient); display: grid; place-items: center; }
.signup-modal-icon .brand-glyph { width: 30px; height: 30px; }
.signup-modal-content h2 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 6px; }
.signup-modal-content p { color: var(--text-mid); font-size: .9rem; margin-bottom: 16px; }
.signup-features { display: grid; gap: 10px; text-align: left; margin-bottom: 22px; }
.signup-feature { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--text-mid); }
.signup-feature::before {
    content: "";
    width: 16px; height: 16px;
    flex: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF5A1F' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.signup-modal-btn {
    display: block;
    height: 48px; line-height: 48px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 600;
}
.signup-modal-login { display: block; margin-top: 14px; color: var(--text-mid); font-size: .85rem; }
.signup-modal-close { margin-top: 8px; padding: 8px; color: var(--text-low); font-size: .82rem; }

/* ---------- bottom navigation ---------- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0 auto;
    max-width: 600px;
    display: flex; justify-content: space-around;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 10, 10, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-soft);
    z-index: 500;
}
.nav-item {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 0;
    color: var(--text-low);
    font-size: .68rem; font-weight: 500;
    transition: color .2s;
}
.nav-item .i { width: 22px; height: 22px; }
.nav-item.active { color: var(--accent-1); }

/* ---------- responsive ---------- */
@media (min-width: 560px) {
    .quick-actions { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 340px) {
    :root { --pad: 14px; }
    .rings-dashboard { --ring: 52px; }
    .ring-value { font-size: .95rem; }
    .brand-tag { display: none; }
    .quick-actions { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ---------- guest hero photo cards (carried over) ---------- */
/* ==================================================
   HERO FEATURE GRID — bold marketing-style cards for guests
================================================== */
.hero-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.hero-feature-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    aspect-ratio: 4/5;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.hero-feature-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    filter: brightness(0.7);
}

.hero-feature-text {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px 18px;
    background: linear-gradient(to top, rgba(11,15,26,0.95) 20%, transparent 100%);
}

.hero-feature-text h3 {
    font-family: 'Space Grotesk', sans-serif;
    color: white;
    font-size: 1.15rem;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.hero-feature-text p {
    color: rgba(255,255,255,0.75);
    font-size: 0.8rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .hero-feature-grid { grid-template-columns: 1fr; }
    .hero-feature-card { aspect-ratio: 16/9; }
}


/* ---------- guest phone mockup (carried over) ---------- */
/* ==================================================
   PHONE MOCKUP — guest hero, pure CSS device frame
================================================== */
.phone-mockup-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 28px;
}

.phone-mockup {
    width: 240px;
    background: #0a0a0a;
    border: 3px solid #2a2a2a;
    border-radius: 36px;
    padding: 10px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.03) inset;
    position: relative;
    animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.phone-notch {
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 70px; height: 18px;
    background: #0a0a0a;
    border-radius: 0 0 14px 14px;
    z-index: 3;
}

.phone-statusbar {
    display: flex;
    justify-content: space-between;
    padding: 6px 14px 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--text-mid);
}
.phone-statusbar-icons { letter-spacing: 1px; }

.phone-screen {
    background: var(--bg-base);
    border-radius: 24px;
    padding: 12px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.phone-chat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-low);
    font-size: 0.6rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 4px;
}
.phone-avatar-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e;
}

.phone-bubble {
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 0.66rem;
    line-height: 1.4;
    max-width: 82%;
    animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.phone-bubble-bot {
    background: var(--bg-surface-2);
    color: var(--text-hi);
    border: 1px solid var(--border-soft);
    align-self: flex-start;
    border-top-left-radius: 3px;
}
.phone-bubble-user {
    background: var(--accent-gradient);
    color: white;
    align-self: flex-end;
    border-top-right-radius: 3px;
}
.phone-bubble-typing {
    display: flex;
    gap: 3px;
    align-items: center;
    padding: 10px 12px;
}
.phone-bubble-typing span {
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent-1);
    animation: typingBounce 1.2s ease-in-out infinite;
}
.phone-bubble-typing span:nth-child(2) { animation-delay: 0.15s; }
.phone-bubble-typing span:nth-child(3) { animation-delay: 0.3s; }

.phone-input-bar {
    margin-top: auto;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 0.6rem;
    color: var(--text-low);
}


/* ---------- onboarding quiz (carried over) ---------- */
/* ==================================================
   ONBOARDING QUIZ OVERLAY
   Was entirely missing — this is why the quiz rendered
   as unstyled text spilling into the page on mobile
================================================== */
.quiz-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.quiz-card {
    background: var(--bg-surface);
    border: 1px solid var(--accent-border-strong);
    border-radius: 24px;
    padding: 32px 26px 28px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.quiz-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.quiz-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-strong);
    transition: all 0.3s ease;
}

.quiz-dot.active {
    background: var(--accent-gradient);
    border-color: transparent;
    width: 22px;
    border-radius: 4px;
}

.quiz-dot.done {
    background: var(--accent-1);
    border-color: transparent;
}

.quiz-step {
    display: none;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.quiz-step.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.quiz-step h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-hi);
    margin-bottom: 8px;
}

.quiz-sub {
    color: var(--text-mid);
    font-size: 0.85rem;
    margin-bottom: 22px;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    padding: 14px 18px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    color: var(--text-hi);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', sans-serif;
}

.quiz-option:hover {
    border-color: var(--accent-border-strong);
    transform: translateY(-1px);
}

.quiz-option.selected {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 6px 20px rgba(255, 90, 31, 0.3);
}

.quiz-back {
    display: block;
    margin: 20px auto 0;
    background: none;
    border: none;
    color: var(--text-low);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 6px 10px;
    transition: color 0.2s;
}

.quiz-back:hover { color: var(--accent-1); }

@media (max-width: 420px) {
    .quiz-card { padding: 26px 20px 22px; border-radius: 20px; }
    .quiz-step h2 { font-size: 1.15rem; }
    .quiz-option { padding: 12px 16px; font-size: 0.86rem; }
}