:root {
    --bg: #f6f1ea;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --line: rgba(41, 33, 23, 0.08);
    --text: #1c1916;
    --muted: #776b61;
    --accent: #d86c47;
    --accent-soft: #f6e3db;
    --ok: #2f9a68;
    --danger: #c86363;
    --radius: 20px;
    --shadow: 0 20px 50px rgba(47, 36, 26, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(216, 108, 71, 0.10), transparent 20%),
        linear-gradient(180deg, #faf7f2 0%, #f3ede5 100%);
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
.page {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 20px 0 28px;
}

.hero, .app-shell, .content, .matches-grid, .auth-shell, .stack, .menu, .profile-form, .chat-form, .matches-list, .quick-stats, .profile-layout, .profile-main, .profile-side, .grid {
    display: grid;
    gap: 14px;
}

.hero {
    grid-template-columns: 1.05fr minmax(320px, 410px);
    align-items: center;
    min-height: calc(100vh - 40px);
}

.hero-copy h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.9rem, 7vw, 5rem);
    line-height: .96;
}

.hero-copy p, .helper-text, .muted-line, .message, .sidebar-profile p, .sidebar-meta, .onboarding-card p, .map-head p, .discover-hint {
    color: var(--muted);
}

.hero-points { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-points div, .panel, .sidebar, .auth-card, .map-card, .preferences-card, .drink-chip, .modal-card, .profile-hero-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-points div, .panel, .sidebar, .auth-card, .map-card, .preferences-card, .modal-card, .profile-hero-card {
    padding: 18px;
}

.auth-card h2, .panel h3, .sidebar h2, .preferences-card h4, .profile-hero-copy h1 {
    margin: 0;
}

.badge, .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .73rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
}

.step-pill, .status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: .82rem;
}

.status-pill.live { color: var(--ok); }

input, textarea, select, .city-picker-trigger {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
}

textarea { resize: vertical; min-height: 108px; }

button {
    border: 0;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.small-btn {
    padding: 10px 12px;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.ghost, .tab-btn, button.secondary, .ghost {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.danger {
    color: var(--danger);
    border-color: rgba(200, 99, 99, 0.18);
}

.app-shell-tight {
    grid-template-columns: 250px 1fr;
    gap: 18px;
    align-items: start;
    min-height: calc(100vh - 48px);
}

.content-tight {
    min-height: calc(100vh - 48px);
}

.tab-pane.active[data-pane="discover"] {
    height: calc(100vh - 48px);
}

.discover-stage {
    height: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 12px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.sidebar-clean {
    position: sticky;
    top: 16px;
    height: fit-content;
}

.sidebar-profile.compact p {
    font-size: .93rem;
    line-height: 1.45;
}

.sidebar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: .9rem;
}

.quick-stats.minimal {
    grid-template-columns: repeat(2, 1fr);
}

.quick-stats.minimal div {
    padding: 12px;
    border-radius: 16px;
    background: rgba(255,255,255,.7);
    border: 1px solid var(--line);
}

.quick-stats strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.tab-btn.active {
    background: var(--accent-soft);
    border-color: rgba(216, 108, 71, 0.24);
    color: var(--accent);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }
.panel-head, .discover-header, .map-head, .modal-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-layout { grid-template-columns: minmax(0, 1.35fr) minmax(240px, .78fr); }

.toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.72);
}

.toggle input { width: auto; }

.city-picker-trigger {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
}

.city-picker-trigger small { color: var(--muted); }

#map {
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.alcohol-grid-pretty {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.drink-chip {
    position: relative;
    padding: 16px;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, background .15s ease;
}

.drink-chip:hover { transform: translateY(-1px); }
.drink-chip.selected {
    border-color: rgba(216, 108, 71, 0.22);
    background: #fff7f3;
}

.drink-checkbox { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; }
.drink-icon { font-size: 1.7rem; display: block; margin-bottom: 8px; }
.drink-name { display: block; font-weight: 700; margin-bottom: 8px; }

.card-stack {
    min-height: 0;
    height: 100%;
    display: grid;
    place-items: center;
}

.discover-card {
    position: relative;
    display: grid;
    gap: 14px;
    width: min(100%, 520px);
    height: 100%;
    max-height: calc(100vh - 130px);
    padding: 16px;
    border-radius: 26px;
    background: rgba(255,255,255,.9);
    border: 1px solid var(--line);
    box-shadow: 0 26px 54px rgba(49, 37, 26, 0.12);
    transition: transform .18s ease, opacity .18s ease;
    touch-action: none;
}

.discover-card.dragging {
    transition: none;
}

.swipe-indicator {
    position: absolute;
    top: 16px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: .82rem;
    font-weight: 800;
    opacity: .92;
}

.swipe-like {
    right: 16px;
    color: var(--ok);
}

.swipe-pass {
    left: 16px;
    color: var(--danger);
}

.discover-photo {
    width: 100%;
    min-height: 0;
    height: min(54vh, 460px);
    border-radius: 20px;
    object-fit: cover;
    transition: transform .18s ease;
}

.discover-header h2 { margin: 0 0 4px; font-size: 1.45rem; }
.discover-subtitle { margin: 0; color: var(--muted); }

.profile-link {
    text-decoration: underline;
    text-decoration-color: rgba(216, 108, 71, 0.28);
    text-underline-offset: 3px;
}

.profile-link.mini {
    display: inline-block;
    margin-top: 6px;
    font-size: .88rem;
    color: var(--accent);
}

.match-reason {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 700;
}

.drink-strip {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fcfaf7;
    border: 1px solid var(--line);
    font-size: .95rem;
}

.card-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-meta-row span {
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: .86rem;
}

.discover-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: stretch;
}

.discover-hint {
    text-align: center;
    font-size: .88rem;
}

.matches-grid { grid-template-columns: 300px 1fr; }

.match-item {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.78);
    text-align: left;
}

.match-item.active {
    background: #fff6f0;
    border-color: rgba(216, 108, 71, 0.22);
}

.match-item img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-messages {
    min-height: 360px;
    max-height: 520px;
    overflow: auto;
    display: grid;
    gap: 10px;
}

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

.chat-suggestion {
    padding: 9px 11px;
    font-size: .88rem;
}

.chat-row {
    padding: 11px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.78);
    border: 1px solid var(--line);
}

.chat-row.mine {
    background: #fff2ea;
    border-color: rgba(216, 108, 71, 0.22);
}

.onboarding-overlay, .modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
}

.onboarding-overlay { background: rgba(33, 26, 20, 0.24); backdrop-filter: blur(8px); }

.onboarding-card {
    width: min(500px, calc(100% - 24px));
    padding: 24px;
    border-radius: 22px;
    background: rgba(255,255,255,.97);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.modal.hidden, .onboarding-overlay.hidden, .hidden { display: none !important; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.24);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    width: min(620px, calc(100% - 24px));
    z-index: 1;
}

.city-picker-list {
    margin-top: 14px;
    max-height: 360px;
    overflow: auto;
    display: grid;
    gap: 8px;
}

.city-option {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.city-option small, .city-empty { color: var(--muted); }
.city-empty {
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    border: 1px dashed var(--line);
}

.bottom-nav {
    display: none;
}

.empty, .loading-card {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 220px;
    text-align: center;
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    border: 1px dashed var(--line);
    color: var(--muted);
    padding: 24px;
}

.profile-page-body {
    min-height: 100vh;
}

.profile-page {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 32px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--accent);
}

.profile-hero-card {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 20px;
}

.profile-hero-photo {
    width: 100%;
    aspect-ratio: 4 / 4.8;
    object-fit: cover;
    border-radius: 20px;
}

.profile-hero-copy {
    display: grid;
    gap: 14px;
}

.profile-hero-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.profile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    width: fit-content;
}

@media (max-width: 980px) {
    .hero, .app-shell-tight, .profile-layout, .matches-grid, .grid.two, .map-head, .profile-hero-card {
        grid-template-columns: 1fr;
    }

    .content-tight, .tab-pane.active[data-pane="discover"], .discover-stage {
        min-height: auto;
        height: auto;
    }

    .discover-card {
        height: auto;
        max-height: none;
    }

    .discover-photo {
        height: min(50vh, 420px);
    }

    .sidebar-clean {
        position: static;
    }

    .panel-head, .discover-header, .map-head, .modal-head, .profile-hero-head {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-stats.minimal {
        grid-template-columns: 1fr 1fr;
    }

    .bottom-nav {
        position: sticky;
        bottom: 12px;
        z-index: 10;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 16px;
        padding: 8px;
        border-radius: 16px;
        background: rgba(255,255,255,.94);
        border: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
}
