/* ==========================================================================
   45sec.chat — Dating App Design System v2
   Customize colors via :root variables when your final mockup is ready.
   ========================================================================== */

:root {
    --app-bg: #08050f;
    --app-bg-soft: #100818;
    --app-surface: rgba(20, 10, 28, 0.82);
    --app-surface-strong: rgba(28, 14, 38, 0.94);
    --app-surface-glass: rgba(255, 255, 255, 0.04);
    --app-border: rgba(255, 140, 170, 0.14);
    --app-border-strong: rgba(255, 120, 160, 0.28);
    --app-text: #fdf4f7;
    --app-text-muted: #d8c4d0;
    --app-text-soft: #9f8aa8;
    --app-accent: #f43f5e;
    --app-accent-hover: #e11d48;
    --app-accent-2: #e879f9;
    --app-accent-3: #a78bfa;
    --app-gold: #fbbf24;
    --app-success: #34d399;
    --app-danger: #fb7185;
    --app-info: #38bdf8;
    --app-radius-xl: 24px;
    --app-radius-lg: 18px;
    --app-radius-md: 14px;
    --app-radius-sm: 10px;
    --app-radius-pill: 999px;
    --app-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
    --app-glow: 0 0 48px rgba(244, 63, 94, 0.18);
    --app-font: "DM Sans", system-ui, -apple-system, sans-serif;
    --app-font-display: "Playfair Display", Georgia, serif;
    --app-gradient-bg:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(244, 63, 94, 0.22), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(167, 139, 250, 0.18), transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(232, 121, 249, 0.08), transparent 60%),
        var(--app-bg);
    --app-gradient-accent: linear-gradient(135deg, #f43f5e 0%, #e879f9 52%, #a78bfa 100%);
    --app-gradient-card: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body,
.app-body {
    font-family: var(--app-font);
    background: var(--app-gradient-bg);
    background-attachment: fixed;
    color: var(--app-text);
    line-height: 1.5;
}

body.app-body--auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.app-body--app {
    min-height: 100vh;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

button,
.btn,
.pill,
.nav a,
input,
select,
textarea {
    font-family: inherit;
}

button,
.btn,
.pill,
.nav a,
.buy-btn {
    touch-action: manipulation;
}

/* ---- Auth layout ---- */

.auth-shell,
.box {
    width: 100%;
    max-width: 440px;
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xl);
    padding: 36px 32px;
    box-shadow: var(--app-shadow), var(--app-glow);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}

.auth-shell::before,
.box::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--app-gradient-accent);
}

.logo,
.brand {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
    color: var(--app-text);
    display: inline-flex;
    align-items: baseline;
    gap: 0;
}

.logo span,
.brand span {
    background: var(--app-gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h1 {
    margin: 0 0 10px;
    font-family: var(--app-font-display);
    font-size: clamp(1.85rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

p,
.muted,
.details {
    color: var(--app-text-muted);
}

.muted,
.box p {
    margin: 0 0 22px;
    font-size: 0.95rem;
    line-height: 1.55;
}

label {
    display: block;
    margin-bottom: 7px;
    color: var(--app-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 15px;
    margin-bottom: 14px;
    border-radius: var(--app-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(8, 5, 15, 0.72);
    color: var(--app-text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--app-text-soft);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(244, 63, 94, 0.55);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.14);
}

select { cursor: pointer; }

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--app-radius-md);
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button[type="submit"],
.btn.primary,
.btn.blue,
.pill.primary,
.nav-cta,
.primary,
.quick-start-large,
.primary-mobile {
    background: var(--app-gradient-accent);
    box-shadow: 0 14px 36px rgba(244, 63, 94, 0.28);
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.auth-shell button[type="submit"],
.box button[type="submit"] {
    width: 100%;
    margin-top: 4px;
}

.link,
.bottom-link {
    margin-top: 18px;
    font-size: 0.9rem;
    color: var(--app-text-muted);
    text-align: center;
}

.link a,
.bottom-link a {
    color: #fda4af;
    text-decoration: none;
    font-weight: 700;
}

.link a:hover,
.bottom-link a:hover {
    color: #fecdd3;
    text-decoration: underline;
}

.footer-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--app-border);
    color: var(--app-text-soft);
    font-size: 0.75rem;
    text-align: center;
}

/* ---- App shell ---- */

.page,
.wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 16px 42px;
}

/* ---- App shell bar (Messenger-style top navigation) ---- */

.app-shell-bar {
    position: sticky;
    top: 0;
    z-index: 9000;
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr minmax(0, auto);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    margin: -22px -16px 18px;
    padding: 8px 14px;
    background: rgba(8, 5, 15, 0.94);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.app-shell-left,
.app-shell-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-shell-right {
    justify-content: flex-end;
}

.app-shell-match {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--app-radius-pill);
    background: var(--app-gradient-accent);
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(244, 63, 94, 0.24);
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-shell-match:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(244, 63, 94, 0.32);
}

.app-shell-match.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 10px 24px rgba(244, 63, 94, 0.28);
}

.app-shell-match-icon {
    font-size: 1rem;
    line-height: 1;
}

.app-shell-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.app-shell-nav-item {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 72px;
    min-height: 48px;
    padding: 6px 10px;
    border-radius: 14px;
    color: var(--app-text-soft);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 800;
    transition: background 0.18s ease, color 0.18s ease;
}

.app-shell-nav-item svg {
    width: 22px;
    height: 22px;
    opacity: 0.82;
}

.app-shell-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--app-text);
}

.app-shell-nav-item.is-active {
    color: #fff;
    background: rgba(244, 63, 94, 0.14);
}

.app-shell-nav-item.is-active svg {
    opacity: 1;
}

.app-shell-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem;
}

.app-shell-icon-btn {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--app-border);
    background: var(--app-surface-glass);
    color: var(--app-text-muted);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.app-shell-icon-btn::-webkit-details-marker {
    display: none;
}

.app-shell-icon-btn svg {
    width: 20px;
    height: 20px;
}

.app-shell-icon-btn:hover,
.app-shell-more[open] .app-shell-icon-btn {
    color: #fff;
    border-color: var(--app-border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.app-shell-more {
    position: relative;
}

.app-shell-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    padding: 8px;
    border-radius: 16px;
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    box-shadow: var(--app-shadow);
    z-index: 9100;
}

.app-shell-more-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--app-text-muted);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
}

.app-shell-more-panel a:hover,
.app-shell-more-panel a.is-active {
    background: rgba(244, 63, 94, 0.12);
    color: #fff;
}

.app-user-menu {
    position: relative;
}

.app-user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 3px 6px 3px 3px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-pill);
    background: var(--app-surface-glass);
    color: var(--app-text);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.app-user-menu-trigger:hover,
.app-user-menu.is-open .app-user-menu-trigger {
    border-color: var(--app-border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.app-user-menu-avatar .avatar {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
}

.app-user-menu-chevron svg {
    width: 16px;
    height: 16px;
    color: var(--app-text-soft);
    transition: transform 0.18s ease;
}

.app-user-menu.is-open .app-user-menu-chevron svg {
    transform: rotate(180deg);
}

.app-user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(300px, calc(100vw - 24px));
    padding: 10px;
    border-radius: 18px;
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    box-shadow: var(--app-shadow);
    z-index: 9200;
}

.app-user-menu-panel[hidden] {
    display: none !important;
}

.app-user-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 12px;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: 8px;
}

.app-user-menu-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.app-user-menu-meta {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--app-gold);
    font-weight: 700;
}

.app-user-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--app-border);
}

.app-user-menu-links {
    display: grid;
    gap: 2px;
}

.app-user-menu-links a,
.app-user-menu-logout {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--app-text-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
}

.app-user-menu-links a:hover,
.app-user-menu-links a.is-active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.app-user-menu-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--app-border);
}

.app-user-menu-logout {
    color: #fecdd3;
}

.app-user-menu-logout:hover {
    background: rgba(127, 29, 29, 0.35);
    color: #fff;
}

/* Legacy topbar (kept for compatibility) */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav a,
.pill {
    color: var(--app-text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 14px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-glass);
    border-radius: var(--app-radius-pill);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav a:hover,
.pill:hover {
    border-color: var(--app-border-strong);
    color: var(--app-text);
}

.nav a.is-active,
.pill.is-active {
    border-color: rgba(244, 63, 94, 0.45);
    color: #fff;
    background: rgba(244, 63, 94, 0.12);
}

.nav-cta {
    border: 0 !important;
    color: #fff !important;
}

.settings-btn {
    font-size: 1rem;
    line-height: 1;
    padding-inline: 12px !important;
}

.mobile-nav-wrap {
    display: none;
}

.mobile-main-nav {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    gap: 8px;
    margin-bottom: 8px;
}

.mobile-main-nav a,
.mobile-more-summary {
    min-height: 44px;
    border-radius: var(--app-radius-pill);
    padding: 11px 10px;
    text-align: center;
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 800;
    color: #fff;
    border: 1px solid var(--app-border);
    background: var(--app-surface-glass);
}

.mobile-main-nav a.primary-mobile,
.mobile-main-nav a.is-active.primary-mobile {
    background: var(--app-gradient-accent);
    border-color: transparent;
}

.mobile-more-links {
    display: grid;
    gap: 8px;
    padding: 10px 0 4px;
}

.mobile-more-links a {
    text-decoration: none;
    color: var(--app-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: var(--app-radius-md);
    background: var(--app-surface-glass);
    border: 1px solid var(--app-border);
}

/* ---- Section accordions ---- */

.app-section-accordion > h2 {
    margin: 0;
}

.app-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--app-text);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: left;
    cursor: pointer;
    transform: none;
    box-shadow: none;
    transition: color 0.18s ease;
}

.app-section-toggle:hover {
    color: #fff;
    transform: none;
}

.app-section-toggle-label {
    flex: 1;
    min-width: 0;
}

.app-section-toggle-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--app-text-soft);
    transition: transform 0.22s ease, color 0.18s ease;
}

.app-section-toggle-chevron svg {
    width: 18px;
    height: 18px;
}

.app-section-accordion.is-open .app-section-toggle-chevron {
    transform: rotate(180deg);
    color: var(--app-text-muted);
}

.app-section-body {
    display: none;
    padding-top: 14px;
}

.app-section-accordion.is-open .app-section-body {
    display: block;
}

/* ---- Cards & layout ---- */

.card {
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    padding: 20px;
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(14px);
}

.hero {
    display: grid;
    grid-template-columns: 112px 1fr auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 290px;
    gap: 18px;
    align-items: start;
}

.stack {
    display: grid;
    gap: 14px;
}

.menu {
    display: grid;
    gap: 10px;
}

.menu a {
    display: block;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: var(--app-radius-md);
    background: var(--app-surface-glass);
    border: 1px solid var(--app-border);
    font-weight: 800;
    color: var(--app-text);
}

.menu a.primary { background: rgba(244, 63, 94, 0.18); border-color: rgba(244, 63, 94, 0.35); }
.menu a.green { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.28); }
.menu a.purple { background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.3); }

.stat-grid,
.online-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat,
.online-stat {
    background: rgba(8, 5, 15, 0.55);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 13px 10px;
    text-align: center;
}

.stat strong,
.online-stat strong {
    display: block;
    color: #fda4af;
    font-size: 1.45rem;
    line-height: 1;
    margin-bottom: 6px;
}

.stat span,
.online-stat span {
    color: var(--app-text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Avatars ---- */

.avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--app-gradient-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.08), var(--app-glow);
}

.avatar.big { width: 112px; height: 112px; font-size: 2.6rem; }
.avatar.small { width: 42px; height: 42px; font-size: 1rem; }

.avatar img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* ---- Buttons palette ---- */

.blue { background: #2563eb; }
.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.green { background: linear-gradient(135deg, #10b981, #059669); }
.dark { background: rgba(255,255,255,0.08); border: 1px solid var(--app-border); }
.red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.gold { background: linear-gradient(135deg, #f59e0b, #d97706); }

.actions,
.hero-profile-actions,
.send-row,
.invite-actions,
.global-private-invite-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Notices ---- */

.notice,
.error,
.message.error {
    padding: 13px 14px;
    border-radius: var(--app-radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.notice.ok,
.notice.success {
    background: rgba(16, 85, 60, 0.55);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #d1fae5;
}

.notice.error,
.error {
    background: rgba(127, 29, 29, 0.55);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}

/* ---- Badges & status ---- */

.badge {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--app-radius-pill);
    background: var(--app-accent);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 900;
}

.online { color: var(--app-success); font-weight: 800; }
.offline { color: var(--app-text-soft); font-weight: 800; }

.empty {
    color: var(--app-text-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 8px 0;
}

/* ---- Dashboard specials ---- */

.quick-match-cta {
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(244, 63, 94, 0.16), transparent 58%),
        var(--app-surface-strong);
    border-color: rgba(244, 63, 94, 0.28);
}

.quick-match-cta-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.45));
}

.quick-start-large,
.primary.quick-start-large {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 15px;
    border-radius: var(--app-radius-md);
    text-align: center;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
}

.post,
.friend-row,
.room-row {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--app-border);
}

.post { flex-direction: column; align-items: stretch; padding: 0; border: 0; }
.post-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.post-text { color: var(--app-text); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.post-time { color: var(--app-text-soft); font-size: 0.75rem; margin-top: 10px; }

.friend-row:last-child,
.room-row:last-child { border-bottom: 0; }

/* ---- Messenger / lists ---- */

.list-card,
.contact-card,
.request-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border);
    background: var(--app-surface-glass);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.list-card:hover,
.contact-card:hover {
    border-color: var(--app-border-strong);
    transform: translateY(-1px);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tab,
.tab-btn {
    border: 1px solid var(--app-border);
    background: transparent;
    color: var(--app-text-muted);
    border-radius: var(--app-radius-pill);
    padding: 9px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.tab.active,
.tab-btn.active {
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fff;
}

/* ---- Chat ---- */

.chat-box {
    min-height: 360px;
    max-height: 58vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 2px;
}

.message {
    max-width: 78%;
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.45;
    word-break: break-word;
}

.message.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.85), rgba(232, 121, 249, 0.75));
    color: #fff;
    border-bottom-right-radius: 6px;
}

.message.theirs {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--app-border);
    border-bottom-left-radius: 6px;
}

.message .time {
    margin-top: 6px;
    font-size: 0.68rem;
    opacity: 0.75;
}

.send-row textarea {
    min-height: 88px;
    resize: vertical;
    margin-bottom: 0;
}

.send-row {
    align-items: stretch;
}

.send-row .btn { align-self: end; }

.typing-note {
    margin-top: 8px;
    color: var(--app-text-soft);
    font-size: 0.75rem;
}

/* ---- Profile ---- */

.profile-hero,
.profile-grid {
    display: grid;
    gap: 18px;
}

.profile-card,
.info-card {
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    padding: 20px;
}

.profile-meta {
    color: var(--app-text-muted);
    font-size: 0.9rem;
}

.tag,
.pill-tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: var(--app-radius-pill);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--app-border);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--app-text-muted);
}

/* ---- Forms / edit profile ---- */

.edit-wrap {
    max-width: 680px;
    margin: 0 auto;
}

.photo-preview {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.locked-field {
    background: rgba(8, 5, 15, 0.72) !important;
    color: var(--app-text-soft) !important;
    cursor: not-allowed;
}

.field-note {
    margin: 6px 0 0 2px;
    color: var(--app-text-soft);
    font-size: 0.75rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--app-border);
    background: rgba(8, 5, 15, 0.55);
    border-radius: var(--app-radius-md);
}

.check-row input { width: 18px; height: 18px; padding: 0; margin: 0; }

/* ---- Modals ---- */

.gift-modal-backdrop,
.invite-panel,
.global-private-invite-panel,
.action-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(4, 2, 8, 0.78);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.gift-modal,
.invite-box,
.global-private-invite-box,
.action-modal {
    width: 100%;
    max-width: 460px;
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-xl);
    padding: 24px;
    box-shadow: var(--app-shadow);
    color: var(--app-text);
}

.invite-panel { display: none; }
.invite-panel[style*="flex"] { display: flex !important; }

/* ---- Tokens / payments ---- */

.token-grid,
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.package-card,
.token-card {
    background: var(--app-surface-strong);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    padding: 20px;
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.package-card:hover,
.token-card:hover {
    border-color: rgba(251, 191, 36, 0.35);
    transform: translateY(-2px);
}

.package-price,
.token-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--app-gold);
}

.account-history-link {
    color: #fda4af;
    font-weight: 700;
    text-decoration: none;
}

/* ---- Character editor ---- */

.character-wrap,
.preview-panel {
    display: grid;
    gap: 18px;
}

.character-preview-box {
    background: rgba(8, 5, 15, 0.55);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-xl);
    padding: 18px;
    text-align: center;
}

.color-grid,
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* ---- Utility ---- */

.chat-toolbar {
    margin-bottom: 14px;
}

.invite-panel {
    display: none;
    align-items: center;
    justify-content: center;
}

.invite-status {
    margin-top: 12px;
    color: var(--app-text-soft);
    font-size: 0.85rem;
}

.invite-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.page-dashboard .hero,
.page-profile .profile-hero-layout .profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.page-dashboard .hero > div,
.page-profile .profile-head > div {
    width: 100%;
    max-width: 520px;
}

.page-dashboard .hero .avatar,
.page-dashboard .hero .avatar.big,
.page-profile .profile-head .avatar {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    margin: 0 auto;
}

.page-dashboard .hero-profile-actions,
.page-profile .profile-head .actions {
    justify-content: center;
}

.page-profile .profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

/* ---- Feed posts (Facebook-style, dark theme) ---- */

.feed-section {
    display: grid;
    gap: 14px;
}

.feed-section-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.feed-post-list,
.post-list {
    display: grid;
    gap: 16px;
}

.feed-post {
    position: relative;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.88)),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.15), transparent 34%);
    border: 1px solid rgba(147, 197, 253, 0.14);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.feed-post-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.feed-post-author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #fff;
    overflow: hidden;
    flex: 0 0 auto;
}

.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-post-name {
    color: #f8fafc;
    font-size: 14px;
    font-weight: 800;
}

.feed-post-time {
    color: #93c5fd;
    font-size: 12px;
    margin-top: 2px;
}

.feed-post-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.feed-post-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.feed-post-body {
    font-size: 15px;
    color: #e5eefc;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}

.feed-post-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px 10px;
    color: #94a3b8;
    font-size: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.feed-stat-icons { margin-right: 4px; }

.feed-post-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding-top: 6px;
}

.fb-like-wrap {
    position: relative;
}

.reaction-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid rgba(147, 197, 253, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 20;
    pointer-events: none;
}

.fb-like-wrap:hover .reaction-picker,
.fb-like-wrap:focus-within .reaction-picker {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.reaction-pick {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    transition: transform 0.12s ease;
    padding: 0;
}

.reaction-pick:hover { transform: scale(1.2) translateY(-2px); }

.fb-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    border: none;
    background: transparent;
    color: #cbd5e1;
    border-radius: 8px;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.fb-action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.fb-action-btn.is-active {
    color: #93c5fd;
}

.fb-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.fb-action-icon {
    font-size: 15px;
    line-height: 1;
    opacity: 0.9;
}

/* ---- Feed composer (Facebook-style, dark theme) ---- */

.feed-composer {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.88)),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 34%);
    border: 1px solid rgba(147, 197, 253, 0.14);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.feed-composer-form {
    display: grid;
    gap: 0;
}

.feed-composer-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.feed-composer .avatar.small {
    margin-top: 2px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
}

.feed-composer-input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    max-height: 140px;
    margin: 0;
    padding: 10px 14px;
    border: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--app-text);
    font-size: 0.92rem;
    line-height: 1.45;
    resize: vertical;
    outline: none;
    transition: background 0.15s ease;
}

.feed-composer-input::placeholder {
    color: var(--app-text-soft);
}

.feed-composer-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border: 0;
    box-shadow: none;
}

.feed-composer-divider {
    height: 1px;
    margin: 10px 0 8px;
    background: rgba(148, 163, 184, 0.12);
}

.feed-composer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.feed-composer-emoji {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.feed-emoji-pick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 4px 5px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
    font-weight: 400;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background 0.12s ease;
}

.feed-emoji-pick:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: none;
}

.feed-composer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.feed-composer-hint {
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: nowrap;
}

.feed-composer-submit {
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.28);
    color: #bfdbfe;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.feed-composer-submit:hover {
    background: rgba(37, 99, 235, 0.42);
    color: #fff;
    transform: none;
}

.page-dashboard .hero {
    border: 1px solid rgba(244, 63, 94, 0.2);
    background:
        radial-gradient(circle at top right, rgba(244, 63, 94, 0.1), transparent 45%),
        var(--app-surface-strong);
}

.logo {
    margin-bottom: 22px;
}

.auth-shell .logo {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-center { text-align: center; }

/* ---- Responsive ---- */

@media (max-width: 1040px) {
    .layout { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 88px 1fr; }
    .hero .actions { grid-column: 1 / -1; }
    .avatar.big { width: 88px; height: 88px; font-size: 2rem; }
}

@media (max-width: 900px) {
    .nav { display: none; }

    .app-shell-bar {
        margin: -22px -16px 14px;
        gap: 8px;
        padding: 8px 10px;
    }

    .app-shell-center {
        gap: 2px;
    }

    .app-shell-nav-item {
        min-width: 56px;
        min-height: 44px;
        padding: 5px 6px;
        font-size: 0.62rem;
    }

    .app-shell-nav-item svg {
        width: 20px;
        height: 20px;
    }

    .app-shell-match-label {
        display: none;
    }

    .app-shell-match {
        padding: 0 12px;
        min-width: 40px;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .page,
    .wrap {
        padding: 12px 10px 28px;
    }

    .app-shell-bar {
        margin: -12px -10px 12px;
    }

    .app-shell-nav-item span:not(.app-shell-nav-badge) {
        display: none;
    }

    .app-shell-nav-item {
        min-width: 44px;
    }

    .app-user-menu-panel {
        width: min(300px, calc(100vw - 20px));
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .app-section-toggle {
        min-height: 48px;
        font-size: 1.1rem;
    }

    .card,
    .auth-shell,
    .box {
        border-radius: 18px;
        padding: 18px 16px;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: left;
    }

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

    body.app-body--auth {
        align-items: flex-start;
        padding-top: 36px;
    }
}

@media (max-width: 560px) {
    h1 { font-size: 1.75rem; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }

    .feed-composer-bottom {
        flex-direction: column;
        align-items: stretch;
    }

    .feed-composer-actions {
        margin-left: 0;
        justify-content: space-between;
    }

    .feed-composer-hint {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    body:not(.app-body--video) *,
    body:not(.app-body--video) *::before,
    body:not(.app-body--video) *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
