:root {
    --bg: #eef4fb;
    --surface: #ffffff;
    --surface-soft: #f7faff;
    --surface-accent: #edf3ff;
    --line: #dce6f4;
    --line-strong: #bfd1ea;
    --text: #1d2b3f;
    --muted: #70829b;
    --brand: #5a67d8;
    --brand-dark: #3647b4;
    --primary: #5a67d8;
    --primary-strong: #3647b4;
    --ink: #1d2b3f;
    --ink-muted: #70829b;
    --teal: #2aa8a1;
    --gold: #f5b400;
    --danger-soft: #fff0f0;
    --danger: #d64949;
    --shadow: 0 18px 45px rgba(59, 89, 152, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

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

body {
    font-family: 'Inter', Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(90, 103, 216, 0.08), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

/* ---------- APP SHELL ---------- */
.page-shell {
    max-width: 1480px;
    margin: 0 auto;
    padding: 18px 24px 36px;
}

/* ---------- HEADER ---------- */
.site-header {
    position: relative;
    z-index: 5000;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(220, 230, 244, 0.95);
    border-radius: 26px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    overflow: visible;
}

.topbar,
.subbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 22px;
}

.subbar {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(243, 247, 255, 0.9), rgba(238, 244, 251, 0.8));
    color: var(--muted);
    font-size: 0.92rem;
    border-radius: 0 0 26px 26px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #8b9dff);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 10px 20px rgba(90, 103, 216, 0.2);
}

.brand-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-text span {
    color: var(--brand);
    font-weight: 700;
}

/* ---------- NAVIGATION ---------- */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 999px;
    color: #4b5d78;
    font-weight: 600;
    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--surface-accent);
    color: var(--brand-dark);
}

.subbar-left,
.subbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.subbar-right a:hover,
.quick-links a.active {
    color: var(--brand-dark);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4dc56e;
    box-shadow: 0 0 0 5px rgba(77, 197, 110, 0.16);
}

/* ---------- HEADER ACTIONS ---------- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 6000;
}

.search-chip {
    min-width: 290px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f8fd;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 16px;
    height: 46px;
    color: var(--muted);
}

.search-chip input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    color: var(--text);
}

/* ---------- BUTTONS / LINKS ---------- */
.ghost-btn,
.primary-btn,
.secondary-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    font-weight: 700;
    transition: 0.2s ease;
}

.ghost-btn {
    padding: 12px 16px;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    background: #f8fbff;
}

.primary-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--brand), #7c8cff);
    color: #fff;
    box-shadow: 0 12px 20px rgba(90, 103, 216, 0.22);
}

.secondary-link {
    color: var(--brand-dark);
    margin-top: 10px;
}

/* ---------- LAYOUT ---------- */
.layout-grid {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 310px;
    gap: 24px;
    align-items: start;
}

.left-rail,
.right-rail,
.feed-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- SHARED CARDS ---------- */
.highlight-card,
.rail-block,
.composer-panel,
.feed-card,
.side-widget {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.rail-block,
.side-widget {
    padding: 18px;
}

.block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.block-head h3 {
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.block-head a {
    color: var(--brand-dark);
    font-size: 0.92rem;
    font-weight: 600;
}

.eyebrow {
    color: var(--danger);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    margin-bottom: 10px;
}

/* ---------- LEFT RAIL ---------- */
.promo-vertical {
    padding: 24px;
    background: linear-gradient(160deg, #fff1f7 0%, #f4f7ff 100%);
}

.promo-vertical h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.promo-vertical p {
    color: var(--muted);
    line-height: 1.55;
}

.feature-tile,
.thumb-card,
.post-preview,
.avatar-photo {
    background-size: cover;
    background-position: center;
}

.large-photo {
    height: 240px;
    border-radius: 18px;
    background-image: linear-gradient(rgba(56, 70, 112, 0.15), rgba(56, 70, 112, 0.15)), url('https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?auto=format&fit=crop&w=900&q=80');
}

.feature-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
}

.feature-caption span,
.meta-row,
.muted-copy,
.info-list span,
.post-copy p {
    color: var(--muted);
}

.thumb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.thumb-card {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
}

.thumb-one { background-image: url('https://images.unsplash.com/photo-1517841905240-472988babdf9?auto=format&fit=crop&w=800&q=80'); }
.thumb-two { background-image: url('https://images.unsplash.com/photo-1488426862026-3ee34a7d66df?auto=format&fit=crop&w=800&q=80'); }
.thumb-three { background-image: url('https://images.unsplash.com/photo-1512316609839-ce289d3eba0a?auto=format&fit=crop&w=800&q=80'); }
.thumb-four { background-image: url('https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=800&q=80'); }

/* ---------- COMPOSER ---------- */
.composer-panel {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.92));
}

.composer-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.mini-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #172033, #4b5d78);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.composer-input {
    flex: 1;
    text-align: left;
    padding: 16px 18px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: #7f8ea7;
}

/* ---------- FILTERS / PILLS ---------- */
.filter-tabs,
.content-pills,
.tag-row,
.post-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tabs {
    margin-bottom: 14px;
}

.tab-btn,
.pill {
    border-radius: 999px;
    font-weight: 700;
}

.tab-btn {
    padding: 10px 14px;
    background: #eff4fb;
    color: #60728c;
}

.tab-btn.active {
    background: var(--brand);
    color: #fff;
}

.pill {
    padding: 9px 13px;
    background: #f4f7fc;
    border: 1px solid var(--line);
    color: #53657f;
    font-size: 0.92rem;
}

.pill.active {
    border-color: rgba(90, 103, 216, 0.3);
    background: rgba(90, 103, 216, 0.1);
    color: var(--brand-dark);
}

/* ---------- FEED POSTS ---------- */
.feed-card {
    padding: 20px;
}

.post-meta,
.profile-line,
.name-row {
    display: flex;
    align-items: center;
}

.post-meta {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-line {
    gap: 12px;
}

.avatar-photo {
    width: 52px;
    height: 52px;
    border-radius: 18px;
}

.avatar-a { background-image: url('https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=400&q=80'); }
.avatar-b { background-image: url('https://images.unsplash.com/photo-1524504388940-b1c1722653e1?auto=format&fit=crop&w=400&q=80'); }
.avatar-c { background-image: url('https://images.unsplash.com/photo-1500648767791-00dcc994a43e?auto=format&fit=crop&w=400&q=80'); }
.avatar-d { background-image: url('https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&w=500&q=80'); }

.name-row {
    gap: 10px;
    font-weight: 700;
    margin-bottom: 4px;
}

.verified {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--brand-dark);
    background: rgba(90, 103, 216, 0.1);
    padding: 5px 9px;
    border-radius: 999px;
}

.verified.subtle {
    color: #8a5f00;
    background: rgba(245, 180, 0, 0.14);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f5f8fe;
    border: 1px solid var(--line);
    color: #6e7e97;
}

.post-copy h2,
.post-copy h3 {
    letter-spacing: -0.03em;
}

.post-copy h2 {
    font-size: 2rem;
    margin: 12px 0;
}

.post-copy h3 {
    font-size: 1.55rem;
    margin: 10px 0;
}

.compact-copy h3 {
    font-size: 1.45rem;
}

.post-copy p {
    line-height: 1.7;
    font-size: 0.98rem;
}

.soft-tag {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.soft-tag.warm {
    color: var(--danger);
    background: var(--danger-soft);
}

.soft-tag.cool {
    color: var(--brand-dark);
    background: rgba(90, 103, 216, 0.1);
}

.soft-tag.neutral {
    color: #617188;
    background: #f3f6fb;
}

.post-preview.large {
    height: 290px;
    margin: 18px 0;
    border-radius: 20px;
    background-image: linear-gradient(rgba(45, 62, 99, 0.14), rgba(45, 62, 99, 0.18)), url('https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?auto=format&fit=crop&w=1200&q=80');
}

.post-actions {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.post-actions button {
    padding: 12px 16px;
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-weight: 700;
}

.post-actions.slim {
    padding-top: 14px;
}

/* ---------- RIGHT RAIL ---------- */
.vip-card {
    padding: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, #fff5cc, #ffe298);
    border-color: #ffd55c;
}

.vip-card h3 {
    letter-spacing: -0.03em;
}

.vip-card p,
.info-list a,
.visit-item {
    line-height: 1.5;
}

.vip-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.45);
    display: grid;
    place-items: center;
    color: #9a6a00;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-list li {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 10px;
}

.info-list a {
    color: var(--brand-dark);
}

.soft-box {
    background: linear-gradient(180deg, #fbfdff, #f4f8ff);
}

.visit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.visit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-weight: 600;
}

.visit-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.visit-badge.pink { background: #ff7aa2; }
.visit-badge.blue { background: #5a67d8; }

/* ---------- AGE GATE ---------- */
.age-gate {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 99999;
}

.age-gate.hidden {
    display: none;
}

.age-gate-box {
    width: min(100%, 520px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
    padding: 32px;
    text-align: center;
}

.age-gate-badge {
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #f05a7e, #7c8cff);
}

.age-gate-box h2 {
    margin-bottom: 10px;
}

.age-gate-box p {
    color: var(--muted);
    line-height: 1.6;
}

.age-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}

/* ---------- VIEW SWITCHING ---------- */
.view-panel {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.view-panel.active {
    display: flex;
}

.section-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.section-hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

.section-intro {
    color: var(--muted);
    line-height: 1.6;
    max-width: 700px;
}

/* ---------- MEDIA / CONTENT SECTIONS ---------- */
.media-grid,
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.media-card,
.profile-card,
.match-card,
.story-card,
.video-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.media-card {
    padding: 14px;
}

.media-thumb,
.video-preview {
    height: 240px;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    margin-bottom: 14px;
}

.media-card h3,
.video-copy h3,
.match-card h3,
.story-card h3,
.profile-card h3 {
    margin-bottom: 6px;
}

.media-card p,
.video-copy p,
.match-card p,
.story-card p,
.profile-card p {
    color: var(--muted);
}

.profile-card {
    padding: 20px;
    text-align: center;
}

.profile-card .avatar-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 14px;
}

.match-card,
.story-card {
    padding: 22px;
}

.video-list,
.match-board,
.story-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.video-card {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 18px;
    padding: 14px;
}

.video-preview {
    margin-bottom: 0;
    position: relative;
}

.play-chip {
    position: absolute;
    left: 14px;
    bottom: 14px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.video-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-five { background-image: linear-gradient(rgba(56, 70, 112, 0.12), rgba(56, 70, 112, 0.12)), url('https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?auto=format&fit=crop&w=900&q=80'); }
.gallery-six { background-image: linear-gradient(rgba(56, 70, 112, 0.12), rgba(56, 70, 112, 0.12)), url('https://images.unsplash.com/photo-1517841905240-472988babdf9?auto=format&fit=crop&w=900&q=80'); }
.video-one { background-image: linear-gradient(rgba(21, 31, 54, 0.12), rgba(21, 31, 54, 0.42)), url('https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?auto=format&fit=crop&w=900&q=80'); }
.video-two { background-image: linear-gradient(rgba(21, 31, 54, 0.12), rgba(21, 31, 54, 0.42)), url('https://images.unsplash.com/photo-1515372039744-b8f02a3ae446?auto=format&fit=crop&w=900&q=80'); }
.video-three { background-image: linear-gradient(rgba(21, 31, 54, 0.12), rgba(21, 31, 54, 0.42)), url('https://images.unsplash.com/photo-1524504388940-b1c1722653e1?auto=format&fit=crop&w=900&q=80'); }

/* ---------- AUTH / MODALS ---------- */
.user-menu {
    position: relative;
    z-index: 7000;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px 0 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    box-shadow: 0 10px 20px rgba(59, 89, 152, 0.06);
}

.user-chip-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 10000;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    min-width: 220px;
    padding: 8px;
    box-shadow: 0 22px 45px rgba(31, 45, 78, 0.18);
    display: none;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text);
    text-align: left;
    font-weight: 700;
}

.user-dropdown-item:hover {
    background: var(--surface-soft);
}

.user-dropdown-item.danger {
    color: var(--danger);
    background: transparent;
}

.user-dropdown-item.danger:hover {
    background: var(--danger-soft);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 26, 43, 0.48);
    backdrop-filter: blur(6px);
    z-index: 11000;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 12000;
}

.auth-panel {
    width: 100%;
    max-width: 560px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 28px 70px rgba(32, 55, 105, 0.22);
    padding: 28px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f7ff;
    color: var(--text);
    border: 1px solid var(--line);
}

.auth-panel h2 {
    font-size: 2rem;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.auth-intro,
.auth-footer-note {
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    margin-top: 22px;
    display: grid;
    gap: 16px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-weight: 700;
    color: var(--text);
}

.field input,
.field textarea {
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #f9fbff;
    padding: 0 15px;
    outline: none;
    color: var(--text);
}

.field input {
    height: 50px;
}

.field textarea {
    padding: 14px 15px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(90, 103, 216, 0.12);
}

.auth-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-row.between {
    justify-content: space-between;
}

.auth-row.center {
    justify-content: center;
    margin-top: 16px;
    color: var(--muted);
}

.checkbox-stack {
    display: grid;
    gap: 10px;
    padding: 4px 0;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    line-height: 1.45;
}

.checkbox-line input {
    margin-top: 3px;
}

.text-link {
    color: var(--brand-dark);
    font-weight: 700;
}

.form-message {
    min-height: 22px;
    font-size: 0.95rem;
    font-weight: 600;
}

.form-message.error {
    color: var(--danger);
}

.form-message.success {
    color: var(--teal);
}

.auth-submit {
    justify-content: center;
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1280px) {
    .layout-grid {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .right-rail {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .search-chip {
        min-width: 220px;
    }
}

@media (max-width: 1100px) {
    .media-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .video-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        flex-wrap: wrap;
    }

    .search-chip {
        min-width: 0;
        width: 100%;
    }

    .layout-grid {
        grid-template-columns: 1fr;
    }

    .right-rail,
    .left-rail {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .search-chip {
        min-width: 100%;
        order: 3;
    }
}

@media (max-width: 760px) {
    .section-hero {
        flex-direction: column;
    }

    .age-gate-box {
        padding: 24px;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 12px;
    }

    .topbar,
    .subbar,
    .composer-panel,
    .feed-card,
    .rail-block,
    .side-widget,
    .promo-vertical,
    .vip-card {
        padding: 16px;
    }

    .main-nav,
    .subbar,
    .right-rail,
    .left-rail {
        display: flex;
        flex-direction: column;
    }

    .brand-mark,
    .header-actions {
        width: 100%;
    }

    .post-copy h2 {
        font-size: 1.55rem;
    }

    .post-copy h3 {
        font-size: 1.25rem;
    }

    .post-preview.large {
        height: 220px;
    }
}

@media (max-width: 640px) {
    .field-grid {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .auth-panel h2 {
        font-size: 1.65rem;
    }

    .user-chip-name {
        max-width: 80px;
    }
}

/* ===== notifications ===== */
.notification-wrap {
    position: relative;
}

.notification-wrap.hidden { display: none; }

.icon-circle-btn {
    position: relative;
    width: 46px;
    height: 46px;
    justify-content: center;
    border-radius: 50%;
}

.notification-badge {
    position: absolute;
    right: -2px;
    top: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    font-size: .72rem;
    font-weight: 800;
    color: #fff;
    background: var(--danger);
}

.notification-badge.hidden { display: none; }

.notification-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(430px, calc(100vw - 30px));
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow);
    display: none;
    z-index: 50;
}

.notification-panel.open { display: block; }

.notification-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.text-link {
    color: var(--brand-dark);
    font-weight: 800;
}

.notification-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.notification-summary span {
    padding: 8px 10px;
    border-radius: 999px;
    background: #f6f8ff;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-size: .82rem;
}

.notification-list {
    display: grid;
    gap: 10px;
    max-height: 380px;
    overflow: auto;
}

.notification-item,
.notification-empty {
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fafcff;
}

.notification-item p,
.notification-empty {
    color: var(--muted);
    line-height: 1.45;
}

.notification-item small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.notification-item.rejected {
    background: rgba(214,73,73,.06);
    border-color: rgba(214,73,73,.16);
}

.right-recommendations-list,
.online-friends-list {
    display: grid;
    gap: 10px;
}

.right-recommendation-item,
.online-friend-row {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    align-items: center;
    padding: 9px;
    border-radius: 16px;
    background: #f7faff;
    border: 1px solid var(--line);
}

.right-recommendation-item img,
.online-friend-row img,
.online-friend-row span,
.right-recommendation-item > span {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--brand), #93a2ff);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.right-recommendation-item small,
.online-friend-row small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.notification-group {
    display: grid;
    gap: 10px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--line);
}

.notification-group:last-child { border-bottom: 0; }
.notification-group h4 { font-size: .95rem; letter-spacing: .02em; }
.notification-item.insta {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    gap: 12px;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 8px 0;
}
.notification-avatar,
.notification-avatar img,
.notification-avatar span {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #93a2ff);
    color: #fff;
    font-weight: 800;
}
.notification-avatar img { object-fit: cover; }
.notification-copy p { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.notification-copy small { color: var(--muted); }
.notification-thumb,
.notification-thumb img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
}
.notification-thumb img { object-fit: cover; display:block; }
.notification-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.notification-summary .pill { padding: 9px 12px; }

/* --- v4 notifications and social widgets overrides --- */
.notification-head-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notification-summary {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-summary .pill {
    border: 1px solid rgba(133,154,198,.18);
    background: rgba(246,249,255,.94);
    color: var(--ink);
}

.notification-summary .pill.active {
    background: rgba(78, 96, 255, .12);
    color: var(--primary-strong);
    border-color: rgba(78,96,255,.2);
}

/* v14.8: remove inner badge bubble in notification filter pills */
.notification-summary .pill span {
    padding: 0;
    margin-left: 4px;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: inherit;
    font-weight: 700;
    display: inline;
    min-width: 0;
    width: auto;
    height: auto;
    line-height: inherit;
    box-shadow: none;
}

.notification-group {
    display: grid;
    gap: 10px;
}

.notification-group h4 {
    margin: 10px 0 4px;
    font-size: .98rem;
    color: var(--ink);
}

.notification-item.insta {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(133,154,198,.14);
    background: rgba(255,255,255,.92);
    position: relative;
}

.notification-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    border: none;
    background: rgba(78,96,255,.12);
    color: var(--primary-strong);
    display: grid;
    place-items: center;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
}

.notification-avatar img,
.notification-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notification-copy {
    min-width: 0;
    position: relative;
    padding-right: 26px;
}

.notification-copy strong,
.notification-copy p,
.notification-copy small {
    display: block;
    overflow-wrap: anywhere;
}

.notification-copy p {
    margin: 3px 0 4px;
    color: var(--ink);
}

.notification-copy small {
    color: var(--ink-muted);
}

.notification-thumb {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    padding: 0;
    background: rgba(222,228,242,.55);
    cursor: pointer;
}

.notification-item-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(240,243,250,.98);
    color: var(--ink-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.notification-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.notification-empty {
    padding: 22px;
    border-radius: 18px;
    background: rgba(246,249,255,.92);
    color: var(--ink-muted);
    text-align: center;
}

.online-friends-list {
    display: grid;
    gap: 12px;
}

.online-friend-row {
    width: 100%;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(133,154,198,.16);
    border-radius: 18px;
    padding: 10px 12px;
    background: rgba(246,249,255,.9);
    cursor: pointer;
    text-align: left;
}

.online-friend-row img,
.online-friend-row span {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(78,96,255,.12);
    color: var(--primary-strong);
    font-weight: 800;
    flex: 0 0 46px;
}

.online-friend-row div {
    min-width: 0;
}

.online-friend-row strong,
.online-friend-row small {
    display: block;
    overflow-wrap: anywhere;
}

.online-friend-row small {
    color: var(--ink-muted);
}

@media (max-width: 720px) {
    .notification-item.insta {
        grid-template-columns: auto 1fr;
    }

    .notification-thumb {
        grid-column: 2;
        justify-self: start;
    }
}

/* ---------- TOAST NOTIFICATIONS ---------- */
.toast-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 50000;
    display: grid;
    gap: 12px;
    width: min(390px, calc(100vw - 32px));
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 42px 1fr 34px;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--line);
    box-shadow: 0 22px 45px rgba(15, 23, 42, .16);
    transform: translateY(-12px);
    opacity: 0;
    transition: .22s ease;
}

.app-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.app-toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: var(--brand-dark);
    background: rgba(90, 103, 216, .12);
}

.app-toast.success .app-toast-icon {
    color: #1c8c42;
    background: rgba(73, 184, 102, .14);
}

.app-toast.error .app-toast-icon {
    color: var(--danger);
    background: rgba(214, 73, 73, .12);
}

.app-toast-copy {
    color: var(--text);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.app-toast-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f4f7fc;
    color: var(--muted);
}

/* ---------- ACCOUNT SETTINGS ---------- */
.settings-page-card {
    display: grid;
    gap: 18px;
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.settings-card-block {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #fff, #f7faff);
}

.settings-card-block h2 {
    margin: 0 0 4px;
}

.settings-card-block p {
    color: var(--muted);
    line-height: 1.5;
}

.settings-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.settings-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: var(--brand-dark);
}

.settings-switch input {
    width: 22px;
    height: 22px;
}

.verified-status-box {
    padding: 14px 16px;
    border-radius: 16px;
    background: #f5f8ff;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-weight: 800;
}

.admin-report-preview {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #f6f8ff;
    border: 1px solid var(--line);
    color: var(--text);
    overflow-wrap: anywhere;
}

.admin-report-media {
    display: block;
    max-width: min(420px, 100%);
    max-height: 360px;
    object-fit: contain;
    margin-top: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #0f172a;
}

body.dark-mode {
    --bg: #101827;
    --surface: #151f31;
    --surface-soft: #1c2940;
    --surface-accent: #243351;
    --line: #33445f;
    --line-strong: #4c6386;
    --text: #e8eef8;
    --muted: #9bacc4;
    background: linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

body.dark-mode .site-header,
body.dark-mode .section-hero,
body.dark-mode .side-widget,
body.dark-mode .rail-block,
body.dark-mode .feed-card,
body.dark-mode .composer-panel,
body.dark-mode .settings-page-card,
body.dark-mode .settings-card-block,
body.dark-mode .profile-info-card,
body.dark-mode .profile-form-card,
body.dark-mode .profile-top,
body.dark-mode .album-comments-wrap,
body.dark-mode .album-detail-summary,
body.dark-mode .album-detail-gallery {
    background: rgba(18, 28, 45, .94) !important;
    color: var(--text);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select,
body.dark-mode .search-chip,
body.dark-mode .user-dropdown,
body.dark-mode .notification-panel {
    background: #182338 !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

body.dark-mode .ghost-btn,
body.dark-mode .notification-item,
body.dark-mode .visit-item,
body.dark-mode .profile-albums-empty,
body.dark-mode .admin-report-preview,
body.dark-mode .verified-status-box {
    background: #1d2a42 !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

@media (max-width: 720px) {
    .settings-check-grid {
        grid-template-columns: 1fr;
    }
}


/* ---------- DARK MODE FIX v14.2 ---------- */
body.dark-mode {
    --primary: #7d8cff;
    --primary-strong: #aeb8ff;
    --ink: #e8eef8;
    --ink-muted: #b2bfd3;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

body.dark-mode .topbar,
body.dark-mode .subbar {
    background: transparent !important;
}

body.dark-mode .subbar {
    border-top-color: var(--line) !important;
}

body.dark-mode .vip-card,
body.dark-mode .highlight-card,
body.dark-mode .promo-vertical,
body.dark-mode .settings-page-card,
body.dark-mode .settings-card-block,
body.dark-mode .side-widget,
body.dark-mode .rail-block,
body.dark-mode .right-recommendation-item,
body.dark-mode .online-friend-row,
body.dark-mode .visit-item,
body.dark-mode .notification-item,
body.dark-mode .notification-empty,
body.dark-mode .profile-albums-empty,
body.dark-mode .album-status-note,
body.dark-mode .album-upload-dropzone-card,
body.dark-mode .album-upload-main-card,
body.dark-mode .album-detail-card,
body.dark-mode .album-owner-strip,
body.dark-mode .album-detail-preview-card,
body.dark-mode .album-comments-wrap,
body.dark-mode .messages-shell,
body.dark-mode .chat-dock,
body.dark-mode .chat-dock-panel {
    background: rgba(18, 28, 45, 0.94) !important;
    border-color: var(--line) !important;
    color: var(--text) !important;
}

body.dark-mode .right-recommendation-item,
body.dark-mode .online-friend-row,
body.dark-mode .visit-item,
body.dark-mode .notification-item.insta {
    background: rgba(28, 41, 64, 0.96) !important;
}

body.dark-mode .right-recommendation-item strong,
body.dark-mode .right-recommendation-item h3,
body.dark-mode .right-recommendation-item span,
body.dark-mode .online-friend-row strong,
body.dark-mode .visit-item,
body.dark-mode .block-head h3,
body.dark-mode .settings-card-block h2,
body.dark-mode .settings-card-block h3,
body.dark-mode .profile-info-card h3,
body.dark-mode .album-detail-card h1,
body.dark-mode .album-detail-card h2,
body.dark-mode .album-detail-card h3 {
    color: var(--text) !important;
}

body.dark-mode .right-recommendation-item small,
body.dark-mode .online-friend-row small,
body.dark-mode .muted-copy,
body.dark-mode .section-intro,
body.dark-mode .info-row span,
body.dark-mode .settings-card-block p,
body.dark-mode .settings-card-block small,
body.dark-mode .profile-quick-meta {
    color: var(--muted) !important;
}

body.dark-mode .vip-card {
    background: linear-gradient(135deg, rgba(101, 79, 23, 0.92), rgba(35, 45, 68, 0.94)) !important;
    border-color: rgba(255, 210, 91, 0.28) !important;
}

body.dark-mode .ghost-btn,
body.dark-mode .primary-btn,
body.dark-mode .pill,
body.dark-mode .album-stat-pill {
    color: var(--text);
}

body.dark-mode .user-chip {
    background: rgba(24, 35, 56, 0.96) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
}

body.dark-mode .user-chip-avatar {
    background: linear-gradient(135deg, var(--brand), #93a2ff) !important;
    border: 1px solid rgba(255,255,255,0.18);
    overflow: hidden !important;
    opacity: 1 !important;
    flex: 0 0 30px;
}

body.dark-mode .user-chip-avatar img,
body.dark-mode .right-recommendation-item img,
body.dark-mode .online-friend-row img,
body.dark-mode .avatar-photo,
body.dark-mode .profile-album-card img,
body.dark-mode .feature-tile,
body.dark-mode .thumb-card,
body.dark-mode .post-preview,
body.dark-mode .media-thumb {
    opacity: 1 !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

body.dark-mode .user-chip-avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

body.dark-mode .toast {
    background: rgba(21, 31, 49, 0.98) !important;
    border-color: var(--line) !important;
    color: var(--text) !important;
}

body.dark-mode .toast.success .toast-icon {
    background: rgba(74, 222, 128, 0.16) !important;
    color: #86efac !important;
}
