/* ==========================================================================
   Unlok Memories — Official Design System 2026
   Palette: #050816 · #12192F · #5EEAD4 · #7C3AED · #F59E0B
   ========================================================================== */

/* 1. RESET --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; }

/* 2. VARIABLES ----------------------------------------------------------- */
:root {
    --bg: #050816;
    --bg-secondary: #0B1023;
    --surface: #12192F;
    --surface-light: #18213D;

    --card: rgba(18, 25, 47, 0.82);
    --glass: rgba(255, 255, 255, 0.06);

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    --text: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #7C8BA5;

    --primary: #5EEAD4;
    --primary-hover: #2DD4BF;
    --primary-soft: rgba(94, 234, 212, 0.12);
    --primary-glow: rgba(94, 234, 212, 0.18);

    --secondary: #7C3AED;
    --secondary-hover: #8B5CF6;
    --secondary-soft: rgba(124, 58, 237, 0.16);

    --gold: #F59E0B;
    --success: #22C55E;
    --danger: #EF4444;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.28);

    --radius: 22px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-btn: 14px;

    --sidebar-width: 250px;
    --sidebar-compact: 88px;
    --bottom-nav-h: 76px;
    --content-max: 1500px;

    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ease: 180ms ease;
    --ease-med: 250ms ease;
    --ease-slow: 300ms ease;

    /* Legacy aliases */
    --bg-primary: var(--bg);
    --text-primary: var(--text);
    --accent: var(--primary);
    --accent-hover: var(--primary-hover);
    --accent-soft: var(--primary-soft);
    --accent-strong: var(--primary-hover);
    --muted: var(--text-muted);
    --line: var(--border);
    --primary-2: var(--primary-hover);
    --panel: var(--card);
    --panel-2: var(--card);
    --surface-2: var(--surface-light);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --surface-active: rgba(255, 255, 255, 0.1);
    --warning: var(--gold);
    --elevation-1: var(--shadow);
}

/* 3. TYPOGRAPHY ---------------------------------------------------------- */
body {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    min-height: 100vh;
    background: radial-gradient(circle at top, #14213D 0%, #0B1023 35%, #050816 100%);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.035;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

.app-shell,
.app-sidebar,
.bottom-nav,
.topbar,
.page-container,
.auth-layout,
.landing,
.app-footer,
.banner,
.toast,
.live-banner,
.bottom-sheet,
.explore-overlay,
.modal-backdrop {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1.6vw, 1.375rem); }
p { margin: 0; }
small, .muted { color: var(--text-muted); line-height: 1.55; font-size: 14px; }
.lead { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.7; font-weight: 500; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-soft);
}

/* 4. BASE ---------------------------------------------------------------- */
.glass {
    background: var(--glass);
    border: 1px solid var(--border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 10000;
    padding: 12px 18px;
    background: var(--primary);
    color: #04111C;
    border-radius: var(--radius-sm);
    font-weight: 700;
}
.skip-link:focus { left: 16px; top: 16px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

.banner {
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #04111C;
    text-align: center;
    font-size: 0.875rem;
    padding: 10px 14px;
    font-weight: 650;
    position: sticky;
    top: 0;
    z-index: 9999;
}

/* 5. LAYOUT -------------------------------------------------------------- */
.app-shell {
    min-height: 100vh;
    max-width: var(--content-max);
    margin-inline: auto;
}

.has-sidebar .app-shell {
    padding-left: var(--sidebar-width);
    transition: padding-left var(--ease-med);
}

.page-container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto 40px;
    padding: 8px 32px 48px;
}

.page-container--narrow { max-width: 960px; }

/* 6. SIDEBAR ------------------------------------------------------------- */
.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 800;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 24px 14px;
    background: rgba(11, 16, 35, 0.75);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow-y: auto;
}

.sidebar-brand {
    display: block;
    padding: 8px 12px 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand__name {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--text);
    line-height: 1.05;
}

.sidebar-brand__sub {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.24em;
    color: var(--primary);
    text-transform: uppercase;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 14px;
    border-left: 3px solid transparent;
    color: var(--text-muted);
    font-size: 0.925rem;
    font-weight: 550;
    transition: background var(--ease), color var(--ease), transform var(--ease), border-color var(--ease);
}

.sidebar-item svg { flex-shrink: 0; width: 20px; height: 20px; opacity: 0.85; }

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    transform: translateX(2px);
}

.sidebar-item.is-active,
.nav-item.active {
    background: rgba(94, 234, 212, 0.12);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-item.is-active svg { opacity: 1; }

.sidebar-item .fab {
    width: 28px;
    height: 28px;
    font-size: 1.05rem;
    transform: none;
    box-shadow: none;
}

.sidebar-spacer { flex: 1; min-height: 16px; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 7. BOTTOM NAV ---------------------------------------------------------- */
.bottom-nav {
    display: none;
    position: fixed;
    left: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 900;
    width: min(420px, calc(100% - 24px));
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    align-items: center;
    justify-content: space-around;
    background: rgba(11, 16, 35, 0.82);
    border: 1px solid var(--border);
    border-radius: 28px;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 48px;
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 650;
    transition: background var(--ease), color var(--ease);
}

.bottom-nav__item span[aria-hidden] { font-size: 1.15rem; line-height: 1; }
.bottom-nav__item:hover,
.bottom-nav__item.is-active {
    color: var(--primary);
    background: var(--primary-soft);
}

.bottom-nav__item.fab,
.bottom-nav .fab {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #04111C;
    font-size: 1.65rem;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(94, 234, 212, 0.28);
    transform: translateY(-10px);
    padding: 0;
}

.bottom-nav__item.fab:hover {
    filter: brightness(1.05);
    color: #04111C;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
}

.fab {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #04111C;
    display: grid;
    place-items: center;
    font-weight: 700;
    box-shadow: 0 14px 36px rgba(94, 234, 212, 0.22);
}

/* 8. HEADER -------------------------------------------------------------- */
.topbar {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px 32px 18px;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background: transparent;
}

.topbar h1 {
    margin: 6px 0 0;
    font-size: clamp(1.55rem, 2.4vw, 2.1rem);
}

.topbar__content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    width: 100%;
}

.topbar-greeting {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.topbar-subtitle {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    max-width: 42ch;
    font-weight: 500;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-secondary);
    transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.topbar-icon-btn:hover {
    background: var(--surface-light);
    color: var(--primary);
    border-color: var(--border-hover);
}

.topbar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.nav-actions,
.hero-actions,
.moment-actions,
.overlay-actions,
.location-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 9. CARDS --------------------------------------------------------------- */
.card,
.stat-card,
.panel,
.hero-strip,
.profile-hero,
.auth-card,
.phone-card,
.mini-stats .stat,
.mini-stats > div,
.location-bar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--ease-med),
        border-color var(--ease-med),
        box-shadow var(--ease-med),
        background var(--ease-med);
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-4px);
        border-color: var(--border-hover);
        box-shadow: var(--shadow);
    }
}

.hero-strip,
.profile-hero {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(94, 234, 212, 0.08), transparent 50%),
        linear-gradient(225deg, rgba(124, 58, 237, 0.08), transparent 45%),
        var(--card);
}

.hero-strip__text { max-width: 720px; }
.hero-strip h2, .profile-hero h2 { margin: 0 0 8px; }
.hero-strip p, .profile-hero p { color: var(--text-secondary); }

.mini-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat,
.mini-stats > div,
.profile-stats > div {
    min-width: 120px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-light);
    border: 1px solid var(--border);
    text-align: center;
}

.stat strong,
.mini-stats strong,
.profile-stats strong {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
}

.stat span,
.mini-stats span,
.profile-stats span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

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

.location-info { display: flex; align-items: center; gap: 12px; }
.location-icon { font-size: 1.25rem; }
.location-coords {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

/* Profile cover */
.profile-cover {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.profile-cover__banner {
    height: 160px;
    background:
        linear-gradient(120deg, rgba(124, 58, 237, 0.55), rgba(94, 234, 212, 0.35)),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.25), transparent 40%);
}

.profile-cover__body {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 0 24px 24px;
    margin-top: -40px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--secondary), var(--primary));
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    border: 3px solid var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.profile-cover__info { flex: 1; min-width: 200px; padding-top: 48px; }
.profile-cover__info h1 { font-size: clamp(1.3rem, 2vw, 1.75rem); word-break: break-word; }

/* Capsule placeholder for locked moments */
.capsule-card {
    position: relative;
    width: 100%;
    height: 220px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(6,10,20,0.6));
    filter: blur(2px) saturate(1.2);
    border-radius: 14px;
    overflow: hidden;
}
.capsule-card__content {
    position: absolute; inset: 0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; z-index:2;
}
.capsule-card__bg {
    position:absolute; inset:0; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300"><rect width="100%" height="100%" fill="%2305121a"/><circle cx="50" cy="50" r="80" fill="rgba(255,255,255,0.02)"/></svg>'); opacity:0.9; mix-blend-mode:overlay; transform:scale(1.15);
}
.capsule__icon { font-size: 28px; }
.capsule__label { font-weight:700; color:var(--text); }
.capsule__meta { color:var(--text-muted); font-size:13px }

/* Bottom sheet preview skeleton */
.bs-skeleton .skeleton-media { height: 220px; background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.06), rgba(255,255,255,0.02)); animation: shimmer 1.2s infinite; border-radius:12px }
.skeleton-line { height: 12px; background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.06), rgba(255,255,255,0.02)); margin:8px 0; border-radius:6px; animation: shimmer 1.2s infinite }
.skeleton-line.short { width:40% }
@keyframes shimmer { 0% {background-position: -200px 0;} 100% {background-position: 200px 0;} }

/* Unlock animation */
.moment-card.unlocking { animation: unlockColor 420ms ease forwards }
@keyframes unlockColor { from { background: linear-gradient(135deg, #3b0764, #120321); } to { background: linear-gradient(135deg, var(--secondary), var(--primary)); } }

/* Toast styles */
.toast { position: fixed; right: 16px; top: 16px; padding: 12px 18px; border-radius: 12px; background: linear-gradient(90deg,var(--surface),var(--surface-light)); color:var(--text); box-shadow: var(--shadow-sm); transform: translateY(-8px); opacity:0; transition: opacity 180ms ease, transform 180ms ease; z-index:12000 }
.toast.is-visible { opacity:1; transform: translateY(0) }
.toast--success { border-left: 4px solid var(--success) }


/* 10. BUTTONS ------------------------------------------------------------ */
.btn {
    border: 0;
    border-radius: var(--radius-btn);
    padding: 12px 18px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 650;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform var(--ease), filter var(--ease), background var(--ease), border-color var(--ease), opacity var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled,
.btn.is-loading,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    pointer-events: none;
}

.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
}

@keyframes btnSpin { to { transform: rotate(360deg); } }

.btn-primary {
    background: var(--primary);
    color: #04111C;
    box-shadow: 0 8px 28px rgba(94, 234, 212, 0.22);
}

.btn-primary:hover {
    filter: brightness(1.05);
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--glass);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-block { width: 100%; }
.btn-small { padding: 10px 14px; min-height: 40px; font-size: 0.875rem; }
.btn-large { padding: 14px 22px; min-height: 50px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    padding: 10px 14px;
    min-height: 44px;
    transition: background var(--ease), border-color var(--ease);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
}

.like-btn.is-active {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.follow-btn.is-active {
    background: var(--primary-soft);
    border-color: rgba(94, 234, 212, 0.35);
    color: var(--primary);
}

/* 11. FORMS -------------------------------------------------------------- */
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span { color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="file"],
textarea,
select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-btn);
    padding: 13px 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

::placeholder { color: var(--text-muted); }
input[type="range"] { accent-color: var(--primary); width: 100%; }

.field-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    grid-template-columns: none;
}

.field-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.field-help, .map-help {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 6px 0 12px;
}

.field-file input[type="file"]::file-selector-button {
    background: var(--primary);
    color: #04111C;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    margin-right: 12px;
    font-weight: 650;
    cursor: pointer;
}

.form-stack { display: grid; gap: 14px; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.manual-location-box { display: grid; gap: 10px; margin: 12px 0; }
.location-actions-stack { display: flex; flex-direction: column; gap: 12px; }

.coords-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: rgba(5, 8, 22, 0.75);
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.alert,
.toast-static {
    width: 100%;
    max-width: var(--content-max);
    margin: 10px auto 16px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.alert-error, .toast-error {
    background: rgba(239, 68, 68, 0.12);
    color: #FCA5A5;
    border-color: rgba(239, 68, 68, 0.25);
}

.alert-success, .toast-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86EFAC;
    border-color: rgba(34, 197, 94, 0.25);
}

.alert-info, .toast-info {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(94, 234, 212, 0.25);
}

/* 12. MODAL -------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--ease-slow), visibility var(--ease-slow);
}

.modal-backdrop.is-open { opacity: 1; visibility: visible; }

.modal {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 24px;
    animation: modalIn 0.3s ease both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 13. BOTTOM SHEET ------------------------------------------------------- */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    max-height: 85vh;
    overflow: auto;
    background: rgba(18, 25, 47, 0.96);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.is-open { transform: translateY(0); }

.bs-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    margin: 12px auto 8px;
}

.bs-body { padding: 8px 18px 24px; }

.bs-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 14px;
}

.bs-preview__media img {
    width: 100%;
    height: 100%;
    min-height: 160px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.bs-preview__content { padding: 6px 4px; }
.bs-preview__content h3 { margin: 0 0 6px; font-size: 1.1rem; }

.bs-meta {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    align-items: center;
}

.bs-caption { color: var(--text-secondary); margin-top: 8px; }
.bs-stats { display: flex; gap: 12px; margin-top: 10px; color: var(--text-muted); }
.bs-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* 14. TOAST -------------------------------------------------------------- */
.toast {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 1400;
    min-width: 220px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(18, 25, 47, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity var(--ease-med), transform var(--ease-med);
}

.toast.is-visible,
.toast-static {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-static {
    position: relative;
    right: auto;
    top: auto;
    margin: 16px 32px 0;
    display: block;
}

.toast--success, .toast-success { border-left: 3px solid var(--success); }
.toast--error, .toast-error { border-left: 3px solid var(--danger); }
.toast--info, .toast-info { border-left: 3px solid var(--primary); }

.live-banner {
    position: fixed;
    left: 50%;
    bottom: calc(var(--bottom-nav-h) + 28px);
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    pointer-events: none;
    z-index: 1100;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.95);
    color: #052e16;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    transition: opacity var(--ease-med), transform var(--ease-med);
}

.live-banner.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 15. MAP ---------------------------------------------------------------- */
.map-box,
.map-fullscreen {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
}

.map-box { min-height: 340px; margin: 14px 0 16px; }

.map-fullscreen {
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    width: calc(100% - 64px);
    max-width: var(--content-max);
    margin: 0 auto 30px;
}

.explore-page { position: relative; padding-bottom: 24px; }

.explore-overlay {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 120%);
    width: min(480px, calc(100% - 24px));
    background: rgba(18, 25, 47, 0.94);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 600;
}

.explore-overlay.is-open { transform: translate(-50%, 0); }
.explore-overlay img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.explore-overlay__content { padding: 18px; }

.overlay-close {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 1.35rem;
    z-index: 2;
    display: grid;
    place-items: center;
}

.map-controls {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-controls button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(11, 16, 35, 0.85);
    color: var(--text);
    backdrop-filter: blur(12px);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Custom markers */
.marker-memory,
.marker-capsule,
.marker-user {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.marker-memory { background: #5EEAD4; }
.marker-capsule { background: #7C3AED; }
.marker-user { background: #F59E0B; }

.leaflet-container { background: var(--bg-secondary); font-family: var(--font); }
.leaflet-control-zoom a {
    background: rgba(11, 16, 35, 0.92) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* 16. MEMORY CARDS ------------------------------------------------------- */
.moments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

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

.moment-card,
.feed-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--ease-med), border-color var(--ease-med), box-shadow var(--ease-med);
}

@media (hover: hover) and (pointer: fine) {
    .moment-card:hover,
    .feed-card:hover {
        transform: translateY(-4px);
        border-color: var(--border-hover);
        box-shadow: var(--shadow);
    }

    .moment-card:hover .moment-card__media,
    .feed-card:hover .feed-card__media {
        transform: scale(1.03);
    }
}

.moment-card--single { max-width: 720px; margin: 0 auto; }

.moment-card__media-wrap,
.feed-card__media-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface);
}

.moment-card__media-wrap::after,
.feed-card__media-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(5, 8, 22, 0.72) 100%);
    pointer-events: none;
    z-index: 1;
}

.moment-card__media,
.feed-card__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.locked-media {
    filter: blur(14px) grayscale(0.2) brightness(0.5);
    transform: scale(1.06);
}

.unlocked-media,
.is-unlocked .locked-media {
    filter: none;
    transform: none;
}

.is-unlocked .moment-card__media,
.is-unlocked .feed-card__media {
    animation: capsuleUnlock 0.45s ease both;
}

.moment-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px;
    pointer-events: none;
    z-index: 2;
}

.badge,
.moment-chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    border: 1px solid var(--border);
    background: rgba(5, 8, 22, 0.78);
    color: var(--text);
    backdrop-filter: blur(8px);
}

.moment-chip { pointer-events: auto; }
.chip-link { cursor: pointer; }

/* Badge colors */
.badge-unlocked,
.moment-card.is-unlocked .status-chip {
    color: #86EFAC;
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.3);
}

.badge-locked,
.moment-card.is-locked .status-chip {
    color: #C4B5FD;
    background: rgba(124, 58, 237, 0.18);
    border-color: rgba(124, 58, 237, 0.35);
}

.badge-nearby {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(94, 234, 212, 0.3);
}

.badge-private {
    color: var(--text-muted);
    background: rgba(124, 139, 165, 0.15);
    border-color: rgba(124, 139, 165, 0.25);
}

.badge-public {
    color: #86EFAC;
    background: rgba(34, 197, 94, 0.1);
}

.badge-new {
    color: #FDE68A;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.28);
}

.badge-danger { color: #FCA5A5; }

.moment-card__body,
.feed-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moment-card__meta,
.feed-card__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.author-link {
    font-weight: 650;
    color: var(--text-secondary);
    transition: color var(--ease);
}

.author-link:hover { color: var(--primary); }

.moment-card__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
    font-weight: 700;
}

.moment-card__text {
    margin: 0;
    line-height: 1.55;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.moment-card__location { font-size: 0.9rem; color: var(--primary); }
.moment-distance { font-size: 0.9rem; color: var(--text-secondary); }
.moment-caption { color: var(--text-muted); line-height: 1.5; font-size: 0.9rem; }
.moment-radius { font-size: 0.85rem; color: var(--text-muted); }
.moment-actions { margin-top: 4px; }

.moment-card.is-locked { border-color: rgba(124, 58, 237, 0.22); }
.moment-card.is-unlocked { border-color: rgba(34, 197, 94, 0.15); }

/* 17. TIME CAPSULE ------------------------------------------------------- */
.capsule-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    min-height: 280px;
    background: var(--card);
}

.capsule-card.is-locked {
    background:
        radial-gradient(circle at center, rgba(124, 58, 237, 0.28), transparent 60%),
        #16102A;
    border-color: rgba(124, 58, 237, 0.35);
}

.capsule-card.is-locked .capsule-card__media {
    filter: blur(18px) brightness(0.35);
    transform: scale(1.08);
}

.capsule-card__lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
    background: rgba(11, 8, 28, 0.55);
    backdrop-filter: blur(4px);
}

.capsule-card__lock-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 18px rgba(124, 58, 237, 0.45));
}

.capsule-card__lock h3 {
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.capsule-card__lock p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 24ch;
}

.capsule-card.is-unlocked {
    background:
        radial-gradient(circle at center, rgba(94, 234, 212, 0.18), transparent 55%),
        var(--card);
    border-color: rgba(94, 234, 212, 0.28);
    box-shadow: 0 0 40px rgba(94, 234, 212, 0.08);
    animation: capsuleUnlock 0.45s ease both;
}

.capsule-card.is-unlocked .capsule-card__lock { display: none; }

.capsule-badge { position: absolute; top: 14px; left: 14px; z-index: 3; }

.capsule-countdown {
    margin-top: 14px;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    color: #C4B5FD;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.capsule-filters .btn-primary {
    box-shadow: none;
}

.capsule-card .moment-card__media-wrap {
    min-height: 200px;
}

.capsule-card.is-locked .moment-card__overlay {
    z-index: 3;
}

.capsule-card .capsule-card__lock {
    pointer-events: none;
}

/* 18. UPLOAD ------------------------------------------------------------- */
.upload-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.panel-soft { padding: 22px; }
.panel h2, .panel-soft h2 { margin-top: 0; margin-bottom: 16px; }

.panel-section-label {
    display: block;
    margin: 8px 0 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
}

.preview-box,
.upload-dropzone {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(148, 163, 184, 0.28);
    min-height: 280px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    transition: border-color var(--ease), background var(--ease);
}

.preview-box:hover,
.upload-dropzone:hover,
.upload-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.preview-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

.preview-placeholder::before {
    content: "↑";
    display: block;
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 10px;
    opacity: 0.85;
}

.upload-progress { width: 100%; margin-top: 12px; }

.upload-progress__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.upload-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.panel-danger-zone {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
}

.account-meta { color: var(--text-secondary); margin-bottom: 16px; }

/* 19. SKELETON ----------------------------------------------------------- */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.1),
        rgba(255, 255, 255, 0.04)
    );
    background-size: 200% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: 8px;
    overflow: hidden;
}

.skeleton--line { height: 12px; width: 100%; }
.skeleton--title { height: 20px; width: 70%; margin-bottom: 10px; }
.skeleton--avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton--card { aspect-ratio: 16 / 10; border-radius: var(--radius); margin-bottom: 12px; }

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 20. EMPTY / LANDING / AUTH --------------------------------------------- */
.empty-state,
.error-state {
    padding: 48px 28px;
    text-align: center;
    background: var(--card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.empty-icon, .error-icon {
    font-size: 2.25rem;
    margin-bottom: 14px;
    opacity: 0.9;
}

.empty-state h3, .error-state h3 { margin-bottom: 10px; }

.empty-state p, .error-state p {
    color: var(--text-secondary);
    max-width: 36ch;
    margin: 0 auto 22px;
}

.landing {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 52px 0 40px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: center;
}

.landing h1 {
    font-size: clamp(2.1rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    margin: 14px 0 18px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.stat-card { padding: 16px; }
.stat-card strong { display: block; margin-bottom: 8px; }
.stat-card span { color: var(--text-muted); font-size: 0.9rem; }

.phone-mockup { display: grid; place-items: center; }
.phone-card { width: min(360px, 100%); overflow: hidden; }

.card-glow {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 24px 70px rgba(94, 234, 212, 0.12),
        0 0 60px rgba(124, 58, 237, 0.1);
}

.phone-card__image {
    height: 380px;
    background:
        linear-gradient(180deg, rgba(124, 58, 237, 0.35), rgba(5, 8, 22, 0.55)),
        url("https://images.unsplash.com/photo-1493246507139-91e8fad9978e?auto=format&fit=crop&w=900&q=80") center / cover;
}

.phone-card__meta { padding: 18px; }
.phone-card__meta h3 { margin: 10px 0 8px; }
.phone-card__meta p { color: var(--text-muted); font-size: 0.92rem; }

/* Auth — centered premium login */
.auth-layout {
    position: relative;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    padding: 40px 0;
}

.auth-layout--centered {
    grid-template-columns: 1fr;
    justify-items: center;
    max-width: 480px;
}

.auth-layout--centered .auth-panel--content {
    text-align: center;
    padding: 0 0 8px;
    order: 0;
}

.auth-layout--centered .auth-panel--form {
    width: 100%;
}

.auth-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 25%, rgba(124, 58, 237, 0.18), transparent 32%),
        radial-gradient(circle at 80% 70%, rgba(94, 234, 212, 0.1), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.05), transparent 30%);
}

.auth-brand { display: block; margin-bottom: 20px; }

.auth-brand__name {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    color: var(--primary);
}

.auth-brand__logo {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--text);
    line-height: 1.1;
}

.auth-brand__logo span {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    color: var(--primary);
    margin-top: 6px;
}

.auth-panel--content { padding: 30px 0; }
.auth-panel--content h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 14px 0 18px;
}

.auth-card {
    padding: 28px;
    background: rgba(18, 25, 47, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.auth-card--small {
    width: min(420px, calc(100% - 32px));
    margin: 0 auto;
    text-align: center;
}

.auth-card h2, .auth-card h1 { margin-top: 0; margin-bottom: 8px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-switch {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 0.925rem;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 650;
    transition: color var(--ease);
}

.auth-switch a:hover { color: var(--primary-hover); }

.logout-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.pulse-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    font-size: 2rem;
}

/* Footer */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding: 40px 20px 28px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1100px;
    margin: auto;
}

.footer-brand h3 { margin: 0 0 8px; }
.footer-brand p { color: var(--text-muted); max-width: 36ch; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-secondary); transition: color var(--ease); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
    text-align: center;
    margin-top: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legal-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.legal-page h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 16px;
}

.legal-page p, .legal-page li { color: var(--text-secondary); }

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.legal-nav__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    min-height: 44px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--glass);
    border: 1px solid transparent;
    transition: all var(--ease);
    font-size: 0.925rem;
}

.legal-nav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border);
}

.legal-nav__link.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(94, 234, 212, 0.25);
    font-weight: 650;
}

.legal-nav__link--back { margin-left: auto; }

/* 21. RESPONSIVE --------------------------------------------------------- */
@media (max-width: 1440px) {
    .page-container, .topbar { padding-left: 28px; padding-right: 28px; }
}

@media (max-width: 1199px) and (min-width: 768px) {
    :root { --sidebar-width: var(--sidebar-compact); }
    .sidebar-brand__sub { display: none; }
    .sidebar-brand__name { font-size: 0.7rem; letter-spacing: 0.08em; }
    .sidebar-item { justify-content: center; padding: 12px; border-left-width: 0; }
    .sidebar-item__label { display: none; }
    .sidebar-item.is-active {
        border-left-width: 0;
        box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.25);
    }
    .app-sidebar { padding: 20px 10px; }
}

@media (max-width: 1024px) {
    .upload-layout,
    .feed-list { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .has-sidebar .app-shell {
        padding-left: 0;
        padding-bottom: calc(var(--bottom-nav-h) + 28px);
    }

    .app-sidebar { display: none; }
    .bottom-nav { display: flex; }

    .topbar, .page-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .topbar { padding-top: 18px; padding-bottom: 12px; }
    .topbar h1, .topbar-greeting { font-size: clamp(1.35rem, 6vw, 1.7rem); }
    .nav-actions .btn-ghost { display: none; }

    .landing,
    .auth-layout,
    .upload-layout,
    .moments-grid,
    .feed-list,
    .stats-row { grid-template-columns: 1fr; }

    .hero-strip, .profile-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

    .mini-stats { width: 100%; }

    .auth-panel--content { order: 2; padding-top: 8px; text-align: center; }
    .auth-panel--form { order: 1; }
    .auth-layout { min-height: auto; padding: 24px 0 80px; gap: 20px; }

    .map-fullscreen {
        height: calc(100vh - 160px);
        height: calc(100dvh - 160px);
        width: calc(100% - 20px);
        border-radius: var(--radius-md);
    }

    .explore-overlay { bottom: calc(var(--bottom-nav-h) + 16px); }
    .live-banner {
        bottom: calc(var(--bottom-nav-h) + 20px);
        width: min(90vw, 360px);
        text-align: center;
    }

    .toast {
        left: 16px;
        right: 16px;
        top: 16px;
        min-width: 0;
        max-width: none;
    }

    .toast-static { margin: 12px 16px 0; }
    .bs-preview { grid-template-columns: 1fr; }
    .bs-preview__media { height: 200px; }
    .app-footer { margin-bottom: 40px; }
    .profile-cover__banner { height: 120px; }
}

@media (max-width: 430px) {
    .topbar, .page-container { padding-left: 14px; padding-right: 14px; }
    .moments-grid { gap: 14px; }
}

@media (max-width: 375px) {
    body { font-size: 15px; }
    .btn { padding: 11px 14px; }
    .bottom-nav { width: calc(100% - 16px); }
}

@media (max-width: 320px) {
    .topbar, .page-container { padding-left: 10px; padding-right: 10px; }
    .auth-card { padding: 20px; }
}

@media (max-width: 480px) {
    .moment-card, .feed-card, .auth-card, .panel, .hero-strip, .empty-state {
        border-radius: var(--radius-md);
    }
    .moments-grid { grid-template-columns: 1fr; }
    .banner { font-size: 0.8rem; padding: 8px; }
    .legal-nav { flex-direction: column; align-items: stretch; }
    .legal-nav__link--back { margin-left: 0; }
}

@media (min-width: 768px) {
    .bottom-nav { display: none; }
}

/* Auth / landing: hide chrome */
body:has(.auth-layout) .app-sidebar,
body:has(.landing) .app-sidebar,
body:has(.logout-screen) .app-sidebar,
body:has(.auth-layout) .bottom-nav,
body:has(.landing) .bottom-nav,
body:has(.logout-screen) .bottom-nav {
    display: none;
}

body:has(.auth-layout).has-sidebar .app-shell,
body:has(.landing).has-sidebar .app-shell,
body:has(.logout-screen).has-sidebar .app-shell {
    padding-left: 0;
    padding-bottom: 0;
}

/* 22. ACCESSIBILITY ------------------------------------------------------ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

:focus:not(:focus-visible) { outline: none; }

@media (prefers-contrast: more) {
    :root {
        --border: rgba(255, 255, 255, 0.22);
        --text-muted: #94A3B8;
    }
}

/* 23. REDUCED MOTION ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
