@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #050505;
    --card-bg: rgba(20, 20, 20, 0.92);
    --accent-color: #ff2d55;
    --accent-glow: rgba(255, 45, 85, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --glass-border: rgba(255, 255, 255, 0.1);
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

html {
    height: 100%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 18+ age gate (first visit) */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: opacity 0.4s ease, visibility 0.4s;
}

html.ifigo-age-ok .age-gate {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.age-gate-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.age-gate-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
}

.age-gate-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.age-gate-text {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.age-gate-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.35;
    margin-bottom: 1.25rem;
    cursor: pointer;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

.age-gate-check input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.age-gate-unlock {
    width: 100%;
    max-width: none;
}

.age-gate-unlock:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.age-gate-exit {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    html.ifigo-age-ok .age-gate {
        transition: none;
    }
}

/* Onboarding */
.onboarding {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    transition: opacity 0.45s ease, visibility 0.45s;
}

.onboarding.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.onboarding-inner {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo-main {
    font-size: clamp(1.75rem, 7vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(to bottom, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onb-lead {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
}

.gender-fieldset {
    border: none;
    margin: 0 0 1.25rem;
}

.gender-fieldset legend {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.gender-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.gender-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.gender-pill.is-checked {
    border-color: var(--accent-color);
    background: rgba(255, 45, 85, 0.15);
}

.gender-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.onb-country-block {
    margin-bottom: 1.25rem;
    text-align: left;
}

.onb-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.45rem;
}

.country-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    color: var(--text-primary);
    cursor: pointer;
    max-width: 100%;
}

.country-chip.wide {
    width: 100%;
    justify-content: flex-start;
}

.country-chip-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.country-chip-flag .flag-img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flag-img {
    vertical-align: middle;
}

.flag-emoji {
    font-family:
        'Twemoji Mozilla',
        'Apple Color Emoji',
        'Segoe UI Emoji',
        'Segoe UI Symbol',
        'Noto Color Emoji',
        emoji,
        sans-serif;
    font-size: 1.1rem;
    line-height: 1;
    font-style: normal;
    font-variant-emoji: emoji;
}

.country-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.start-btn {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    background: var(--accent-color);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: transform 0.2s, opacity 0.2s;
}

.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.start-btn:not(:disabled):active {
    transform: scale(0.98);
}

button#onb-continue,
button#age-unlock {
    border-radius: 40px;
}

.onb-terms {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

.onb-terms a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.onb-terms a:hover {
    text-decoration: underline;
}

/* Header */
header {
    min-height: 64px;
    padding: calc(var(--safe-area-top) + 4px) 1rem 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-logo {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    padding-top: 2px;
}

.header-status {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.live-line {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.header-ptv-timer {
    font-size: 0.76rem;
    font-weight: 600;
    color: #6ee7b7;
    white-space: nowrap;
    max-width: 100%;
    text-align: right;
}

.partner-pref-header-wrap {
    margin-top: 4px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.partner-pref-header-wrap.settings-row--disabled {
    opacity: 1;
    pointer-events: none;
}

.partner-pref-select {
    appearance: none;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #a3a3a3;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    cursor: pointer;
    outline: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a3a3a3%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem top 50%;
    background-size: 0.6rem auto;
}

/* Main: stage + optional chat 50/50 */
#app-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

#app-main.chat-open .stage {
    flex: 1 1 50%;
}

#app-main.chat-open .chat-panel {
    flex: 1 1 50%;
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    border-top: 1px solid var(--glass-border);
}

aside#chat-panel {
    z-index: 999;
}

.chat-panel {
    flex: 0 0 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    transition: flex 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.chat-panel-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

.chat-panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* Video stack */
.video-stack {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #000;
}

.partner-feed {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.partner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.partner-video.visible {
    display: block;
}

.partner-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #050505 100%);
}

.partner-placeholder.hidden {
    display: none;
}

.partner-hint {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.partner-place {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.65rem;
    max-width: 92vw;
    padding: 0 0.5rem;
    text-align: center;
    word-wrap: break-word;
}

.partner-idle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.45;
}

.partner-feed.searching .partner-placeholder {
    filter: blur(8px);
    opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
    .partner-feed.searching .partner-placeholder {
        filter: none;
        opacity: 1;
    }
}

/* Self view + flip */
#self-view-container {
    position: absolute;
    right: 1rem;
    bottom: 108px;
    width: 104px;
    height: 156px;
    background: #111;
    border-radius: 12px;
    overflow: visible;
    border: 2px solid var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    z-index: 50;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#self-view-container.pip-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
}

#self-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    border-radius: 10px;
    display: block;
}

#self-video.mirror-off {
    transform: none;
}

.pip-flip-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pip-flip-btn:active {
    background: var(--accent-color);
}

/* Controls */
.app-controls {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem calc(0.85rem + var(--safe-area-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, transparent 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 60;
}

.action-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.action-btn:active {
    transform: scale(0.9);
    background: var(--accent-color);
}

.action-btn.primary {
    width: 68px;
    height: 68px;
    background: var(--accent-color);
    border: none;
    box-shadow: 0 0 25px var(--accent-glow);
    font-weight: 700;
    font-size: 0.85rem;
}

.icon-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.msg-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.msg {
    max-width: 88%;
    padding: 0.65rem 0.9rem;
    border-radius: 16px;
    font-size: 0.92rem;
    word-break: break-word;
}

.msg.received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.msg.sent {
    align-self: flex-end;
    background: var(--accent-color);
    border-bottom-right-radius: 4px;
}

.msg.system {
    align-self: center;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.chat-input-row {
    flex-shrink: 0;
    padding: 0.65rem 1rem calc(0.75rem + var(--safe-area-bottom));
    display: flex;
    gap: 0.6rem;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    color: white;
    outline: none;
    font-size: 1rem;
}

.send-btn {
    background: none;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--accent-color);
    line-height: 1;
}

/* Country modal */
.country-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.country-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.country-modal-sheet {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: min(88vh, 640px);
    background: #121212;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

.country-modal-head {
    flex-shrink: 0;
    padding: 1rem 1rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-modal-head h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.country-search-wrap {
    padding: 0 1rem 0.5rem;
    flex-shrink: 0;
}

.country-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    outline: none;
}

.country-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0 0.5rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

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

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

.country-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.country-list::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.92rem;
}

.country-item:hover,
.country-item:focus {
    background: rgba(255, 255, 255, 0.06);
}

.country-item-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    line-height: 0;
}

.country-item-flag .flag-img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.country-item-flag .flag-emoji {
    font-size: 1.15rem;
}

.country-item-name {
    flex: 1;
    text-align: left;
}

.country-item--worldwide {
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.35rem;
    padding-bottom: 0.75rem;
    font-weight: 600;
}

/* Membership upsell (every 30 × NEXT) */
.membership-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.membership-modal.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.membership-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
}

.membership-modal__sheet {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: #121212;
    border: 1px solid var(--glass-border);
    border-radius: 20px 20px 0 0;
    padding: 1.35rem 1.25rem calc(1.25rem + var(--safe-area-bottom));
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.membership-modal.is-open .membership-modal__sheet {
    transform: translateY(0);
}

.membership-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.membership-modal__lead {
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.membership-modal__perks {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    padding-left: 1.1rem;
    margin-bottom: 1rem;
}

.membership-modal__perks li {
    margin-bottom: 0.35rem;
}

.membership-modal__paypal {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.membership-modal__price-label {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0.25rem 0 0;
}

.paypal-btn-slot {
    min-height: 45px;
}

.membership-modal__fallback {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.membership-modal__warn {
    font-size: 0.8rem;
    color: #fbbf24;
    line-height: 1.4;
}

.membership-fallback-btn {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.membership-modal__skip {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.settings-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
    border: 1px solid rgba(255, 45, 85, 0.45);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.settings-help {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: -0.35rem 0 0.5rem;
}

.settings-row--disabled {
    opacity: 0.65;
}

.settings-row--disabled input:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Settings overlay */
.settings-overlay {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 55vh;
    background: #141414;
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--glass-border);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-overlay.visible {
    transform: translateY(0);
}

.settings-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--glass-border);
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.35rem;
}

.settings-section-label:not(:first-child) {
    margin-top: 1rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.settings-row input[type='checkbox'] {
    width: 22px;
    height: 22px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.settings-row select {
    min-width: 9.5rem;
    max-width: 55%;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.settings-row--disabled select:disabled {
    opacity: 1;
}

.settings-unlock-btn {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

.ptv-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ptv-modal-head .membership-modal__title {
    margin: 0;
}

.ptv-gateway-block {
    margin-top: 0.75rem;
}

.ptv-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ptv-field input {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
}

.ptv-pay-primary {
    width: 100%;
    margin-top: 0.35rem;
}

.settings-note {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.loading-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%,
    20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%,
    100% {
        content: '...';
    }
}

@media (prefers-reduced-motion: reduce) {
    .onboarding,
    .chat-panel,
    .settings-overlay,
    .membership-modal,
    .membership-modal__sheet,
    #app-main .stage {
        transition: none;
    }

    .loading-dots::after {
        animation: none;
        content: '…';
    }
}

@media (min-width: 768px) {
    #app-main.chat-open {
        flex-direction: row;
    }

    #app-main.chat-open .stage {
        flex: 1 1 50%;
        border-right: 1px solid var(--glass-border);
    }

    #app-main.chat-open .chat-panel {
        flex: 1 1 50%;
        max-width: 50%;
        border-top: none;
    }
}

/* —— Legal & policy pages (standalone HTML) —— */
body.legal-doc-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.legal-doc-wrap {
    max-width: 42rem;
    margin: 0 auto;
    padding: calc(var(--safe-area-top) + 1.25rem) 1.25rem calc(2rem + var(--safe-area-bottom));
}

.legal-doc-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.legal-doc-nav a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.legal-doc-nav a:hover {
    text-decoration: underline;
}

.legal-doc-banner {
    border: 1px solid rgba(255, 45, 85, 0.45);
    background: rgba(255, 45, 85, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.legal-doc-banner strong {
    color: var(--text-primary);
}

.legal-doc-wrap h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.legal-doc-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.legal-doc-wrap h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 0.65rem;
    color: var(--text-primary);
}

.legal-doc-wrap p,
.legal-doc-wrap li {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.legal-doc-wrap ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.legal-doc-wrap a {
    color: var(--accent-color);
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    padding: 6px 10px calc(6px + var(--safe-area-bottom));
    text-align: center;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.45);
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.65));
    pointer-events: none;
}

.site-footer nav {
    pointer-events: auto;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    margin: 0 0.35rem;
}

.site-footer a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.age-gate-legal {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.age-gate-legal a {
    color: var(--accent-color);
    text-decoration: none;
}

.age-gate-legal a:hover {
    text-decoration: underline;
}
