/* fonts.css */
/* Self-hosted Outfit (variable latin face; originally from Google Fonts library).
   Binary: /static/fonts/outfit-latin-var.woff2
   Also: outfit-latin-ext-var.woff2; optional per-weight copies outfit-latin-300..900.woff2
         (same variable binary — one VF covers listed weights).
   Do not reintroduce Google Fonts CDN hosts. */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('/static/fonts/outfit-latin-ext-var.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('/static/fonts/outfit-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* tokens.css */
/* MGF.AI public — tokens.css */

:root {
    /* Core background - Spatial Deep Dark */
    --bg:            #030407; /* Noir obsidienne profond */
    --bg-surface:    #0a0b10;
    --bg-elevated:   rgba(20, 22, 30, 0.4); /* Base pour le verre dépoli */
    --bg-glass:      rgba(15, 17, 24, 0.65); /* Verre lourd */

    /* Glassmorphism Borders & Shadows */
    --border:        rgba(255, 255, 255, 0.05);
    --border-light:  rgba(255, 255, 255, 0.12); /* Pour les reflets supérieurs */
    --border-active: rgba(255, 255, 255, 0.25);
    --shadow-glass:  0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);

    /* Mode Sweet — rose néon */
    --sweet-primary:   #ff3377;
    --sweet-secondary: #ff85b3;
    --sweet-glow:      rgba(255, 51, 119, 0.35);
    --sweet-dim:       rgba(255, 51, 119, 0.08);

    /* Mode After Dark — violet laser */
    --dark-primary:   #7928ca;
    --dark-secondary: #9a4cff;
    --dark-glow:      rgba(121, 40, 202, 0.35);
    --dark-dim:       rgba(121, 40, 202, 0.08);

    /* Active mode (overridden by JS) */
    --primary:      var(--sweet-primary);
    --primary-glow: var(--sweet-glow);
    --primary-dim:  var(--sweet-dim);
    --secondary:    var(--dark-primary);

    /* Text - Contraste extrème */
    --text:       #ffffff;
    --text-muted: #8b92a5;
    --text-faint: #42485e;

    /* Tokens (gamification) */
    --xp-color:   #ffb000;
    --token-color:#00f0ff;

    /* Shape - Plus arrondi, organique */
    --radius-xs: 6px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;

    /* Transitions - Spring Physics (Rebond) */
    --transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15); /* Effet ressort léger */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* After Dark mode overrides */
[data-mode="after_dark"] {
    --primary:      var(--dark-primary);
    --primary-glow: var(--dark-glow);
    --primary-dim:  var(--dark-dim);
}

/* base.css */
/* MGF.AI public — base.css */

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: #000;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Immersive Background Layer ────────────────────────────────── */
.immersive-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
    overflow: hidden;
}

.immersive-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5) contrast(1.1);
    transition: opacity 1s ease-in-out;
}

.immersive-bg .mgf-bg-plane {
    width: 100%;
    height: 100%;
    transition: opacity 1s ease-in-out;
}

/* Grain texture for luxury feel */
.immersive-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/static/backgrounds/noise.svg");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* Subtle vignette */
.immersive-bg-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.4) 100%),
                linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, #000 100%);
}

body > * { position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════════
   NAVBAR (Minimalist Floating)
══════════════════════════════════════════════════════════════ */

/* backgrounds.css */
/* Immersive page planes — night / neon / aurora */

.mgf-bg-plane--night {
    background:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(255, 77, 143, 0.22), transparent 58%),
        radial-gradient(ellipse 55% 45% at 100% 85%, rgba(109, 40, 217, 0.16), transparent 55%),
        radial-gradient(ellipse 40% 35% at 0% 70%, rgba(255, 77, 143, 0.08), transparent 50%),
        #07060c;
}

.mgf-bg-plane--neon {
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 51, 153, 0.2), transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(124, 58, 237, 0.18), transparent 50%),
        #06050b;
}

.mgf-bg-plane--aurora {
    background:
        radial-gradient(ellipse 70% 50% at 70% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(ellipse 50% 40% at 10% 90%, rgba(255, 77, 143, 0.1), transparent 50%),
        #07080d;
}

/* navbar.css */
/* MGF.AI public — navbar.css */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    background: rgba(6, 7, 11, 0.88);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
    justify-content: space-between;
    gap: 2rem;
}

.navbar-brand {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.navbar-brand .brand-dot {
    color: var(--primary);
    transition: color var(--transition);
}

.navbar-brand .brand-ai {
    background: linear-gradient(135deg, var(--sweet-primary), var(--dark-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.nav-link.active {
    color: var(--primary);
}

.nav-link-with-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
}
/* Point LED (Mes Contacts + fils) — pas de chiffre */
.mgf-notif-led {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ffc2e0, #ff2d6a 55%, #b01040);
    box-shadow: 0 0 10px rgba(255, 45, 106, 0.85), 0 0 4px rgba(168, 85, 247, 0.5);
    pointer-events: none;
    flex-shrink: 0;
}
.mgf-notif-led.is-on {
    display: inline-block;
    animation: mgfNotifLedPulse 1.8s ease-in-out infinite;
}
@keyframes mgfNotifLedPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.88; transform: scale(1.12); }
}
.nav-contacts-led {
    position: absolute;
    top: 2px;
    right: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.nav-lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.nav-lang-switch__link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.35rem 0.4rem;
    min-width: 1.75rem;
    text-align: center;
    border-radius: 6px;
}
.nav-lang-switch__link:hover,
.nav-lang-switch__link:focus-visible {
    color: var(--text);
}
.nav-lang-switch__link.is-active {
    color: var(--sweet-primary);
}
.nav-lang-switch__sep {
    color: var(--text-faint);
    user-select: none;
}

/* Token counter in navbar */
.nav-tokens-wrap {
    position: relative;
}
.nav-tokens {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,212,170,0.08);
    border: 1px solid rgba(0,212,170,0.2);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    color: var(--token-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.nav-tokens:hover,
.nav-tokens-wrap:focus-within .nav-tokens {
    border-color: rgba(0,212,170,0.45);
    background: rgba(0,212,170,0.12);
}
.nav-tokens svg { opacity: 0.8; }

.nav-tokens-popover {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 1200;
    min-width: 220px;
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-md);
    background: rgba(12, 14, 22, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
}
.nav-tokens-popover[hidden] { display: none !important; }
.nav-tokens-popover__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.nav-tokens-popover__row strong { color: var(--text); font-weight: 800; }
.nav-tokens-popover__bar {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.55rem 0 0.5rem;
}
.nav-tokens-popover__bar-sub { background: #a855f7; width: 0; }
.nav-tokens-popover__bar-buy { background: #00d4aa; width: 0; }
.nav-tokens-popover__next {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-height: 1.1em;
    margin-bottom: 0.45rem;
}
.nav-tokens-popover__link {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--token-color);
    text-decoration: none;
}
.nav-tokens-popover__link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .nav-tokens-popover { display: none !important; }
}

/* Tier badge in navbar */
.nav-tier-preview-form {
    display: inline-flex;
    margin: 0;
}
.nav-tier-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-xs);
}
button.nav-tier-badge {
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
button.nav-tier-badge.is-preview {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.85);
}
.tier-free     { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.tier-premium  { background: linear-gradient(135deg, rgba(255,77,143,0.2), rgba(140,82,255,0.2)); color: var(--sweet-secondary); border: 1px solid rgba(255,77,143,0.3); }
.tier-vip      { background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,140,0,0.15)); color: #ffd700; border: 1px solid rgba(255,215,0,0.3); }

.mgf-admin-preview-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem 1rem;
    padding: 0.45rem 1rem;
    background: rgba(251, 191, 36, 0.12);
    border-bottom: 1px solid rgba(251, 191, 36, 0.35);
    color: #fde68a;
    font-size: 0.82rem;
    font-weight: 600;
    position: sticky;
    top: var(--mgf-navbar-h, 72px);
    z-index: 40;
}
.mgf-admin-preview-banner form { margin: 0; }
.mgf-admin-preview-banner__exit {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    color: #111;
    background: #fbbf24;
    border: 0;
    border-radius: var(--radius-xs, 6px);
    padding: 0.28rem 0.7rem;
}

/* ── Menu compte (avatar) ── */
.nav-user-menu {
    position: relative;
    flex-shrink: 0;
}
.nav-user-trigger {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.nav-user-trigger:hover {
    border-color: var(--border-active);
}
.nav-user-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}
.nav-user-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nav-user-initial {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    text-transform: uppercase;
}
.nav-user-menu.is-open .nav-user-trigger {
    border-color: var(--primary);
}
.nav-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    padding: 0.4rem 0;
    background: rgba(14, 16, 22, 0.98);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    z-index: 1100;
}
.nav-user-menu.is-open .nav-user-dropdown {
    display: block !important;
}
.nav-user-dropdown a {
    display: block;
    padding: 0.65rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-user-dropdown a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}
.nav-user-dropdown a.nav-user-dropdown-logout {
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    color: var(--text-faint);
}
.nav-user-dropdown a.nav-user-dropdown-logout:hover {
    color: var(--sweet-secondary);
}

/* ── Theme Switch ── */
.theme-switch {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 4px;
    position: relative;
    width: 60px;
    height: 32px;
    margin-right: 0.5rem;
}
.theme-switch-knob {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform var(--transition);
    top: 3px;
    left: 3px;
    pointer-events: none;
}
[data-mode="after_dark"] .theme-switch-knob {
    transform: translateX(28px);
    background: rgba(121, 40, 202, 0.4);
    border-color: var(--dark-primary);
}
.theme-switch-icon {
    font-size: 0.85rem;
    width: 50%;
    text-align: center;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.2s;
    user-select: none;
}
[data-mode="sweet"] .theme-switch-icon.sweet { opacity: 1; text-shadow: 0 0 5px var(--sweet-primary); }
[data-mode="after_dark"] .theme-switch-icon.dark { opacity: 1; text-shadow: 0 0 5px var(--dark-primary); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════ */

/* components.css */
/* MGF.AI public — components.css */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, var(--sweet-primary), #e0336b);
    color: #fff;
    box-shadow: 0 4px 20px var(--sweet-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--sweet-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border: 1px solid var(--border-active);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.25);
}

.btn-dark {
    background: linear-gradient(135deg, var(--dark-primary), #6a35d4);
    color: #fff;
    box-shadow: 0 4px 20px var(--dark-glow);
}
.btn-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--dark-glow);
}

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

.btn-sm { padding: 0.4rem 1rem; font-size: 0.84rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; border-radius: var(--radius-md); }

/* ══════════════════════════════════════════════════════════════
   CARDS / GLASS
══════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

/* ══════════════════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════════════════ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-control {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.8rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--sweet-primary);
    box-shadow: 0 0 0 3px var(--sweet-glow);
}
.form-control::placeholder { color: var(--text-faint); }

/* ══════════════════════════════════════════════════════════════
   BADGES / PILLS
══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-sweet  { background: var(--sweet-dim); color: var(--sweet-primary); border: 1px solid rgba(255,77,143,0.2); }
.badge-dark   { background: var(--dark-dim);  color: var(--dark-secondary);  border: 1px solid rgba(140,82,255,0.2); }
.badge-xp     { background: rgba(255,215,0,0.08); color: var(--xp-color); border: 1px solid rgba(255,215,0,0.2); }
.badge-token  { background: rgba(0,212,170,0.08); color: var(--token-color); border: 1px solid rgba(0,212,170,0.2); }

/* ══════════════════════════════════════════════════════════════
   XP BAR
══════════════════════════════════════════════════════════════ */
.xp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.xp-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}
.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sweet-primary), var(--dark-primary));
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════════
   MESSAGE/CONTACT ITEM (Global reusable)
══════════════════════════════════════════════════════════════ */
.message-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text);
    position: relative;
    /* visible: .rel-badge / .msg-online-dot sit on the avatar corner and must not clip */
    overflow: visible;
}

.message-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.message-item.conv-has-unread,
.dash-resume-card.conv-has-unread {
    padding-left: 2rem;
    border-left: 3px solid rgba(255, 45, 106, 0.55);
}

.message-item.conv-has-unread .msg-preview,
.dash-resume-card.conv-has-unread .dash-resume-card__preview {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
}

.msg-avatar-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    overflow: visible;
    z-index: 2;
    isolation: isolate;
}

.msg-avatar-wrap .persona-avatar,
.msg-avatar-wrap .msg-avatar {
    position: relative;
    z-index: 0;
}

.msg-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.5s ease;
}

.message-item:hover .msg-avatar {
    transform: scale(1.05);
    border-color: var(--primary);
}

.msg-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    z-index: 2;
    pointer-events: none;
}

.rel-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    z-index: 3;
    background: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.3rem;
    justify-content: space-between;
}

.msg-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.msg-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
}

.msg-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.msg-preview {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.message-item:hover .msg-preview {
    color: rgba(255,255,255,0.9);
}

.msg-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(255,255,255,0.05);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    transition: all 0.3s;
    flex-shrink: 0;
}

.message-item:hover .msg-action {
    background: linear-gradient(135deg, var(--sweet-primary), var(--dark-primary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 77, 143, 0.4);
}

/* Modifier for contacts page */
.message-item-lg {
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    background: rgba(10, 11, 16, 0.4);
}
.message-item-lg .msg-avatar-wrap {
    width: 80px;
    height: 80px;
}
.message-item-lg .msg-name {
    font-size: 1.4rem;
}
.message-item-lg .msg-preview {
    font-size: 1rem;
}
.message-item-lg .msg-date {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .msg-date { display: none; }
    .msg-action { display: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   FLASH MESSAGES
══════════════════════════════════════════════════════════════ */
.flashes {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 9999;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.flash {
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border-left: 3px solid var(--sweet-primary);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease forwards;
    max-width: 360px;
}
.flash.error   { border-color: #e74c3c; }
.flash.success { border-color: #2ecc71; }
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════════════════════════════ */
main { flex: 1; display: flex; flex-direction: column; }
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3.25rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
    background: linear-gradient(180deg, rgba(10, 11, 15, 0.55) 0%, rgba(6, 7, 10, 0.92) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.footer-inner {
    max-width: 88rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 0.9fr)
        minmax(0, 0.85fr);
    gap: 2rem 1.75rem;
    align-items: start;
}
.footer-inner.footer-inner--app {
    grid-template-columns:
        minmax(0, 1.05fr)
        minmax(0, 0.8fr)
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 0.9fr)
        minmax(0, 0.85fr);
}
.footer-brand { display: flex; flex-direction: column; gap: 0.85rem; }
.footer-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-logo:hover { color: var(--primary); }
.footer-tagline {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 22rem;
}
.footer-copy {
    font-size: 0.82rem;
    color: var(--text-faint);
}
.footer-age-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}
.footer-col-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1rem;
}
.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    align-items: flex-start;
}
.footer-nav a {
    font-size: 0.92rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-nav a:hover { color: var(--text); }
.footer-nav a.is-active { color: var(--text); font-weight: 600; }
.footer-nav a.footer-link-hub {
    color: var(--primary);
    font-weight: 600;
}
.footer-nav a.footer-link-hub:hover { opacity: 0.85; }
.footer-discord {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none;
    background: #5865f2;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.footer-discord:hover {
    background: #4752c4;
    box-shadow: 0 6px 28px rgba(88, 101, 242, 0.45);
    transform: translateY(-1px);
}
.footer-discord svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.footer-lang {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.88rem;
    color: var(--text-faint);
}
.footer-lang a {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-lang a:hover,
.footer-lang a.is-active { color: var(--primary); }
.footer-lang .sep { opacity: 0.35; user-select: none; }
.footer-lang--solo { margin-top: 0; }
.footer-col--tail .footer-lang--solo {
    padding-top: 0.15rem;
}

/* responsive.css */
/* MGF.AI public — responsive.css */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-only { display: none !important; }

@media (max-width: 1100px) {
    .footer-inner,
    .footer-inner.footer-inner--app {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; }
    .mobile-menu-toggle { display: block; }
    
    .nav-links {
        display: none; /* Hidden by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10,11,15,0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 0;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .nav-links.show {
        display: flex;
    }
    /* Masquer uniquement les boutons Connexion / CTA (les liens mobile-only du menu restent) */
    .nav-actions .btn {
        display: none !important;
    }
    .nav-actions {
        flex-wrap: nowrap;
        justify-content: flex-end;
        min-width: 0;
        gap: 0.4rem;
    }
    .nav-tokens {
        font-size: 0.78rem;
        padding: 0.28rem 0.55rem;
    }
    .nav-tier-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    .nav-user-trigger {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }
    .mobile-only { display: block !important; }
    .mobile-only-flex { display: flex !important; }

    .site-footer { padding-top: 2.5rem; padding-bottom: 2rem; }
    .footer-inner,
    .footer-inner.footer-inner--app {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    .footer-brand { align-items: center; }
    .footer-tagline { max-width: none; }
    .footer-age-badge { margin: 0 auto; }
    .footer-col-title { margin-bottom: 0.75rem; }
    .footer-nav { align-items: center; }
    .footer-discord { margin: 0 auto; }
    .footer-lang { justify-content: center; margin-top: 1rem; }
}

/* Première visite — confirmation 18+ (home / fiches SFW sans redirect SEO) */
html.mgf-age-noscroll body { overflow: hidden; }
.mgf-age-gate-overlay {
    display: none; position: fixed; inset: 0; z-index: 99999;
    background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    align-items: center; justify-content: center;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}
.mgf-age-gate-overlay.mgf-age-gate-open { display: flex; }
.mgf-age-gate-card {
    width: 100%; max-width: 400px;
    background: linear-gradient(180deg, rgba(18, 16, 24, 0.96), rgba(10, 11, 16, 0.98));
    border: 1px solid rgba(255, 51, 119, 0.18);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem 1.25rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 51, 119, 0.08);
    text-align: center;
}
.mgf-age-gate-brand {
    margin: 0 0 0.85rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}
.mgf-age-gate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 51, 119, 0.35);
    background: rgba(255, 51, 119, 0.12);
    color: var(--sweet-primary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(255, 51, 119, 0.18);
}
.mgf-age-gate-card h2 {
    font-size: 1.45rem; font-weight: 900; margin: 0 0 0.65rem;
    letter-spacing: -0.03em; color: #fff; line-height: 1.2;
}
.mgf-age-gate-body {
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.55;
    margin: 0 0 1.35rem;
}
.mgf-age-gate-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
}
.mgf-age-gate-actions .btn-primary {
    width: 100%;
    min-height: 48px;
    font-weight: 800;
}
.mgf-age-gate-leave {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.25rem 0 0.15rem;
}
.mgf-age-gate-leave:hover { color: #fff; }
.mgf-age-gate-cookie {
    margin: 1.15rem 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--text-faint);
}
.mgf-age-gate-cookie a {
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.mgf-age-gate-cookie a:hover { color: #fff; }
.mgf-age-gate-foot {
    margin: 0.85rem 0 0;
    font-size: 0.72rem;
    color: var(--text-faint);
}
.mgf-age-gate-foot a {
    color: var(--text-faint);
    font-weight: 600;
    text-decoration: none;
}
.mgf-age-gate-foot a:hover { color: var(--text-muted); }

/* Paywall / confirm modal */
.mgf-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 100000;
    background: rgba(0,0,0,0.72); backdrop-filter: blur(12px);
    align-items: center; justify-content: center; padding: 1.25rem;
}
.mgf-modal-overlay.open { display: flex; }
.mgf-modal {
    position: relative;
    width: 100%; max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: var(--shadow-glass);
}
.mgf-modal__dismiss {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-md, 10px);
    background: transparent;
    color: var(--text-muted);
    font-size: 1.65rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mgf-modal__dismiss:hover,
.mgf-modal__dismiss:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}
.mgf-modal-overlay.open .mgf-modal__dismiss { display: inline-flex; }
.mgf-modal-snooze-hint {
    margin-top: 0.85rem !important;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.mgf-modal-actions--snooze #mgf-modal-later {
    font-weight: 700;
}
.mgf-modal h3 { font-size: 1.15rem; margin-bottom: 0.6rem; font-weight: 800; padding-right: 2.75rem; }
.mgf-modal-body {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}
.mgf-modal-body p { margin: 0 0 0.75rem 0; }
.mgf-modal-body p:last-child { margin-bottom: 0; }
.mgf-modal-body strong { color: var(--text); font-weight: 700; }
.mgf-modal-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-end; }
.mgf-modal-actions .btn { min-height: 44px; }
@media (max-width: 640px) {
    .mgf-modal-overlay { align-items: flex-end; padding: 0; }
    .mgf-modal {
        max-width: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 1.35rem 1.25rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    }
    .mgf-modal__dismiss {
        top: 0.5rem;
        right: 0.5rem;
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.75rem;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 999px;
    }
    .mgf-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .mgf-modal-actions .btn { width: 100%; justify-content: center; }
    .mgf-modal-actions--snooze #mgf-modal-later {
        order: 0;
        min-height: 48px;
        border: 1px solid var(--border-light);
        background: rgba(255, 255, 255, 0.06);
        font-weight: 700;
    }
    .mgf-modal-actions--snooze #mgf-modal-subscribe { order: 1; }
    .mgf-modal--snooze .mgf-modal__dismiss {
        width: 3rem;
        height: 3rem;
        font-size: 1.85rem;
    }
    .mgf-modal-actions:not(.mgf-modal-actions--snooze) .btn-ghost { order: 1; }
}

/* Persona avatar (initiale si portrait absent) */
.persona-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, #2e3038 0%, #1a1c22 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}
.persona-avatar--xs { width: 32px; height: 32px; font-size: 0.78rem; }
.persona-avatar--sm { width: 40px; height: 40px; font-size: 0.88rem; }
.persona-avatar--md { width: 42px; height: 42px; font-size: 0.92rem; }
.persona-avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }
.persona-avatar--xl { width: 100px; height: 100px; font-size: 2rem; }
.persona-avatar.conv-avatar,
.persona-avatar.chat-char-avatar { width: 42px; height: 42px; font-size: 0.95rem; }
.persona-avatar.chat-char-avatar { width: 40px; height: 40px; }
.persona-avatar.char-profile-avatar { width: 100px; height: 100px; font-size: 2.2rem; }
.persona-avatar.msg-avatar,
.persona-avatar.persona-avatar--msg { width: 100%; height: 100%; font-size: 1.25rem; }
.msg-avatar-wrap .persona-avatar { width: 56px; height: 56px; }
.persona-avatar__ph {
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.persona-avatar__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 2;
}
.persona-avatar--pending {
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.25);
    animation: personaAvatarPulse 2.2s ease-in-out infinite;
}
@keyframes personaAvatarPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.82; }
}
.persona-avatar--square {
    border-radius: var(--radius-md, 12px);
}
.persona-avatar--square .persona-avatar__img { border-radius: var(--radius-md, 12px); }
.persona-avatar--fill {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    border: none;
}
.persona-avatar--fill .persona-avatar__img { border-radius: 0; }

.mgf-ai-disclosure {
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-muted);
    opacity: 0.92;
    margin-top: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.mgf-ai-disclosure--inline {
    display: inline-block;
    margin-top: 0;
    max-width: 100%;
    text-align: center;
}
.mgf-ai-disclosure--subtle {
    font-size: 0.68rem;
    opacity: 0.85;
    margin-top: 0.75rem;
    padding: 0.25rem 0.4rem;
}

/* mgf-shell.css */
/* MGF.AI — App shell (bottom nav, mobile topbar, safe-area, polish) */

:root {
  --mgf-bottom-nav-h: 4.5rem;
  --mgf-navbar-h: calc(72px + env(safe-area-inset-top, 0px));
}

/* Clip page-level horizontal bounce (100vw / crowded nav). Carousels stay local. */
html:has(body.mgf-app-shell) {
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

/* ── App shell body ── */
body.mgf-app-shell {
  padding-bottom: calc(var(--mgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
}

body.mgf-app-shell.mgf-chat-page {
  padding-bottom: 0;
}

body.mgf-app-shell .immersive-bg img {
  opacity: 0.42;
  filter: brightness(0.45) contrast(1.05);
}

@media (min-width: 769px) {
  body.mgf-app-shell {
    padding-bottom: 0;
  }
  body.mgf-app-shell .immersive-bg img {
    opacity: 0.55;
  }
  body.mgf-app-shell:not(.mgf-chat-page) main.container {
    width: 100%;
    max-width: min(1360px, 94vw);
    margin-left: auto;
    margin-right: auto;
  }
  body.mgf-app-shell .navbar {
    padding: env(safe-area-inset-top, 0px) max(2rem, env(safe-area-inset-right, 0px)) 0 max(2rem, env(safe-area-inset-left, 0px));
    height: var(--mgf-navbar-h, 72px);
    box-sizing: border-box;
  }
  body.mgf-app-shell .nav-tier-badge {
    display: inline-flex;
  }
}

/* ── Mobile topbar compact ── */
@media (max-width: 768px) {
  :root {
    --mgf-navbar-h: calc(56px + env(safe-area-inset-top, 0px));
  }
  body.mgf-app-shell .navbar {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: 0;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    height: var(--mgf-navbar-h);
    min-height: var(--mgf-navbar-h);
    gap: 0.45rem;
    max-width: 100%;
    box-sizing: border-box;
  }
  body.mgf-app-shell .nav-actions {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 0.4rem;
  }
  body.mgf-app-shell .nav-user-menu,
  body.mgf-app-shell .nav-user-trigger {
    flex-shrink: 0;
  }
  body.mgf-app-shell .nav-user-trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  body.mgf-app-shell .nav-tokens-wrap {
    min-width: 0;
    flex-shrink: 1;
  }
  body.mgf-app-shell .nav-tokens-word {
    display: none;
  }
  body.mgf-app-shell .nav-lang-switch {
    padding: 0.1rem 0.15rem;
    gap: 0;
  }
  body.mgf-app-shell .nav-lang-switch__link {
    padding: 0.28rem 0.25rem;
    min-width: 0;
  }
  body.mgf-app-shell .nav-actions .theme-switch {
    width: 52px;
    height: 28px;
    margin-right: 0;
    flex-shrink: 0;
  }
  body.mgf-app-shell .nav-tier-badge {
    display: none;
  }
  body.mgf-app-shell .mobile-menu-toggle {
    display: none !important;
  }
}

@media (max-width: 360px) {
  body.mgf-app-shell .navbar-brand {
    font-size: 1.05rem;
  }
  body.mgf-app-shell .nav-actions .theme-switch {
    width: 44px;
  }
}

@media (min-width: 769px) {
  body.mgf-app-shell .mobile-menu-toggle {
    display: none !important;
  }
}

/* ── Bottom navigation ── */
.mgf-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1005;
  height: calc(var(--mgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(6, 7, 11, 0.96);
  backdrop-filter: blur(24px) saturate(1.15);
  -webkit-backdrop-filter: blur(24px) saturate(1.15);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.04), 0 -12px 40px rgba(0, 0, 0, 0.55);
}

body.mgf-app-shell .mgf-bottom-nav {
  display: flex;
}

body.mgf-app-shell.mgf-chat-page .mgf-bottom-nav {
  display: none;
}

@media (min-width: 769px) {
  .mgf-bottom-nav {
    display: none !important;
  }
}

.mgf-bottom-nav__inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  width: 100%;
  max-width: none;
  margin: 0;
  height: var(--mgf-bottom-nav-h);
  padding: 0 0.15rem;
}

.mgf-bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
  min-height: 44px;
  padding: 0.4rem 0.15rem 0.35rem;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mgf-bottom-nav__item:hover,
.mgf-bottom-nav__item:focus-visible {
  color: var(--text);
  outline: none;
}

.mgf-bottom-nav__item:active {
  transform: scale(0.9);
}

.mgf-bottom-nav__item.is-active {
  color: var(--primary);
}

.mgf-bottom-nav__item.is-active::before {
  content: "";
  position: absolute;
  inset: 0.28rem 0.05rem 0.38rem;
  border-radius: 0.85rem;
  background: rgba(255, 51, 119, 0.1);
  z-index: 0;
  pointer-events: none;
  animation: mgfTabPillIn 0.38s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.mgf-bottom-nav__item .mgf-bottom-nav__icon,
.mgf-bottom-nav__item .mgf-bottom-nav__label {
  position: relative;
  z-index: 1;
}

.mgf-bottom-nav__item.is-pressing .mgf-bottom-nav__icon {
  transform: scale(0.72);
  transition: transform 0.07s cubic-bezier(0.4, 0, 0.6, 1);
}

.mgf-bottom-nav__item.is-pressing:not(.is-active) .mgf-bottom-nav__label {
  opacity: 0.75;
  transition: opacity 0.07s ease;
}

.mgf-bottom-nav__item.is-tab-arrived .mgf-bottom-nav__icon {
  animation: mgfTabIconPop 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mgf-bottom-nav__item.is-tab-arrived::after {
  animation: mgfTabIndicatorPop 0.42s cubic-bezier(0.34, 1.45, 0.64, 1) both;
}

.mgf-bottom-nav__item.is-active::after {
  content: "";
  position: absolute;
  bottom: 0.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.35rem;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow, rgba(255, 51, 119, 0.5));
}

.mgf-bottom-nav__icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.mgf-bottom-nav__item.is-active .mgf-bottom-nav__icon {
  transform: translateY(-1px) scale(1.06);
  filter: drop-shadow(0 0 6px var(--primary-glow, rgba(255, 51, 119, 0.45)));
}

.mgf-bottom-nav__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
  padding: 0 0.1rem;
}

.mgf-bottom-nav__led {
  position: absolute;
  top: 0.45rem;
  right: calc(50% - 1.15rem);
}

/* ── Adaptive flashes ── */
@media (max-width: 768px) {
  .flashes {
    top: auto;
    bottom: calc(var(--mgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.75rem);
    left: 1rem;
    right: 1rem;
    align-items: stretch;
  }
  .flash {
    max-width: none;
    animation-name: mgfFlashSlideUp;
  }
  body.mgf-chat-page .flashes {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Hide desktop nav on mobile (bottom nav replaces it) ── */
@media (max-width: 768px) {
  body.mgf-app-shell .nav-links {
    display: none !important;
  }
}

@media (min-width: 769px) {
  body.mgf-app-shell .nav-links {
    display: flex;
  }
}

/* ── Dashboard premium upsell above bottom nav ── */
@media (max-width: 768px) {
  body.mgf-app-shell .premium-floating {
    bottom: calc(var(--mgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.75rem) !important;
    left: 1rem !important;
    right: 1rem !important;
    width: auto !important;
  }
}

/* ── Dashboard resume card ── */
.dash-resume-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 51, 119, 0.35);
  background: linear-gradient(135deg, rgba(255, 51, 119, 0.12), rgba(255, 255, 255, 0.03));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.dash-resume-led {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
}
.dash-resume-card.conv-has-unread {
  padding-left: 2rem;
}
.dash-resume-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.dash-resume-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dash-resume-card__body { flex: 1; min-width: 0; }
.dash-resume-card__label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.15rem;
}
.dash-resume-card__name {
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}
.dash-resume-card__preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-resume-card__cta {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
}

/* ── Profile accordion (settings cards) ── */
@media (max-width: 768px) {
  .settings-card.mgf-profile-accordion > h2,
  .settings-card.mgf-profile-accordion > h3 {
    display: none;
  }
  .settings-card.mgf-profile-accordion .profile-section__body {
    display: none;
  }
  .settings-card.mgf-profile-accordion.is-open .profile-section__body {
    display: block;
  }
  .settings-card.mgf-profile-accordion .profile-section__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
  }
  .subscription-teaser.mgf-profile-accordion .profile-section__toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: left;
  }
  .subscription-teaser.mgf-profile-accordion .profile-section__body {
    display: none;
  }
  .subscription-teaser.mgf-profile-accordion.is-open .profile-section__body {
    display: block;
  }
}

@media (min-width: 769px) {
  .settings-card.mgf-profile-accordion .profile-section__toggle,
  .subscription-teaser.mgf-profile-accordion .profile-section__toggle {
    display: none;
  }
  .settings-card.mgf-profile-accordion .profile-section__body,
  .subscription-teaser.mgf-profile-accordion .profile-section__body {
    display: block !important;
  }
}

@keyframes mgfFlashSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Page title utilities ── */
.mgf-page-title {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.mgf-page-sub {
  color: var(--text-muted);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  font-weight: 600;
}

.mgf-page-header {
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.mgf-page-header--center {
  text-align: center;
}

/* ── Sticky subheaders (Discover / Gallery) ── */
.mgf-sticky-subheader {
  position: sticky;
  top: var(--mgf-navbar-h, 72px);
  z-index: 900;
  margin-bottom: 1.5rem;
  padding: 0.75rem 0 1rem;
  background: linear-gradient(180deg, rgba(3, 4, 7, 0.96) 0%, rgba(3, 4, 7, 0.88) 75%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
  .mgf-sticky-subheader {
    top: var(--mgf-navbar-h, 56px);
  }
}

/* ── Horizontal scroll hint ── */
.mgf-scroll-hint-wrap {
  position: relative;
}

.mgf-scroll-hint-wrap::after {
  content: "→";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  opacity: 0.7;
  padding-right: 0.5rem;
  animation: mgfScrollHintPulse 2s ease-in-out infinite;
}

@media (min-width: 769px) {
  .mgf-scroll-hint-wrap::after {
    display: none;
  }
}

@keyframes mgfScrollHintPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

/* ── Dashboard feed mobile ── */
@media (max-width: 768px) {
  .dash-container {
    display: block !important;
    padding: 0 0 calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
    min-height: auto !important;
  }
  .dash-hero {
    margin-top: 0.5rem !important;
    margin-bottom: 1.5rem !important;
    align-items: flex-start !important;
    text-align: left !important;
  }
  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
  }
}

/* ── Contacts inbox mobile ── */
@media (max-width: 768px) {
  .inbox-container {
    margin: 1rem auto 5rem !important;
    padding: 0 1rem !important;
  }
  .inbox-header h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
  }
}

/* ── Discover mobile ── */
@media (max-width: 768px) {
  .discover-container {
    margin: 0 auto !important;
    padding: 0 1rem calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  .discover-page-header h1 {
    font-size: clamp(1.75rem, 6vw, 2.2rem) !important;
  }
  .discover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem !important;
  }
}

/* ── Mobile app native polish (logged-in shell) ── */
@media (max-width: 768px) {
  body.mgf-app-shell {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
  }

  body.mgf-app-shell:not(.mgf-chat-page) .site-footer {
    display: none;
  }

  body.mgf-app-shell .navbar {
    position: sticky;
    top: 0;
    background: rgba(6, 7, 11, 0.9);
    backdrop-filter: blur(20px) saturate(1.15);
    -webkit-backdrop-filter: blur(20px) saturate(1.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  body.mgf-app-shell .navbar-brand {
    font-size: 1.2rem;
  }

  body.mgf-app-shell:not(.mgf-chat-page) main.container {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  body.mgf-app-shell .mgf-page-header {
    margin-bottom: 1.25rem;
  }

  body.mgf-app-shell .mgf-page-title {
    font-size: 1.65rem;
    letter-spacing: -0.03em;
  }

  body.mgf-app-shell .mgf-page-sub {
    font-size: 0.88rem;
  }

  /* Conversation / inbox rows — iOS-style list */
  body.mgf-app-shell .message-item,
  body.mgf-app-shell .message-item-lg {
    padding: 0.85rem 1rem;
    gap: 0.85rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
  }

  body.mgf-app-shell .message-item:active,
  body.mgf-app-shell .message-item-lg:active {
    transform: scale(0.985);
    background: rgba(255, 255, 255, 0.07);
  }

  body.mgf-app-shell .message-item:hover,
  body.mgf-app-shell .message-item-lg:hover {
    transform: none;
    box-shadow: none;
  }

  body.mgf-app-shell .msg-avatar-wrap {
    width: 48px;
    height: 48px;
  }

  body.mgf-app-shell .message-item-lg .msg-avatar-wrap {
    width: 56px;
    height: 56px;
  }

  body.mgf-app-shell .msg-name {
    font-size: 1rem;
  }

  body.mgf-app-shell .message-item-lg .msg-name {
    font-size: 1.05rem;
  }

  body.mgf-app-shell .msg-preview {
    font-size: 0.85rem;
  }

  body.mgf-app-shell .msg-action {
    display: none;
  }

  body.mgf-app-shell .dash-resume-card {
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
  }

  body.mgf-app-shell .stat-glass {
    border-radius: 1rem;
    padding: 0.85rem 0.75rem;
  }

  body.mgf-app-shell .portrait-card {
    border-radius: 1rem;
  }
}

@media (max-width: 768px) and (hover: hover) {
  body.mgf-app-shell .message-item:hover,
  body.mgf-app-shell .message-item-lg:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* ── Haptic tab transitions (mobile app shell) ── */
@keyframes mgfTabIconPop {
  0% { transform: scale(0.75); }
  42% { transform: translateY(-3px) scale(1.14); }
  68% { transform: translateY(-1px) scale(1.02); }
  100% { transform: translateY(-1px) scale(1.06); }
}

@keyframes mgfTabPillIn {
  0% { transform: scale(0.55); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes mgfTabIndicatorPop {
  0% { transform: translateX(-50%) scaleX(0.2); opacity: 0; }
  100% { transform: translateX(-50%) scaleX(1); opacity: 1; }
}

@keyframes mgfPageEnterFromRight {
  from {
    opacity: 0.42;
    transform: translateX(44px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mgfPageEnterFromLeft {
  from {
    opacity: 0.42;
    transform: translateX(-44px) scale(0.975);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mgfPageExitToLeft {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0.35;
    transform: translateX(-40px) scale(0.975);
  }
}

@keyframes mgfPageExitToRight {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0.35;
    transform: translateX(40px) scale(0.975);
  }
}

@media (max-width: 768px) {
  body.mgf-app-shell.mgf-tab-navigating {
    overflow: hidden;
  }

  body.mgf-app-shell.mgf-tab-navigating .mgf-bottom-nav {
    pointer-events: none;
  }

  body.mgf-app-shell.mgf-tab-navigating main.container.mgf-tab-exit-left {
    animation: mgfPageExitToLeft 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  body.mgf-app-shell.mgf-tab-navigating main.container.mgf-tab-exit-right {
    animation: mgfPageExitToRight 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  html.mgf-tab-enter-right body.mgf-app-shell:not(.mgf-chat-page) main.container,
  body.mgf-app-shell:not(.mgf-chat-page) main.container.mgf-tab-enter-right {
    animation: mgfPageEnterFromRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  html.mgf-tab-enter-left body.mgf-app-shell:not(.mgf-chat-page) main.container,
  body.mgf-app-shell:not(.mgf-chat-page) main.container.mgf-tab-enter-left {
    animation: mgfPageEnterFromLeft 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

/* ── PWA install banner ── */
@keyframes mgfBannerIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  body.mgf-chat-page .mgf-pwa-banner {
    display: none !important;
  }

  .mgf-pwa-banner {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(var(--mgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 0.65rem);
    z-index: 1010;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(10, 11, 16, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: mgfBannerIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
    pointer-events: auto;
  }

  .mgf-pwa-banner__actions .btn {
    pointer-events: auto;
    touch-action: manipulation;
  }

  .mgf-pwa-banner[hidden] {
    display: none !important;
  }

  .mgf-pwa-banner__title {
    margin: 0 0 0.2rem;
    font-size: 0.92rem;
    font-weight: 800;
  }

  .mgf-pwa-banner__text,
  .mgf-pwa-banner__ios {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
  }

  .mgf-pwa-banner__ios {
    margin-top: 0.35rem;
    color: var(--primary);
    font-weight: 700;
  }

  .mgf-pwa-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
  }
}

/* ── 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;
  }
  .mgf-scroll-hint-wrap::after {
    animation: none;
  }
  body.mgf-app-shell main.container.mgf-tab-enter-right,
  body.mgf-app-shell main.container.mgf-tab-enter-left {
    animation: none !important;
  }
  html.mgf-tab-enter-right body.mgf-app-shell main.container,
  html.mgf-tab-enter-left body.mgf-app-shell main.container {
    animation: none !important;
  }
  body.mgf-app-shell.mgf-tab-navigating main.container.mgf-tab-exit-left,
  body.mgf-app-shell.mgf-tab-navigating main.container.mgf-tab-exit-right {
    animation: none !important;
  }
  .mgf-bottom-nav__item.is-active::before,
  .mgf-bottom-nav__item.is-tab-arrived .mgf-bottom-nav__icon,
  .mgf-bottom-nav__item.is-tab-arrived::after {
    animation: none !important;
  }
}
