/* Tendrils Web — Living Botanical, light theme "E — No Tint" (v4, Nov 2026)
   Matches the mobile app (Tendrils/Themes/BotanicalTheme.xaml): surfaces are
   WHITE, the Browse canvas is sunken #E9EBE8, chips/sunken elements are white
   with a Pine hairline border. The cream family is retired (mobile F13).
   Pine #173F35 | PineDeep #0B241C | Sprout #85AF4B | SproutDeep #527A28 |
   Coral #FF6B4A | Ink #1E2422 | TextSecondary #4F5D53 | Tint #E7EFDB */

:root {
    --pine: #173F35;
    --pine-deep: #0B241C;
    --surface: #FFFFFF;
    --sunken: #E9EBE8;
    --tint: #E7EFDB;
    --sprout: #85AF4B;
    --sprout-deep: #527A28;
    --coral: #FF6B4A;
    --coral-dark: #E8552F;
    --ink: #1E2422;
    --ink-soft: #4F5D53;
    --hairline: rgba(23, 63, 53, 0.16);
    --card-shadow: 0 8px 32px rgba(23, 63, 53, 0.12);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-full: 999px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--sunken);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface);
    color: var(--pine);
    border-bottom: 1px solid var(--hairline);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand img { height: 32px; width: 32px; }

.main-content {
    flex: 1;
    padding: 20px;
    padding-bottom: 96px; /* room for bottom nav */
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--hairline);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 50;
    max-width: 1200px;
    margin: 0 auto;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.bottom-nav a.active { color: var(--pine); }
.bottom-nav a.active .nav-icon { background: var(--sprout); color: white; }

.nav-icon {
    width: 40px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
}

/* ---------- Sidebar (desktop) ---------- */
@media (min-width: 1024px) {
    .app-shell { flex-direction: row; }
    .top-bar { display: none; }
    .bottom-nav {
        position: sticky;
        top: 0;
        height: 100vh;
        flex-direction: column;
        max-width: 220px;
        border-top: none;
        border-right: 1px solid rgba(23, 63, 53, 0.12);
        padding: 24px 12px;
        gap: 4px;
    }
    .bottom-nav a {
        /* Base rule's flex: 1 (equal-width mobile tabs) must not carry into
           the sidebar, or the items stretch the full column height. */
        flex: none;
        flex-direction: row;
        gap: 12px;
        padding: 12px;
        font-size: 0.95rem;
    }
    .main-content { padding: 32px; padding-bottom: 32px; }
}

/* ---------- Cards ---------- */
.profile-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    max-width: 420px;
    margin: 0 auto;
}

.profile-card img.card-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

.card-body { padding: 20px; }
.card-body h2 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -0.02em; }
.card-meta { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 12px; }
.card-bio { line-height: 1.55; margin-bottom: 16px; }

.interest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
    background: var(--surface);
    border: 1px solid var(--hairline);
    color: var(--pine);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 4px 0 8px;
}

.action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.12s ease;
}
.action-btn:active { transform: scale(0.92); }
.action-btn.pass { background: white; color: var(--ink-soft); }
.action-btn.like { background: var(--coral); color: white; width: 76px; height: 76px; font-size: 2rem; }

/* ---------- Buttons ---------- */
.btn-primary {
    display: inline-block;
    background: var(--coral);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary:hover { background: var(--coral-dark); }

.btn-secondary {
    display: inline-block;
    background: transparent;
    color: var(--pine);
    border: 2px solid var(--pine);
    padding: 12px 26px;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

/* ---------- Lists (matches, likes) ---------- */
.person-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(23, 63, 53, 0.07);
    text-decoration: none;
    color: inherit;
}

.person-row img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.person-row .info { flex: 1; min-width: 0; }
.person-row .name { font-weight: 700; }
.person-row .preview {
    color: var(--ink-soft);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    background: var(--coral);
    color: white;
    min-width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0 6px;
}

.locked-card {
    position: relative;
}
.locked-card img { filter: blur(14px); }
.lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

/* ---------- Chat ---------- */
.chat-layout { display: flex; flex-direction: column; height: calc(100vh - 140px); }

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 8px 4px;
    flex: 1;
}

.bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.45;
    font-size: 0.95rem;
}

.bubble.mine {
    align-self: flex-end;
    background: var(--pine);
    color: #FFFFFF;
    border-bottom-right-radius: 6px;
}

.bubble.theirs {
    align-self: flex-start;
    background: white;
    color: var(--ink);
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(23, 63, 53, 0.08);
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 12px 0;
}

.chat-input input {
    flex: 1;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    padding: 12px 18px;
    font-size: 1rem;
    outline: none;
    background: var(--surface);
}
.chat-input input:focus { border-color: var(--sprout); }

.chat-input button {
    background: var(--coral);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (min-width: 1024px) {
    .chat-two-pane { display: grid; grid-template-columns: 340px 1fr; gap: 24px; }
    .chat-layout { height: calc(100vh - 120px); }
}

/* ---------- States ---------- */
.loading-state, .empty-state, .error-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-soft);
}
.empty-state h1, .error-state h1 { color: var(--pine); }

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--tint);
    border-top-color: var(--sprout);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--pine);
}
.form-group input:not([type="checkbox"]):not([type="radio"]), .form-group textarea, .form-group select {
    width: 100%;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
}

.form-group input[type="checkbox"], .form-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--sprout);
}

/* ---------- Demo banner ---------- */
.demo-banner {
    background: var(--pine-deep);
    color: #FFFFFF;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ---------- Discover location fallback ---------- */
.fallback-options {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.place-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.place-row input {
    padding: 0.65rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    min-width: 240px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
.place-row input:focus { border-color: var(--sprout); outline: none; }
.place-error { color: var(--coral-dark); margin: 0; }
.fallback-or { margin: 0; color: var(--ink-soft); }
.mode-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

/* ---------- Icon system (Living Botanical inline SVG) ---------- */
.nav-icon svg, .action-btn svg, .mode-banner svg { display: block; }
.mode-banner { color: var(--pine); }
.mode-banner span { color: var(--ink); }
.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--tint);
    color: var(--sprout-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.lock-overlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px; /* avatar column: 12px padding + 56px avatar, badge centered on it */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.lock-badge {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pine);
    box-shadow: var(--card-shadow);
}
.lock-overlay { font-size: 0; }
.saved-note {
    color: var(--sprout-deep);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.chat-input button { display: flex; align-items: center; justify-content: center; }
.chat-input button svg { display: block; }

/* ---------- Match banner (Discover + Likes) ---------- */
.match-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-left: 4px solid var(--coral);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--pine);
}
.match-banner span { color: var(--ink); flex: 1; min-width: 200px; }

/* ---------- Discover toolbar ---------- */
.feed-toolbar {
    display: flex;
    justify-content: flex-end;
    max-width: 420px;
    margin: 0 auto 12px;
}
.feed-toolbar .btn-secondary { padding: 8px 20px; }

/* ---------- Settings check lists ---------- */
.check-list label {
    display: block;
    font-weight: 400;
    margin-bottom: 6px;
    color: var(--ink);
}
.check-list input[type="checkbox"] { width: auto; margin-right: 8px; }

/* ---------- Profile menu (mobile profile-tab parity) ---------- */
.menu-list {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
}
.menu-list a {
    display: block;
    padding: 14px 16px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--hairline);
}
.menu-list a:last-child { border-bottom: none; }
.menu-list a:hover { background: var(--tint); }

/* ---------- Landing (signed-out) ---------- */
.landing-hero {
    background: var(--pine);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    text-align: center;
    padding: 56px 24px;
    margin-top: 24px;
}
.landing-hero h1 { color: #FFFFFF; letter-spacing: -0.02em; margin: 16px 0 8px; }
.landing-hero p { color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; max-width: 420px; margin: 0 auto 32px; }
.landing-hero .note { font-size: 0.9rem; margin: 16px auto 0; }

/* ---------- Premium plans ---------- */
.plan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}
@media (min-width: 900px) {
    .plan-grid { grid-template-columns: repeat(3, 1fr); }
}
.plan-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
}
.plan-card .plan-tag {
    display: inline-block;
    background: var(--tint);
    color: var(--sprout-deep);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}
.plan-card h2 { margin: 0 0 4px; color: var(--pine); }
.plan-card .plan-price { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.plan-card .plan-was { color: var(--ink-soft); text-decoration: line-through; margin-right: 8px; }
.plan-card ul { padding-left: 18px; line-height: 1.6; color: var(--ink); }
.store-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
