/* ============================================================
   LoopIn - NEON VAULT 777 theme (Game Vault style)
   Deep navy base, neon blue + magenta accents, chrome highlights,
   Orbitron display font for headings / nav / buttons.
   Full light/dark system via [data-theme]. Shared brand pieces
   (animated logo, casino header, rings) live in brand.css.
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== DARK (default) ===== */
:root {
    --font-body: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
    --font-display: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
    --bg: #03060e;
    --bg-glow: #0c1b3d;
    --card: #0a1226;
    --inset: #101a33;
    --inset-hover: #15224a;
    --border: #1b2b52;
    --border-soft: #142244;
    --text: #e9eefc;
    --text-mute: #8fa2c9;
    --accent: #3fb0ff;
    --accent-strong: #2f9dff;
    --accent-deep: #1a5cff;
    --accent-soft: rgba(63, 176, 255, 0.10);
    --accent-line: rgba(63, 176, 255, 0.38);
    --accent2: #ff3fc6;
    --accent2-soft: rgba(255, 63, 198, 0.12);
    --on-accent: #04101f;
    --danger: #ff5c8a;
    --danger-soft: rgba(255, 92, 138, 0.12);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --gold: #f5c542;
    --navbg: #05091a;
    --nav-inset: #101a33;
    --nav-text: #b9c8e4;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(63, 176, 255, 0.08);
    --grad: linear-gradient(135deg, #1a5cff 0%, #2f9dff 55%, #7fe1ff 100%);
    --grad-hover: linear-gradient(135deg, #2a6cff 0%, #45adff 55%, #9beaff 100%);
    --grad-glow: 0 6px 18px rgba(47, 157, 255, 0.32);
    --bubble-in: #14224a;
    --overlay: rgba(2, 5, 14, 0.8);
    --dots: rgba(120, 160, 235, 0.16);

    /* Legacy aliases - keep old variable names working everywhere */
    --navy-deep: var(--text);
    --navy-royal: var(--text);
    --navy-bright: var(--accent);
    --success-old: var(--success);
}

/* ===== LIGHT ===== */
[data-theme="light"] {
    /* Round 12: a real contrast ladder (page < inset < card) so nothing reads as white on white */
    --bg: #dfe6f3;
    --bg-glow: #bfd2ff;
    --card: #ffffff;
    --inset: #edf1f9;
    --inset-hover: #dfe6f3;
    --border: #b9c7e2;
    --border-soft: #cfd9ec;
    --text: #0e1630;
    --text-mute: #4b5b80;
    --accent: #1a6dff;
    --accent-strong: #0f5ae0;
    --accent-deep: #0f5ae0;
    --accent-soft: rgba(26, 109, 255, 0.09);
    --accent-line: rgba(26, 109, 255, 0.35);
    --accent2: #d61fb2;
    --accent2-soft: rgba(214, 31, 178, 0.10);
    --on-accent: #ffffff;
    --danger: #dc2653;
    --danger-soft: rgba(220, 38, 83, 0.09);
    --success: #0d9964;
    --success-soft: rgba(13, 153, 100, 0.1);
    --navbg: #05091a;            /* navbar stays midnight - brand identity */
    --nav-inset: #141f3d;
    --nav-text: #b9c8e4;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.10), 0 0 0 1px rgba(16, 24, 40, 0.03);
    --shadow-pop: 0 10px 34px rgba(16, 24, 40, 0.18);
    --grad: linear-gradient(135deg, #1a5cff 0%, #2f9dff 100%);
    --grad-hover: linear-gradient(135deg, #2a6cff 0%, #45adff 100%);
    --grad-glow: 0 6px 16px rgba(26, 109, 255, 0.28);
    --bubble-in: #e6edf9;
    --overlay: rgba(10, 16, 40, 0.55);
    --dots: rgba(26, 109, 255, 0.14);
}
[data-theme="light"] .card, [data-theme="light"] .post, [data-theme="light"] .composer { background-image: none; border-color: var(--border-soft); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.06); }
[data-theme="light"] .card-title .ic { filter: none; }
[data-theme="light"] .menu-item.active { text-shadow: none; }
[data-theme="light"] .vbadge { filter: none; }
[data-theme="light"] .btn-primary { color: #ffffff; }
[data-theme="light"] .notif-item.unread { background: #e8f0ff; }
[data-theme="light"] .form-input, [data-theme="light"] .form-textarea, [data-theme="light"] .form-select, [data-theme="light"] .composer-input, [data-theme="light"] .comment-input { background: #f4f7fc; border-color: var(--border); }
[data-theme="light"] .form-input:focus, [data-theme="light"] .form-textarea:focus, [data-theme="light"] .composer-input:focus { background: #ffffff; }
[data-theme="light"] .modal-header { background: linear-gradient(135deg, #0d1a3a 0%, #1a2f60 100%); }
[data-theme="light"] .open-case-bar { background: #fff6dc; }
[data-theme="light"] .post-private-banner { background: #fff6dc; }
[data-theme="light"] .empty-state .ic { color: var(--border); }
[data-theme="light"] #toast { background: #0e1630; }

/* No background on <html>: the body background then propagates to the viewport canvas and is painted
   FIRST, so the fixed z-index:-1 layers (neon network, rings, halftone dots) stay visible behind the page. */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body, 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif);
    background: radial-gradient(1200px 640px at 50% -12%, var(--bg-glow) 0%, transparent 60%) fixed, var(--bg);
    color: var(--text); min-height: 100vh; padding-top: 64px;
    transition: background 0.25s, color 0.25s;
}
/* Halftone dot mesh at the edges - the Neon Vault backdrop texture */
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
    background-image: radial-gradient(circle, var(--dots) 1px, transparent 1.6px); background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 28%, transparent 72%, #000 100%);
    mask-image: linear-gradient(90deg, #000 0%, transparent 28%, transparent 72%, #000 100%);
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }
input, textarea, select { color: var(--text); }
::placeholder { color: var(--text-mute); opacity: 0.8; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.3px; }
[hidden] { display: none !important; }

/* SVG icon sizing */
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

/* ============ NAVBAR ============ */
.top-navbar {
    position: fixed; top: 0; left: 0; width: 100%; height: 64px;
    background: linear-gradient(180deg, #080e22 0%, var(--navbg) 100%);
    border-bottom: 1px solid rgba(63, 176, 255, 0.18);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.45);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 18px; z-index: 5000; gap: 12px;
}
.top-navbar > .nav-left, .top-navbar > .nav-menu, .top-navbar > .nav-right { position: relative; z-index: 1; }
.nav-left { display: flex; align-items: center; gap: 14px; position: relative; min-width: 0; }
.app-logo { color: #e6eefc; font-family: var(--font-display); font-size: 20px; font-weight: 900; letter-spacing: 1px; white-space: nowrap; text-transform: uppercase; }
.app-logo span { color: var(--accent); }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .ic { position: absolute; left: 12px; color: var(--nav-text); width: 16px; height: 16px; pointer-events: none; }
.search-bar {
    background: var(--nav-inset); border: 1px solid rgba(63, 176, 255, 0.18); padding: 9px 14px 9px 36px;
    border-radius: 50px; font-size: 14px; outline: none; width: 220px; color: #e6eefc; transition: all 0.2s;
}
.search-bar::placeholder { color: var(--nav-text); }
.search-bar:focus { border-color: var(--accent); width: 260px; box-shadow: 0 0 0 3px rgba(63, 176, 255, 0.14), 0 0 14px rgba(63, 176, 255, 0.25); }
.search-results-box {
    position: absolute; top: 52px; left: 0; width: 320px; background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-pop); border: 1px solid var(--border); display: none; flex-direction: column; padding: 8px;
    max-height: 380px; overflow-y: auto; z-index: 6000;
}
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.search-item:hover { background: var(--inset); }
.search-item-name { font-size: 14px; font-weight: 600; color: var(--text); }
.search-item-bio { font-size: 12px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }

.nav-menu { display: flex; gap: 4px; align-items: center; }
.menu-item {
    padding: 9px 16px; color: var(--nav-text); border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 11.5px;
    letter-spacing: 0.8px; text-transform: uppercase;
    transition: all 0.2s; white-space: nowrap; position: relative;
}
.menu-item:hover { background: var(--nav-inset); color: #fff; }
.menu-item.active { color: #8be4ff; background: rgba(63, 176, 255, 0.10); text-shadow: 0 0 10px rgba(63, 176, 255, 0.6); }
.menu-item.active::after {
    content: ''; position: absolute; bottom: -9px; left: 16px; right: 16px; height: 2px;
    background: linear-gradient(90deg, var(--accent), #8be4ff); border-radius: 2px 2px 0 0; box-shadow: 0 0 10px rgba(63, 176, 255, 0.9);
}
.menu-item .ic { width: 18px; height: 18px; }

/* External link buttons (Booking / Game - admin controlled) */
.nav-ext-btn {
    display: flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: 50px;
    font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
    color: #8be4ff; white-space: nowrap; transition: all 0.2s;
    background: rgba(63, 176, 255, 0.08); border: 1px solid rgba(63, 176, 255, 0.35); box-shadow: 0 0 12px rgba(63, 176, 255, 0.12);
}
.nav-ext-btn:hover { background: rgba(63, 176, 255, 0.18); box-shadow: 0 0 16px rgba(63, 176, 255, 0.3); }
.nav-ext-btn .ic { width: 15px; height: 15px; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-icon-btn {
    background: var(--nav-inset); border: 1px solid transparent; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--nav-text);
    position: relative; transition: all 0.2s;
}
.nav-icon-btn:hover { color: #fff; background: #172448; border-color: rgba(63, 176, 255, 0.35); box-shadow: 0 0 12px rgba(63, 176, 255, 0.25); }
.nav-badge {
    position: absolute; top: -3px; right: -3px; background: var(--accent2); color: #fff; font-size: 10px;
    font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: none;
    align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--navbg); box-shadow: 0 0 8px rgba(255, 63, 198, 0.7);
}

/* Avatar circle */
.avatar {
    background: linear-gradient(135deg, #1a5cff, #ff3fc6); color: #fff; font-weight: 700; border-radius: 50%;
    background-size: cover; background-position: center; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; cursor: pointer; user-select: none;
    box-shadow: 0 0 0 1px rgba(139, 228, 255, 0.25);
}
.avatar.has-img { color: transparent; }
.av-38 { width: 38px; height: 38px; font-size: 13px; }
.av-32 { width: 32px; height: 32px; font-size: 12px; }
.av-44 { width: 44px; height: 44px; font-size: 14px; }
.av-48 { width: 48px; height: 48px; font-size: 15px; }
.av-28 { width: 28px; height: 28px; font-size: 10px; }

/* Dropdowns */
.dropdown-panel {
    position: absolute; top: 52px; right: 0; background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-pop); border: 1px solid var(--border); display: none; flex-direction: column;
    z-index: 7000; overflow: hidden;
}
.dropdown-panel::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 10px rgba(63, 176, 255, 0.7); }
.user-dropdown { width: 240px; }
.user-dd-header { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.user-dd-name { font-size: 15px; font-weight: 700; color: var(--text); }
.user-dd-email { font-size: 12px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.dd-item {
    padding: 12px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 12px; color: var(--text); background: none; border: none; width: 100%; text-align: left;
}
.dd-item:hover { background: var(--inset); }
.dd-item.danger { color: var(--danger); }
.dd-item .ic { width: 18px; height: 18px; color: var(--text-mute); }
.dd-item.danger .ic { color: var(--danger); }

.notif-dropdown { width: 380px; }
.notif-dd-header { padding: 14px 16px; font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-mark-read { font-family: var(--font-body); font-size: 13px; color: var(--accent); cursor: pointer; font-weight: 600; letter-spacing: 0; text-transform: none; }
.notif-list { max-height: 430px; overflow-y: auto; }
.notif-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.notif-item:hover { background: var(--inset); }
.notif-item.unread { background: var(--accent-soft); }
.notif-icon-wrap { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--on-accent); box-shadow: var(--grad-glow); }
.notif-icon-wrap .ic { width: 19px; height: 19px; }
.notif-text { font-size: 14px; line-height: 19px; flex: 1; min-width: 0; color: var(--text); }
.notif-time { font-size: 11px; color: var(--accent); font-weight: 600; margin-top: 3px; display: block; }
.notif-unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent2); flex-shrink: 0; box-shadow: 0 0 8px rgba(255, 63, 198, 0.8); }
.notif-empty { padding: 34px; text-align: center; color: var(--text-mute); font-size: 14px; }
.notif-see-all { display: block; text-align: center; padding: 12px; font-size: 14px; font-weight: 600; border-top: 1px solid var(--border); }
.notif-see-all:hover { background: var(--inset); }

/* ============ LAYOUT ============ */
.page-container { max-width: 1100px; margin: 0 auto; padding: 22px 18px; }
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-soft); padding: 18px;
    background-image: linear-gradient(180deg, rgba(63, 176, 255, 0.045), transparent 38%);
}
.card-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.card-title .ic { color: var(--accent); filter: drop-shadow(0 0 5px rgba(63, 176, 255, 0.6)); }

/* ============ BUTTONS ============ */
.btn { border: none; border-radius: 9px; font-weight: 700; font-size: 14px; cursor: pointer; padding: 10px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; }
.btn-primary { background: var(--grad); color: var(--on-accent); font-family: var(--font-display); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; box-shadow: var(--grad-glow); }
.btn-primary:hover { background: var(--grad-hover); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(47, 157, 255, 0.45); }
.btn-light { background: var(--inset); color: var(--text); border: 1px solid var(--border-soft); }
.btn-light:hover { background: var(--inset-hover); border-color: var(--accent-line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255, 92, 138, 0.25); }
.btn-danger:hover { background: rgba(255, 92, 138, 0.2); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-primary.btn-sm { font-size: 11px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .ic { width: 16px; height: 16px; }

/* ============ FEED / POSTS ============ */
.composer { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-soft); padding: 16px; position: relative; }
.composer::before { content: ''; position: absolute; top: -1px; left: 22px; right: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent); opacity: 0.8; box-shadow: 0 0 10px rgba(63, 176, 255, 0.5); }
.composer-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.composer-input { flex: 1; border: 1px solid transparent; background: var(--inset); padding: 12px 18px; border-radius: 22px; font-size: 15px; outline: none; resize: none; min-height: 46px; max-height: 240px; line-height: 1.45; font-family: inherit; color: var(--text); overflow-y: hidden; white-space: pre-wrap; }
.composer-input:focus { background: var(--inset-hover); border-color: var(--accent-line); }
.composer-preview { position: relative; margin-bottom: 12px; display: none; }
.composer-preview img, .composer-preview video { max-height: 260px; width: 100%; object-fit: cover; border-radius: 10px; }
.composer-preview-close { position: absolute; top: 8px; right: 8px; background: rgba(4, 8, 18, 0.7); color: #fff; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 11px; }
.media-btn { display: flex; align-items: center; gap: 7px; color: var(--success); font-weight: 600; font-size: 14px; cursor: pointer; padding: 7px 12px; border-radius: 8px; }
.media-btn:hover { background: var(--inset); }

.post { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border-soft); padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.post-header { display: flex; align-items: center; justify-content: space-between; }
.post-header-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.post-author { font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; }
.post-author:hover { color: var(--accent); }
.post-time { font-size: 12px; color: var(--text-mute); display: block; margin-top: 2px; }
.post-content { font-size: 15px; line-height: 22px; word-wrap: break-word; white-space: pre-wrap; color: var(--text); }
.post-media { width: 100%; border-radius: 10px; max-height: 520px; object-fit: cover; cursor: pointer; background: #000; }
video.post-media { cursor: default; }
/* Round 35: optimised media - <picture> adds no box of its own; width / height attributes + height:auto reserve the space before the picture loads */
picture.lp-pic { display: contents; }
.post-media, .shared-media, .chat-media { height: auto; }

.shared-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.shared-box-inner { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.shared-header { display: flex; align-items: center; gap: 9px; }
.shared-media { width: 100%; max-height: 380px; object-fit: cover; }
.shared-deleted { padding: 18px; text-align: center; color: var(--text-mute); font-size: 14px; font-style: italic; }

.post-stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-mute); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.post-actions { display: flex; border-bottom: 1px solid var(--border); }
.post-action { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px; font-weight: 600; font-size: 14px; color: var(--text-mute); border-radius: 8px; cursor: pointer; transition: all 0.15s; background: none; border: none; }
.post-action:hover { background: var(--inset); }
.post-action.active { color: var(--accent); text-shadow: 0 0 8px rgba(63, 176, 255, 0.5); }
.post-action .ic { width: 18px; height: 18px; }

.dots-wrap { position: relative; }
.dots-btn { background: none; border: none; cursor: pointer; padding: 6px 10px; border-radius: 50%; color: var(--text-mute); display: flex; }
.dots-btn:hover { background: var(--inset); }
.dots-menu { position: absolute; top: 34px; right: 0; background: var(--card); box-shadow: var(--shadow-pop); border: 1px solid var(--border); border-radius: 10px; display: none; flex-direction: column; min-width: 160px; z-index: 300; overflow: hidden; }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 7px; }
.comment { display: flex; gap: 9px; align-items: flex-start; }
.comment-bubble { background: var(--inset); padding: 8px 13px; border-radius: 14px; font-size: 13px; max-width: 90%; color: var(--text); }
.comment-author { font-weight: 700; color: var(--accent); cursor: pointer; font-size: 13px; }
.comment-input-row { display: flex; gap: 9px; align-items: center; margin-top: 4px; }
.comment-input { flex: 1; padding: 9px 15px; background: var(--inset); border: 1px solid transparent; border-radius: 20px; font-size: 13px; outline: none; }
.comment-input:focus { border-color: var(--accent-line); }
.comment-send { background: var(--grad); color: var(--on-accent); border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--grad-glow); }
.comment-send .ic { width: 15px; height: 15px; }

/* ============ MODALS ============ */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); display: none; justify-content: center; align-items: center; z-index: 9000; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--card); width: 100%; max-width: 460px; border-radius: 16px; box-shadow: var(--shadow-pop); border: 1px solid rgba(96, 160, 255, 0.3); overflow: hidden; display: flex; flex-direction: column; max-height: 88vh; }
.modal-header { padding: 16px 20px; background: linear-gradient(135deg, #060b18 0%, #0d1a3a 100%); color: #e6eefc; border-bottom: 2px solid var(--accent); box-shadow: 0 2px 18px rgba(63, 176, 255, 0.25); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }
.modal-close { background: none; border: none; color: #e6eefc; cursor: pointer; opacity: 0.85; display: flex; padding: 4px; }
.modal-close:hover { opacity: 1; color: #8be4ff; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-mute); margin-bottom: -6px; }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 12px 15px; border: 1.5px solid var(--border); border-radius: 9px;
    font-size: 15px; outline: none; background: var(--inset); font-family: inherit; transition: all 0.2s; color: var(--text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 3px rgba(63, 176, 255, 0.14); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--card); color: var(--text); }

/* ============ TOAST ============ */
#toast {
    position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
    background: #05091a; border: 1px solid var(--accent-line); color: #e6eefc; padding: 11px 22px; border-radius: 24px;
    font-size: 14px; font-weight: 600; z-index: 99999; pointer-events: none; opacity: 0; box-shadow: 0 0 20px rgba(63, 176, 255, 0.25);
    transition: opacity 0.3s; max-width: 90%; text-align: center;
}

/* Image lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(2, 5, 12, 0.95); z-index: 9999; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 93%; max-height: 93%; border-radius: 8px; object-fit: contain; }
.lightbox-close { position: absolute; top: 18px; right: 22px; background: rgba(255, 255, 255, 0.12); border: none; color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Announcement banner */
.announce-bar { background: var(--navbg); border: 1px solid var(--accent-line); color: #e6eefc; border-radius: var(--radius); padding: 13px 18px; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; box-shadow: 0 0 20px rgba(63, 176, 255, 0.12); }
.announce-bar .ic { color: var(--accent); flex-shrink: 0; }
.announce-title { font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.5px; }
.announce-body { font-size: 13px; color: #a7b8d8; }
.announce-close { margin-left: auto; background: none; border: none; color: #fff; opacity: 0.7; cursor: pointer; display: flex; }
.announce-img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }

/* Sponsored ad card - pinned first on the home feed */
.spot-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); position: relative; }
.spot-badge { position: absolute; top: 12px; left: 12px; background: rgba(4, 8, 18, 0.82); color: #8be4ff; font-family: var(--font-display); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 11px; border-radius: 12px; z-index: 2; border: 1px solid var(--accent-line); }
.spot-img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.spot-body { padding: 14px 16px; display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.spot-title { font-size: 16px; font-weight: 700; color: var(--text); }
.spot-text { font-size: 13px; color: var(--text-mute); margin-top: 3px; line-height: 19px; }
.spot-cta { flex-shrink: 0; }
/* Round 15: "Sponsored" is its own row above the ad so it never covers the title on phones */
.spot-top { display: flex; align-items: center; padding: 10px 14px 0; }
.spot-badge-inline { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-size: 9px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 11px; border-radius: 12px; border: 1px solid var(--accent-line); }
.spot-badge-inline .ic { width: 12px; height: 12px; }
.spot-card .spot-img { margin-top: 10px; }

/* External-link items inside the profile dropdown (mobile placement) */
.mobile-only { display: none !important; }
.dd-ext-tag { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--accent-soft); color: var(--accent); padding: 3px 9px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Notification opt-in nudge (Round 19: bottom-LEFT, slides in, never over the page's action buttons) */
.notif-nudge {
    position: fixed; bottom: 20px; left: 16px; z-index: 8000;
    background: var(--card); border: 1px solid var(--accent-line); border-radius: 14px;
    box-shadow: var(--shadow-pop); padding: 13px 14px; display: flex; align-items: center; gap: 11px;
    max-width: 330px; opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .25s ease;
}
.notif-nudge.show { opacity: 1; transform: translateY(0); }
@keyframes nudgeIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.notif-nudge-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--grad-glow); }
.notif-nudge-icon .ic { width: 18px; height: 18px; }
.notif-nudge-text { font-size: 12.5px; line-height: 17px; color: var(--text-mute); min-width: 0; }
.notif-nudge-text b { color: var(--text); font-size: 13px; }
.notif-nudge-btn { background: var(--grad); color: var(--on-accent); border: none; border-radius: 8px; padding: 8px 13px; font-weight: 700; font-size: 12.5px; cursor: pointer; flex-shrink: 0; }
.notif-nudge-btn:hover { background: var(--grad-hover); }
.notif-nudge-close { background: none; border: none; color: var(--text-mute); font-size: 17px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; align-self: flex-start; line-height: 1; }
@media (max-width: 600px) { .notif-nudge { right: 10px; left: 10px; max-width: none; bottom: 76px; } }

/* ============ PERMISSION CONSENT CARD (Round 19) ============ */
.perm-overlay { position: fixed; inset: 0; z-index: 99990; background: rgba(2, 5, 14, 0.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .2s ease; }
.perm-overlay.open { opacity: 1; }
.perm-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--accent-line); border-radius: 20px; box-shadow: var(--shadow-pop), 0 0 40px rgba(63,176,255,.18); padding: 26px 22px 20px; text-align: center; transform: translateY(16px) scale(.98); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.perm-overlay.open .perm-card { transform: none; }
.perm-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; background: var(--grad); color: var(--on-accent); display: flex; align-items: center; justify-content: center; box-shadow: var(--grad-glow); }
.perm-icon .ic { width: 28px; height: 28px; }
.perm-icon.blocked { background: rgba(255,92,138,.16); color: var(--danger); box-shadow: none; border: 1px solid rgba(255,92,138,.4); }
.perm-title { font-family: var(--font-display); font-size: 15px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text); }
.perm-body { font-size: 13.5px; line-height: 20px; color: var(--text-mute); margin: 10px 0 4px; }
.perm-note { font-size: 12px; color: var(--text-mute); background: var(--inset); border-radius: 10px; padding: 8px 10px; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.perm-note .ic { color: var(--success); }
.perm-actions { display: flex; gap: 10px; margin-top: 18px; }
.perm-actions .btn { flex: 1; justify-content: center; }
@media (max-width: 600px) {
    .perm-overlay { align-items: flex-end; padding: 0; }
    .perm-card { max-width: none; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateY(40px); }
}

/* ============ CALLS (Round 19 - WebRTC audio / video) ============ */
.call-screen { position: fixed; inset: 0; z-index: 99980; background: radial-gradient(900px 600px at 50% 30%, #0d1e45 0%, #06091a 60%, #03060e 100%); color: #e6eefc; display: none; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; }
.call-screen.open { display: flex; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call-screen.has-video .call-remote { display: block; }
.call-screen.has-video::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 25%, transparent 70%, rgba(0,0,0,.6) 100%); pointer-events: none; }
.call-local { position: absolute; right: 16px; top: 76px; width: 118px; height: 160px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(63,176,255,.45); box-shadow: 0 8px 26px rgba(0,0,0,.5); background: #000; display: none; z-index: 3; transform: scaleX(-1); }
.call-screen.local-on .call-local { display: block; }
.call-top { position: relative; z-index: 2; width: 100%; padding: calc(18px + env(safe-area-inset-top)) 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.call-brand { font-family: var(--font-display); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: #8be4ff; opacity: .85; display: flex; align-items: center; gap: 8px; }
.call-brand .ic { width: 16px; height: 16px; filter: drop-shadow(0 0 6px rgba(63,176,255,.7)); }
.call-quality { font-size: 11.5px; font-weight: 700; color: #b9c7e6; background: rgba(5,9,26,.6); border: 1px solid rgba(63,176,255,.25); border-radius: 20px; padding: 5px 11px; display: flex; align-items: center; gap: 7px; }
.call-quality i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); display: inline-block; }
.call-quality.warn i { background: var(--gold, #f5c542); box-shadow: 0 0 8px rgba(245,197,66,.8); }
.call-quality.bad i { background: var(--danger); box-shadow: 0 0 8px rgba(255,92,138,.8); }
.call-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; flex: 1; justify-content: center; }
.call-screen.has-video .call-center { justify-content: flex-start; padding-top: 6px; }
.call-screen.has-video .call-avatar { display: none; }
.call-avatar { position: relative; width: 132px; height: 132px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.call-avatar .avatar { width: 116px; height: 116px; font-size: 40px; box-shadow: 0 0 0 4px rgba(63,176,255,.35), 0 0 60px rgba(63,176,255,.35); }
.call-avatar::before, .call-avatar::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(63,176,255,.45); opacity: 0; }
.call-screen.ringing .call-avatar::before { animation: callRing 2s ease-out infinite; }
.call-screen.ringing .call-avatar::after { animation: callRing 2s ease-out .7s infinite; }
@keyframes callRing { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.55); opacity: 0; } }
.call-name { font-size: 24px; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.call-status { font-size: 14px; color: #b9c7e6; min-height: 20px; }
.call-status.live { color: var(--success); font-weight: 700; font-variant-numeric: tabular-nums; }
.call-controls { position: relative; z-index: 2; display: flex; gap: 16px; align-items: center; justify-content: center; padding: 0 20px calc(28px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.1); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s, background .2s; backdrop-filter: blur(6px); position: relative; }
.call-btn .ic { width: 24px; height: 24px; }
.call-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.18); }
.call-btn.on { background: #fff; color: #05091a; }
.call-btn.end { background: var(--danger); border-color: transparent; box-shadow: 0 0 24px rgba(255,92,138,.55); width: 68px; height: 68px; }
.call-btn.accept { background: var(--success); border-color: transparent; box-shadow: 0 0 24px rgba(52,211,153,.55); width: 68px; height: 68px; }
.call-btn span { position: absolute; bottom: -20px; font-size: 10.5px; color: #b9c7e6; white-space: nowrap; letter-spacing: .3px; }
.call-btn[hidden] { display: none !important; }
.call-controls { margin-bottom: 22px; }
/* Round 30: minimised call - a small floating window (video) or pill (audio); tap to bring the call back */
.call-min { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.call-min .ic { width: 18px; height: 18px; }
.call-mini-bar { display: none; }
.call-screen.mini { inset: auto 12px calc(84px + env(safe-area-inset-bottom)) auto; width: 150px; height: 200px; border-radius: 16px; border: 1px solid rgba(63,176,255,.5); box-shadow: 0 14px 40px rgba(0,0,0,.6), 0 0 24px rgba(63,176,255,.25); cursor: pointer; justify-content: flex-end; z-index: 99970; }
.call-screen.mini:not(.has-video) { width: min(300px, calc(100vw - 24px)); height: 64px; border-radius: 40px; }
.call-screen.mini .call-top, .call-screen.mini .call-center, .call-screen.mini .call-controls, .call-screen.mini .call-local { display: none; }
.call-screen.mini.has-video::after { background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.75) 100%); }
.call-screen.mini .call-mini-bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; position: relative; z-index: 3; }
.call-screen.mini.has-video .call-mini-bar .call-mini-av { display: none; }
.call-mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.call-mini-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-mini-text span { font-size: 11.5px; color: #8be4ff; font-variant-numeric: tabular-nums; }
.call-mini-end { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--danger); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.call-mini-end .ic { width: 17px; height: 17px; }
@media (min-width: 769px) { .call-screen.mini { bottom: 24px; } }
/* Round 35: Android picture-in-picture (video call while the person is outside the app) - the whole small window is the other person's video */
.call-screen.pip { inset: 0; width: auto; height: auto; border-radius: 0; border: none; box-shadow: none; z-index: 99990; }
.call-screen.pip .call-top, .call-screen.pip .call-controls, .call-screen.pip .call-mini-bar, .call-screen.pip .call-local { display: none !important; }
.call-screen.pip.has-video .call-center { display: none; }
.call-screen.pip::after { display: none; }
.call-screen.pip .call-remote { object-fit: cover; }

/* Incoming call card (slides down under the header on every page) */
.call-incoming { position: fixed; top: 12px; left: 50%; transform: translate(-50%, -140%); width: min(440px, calc(100% - 20px)); z-index: 99985; background: linear-gradient(135deg, #0b1a3f 0%, #0a1226 100%); border: 1px solid var(--accent-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 30px rgba(63,176,255,.25); padding: 14px 16px; display: flex; align-items: center; gap: 14px; color: #e6eefc; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.call-incoming.show { transform: translate(-50%, 0); }
.call-incoming .avatar { flex-shrink: 0; }
.call-incoming-body { flex: 1; min-width: 0; }
.call-incoming-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-incoming-sub { font-size: 12.5px; color: #8be4ff; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.call-incoming-sub .ic { width: 14px; height: 14px; }
.call-incoming-actions { display: flex; gap: 10px; flex-shrink: 0; }
.call-incoming-actions button { width: 46px; height: 46px; border-radius: 50%; border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.call-incoming-actions .decline { background: var(--danger); box-shadow: 0 0 16px rgba(255,92,138,.5); }
.call-incoming-actions .accept { background: var(--success); box-shadow: 0 0 16px rgba(52,211,153,.5); animation: callPulse 1.2s ease-in-out infinite; }
.call-incoming-actions .ic { width: 20px; height: 20px; }
@keyframes callPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.call-toast { font-size: 12px; color: #b9c7e6; }

/* Call cards inside the chat */
.bubble.call-card { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--border-soft); box-shadow: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.bubble.call-card .call-card-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft, rgba(63,176,255,.12)); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bubble.call-card.missed .call-card-ic { background: rgba(255,92,138,.14); color: var(--danger); }
.bubble.call-card .call-card-ic .ic { width: 17px; height: 17px; }
.bubble.call-card b { font-size: 13.5px; display: block; }
.bubble.call-card small { font-size: 11.5px; color: var(--text-mute); }
.bubble.call-card.missed b { color: var(--danger); }


/* Round 27: iPhone "Add to Home Screen" onboarding sheet (Safari only, never inside the installed app) */
.ios-a2hs { position: fixed; inset: 0; z-index: 99997; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(2, 5, 14, 0); pointer-events: none; transition: background .25s ease; }
.ios-a2hs.show { background: rgba(2, 5, 14, 0.55); pointer-events: auto; }
.ios-a2hs-card { position: relative; width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--accent-line); border-radius: 20px; box-shadow: var(--shadow-pop); padding: 18px 18px 16px; transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1); margin-bottom: env(safe-area-inset-bottom); }
.ios-a2hs.show .ios-a2hs-card { transform: translateY(0); }
.ios-a2hs-x { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--text-mute); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px; }
.ios-a2hs-head { display: flex; gap: 13px; align-items: center; padding-right: 22px; }
.ios-a2hs-logo { width: 54px; height: 54px; border-radius: 13px; flex-shrink: 0; box-shadow: var(--grad-glow); }
.ios-a2hs-head b { display: block; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.ios-a2hs-head span { font-size: 12.5px; line-height: 17px; color: var(--text-mute); }
.ios-a2hs-steps { list-style: none; margin: 14px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.ios-a2hs-steps li { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--text-mute); background: var(--inset); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; }
.ios-a2hs-steps b { color: var(--text); }
.ios-a2hs-steps .ic { width: 17px; height: 17px; vertical-align: -3px; color: var(--accent); }
.ios-a2hs-num { width: 22px; height: 22px; border-radius: 50%; background: var(--grad); color: var(--on-accent); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ios-a2hs-ok { width: 100%; justify-content: center; }

/* Round 27: "Get the LoopIn 777 app" banner for Android users on the installed web app (sticky, slim, above the bottom bar) */
.apk-banner { position: fixed; left: 50%; bottom: 16px; z-index: 7999; width: calc(100% - 20px); max-width: 520px; display: flex; align-items: center; gap: 11px; padding: 9px 10px 9px 11px; background: var(--card); border: 1px solid var(--accent-line); border-radius: 14px; box-shadow: var(--shadow-pop); opacity: 0; transform: translate(-50%, 14px); transition: opacity .25s ease, transform .25s ease; }
.apk-banner.show { opacity: 1; transform: translate(-50%, 0); }
.apk-banner-logo { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.apk-banner-text { min-width: 0; flex: 1; font-size: 12px; line-height: 16px; color: var(--text-mute); }
.apk-banner-text b { display: block; font-size: 13px; color: var(--text); }
.apk-banner-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--grad); color: var(--on-accent); border-radius: 9px; padding: 8px 12px; font-weight: 700; font-size: 12.5px; text-decoration: none; flex-shrink: 0; box-shadow: var(--grad-glow); }
.apk-banner-x { background: none; border: none; color: var(--text-mute); font-size: 19px; line-height: 1; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
@media (max-width: 768px) { .apk-banner { bottom: calc(66px + env(safe-area-inset-bottom)); } body.has-apk-banner { padding-bottom: 134px; } }

/* Empty states */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-mute); }
.empty-state .ic { width: 46px; height: 46px; color: var(--border); margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ============ MOBILE NAV ============ */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: var(--navbg); border-top: 1px solid rgba(63, 176, 255, 0.25); box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5), 0 -1px 14px rgba(63, 176, 255, 0.12); z-index: 5000; padding: 5px 0 7px; }
.mobile-nav-items { display: flex; justify-content: space-around; align-items: center; }
.mob-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 10px; color: var(--nav-text); font-family: var(--font-display); font-size: 8.5px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; border-radius: 10px; min-width: 52px; position: relative; }
.mob-item.active { color: #8be4ff; text-shadow: 0 0 8px rgba(63, 176, 255, 0.7); }
.mob-item .ic { width: 23px; height: 23px; }
.mob-item.active .ic { filter: drop-shadow(0 0 5px rgba(63, 176, 255, 0.8)); }
.mob-badge { position: absolute; top: 0; right: 6px; background: var(--accent2); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: none; align-items: center; justify-content: center; padding: 0 4px; }

/* ============ THEME TOGGLE ============ */
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .right-col { display: none; }
}
@media (max-width: 768px) {
    body { padding-top: 58px; padding-bottom: 64px; }
    .top-navbar { height: 58px; padding: 0 10px; }
    .nav-menu { display: none !important; }
    .mobile-bottom-nav { display: block; }
    .search-bar { width: 130px; }
    .search-bar:focus { width: 170px; }
    .app-logo { font-size: 17px; }
    .nl { font-size: 17px; }
    .page-container { padding: 12px 10px; }
    .composer-input { font-size: 14px; padding: 12px 14px; }
    .notif-dropdown { position: fixed; top: 58px; left: 8px; right: 8px; width: auto; }
    .user-dropdown { right: 0; }
    /* Booking/Game buttons move into the profile dropdown on mobile (no overlap) */
    .nav-ext-btn { display: none !important; }
    .mobile-only { display: flex !important; }
}
@media (max-width: 400px) {
    .nav-left { gap: 8px; }
    .search-bar { width: 108px; padding-left: 32px; }
}


/* ===== Round 9: verified badge, report modal, private posts ===== */
.vbadge { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 3px; color: var(--accent); filter: drop-shadow(0 0 5px rgba(63,176,255,.6)); }
.vbadge .ic { width: 15px; height: 15px; }
.profile-name .vbadge .ic { width: 22px; height: 22px; }
.report-cats { display: flex; flex-wrap: wrap; gap: 7px; }
.report-cat { background: var(--inset); border: 1px solid var(--border); color: var(--text); border-radius: 20px; padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.report-cat:hover { border-color: var(--accent-line); }
.report-cat.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px rgba(63,176,255,.12); }
.post.post-private { border: 1px solid rgba(245,197,66,.45); box-shadow: 0 0 0 1px rgba(245,197,66,.15), var(--shadow); }
.post-private-banner { display: flex; align-items: flex-start; gap: 10px; margin: 0 16px 10px; padding: 11px 13px; border-radius: 10px; background: rgba(245,197,66,.10); border: 1px solid rgba(245,197,66,.4); color: var(--text); font-size: 13px; line-height: 18px; }
.post-private-banner .ic { color: var(--gold); flex-shrink: 0; margin-top: 1px; }

/* ===== Round 11: live times, open-case banner, comment times, post viewer ===== */
time.live-ago { font-variant-numeric: tabular-nums; }
.comment-time { display: block; font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.open-case-bar { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius); background: rgba(245,197,66,.10); border: 1px solid rgba(245,197,66,.45); color: var(--text); font-size: 13.5px; line-height: 19px; margin-bottom: 14px; box-shadow: 0 0 18px rgba(245,197,66,.12); }
.open-case-bar .ic { color: var(--gold); flex-shrink: 0; }
.open-case-bar u { color: var(--accent); font-weight: 700; text-decoration: none; }
.open-case-bar:hover { border-color: var(--gold); }
canvas.neon-net { display: block; }
[data-theme="light"] canvas.neon-net { mix-blend-mode: multiply; }

/* ===== Round 12: agent badge, task center bits ===== */
.vbadge.agent { color: #ff5c8a; filter: drop-shadow(0 0 5px rgba(255,92,138,.6)); }
.agent-tag { display: inline-block; font-family: var(--font-display); font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: #ff5c8a; border: 1px solid rgba(255,92,138,.45); border-radius: 10px; padding: 2px 8px; vertical-align: middle; margin-left: 4px; }
.dd-ext-tag.agent { background: rgba(255,92,138,.12); color: #ff5c8a; }
.spot-by { font-size: 11px; color: var(--text-mute); margin-top: 3px; }

/* ===== Round 15: loaders + network status ===== */
/* Thin top progress bar shown while an API call is in flight */
.netbar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 99997; background: linear-gradient(90deg, var(--accent), #8be4ff, var(--accent2)); box-shadow: 0 0 10px rgba(63,176,255,.7); opacity: 0; transition: width .3s ease, opacity .3s ease; border-radius: 0 3px 3px 0; }
.netbar.on { opacity: 1; width: 80%; transition: width 8s cubic-bezier(.1,.7,.3,1), opacity .2s; }
.netbar.error { background: linear-gradient(90deg, var(--danger), #ff9ab4); width: 100%; }
/* Offline / back-online banner */
.net-banner { position: fixed; left: 50%; transform: translateX(-50%) translateY(-120%); top: 70px; z-index: 99996; display: flex; align-items: center; gap: 8px; background: var(--danger); color: #fff; font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 22px; box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: 92%; }
.net-banner.show { transform: translateX(-50%) translateY(0); }
.net-banner.online { background: var(--success); }
.net-banner .ic { width: 15px; height: 15px; }
/* Full-screen branded loader between pages / while the network is slow */
.loop-loader { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: radial-gradient(900px 500px at 50% 40%, #0c1b3d 0%, #05091a 60%, #03060e 100%); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.loop-loader.on { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.loop-loader-ring { position: relative; width: 78px; height: 78px; }
.loop-loader-ring span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; animation: loopspin 1.1s linear infinite; }
.loop-loader-ring span:nth-child(1) { border-top-color: #3fb0ff; }
.loop-loader-ring span:nth-child(2) { inset: 12px; border-top-color: #ff3fc6; animation-duration: 1.5s; animation-direction: reverse; }
.loop-loader-ring span:nth-child(3) { inset: 24px; border-top-color: #f5c542; animation-duration: .9s; }
@keyframes loopspin { to { transform: rotate(360deg); } }
.loop-loader-word { font-family: var(--font-display); font-weight: 900; font-size: 15px; letter-spacing: 4px; transform: skewX(-8deg); background: linear-gradient(180deg, #fff, #cfd6e4 55%, #9aa6bd); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(140,200,255,.4)); }
@media (prefers-reduced-motion: reduce) { .loop-loader-ring span { animation-duration: 2.4s; } }

/* ===== Round 15: what's-new / update banner ===== */
.update-bar { position: fixed; left: 12px; right: 12px; bottom: 84px; max-width: 460px; margin: 0 auto; z-index: 99995; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--accent-line); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 12px 14px; animation: nudgeIn .35s ease; }
.update-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--grad); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--grad-glow); }
.update-txt { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-mute); line-height: 16px; } .update-txt b { color: var(--text); font-size: 13.5px; }
.update-btn { background: var(--grad); color: var(--on-accent); border: none; border-radius: 8px; padding: 8px 13px; font-weight: 700; font-size: 12.5px; cursor: pointer; flex-shrink: 0; }
.update-x { background: none; border: none; color: var(--text-mute); font-size: 20px; cursor: pointer; padding: 0 4px; flex-shrink: 0; line-height: 1; }
.wn-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.wn-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); line-height: 20px; }
.wn-tag { flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 8px; margin-top: 1px; }
.wn-added { background: var(--success-soft); color: var(--success); } .wn-improved { background: var(--accent-soft); color: var(--accent); } .wn-fixed { background: rgba(245,197,66,.14); color: var(--gold); } .wn-removed { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 600px) { .update-bar { bottom: 76px; } }

/* ===== Round 15: switch-profile rows ===== */
.switch-acc { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border-soft); border-radius: 12px; cursor: pointer; margin-bottom: 8px; background: var(--inset); transition: border-color .15s, background .15s; }
.switch-acc:hover { border-color: var(--accent-line); background: var(--inset-hover); }
.switch-acc .ic { color: var(--text-mute); }

/* ===== Round 15: mobile grid menu drawer ===== */
.app-menu-btn { display: none; }
.appmenu, .appmenu-backdrop { display: none; }
@media (max-width: 768px) {
    /* Phones: the grid button replaces the avatar; the account menu is a panel that slides down UNDER the header */
    .app-menu-btn { display: inline-flex; }
    .app-menu-btn[aria-expanded="true"] { color: #8be4ff; border-color: rgba(63, 176, 255, 0.4); box-shadow: 0 0 12px rgba(63, 176, 255, 0.3); }
    #userMenuWrap { display: none !important; }
    .appmenu-backdrop { display: block; position: fixed; left: 0; right: 0; top: 58px; bottom: 0; background: rgba(2, 5, 14, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 4980; opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; }
    .appmenu-backdrop.open { opacity: 1; visibility: visible; transition: opacity 0.22s ease; }
    .appmenu { display: flex; flex-direction: column; position: fixed; top: 58px; right: 8px; width: min(320px, calc(100vw - 16px)); max-height: calc(100vh - 58px - 72px); overflow-y: auto; z-index: 4990; background: linear-gradient(180deg, var(--navbg) 0%, #070d1f 100%); border: 1px solid rgba(63, 176, 255, 0.22); border-top: none; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); border-radius: 0 0 18px 18px; transform: translateY(-14px); opacity: 0; visibility: hidden; transition: transform 0.24s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease, visibility 0s linear 0.24s; }
    .appmenu::before { content: ''; position: absolute; top: 0; left: 18px; right: 18px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 10px rgba(63, 176, 255, 0.7); }
    .appmenu.open { transform: none; opacity: 1; visibility: visible; transition: transform 0.24s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease; }
    .appmenu-head { color: #e6eefc; border-bottom: 1px solid rgba(63, 176, 255, 0.14); }
    .appmenu-head .user-dd-name { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .appmenu-head .user-dd-email { color: #8fa2c9; max-width: 220px; white-space: nowrap; }
    .appmenu-items { display: flex; flex-direction: column; padding: 8px; gap: 2px; }
    .appmenu-items .dd-item { padding: 13px 14px; border-radius: 10px; color: #b9c8e4; font-weight: 600; font-size: 15px; }
    .appmenu-items .dd-item .ic { width: 20px; height: 20px; color: #8fa2c9; }
    .appmenu-items .dd-item:hover, .appmenu-items .dd-item:active { background: rgba(63, 176, 255, 0.12); color: #8be4ff; }
    .appmenu-items .dd-item:hover .ic, .appmenu-items .dd-item:active .ic { color: #8be4ff; }
    .appmenu-items .dd-item.danger, .appmenu-items .dd-item.danger .ic { color: var(--danger); }
    body.appmenu-lock { overflow: hidden; }
}

/* ===== Round 14: mobile search panel, soft page transitions, sideways scrolling, CMS pages ===== */
/* Phones: a search icon on the RIGHT of the header opens a panel that slides down UNDER the header.
   The header never moves; the page behind is dimmed; results are cards inside the panel. */
.msearch-btn { display: none; }
.msearch, .msearch-backdrop { display: none; }
@media (max-width: 768px) {
    .msearch-btn { display: inline-flex; }
    .search-wrap, .search-results-box { display: none !important; }
    .msearch-backdrop { display: block; position: fixed; left: 0; right: 0; top: 58px; bottom: 0; background: rgba(2, 5, 14, 0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 4980; opacity: 0; visibility: hidden; transition: opacity 0.22s ease, visibility 0s linear 0.22s; }
    .msearch-backdrop.open { opacity: 1; visibility: visible; transition: opacity 0.22s ease; }
    .msearch { display: block; position: fixed; left: 0; right: 0; top: 58px; z-index: 4990; background: linear-gradient(180deg, var(--navbg) 0%, #070d1f 100%); border-bottom: 1px solid rgba(63, 176, 255, 0.22); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); border-radius: 0 0 18px 18px; transform: translateY(-14px); opacity: 0; visibility: hidden; transition: transform 0.24s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease, visibility 0s linear 0.24s; }
    .msearch.open { transform: none; opacity: 1; visibility: visible; transition: transform 0.24s cubic-bezier(.2,.8,.2,1), opacity 0.2s ease; }
    .msearch::before { content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.7; }
    .msearch-bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; }
    .msearch-field { flex: 1; position: relative; display: flex; align-items: center; min-width: 0; }
    .msearch-field > .ic { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--nav-text); pointer-events: none; }
    .msearch-input { width: 100%; height: 44px; background: var(--nav-inset); border: 1px solid rgba(63, 176, 255, 0.28); border-radius: 50px; padding: 0 42px 0 40px; font-size: 16px; color: #e6eefc; outline: none; -webkit-appearance: none; appearance: none; transition: border-color 0.15s, box-shadow 0.15s; }
    .msearch-input::placeholder { color: var(--nav-text); }
    .msearch-input::-webkit-search-cancel-button, .msearch-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
    .msearch-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 176, 255, 0.16), 0 0 16px rgba(63, 176, 255, 0.25); }
    .msearch-clear { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(63, 176, 255, 0.14); color: #e6eefc; align-items: center; justify-content: center; cursor: pointer; }
    .msearch-clear .ic { width: 15px; height: 15px; }
    .msearch.has-text .msearch-clear { display: flex; }
    .msearch-cancel { flex-shrink: 0; background: none; border: none; color: var(--accent); font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 10px 4px; cursor: pointer; }
    .msearch-body { max-height: min(62vh, calc(100vh - 58px - 66px - 70px)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 12px 14px; }
    .msearch-label { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--nav-text); margin: 4px 2px 10px; }
    .msearch-label button { background: none; border: none; color: var(--accent); font-family: inherit; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; cursor: pointer; padding: 2px 4px; }
    .msearch-list { display: flex; flex-direction: column; gap: 8px; }
    .msearch-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(63, 176, 255, 0.14); color: #e6eefc; text-decoration: none; transition: background 0.12s, border-color 0.12s; animation: msearch-in 0.18s ease both; }
    .msearch-item:active { background: rgba(63, 176, 255, 0.12); border-color: rgba(63, 176, 255, 0.4); }
    .msearch-item .avatar { flex-shrink: 0; }
    .msearch-item-name { font-size: 15px; font-weight: 600; color: #e6eefc; display: flex; align-items: center; gap: 4px; min-width: 0; }
    .msearch-item-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .msearch-item-bio { font-size: 12.5px; color: var(--nav-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
    .msearch-item .go { margin-left: auto; color: var(--nav-text); flex-shrink: 0; }
    .msearch-item .go .ic { width: 16px; height: 16px; }
    .msearch-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .msearch-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 22px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(63, 176, 255, 0.16); color: #e6eefc; font-size: 13.5px; font-weight: 600; text-decoration: none; }
    .msearch-chip .avatar { width: 26px; height: 26px; font-size: 10px; }
    .msearch-empty { text-align: center; padding: 26px 12px 18px; color: var(--nav-text); font-size: 13.5px; line-height: 20px; }
    .msearch-empty .ic { width: 34px; height: 34px; color: rgba(63, 176, 255, 0.55); margin-bottom: 8px; }
    .msearch-empty b { color: #e6eefc; }
    .msearch-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--nav-text); padding: 2px 2px 10px; }
    .msearch-status::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(63, 176, 255, 0.25); border-top-color: var(--accent); animation: msearch-spin 0.8s linear infinite; }
    body.msearch-lock { overflow: hidden; }
    .nav-right .msearch-btn.on { color: #fff; background: rgba(63, 176, 255, 0.2); border-color: rgba(63, 176, 255, 0.5); box-shadow: 0 0 12px rgba(63, 176, 255, 0.35); }
}
@keyframes msearch-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes msearch-spin { to { transform: rotate(360deg); } }
/* Cross-fade between pages: View Transitions where supported, a quick fade-in everywhere else */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 140ms ease-out both loopin-fade-out; }
::view-transition-new(root) { animation: 200ms ease-out both loopin-fade-in; }
@keyframes loopin-fade-out { to { opacity: 0; } }
@keyframes loopin-fade-in { from { opacity: 0; } }
.page-container { animation: loopin-page-in 220ms ease-out both; }
@keyframes loopin-page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-container { animation: none; } ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
/* Wide content scrolls inside its card instead of breaking the page */
.card, .post, .two-col > * { min-width: 0; }
.card table, .post table, .page-content table { display: block; overflow-x: auto; max-width: 100%; white-space: nowrap; border-collapse: collapse; }
.card pre, .post pre, .page-content pre { overflow-x: auto; white-space: pre; }
.notif-list .notif-text, .ref-item .sub, .deal-item .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
img { max-width: 100%; }
/* Pages written in Admin > Pages (Jodit output) */
.page-content { font-size: 15px; line-height: 25px; color: var(--text-mute); overflow-wrap: anywhere; }
.page-content h1 { font-family: var(--font-display); font-size: 22px; color: var(--text); margin: 22px 0 10px; }
.page-content h2 { font-family: var(--font-display); font-size: 18px; color: var(--accent); margin: 22px 0 10px; }
.page-content h3 { font-family: var(--font-display); font-size: 15px; color: var(--accent); margin: 20px 0 8px; }
.page-content p { margin-bottom: 14px; }
.page-content ul, .page-content ol { margin: 10px 0 18px 22px; }
.page-content li { margin-bottom: 6px; }
.page-content a { color: var(--accent); }
.page-content img { height: auto; border-radius: 12px; margin: 6px 0; }
.page-content blockquote { border-left: 3px solid var(--accent); margin: 14px 0; padding: 6px 14px; background: var(--inset); border-radius: 0 10px 10px 0; }
.page-content table td, .page-content table th { border: 1px solid var(--border); padding: 8px 12px; }
.page-content table th { color: var(--text); background: var(--inset); }
.page-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.page-content strong { color: var(--text); }
/* Round 14: the right-hand icon group never squeezes the logo on small phones */
@media (max-width: 768px) {
    .nav-left { flex: 1 1 auto; }
    .nav-right { flex-shrink: 0; gap: 8px; }
}
@media (max-width: 360px) {
    .top-navbar { gap: 6px; padding: 0 8px; }
    .nav-left { gap: 6px; }
    .nav-right { gap: 5px; }
    .nav-icon-btn { width: 36px; height: 36px; }
    .nav-left .nl { transform: scale(.9); transform-origin: left center; }
}

/* ===== Round 18: desktop header - the tab group is TRULY centred (grid 1fr auto 1fr), whatever the
   width of the search on the left or the buttons on the right; below 1240 px the tabs shrink, below
   1060 px they show icons only. Phones (<= 768 px) keep their own layout untouched. ===== */
@media (min-width: 769px) {
    .top-navbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; }
    .top-navbar > .nav-left { justify-self: start; min-width: 0; }
    .top-navbar > .nav-menu { justify-self: center; }
    .top-navbar > .nav-right { justify-self: end; }
    /* the search shrinks before anything else can overlap the centred tabs */
    .nav-left .search-wrap { flex: 1 1 auto; min-width: 0; max-width: 260px; }
    .nav-left .search-bar { width: 100%; max-width: 220px; min-width: 96px; }
    .nav-left .search-bar:focus { width: 100%; max-width: 260px; }
    /* the home feed sits inside the same centred column as every post */
    .feed-col { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
}
@media (min-width: 769px) and (max-width: 1240px) {
    .menu-item { padding: 9px 11px; font-size: 11px; gap: 6px; }
    .search-bar { width: 170px; } .search-bar:focus { width: 200px; }
    .nav-ext-btn { padding: 8px 11px; }
}
@media (min-width: 769px) and (max-width: 1160px) {
    .menu-item .mi-label { display: none; }
    .menu-item { padding: 9px 13px; }
    .menu-item .ic { width: 20px; height: 20px; }
    .nav-ext-btn span { display: none; }
    .search-bar { width: 140px; } .search-bar:focus { width: 170px; }
    .nav-right { gap: 8px; }
}

/* ===== Round 24: Reels + Stories (lv- = LoopIn video player; Admin > Reels & Stories > Player CSS can restyle every lv- / st- class) ===== */
.lv-create .modal-title .ic { color: var(--accent); }
.lv-drop { display: block; position: relative; border: 2px dashed var(--accent-line); border-radius: 16px; background: var(--inset); cursor: pointer; overflow: hidden; min-height: 170px; transition: border-color .2s; }
.lv-drop:hover { border-color: var(--accent); }
.lv-drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 34px 16px; color: var(--text-mute); font-size: 12.5px; text-align: center; }
.lv-drop-empty .ic { width: 38px; height: 38px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(63,176,255,.6)); }
.lv-drop-empty b { color: var(--text); font-size: 15px; }
.lv-drop-preview { display: none; width: 100%; max-height: 340px; background: #000; object-fit: contain; }
.lv-drop.has .lv-drop-empty { display: none; }
.lv-drop.has .lv-drop-preview { display: block; }
.lv-count { text-align: right; font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.lv-progress-bar { height: 8px; border-radius: 6px; background: var(--inset); overflow: hidden; border: 1px solid var(--border-soft); }
.lv-progress-bar i { display: block; height: 100%; width: 0; background: var(--grad); box-shadow: 0 0 12px rgba(63,176,255,.7); transition: width .25s; }
.lv-stage { font-size: 12.5px; color: var(--text-mute); margin-top: 6px; }
.lv-result { padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 19px; }
.lv-result a { color: var(--accent); font-weight: 700; }
.lv-result.ok { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.45); }
.lv-result.wait { background: rgba(245,197,66,.08); border: 1px solid rgba(245,197,66,.4); }
.lv-result.bad { background: rgba(255,92,138,.08); border: 1px solid rgba(255,92,138,.45); }
.lv-note { font-size: 11.5px; color: var(--text-mute); line-height: 16px; }
@keyframes lvspin { to { transform: rotate(360deg); } }

/* ---- Stories tray (home feed, Facebook style) ---- */
.st-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 12px 8px; }
.st-tray { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.st-tray::-webkit-scrollbar { display: none; }
.st-item { flex: 0 0 auto; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: none; border: none; padding: 0; color: var(--text); font-family: inherit; scroll-snap-align: start; }
.st-ring { width: 68px; height: 68px; border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--accent), var(--accent2), #ffb84d, var(--accent)); box-shadow: 0 0 14px rgba(255,63,198,.35); position: relative; }
.st-item.seen .st-ring { background: var(--border); box-shadow: none; }
.st-ring .avatar { width: 100%; height: 100%; border: 3px solid var(--card); font-size: 20px; }
.st-name { font-size: 11.5px; font-weight: 600; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-mute); }
.st-item:not(.seen) .st-name { color: var(--text); }
.st-add { position: absolute; right: -1px; bottom: -1px; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; border: 3px solid var(--card); display: flex; align-items: center; justify-content: center; }
.st-add .ic { width: 13px; height: 13px; stroke-width: 3; }
.st-pending { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); background: var(--gold); color: #1a1200; font-size: 8.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 2px 6px; border-radius: 8px; white-space: nowrap; }
.st-skel { width: 68px; height: 68px; border-radius: 50%; background: var(--inset); animation: stpulse 1.2s ease-in-out infinite; }
@keyframes stpulse { 50% { opacity: .45; } }

/* ---- Story viewer (full screen, tap left / right, hold to pause) ---- */
.st-viewer { position: fixed; inset: 0; z-index: 9500; background: rgba(2,4,10,.96); display: none; align-items: center; justify-content: center; }
.st-viewer.open { display: flex; }
.st-stage { position: relative; height: min(100dvh, 860px); aspect-ratio: 9 / 16; max-width: 100vw; background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 0 60px rgba(63,176,255,.18); user-select: none; }
.st-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.st-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.st-bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.3); overflow: hidden; position: relative; }
.st-bars i b { position: absolute; inset: 0; width: 0; background: #fff; }
.st-top { position: absolute; top: 20px; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; z-index: 4; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.st-top .avatar { width: 38px; height: 38px; font-size: 14px; border: 2px solid rgba(255,255,255,.8); flex-shrink: 0; }
.st-who { min-width: 0; flex: 1; font-size: 13.5px; font-weight: 700; color: #fff; }
.st-who span { display: block; font-size: 11.5px; font-weight: 500; opacity: .8; }
.st-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(0,0,0,.35); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.st-btn:hover { background: rgba(255,255,255,.18); }
.st-btn .ic { width: 18px; height: 18px; }
.st-tap { position: absolute; top: 70px; bottom: 90px; width: 42%; z-index: 2; cursor: pointer; }
.st-tap.prev { left: 0; } .st-tap.next { right: 0; }
.st-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 18px; background: linear-gradient(transparent, rgba(0,0,0,.78)); color: #fff; font-size: 14px; line-height: 20px; z-index: 3; white-space: pre-wrap; word-break: break-word; }
.st-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.st-foot button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 18px; padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.st-foot .ic { width: 14px; height: 14px; }
.st-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(10,18,38,.7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.st-arrow.l { left: calc(50% - min(100dvh, 860px) * 9 / 32 - 64px); }
.st-arrow.r { right: calc(50% - min(100dvh, 860px) * 9 / 32 - 64px); }
.st-arrow.r .ic { transform: rotate(180deg); }
.st-spin { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: lvspin .8s linear infinite; z-index: 2; display: none; }
.st-stage.loading .st-spin { display: block; }
.st-state { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; background: rgba(10,18,38,.85); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; text-align: center; max-width: 80%; }
.st-viewers { position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; background: var(--card); border-radius: 16px 16px 0 0; z-index: 6; overflow-y: auto; padding: 14px; transform: translateY(100%); transition: transform .25s; color: var(--text); }
.st-viewers.open { transform: none; }
.st-viewers h4 { font-size: 13px; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.st-vrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.st-vrow .avatar { width: 34px; height: 34px; font-size: 12px; }
.st-compose-prev { width: 100%; max-height: 360px; border-radius: 14px; background: #000; object-fit: contain; display: block; }
@media (max-width: 768px) {
    .st-stage { height: 100dvh; width: 100vw; aspect-ratio: auto; border-radius: 0; }
    .st-arrow { display: none; }
}

/* Round 26: Facebook-style action line ("updated their profile picture.") + privacy icon under it */
.post-action-line { color: var(--text-mute); font-size: 14px; }
.post-privacy { display: inline-flex; vertical-align: -2px; }
.post-privacy .ic { width: 12px; height: 12px; }
/* Round 26: a reel shared to the feed */
.post-reel { position: relative; display: block; margin: 10px auto 0; width: min(100%, 340px); aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--border); }
.post-reel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-reel-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; }
.post-reel-play .ic { width: 30px; height: 30px; fill: currentColor; margin-left: 4px; }
.post-reel-tag { position: absolute; top: 10px; left: 10px; display: inline-flex; gap: 5px; align-items: center; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 10px; }
.post-reel-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 12px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: 13px; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-reel-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; background: var(--grad); color: var(--on-accent); border-radius: 18px; padding: 6px 12px; font-size: 12px; font-weight: 700; }

/* Round 26: reel editor (Create New Reel) */
.lv-ed-modal { max-width: 560px; }
.lv-ed { display: flex; flex-direction: column; gap: 10px; }
.lv-ed-wrap { display: flex; justify-content: center; background: #000; border-radius: 14px; overflow: hidden; }
.lv-ed-stage { position: relative; overflow: hidden; touch-action: none; }
.lv-ed-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lv-ed-layer { position: absolute; inset: 0; z-index: 2; }
.lv-ed-item { position: absolute; transform: translate(-50%, -50%); font-family: "Space Grotesk", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-weight: 700; line-height: 1.15; white-space: nowrap; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; text-shadow: 0 0 4px rgba(0,0,0,.65), 0 1px 2px rgba(0,0,0,.6); padding: 2px; border: 1.5px dashed transparent; border-radius: 6px; }
.lv-ed-item.on { border-color: rgba(255,255,255,.85); }
.lv-ed-item.gif img { display: block; width: 100%; height: auto; pointer-events: none; }
.lv-ed-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; width: 62px; height: 62px; border-radius: 50%; border: none; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lv-ed-play .ic { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }
.lv-ed-stage.playing .lv-ed-play { opacity: 0; pointer-events: none; }
.lv-ed-bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-mute); }
.lv-ed-badge { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--gold); border: 1px solid rgba(245,197,66,.4); border-radius: 6px; padding: 1px 6px; }
.lv-ed-link { margin-left: auto; background: none; border: none; color: var(--accent); font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 0; }
.lv-ed-link.danger { color: var(--danger); }
.lv-ed-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 9px 12px; border-radius: 10px; background: var(--inset); border: 1px solid var(--accent-line); font-size: 12.5px; color: var(--text-mute); }
.lv-ed-sel > span { font-weight: 800; color: var(--text); }
.lv-ed-sel label { display: inline-flex; align-items: center; gap: 6px; }
.lv-ed-sel input[type=range] { width: 110px; }
.lv-ed-tabs { display: flex; gap: 4px; background: var(--inset); border-radius: 12px; padding: 4px; }
.lv-ed-tabs button { flex: 1; border: none; background: none; color: var(--text-mute); font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 8px 4px; border-radius: 9px; cursor: pointer; }
.lv-ed-tabs button.on { background: var(--grad); color: var(--on-accent); box-shadow: var(--grad-glow); }
.lv-ed-panel { display: flex; flex-direction: column; gap: 10px; }
.lv-ed-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; color: var(--text-mute); }
.lv-ed-row b { color: var(--text); }
.lv-ed-row input[type=range] { grid-column: 1 / -1; width: 100%; }
.lv-ed-hint { font-size: 11.5px; color: var(--text-mute); line-height: 16px; }
.lv-ed-inline { display: flex; gap: 8px; align-items: center; }
.lv-ed-inline .form-input { flex: 1; min-width: 0; }
.lv-ed-inline input[type=color], .lv-ed-sel input[type=color] { width: 36px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.lv-ed-emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; max-height: 150px; overflow-y: auto; }
.lv-ed-emojis button { font-size: 24px; line-height: 1; padding: 8px 0; border: none; border-radius: 9px; background: none; cursor: pointer; }
.lv-ed-emojis button:hover { background: var(--inset-hover); }
.lv-ed-music { display: flex; flex-direction: column; gap: 10px; }
.lv-ed-mname { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.lv-ed-mname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
    .lv-create.modal-overlay { padding: 0; }
    .lv-ed-modal { max-width: none; height: 100%; max-height: none; border-radius: 0; }
}

/* Round 26: share sheet */
.lv-sh-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-sh-acts button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--inset); color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer; }
.lv-sh-acts button:hover:not(:disabled) { border-color: var(--accent-line); box-shadow: 0 0 14px rgba(63,176,255,.25); }
.lv-sh-acts button:disabled { opacity: .5; cursor: default; }
.lv-sh-acts button.done { opacity: 1; border-color: rgba(52,211,153,.5); color: var(--success); }
.lv-sh-acts .c { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--grad); color: var(--on-accent); }
.lv-sh-wait { font-size: 12px; color: var(--text-mute); line-height: 17px; }
.lv-sh-friends { display: flex; flex-direction: column; max-height: 230px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 12px; }
.lv-sh-friend { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border-soft); }
.lv-sh-friend:last-child { border-bottom: none; }
.lv-sh-friend .avatar { width: 36px; height: 36px; font-size: 12px; flex-shrink: 0; }
.lv-sh-friend b { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-sh-empty { padding: 18px; text-align: center; font-size: 12.5px; color: var(--text-mute); }
.lv-sh-link { display: flex; gap: 8px; }
.lv-sh-link .form-input { flex: 1; min-width: 0; font-size: 12.5px; }
