/* ═══════════════════════════════════════════════════
   AMORÉ — Premium Companion Chat Platform
   Aesthetic: Dark luxury, intimate, editorial
   ═══════════════════════════════════════════════════ */

/* ===== VARIABLES ===== */
:root {
    --bg-deep: #0a0710;
    --bg-base: #0f0b15;
    --bg-card: #151020;
    --bg-elevated: #1a1428;
    --bg-surface: #211a30;
    --bg-hover: #2a2240;
    --bg-input: #18122a;

    --accent: #e05580;
    --accent-dark: #b8406a;
    --accent-glow: rgba(224, 85, 128, 0.2);
    --accent-subtle: rgba(224, 85, 128, 0.06);
    --accent-gradient: linear-gradient(135deg, #e05580, #c44a90);

    --gold: #d4a853;
    --gold-soft: rgba(212, 168, 83, 0.15);

    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    --text-primary: #ede7f5;
    --text-secondary: #a89bbe;
    --text-muted: #6a5d80;
    --text-on-accent: #fff;

    --border: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(224, 85, 128, 0.2);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 60px rgba(224, 85, 128, 0.1);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --nav-h: 56px;
    --sidebar-w: 380px;
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-deep);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== AMBIENT BACKGROUNDS ===== */
.bg-base {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 0%, rgba(100, 30, 70, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 100%, rgba(50, 20, 90, 0.2) 0%, transparent 50%),
        var(--bg-deep);
}

.bg-orb {
    position: fixed; border-radius: 50%; filter: blur(100px);
    opacity: 0.3; z-index: 0; pointer-events: none;
    animation: orbFloat 16s ease-in-out infinite alternate;
}

.bg-orb--1 {
    width: 500px; height: 500px; top: -150px; left: 10%;
    background: radial-gradient(circle, rgba(224, 85, 128, 0.25), transparent 70%);
}

.bg-orb--2 {
    width: 400px; height: 400px; bottom: -100px; right: 5%;
    background: radial-gradient(circle, rgba(100, 50, 160, 0.2), transparent 70%);
    animation-delay: -8s;
}

.bg-orb--3 {
    width: 300px; height: 300px; top: 40%; left: 50%;
    background: radial-gradient(circle, rgba(212, 168, 83, 0.08), transparent 70%);
    animation-delay: -4s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, -30px) scale(1.15); }
}

.bg-grain {
    position: fixed; inset: 0; z-index: 0; opacity: 0.025; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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: 256px 256px;
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-h);
    background: rgba(15, 11, 21, 0.85);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1400px; height: 100%; margin: 0 auto;
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}

.nav-brand {
    display: flex; align-items: center; gap: 10px;
}

.brand-icon {
    color: var(--accent);
    font-size: 18px;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.brand-badge {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gold);
    background: var(--gold-soft);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(212, 168, 83, 0.2);
}

.nav-links {
    display: flex; gap: 8px;
}

.nav-link {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all 0.25s var(--ease-out);
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--text-primary); background: var(--bg-surface); }

.nav-user {
    display: flex; align-items: center; gap: 14px;
}

.nav-credits {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500; color: var(--gold);
    background: var(--gold-soft);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(212, 168, 83, 0.15);
}

.credits-icon { font-size: 10px; }

.nav-avatar-small {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
    position: relative; z-index: 1;
    display: flex;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    margin-top: var(--nav-h);
    max-width: 1400px;
    margin-left: auto; margin-right: auto;
}

/* ===== PROFILE SIDEBAR ===== */
.profile-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px 16px 20px 24px;
    overscroll-behavior: contain;
}

.profile-sidebar::-webkit-scrollbar { width: 3px; }
.profile-sidebar::-webkit-scrollbar-track { background: transparent; }
.profile-sidebar::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Profile Hero Image */
.profile-hero {
    position: relative;
    height: 320px;
    overflow: hidden;
}

.profile-img-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #2a1f3d, #1a1230, #251840);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}

.placeholder-shimmer {
    position: absolute; inset: 0;
    background: linear-gradient(110deg,
        transparent 30%,
        rgba(224, 85, 128, 0.04) 40%,
        rgba(224, 85, 128, 0.08) 50%,
        rgba(224, 85, 128, 0.04) 60%,
        transparent 70%
    );
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.placeholder-initial {
    font-family: var(--font-display);
    font-size: 80px;
    font-weight: 600;
    color: rgba(224, 85, 128, 0.15);
    z-index: 1;
}

.profile-hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(to top, var(--bg-card), transparent);
}

.profile-hero-badges {
    position: absolute; top: 14px; left: 14px; right: 14px;
    display: flex; gap: 8px; z-index: 2;
}

.badge {
    font-size: 11px; font-weight: 500; letter-spacing: 0.3px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}

.badge--verified {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge--online {
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.15);
    margin-left: auto;
}

/* Profile Info */
.profile-info {
    padding: 20px 22px 0;
}

.profile-name-row {
    display: flex; align-items: baseline; gap: 10px;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-age {
    font-size: 20px;
    font-weight: 300;
    color: var(--text-secondary);
}

.profile-location {
    display: flex; align-items: center; gap: 6px;
    margin-top: 6px;
    font-size: 13px; font-weight: 300; color: var(--text-muted);
}

.location-icon { font-size: 10px; color: var(--accent); }

.profile-tagline {
    margin-top: 12px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 15px;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Profile Stats */
.profile-stats {
    display: flex; align-items: center; justify-content: center;
    margin: 20px 22px;
    padding: 16px 0;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.stat { text-align: center; flex: 1; }

.stat-value {
    display: block;
    font-size: 18px; font-weight: 600; color: var(--text-primary);
}

.stat-label {
    display: block; margin-top: 2px;
    font-size: 11px; font-weight: 300; color: var(--text-muted);
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px; height: 32px;
    background: var(--border-light);
}

/* Profile Sections */
.profile-section {
    padding: 18px 22px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.photo-count {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: 6px;
}

.profile-bio {
    font-size: 13.5px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
    font-size: 12px; font-weight: 400;
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all 0.2s var(--ease-out);
}

.tag:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-subtle);
}

/* Detail Grid */
.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.detail-item {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.detail-label {
    font-size: 11px; font-weight: 300; color: var(--text-muted);
    letter-spacing: 0.3px;
}

.detail-value {
    font-size: 13px; font-weight: 500; color: var(--text-primary);
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.gallery-item {
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.gallery-placeholder {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-placeholder { opacity: 0.7; }

.gallery-item--more { position: relative; }

.gallery-more {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5);
    font-size: 16px; font-weight: 600; color: white;
    backdrop-filter: blur(4px);
}

/* ===== CHAT SECTION ===== */
.chat-section {
    flex: 1;
    min-width: 0;
    padding: 20px 24px 20px 16px;
}

.chat-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    position: relative;
}

/* Chat Header */
.chat-header {
    flex-shrink: 0;
    height: 64px;
    padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(21, 16, 32, 0.8);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.chat-header-inner {
    display: flex; align-items: center; gap: 12px;
}

.mobile-back-btn {
    display: none;
    padding: 6px; color: var(--text-secondary);
    border-radius: var(--radius-xs);
}

.mobile-back-btn:hover { background: var(--bg-hover); }

.chat-header-avatar { position: relative; }

.mini-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600; color: white;
}

.mini-status {
    position: absolute; bottom: 0; right: 0;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-card);
}

.chat-header-info h2 {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    color: var(--text-primary);
}

.chat-header-status {
    font-size: 11px; font-weight: 300;
    color: var(--success);
    letter-spacing: 0.3px;
}

.chat-header-actions {
    display: flex; gap: 4px;
}

.header-action {
    padding: 8px;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    transition: all 0.2s var(--ease-out);
}

.header-action:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== CHAT CONTAINER ===== */
.chat-container {
    flex: 1;
    overflow-y: auto; overflow-x: hidden;
    padding: 24px 20px;
    display: flex; flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.chat-container::-webkit-scrollbar { width: 3px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }

/* Welcome */
.welcome-screen {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px;
    animation: welcomeIn 0.8s var(--ease-out);
}

@keyframes welcomeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-avatar {
    position: relative;
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
}

.welcome-letter {
    font-family: var(--font-display);
    font-size: 30px; font-weight: 600;
    color: var(--text-primary);
    z-index: 1;
}

.welcome-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0.3;
    animation: welcomePulse 3s ease-in-out infinite;
}

@keyframes welcomePulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.12); opacity: 0.15; }
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 600;
    color: var(--text-primary);
}

.welcome-sub {
    font-size: 13px; font-weight: 300;
    color: var(--text-muted);
}

.welcome-hints {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px; margin-top: 8px;
}

.hint-chip {
    font-size: 12px; font-weight: 400;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
}

.hint-chip:hover {
    border-color: var(--border-accent);
    background: var(--accent-subtle);
    color: var(--accent);
}

/* Messages */
.user-msg, .ai-msg {
    max-width: 78%;
    padding: 12px 18px;
    line-height: 1.55;
    font-size: 14px;
    word-wrap: break-word;
    animation: msgIn 0.35s var(--ease-spring);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(10px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-msg {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: var(--text-on-accent);
    border-radius: var(--radius-lg) var(--radius-xs) var(--radius-lg) var(--radius-lg);
    box-shadow: 0 4px 20px rgba(224, 85, 128, 0.2),
                inset 0 1px 0 rgba(255,255,255,0.1);
}

.ai-msg {
    align-self: flex-start;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-xs) var(--radius-lg) var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.ai-msg.error {
    background: rgba(248, 113, 113, 0.06);
    border-color: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

/* Typing */
.typing-indicator { display: none; align-self: flex-start; }
.typing-indicator.active { display: block; }

.typing-bubble {
    display: flex; align-items: center; gap: 5px;
    padding: 14px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs) var(--radius-lg) var(--radius-lg) var(--radius-lg);
}

.typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.3;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.35); }
}

/* ===== CHAT FOOTER ===== */
.chat-footer {
    flex-shrink: 0;
    padding: 16px 20px 14px;
    background: rgba(21, 16, 32, 0.8);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
}

.chat-form {
    display: flex; gap: 10px; align-items: flex-end;
}

.input-container {
    flex: 1; position: relative;
}

.message-input {
    width: 100%;
    padding: 12px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px; font-weight: 400;
    line-height: 1.4;
    resize: none;
    max-height: 120px; min-height: 44px;
    outline: none;
    transition: all 0.3s var(--ease-out);
}

.message-input::placeholder { color: var(--text-muted); font-weight: 300; }

.message-input:focus {
    border-color: rgba(224, 85, 128, 0.3);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.message-input:disabled { opacity: 0.35; cursor: not-allowed; }

.char-count {
    position: absolute; right: 16px; bottom: -17px;
    font-size: 10px; color: var(--text-muted);
    opacity: 0; transition: opacity 0.2s; pointer-events: none;
}

.message-input:focus ~ .char-count,
.char-count.warning, .char-count.danger { opacity: 1; }

.char-sep { margin: 0 1px; opacity: 0.4; }
.char-count.warning { color: var(--warning); }
.char-count.danger { color: var(--danger); }

.send-btn {
    flex-shrink: 0;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient);
    border-radius: 50%;
    color: white;
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.06);
    box-shadow: 0 6px 30px rgba(224, 85, 128, 0.35);
}

.send-btn:active:not(:disabled) { transform: scale(0.93); }
.send-btn:disabled { background: var(--bg-hover); box-shadow: none; opacity: 0.35; }

.send-svg { width: 18px; height: 18px; transform: translateX(1px); }

.input-hint {
    text-align: center;
    font-size: 10px; font-weight: 300;
    color: var(--text-muted);
    margin-top: 8px; opacity: 0.4;
    letter-spacing: 0.3px;
}

/* Offline */
.offline-banner {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0; z-index: 20;
    padding: 10px;
    background: rgba(248, 113, 113, 0.1);
    border-bottom: 1px solid rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    font-size: 12px; font-weight: 400; text-align: center;
}

.offline-banner.visible { display: block; }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 49;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active { display: block; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
    :root { --sidebar-w: 320px; }

    .nav-links { display: none; }

    .profile-hero { height: 260px; }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-inner { padding: 0 16px; }
    .nav-credits { display: none; }
    .brand-badge { display: none; }

    .main-layout {
        flex-direction: column;
    }

    /* Sidebar = slide-in panel on mobile */
    .profile-sidebar {
        position: fixed;
        top: var(--nav-h); left: 0; bottom: 0;
        width: 85vw; max-width: 380px;
        z-index: 50;
        padding: 16px;
        background: var(--bg-base);
        border-right: 1px solid var(--border);
        transform: translateX(-100%);
        transition: transform 0.4s var(--ease-out);
        box-shadow: var(--shadow-lg);
    }

    .profile-sidebar.open {
        transform: translateX(0);
    }

    /* Chat fills screen on mobile */
    .chat-section {
        padding: 0;
        height: calc(100vh - var(--nav-h));
        height: calc(100dvh - var(--nav-h));
    }

    .chat-app {
        border-radius: 0;
        border-left: none; border-right: none;
    }

    .mobile-back-btn { display: flex; }

    .user-msg, .ai-msg {
        max-width: 88%;
        font-size: 14px;
    }

    .message-input {
        font-size: 16px; /* prevent iOS zoom */
    }

    .input-hint { display: none; }

    .welcome-hints { display: none; }
}

/* Small mobile */
@media (max-width: 380px) {
    .brand-name { font-size: 20px; }
    .profile-name { font-size: 26px; }
}

/* ===== PAGE LOAD ANIMATION ===== */
.profile-sidebar, .chat-section {
    animation: fadeSlideIn 0.6s var(--ease-out);
}

.chat-section { animation-delay: 0.1s; animation-fill-mode: both; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== PRINT ===== */
@media print {
    .bg-base, .bg-orb, .bg-grain, .top-nav,
    .profile-sidebar, .chat-header, .chat-footer,
    .typing-indicator, .offline-banner, .welcome-screen,
    .sidebar-overlay { display: none !important; }

    body { background: white; color: black; }
    .chat-app, .chat-section { border: none; box-shadow: none; }
    .user-msg { background: #eee !important; color: black !important; }
    .ai-msg { border: 1px solid #ccc; }
}