* { box-sizing: border-box; }
:root {
    --bg: #07111f;
    --bg-soft: #0c1629;
    --card: rgba(13, 24, 43, 0.88);
    --card-2: rgba(18, 31, 54, 0.9);
    --text: #e5eefc;
    --muted: #8ba3c7;
    --line: rgba(148, 163, 184, 0.14);
    --accent: #7c3aed;
    --accent-2: #2563eb;
    --success: #0f766e;
    --error: #7f1d1d;
    --shadow: 0 25px 60px rgba(0,0,0,.28);
}
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124,58,237,.22), transparent 25%),
        radial-gradient(circle at top right, rgba(37,99,235,.18), transparent 22%),
        linear-gradient(180deg, #07111f 0%, #091423 100%);
    color: var(--text);
    min-height: 100vh;
}
a { color: #c4b5fd; text-decoration: none; }
a:hover { text-decoration: none; color: white; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, 92%); margin: 0 auto; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    background: rgba(7, 17, 31, 0.72);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 18px;
}
.topbar nav { display: flex; gap: 10px; flex-wrap: wrap; }
.topbar nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    transition: .2s ease;
}
.topbar nav a:hover { background: rgba(255,255,255,.06); color: white; }
.brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: white;
}
.main { padding: 28px 0 56px; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}
.surface { background: var(--card-2); }
.hero {
    display: grid;
    gap: 14px;
    background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(37,99,235,.18));
}
.hero h1, .auth-card h1, .composer h2, .page-title, .section-title, .card h2, .card h3 { margin-top: 0; }
.hero p { margin: 0; color: #d8e4fb; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
textarea, input {
    width: 100%;
    background: rgba(7,17,31,.82);
    border: 1px solid rgba(148,163,184,.18);
    color: var(--text);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color .2s ease, transform .15s ease;
}
textarea:focus, input:focus { border-color: rgba(196,181,253,.75); }
input[type="file"] { padding: 12px; }
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    padding: 11px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform .16s ease, opacity .16s ease, box-shadow .16s ease;
    box-shadow: 0 10px 24px rgba(80, 70, 229, 0.28);
}
button:hover, .btn:hover { opacity: .98; transform: translateY(-1px); }
.btn-secondary {
    background: rgba(255,255,255,.06);
    box-shadow: none;
    border: 1px solid rgba(148,163,184,.16);
}
.post-header, .post-actions, .stats, .result-row, .message-header, .message-user, .profile-main, .gallery-meta, .gallery-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.post-content { font-size: 1.04rem; line-height: 1.65; }
.comment {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    margin-top: 12px;
}
.comment-form, .inline-form { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.comment-form input, .inline-form input { margin-bottom: 0; }
.alert {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,.08);
}
.success { background: rgba(15,118,110,.25); }
.error { background: rgba(127,29,29,.35); }
.muted { color: var(--muted); font-size: .94rem; }
.auth-card { max-width: 480px; margin: 40px auto; }
.user-link { font-weight: 800; color: white; }
.profile-card form, .post-actions form { margin: 0; }
.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 18px;
}
.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}
.search-form input { margin-bottom: 0; }
.search-results .card:last-child, .sidebar .card:last-child { margin-bottom: 0; }
.feed { display: grid; gap: 18px; }
.post {
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 27, 49, 0.95), rgba(10, 20, 37, 0.94));
}
.profile-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(124,58,237,.2), rgba(37,99,235,.17));
}
.profile-main { align-items: flex-start; }
.profile-name h1 { margin-bottom: 6px; }
.stats { justify-content: flex-start; flex-wrap: wrap; margin-top: 16px; }
.stat-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}
.avatar, .avatar-lg, .avatar-xl {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
}
.avatar-lg { width: 62px; height: 62px; }
.avatar-xl { width: 94px; height: 94px; }
.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(37,99,235,.9));
    color: white;
    font-weight: 800;
    letter-spacing: .03em;
}
.user-meta { display: flex; align-items: center; gap: 12px; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.gallery-link { color: inherit; display: block; }
.gallery-item {
    background: rgba(7,17,31,.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease;
}
.gallery-item:hover { transform: translateY(-3px); border-color: rgba(196,181,253,.35); }
.gallery-item img {
    width: 100%;
    height: 210px;
    object-fit: cover;
}
.gallery-caption { padding: 12px 13px 14px; }
.gallery-caption strong { display: block; margin-bottom: 6px; }
.gallery-card {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    gap: 18px;
    align-items: start;
}
.gallery-card-image {
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}
.gallery-card-image img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #050b15;
}
.gallery-side .card { margin-bottom: 0; }
.like-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.message-list .card, .search-results .card { margin-bottom: 12px; }
.chat-box {
    max-height: 540px;
    overflow-y: auto;
    padding-right: 4px;
}
.chat-message {
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 12px;
    max-width: 82%;
}
.chat-message.me {
    background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(37,99,235,.95));
    margin-left: auto;
}
.chat-message.them {
    background: rgba(255,255,255,.06);
}
.empty-state { text-align: center; padding: 26px; }
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(124,58,237,.18);
    border: 1px solid rgba(196,181,253,.25);
    font-size: .9rem;
}
.search-user-card { padding: 16px 18px; }
.search-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.top-note { margin-bottom: 12px; }
@media (max-width: 920px) {
    .grid-2, .gallery-card { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .post-actions, .comment-form, .stats, .topbar-inner, .search-form, .inline-form, .result-row, .message-header, .profile-main {
        flex-direction: column;
        align-items: flex-start;
        display: flex;
    }
    .search-form { display: flex; }
    .chat-message { max-width: 100%; }
    .topbar nav { gap: 6px; }
    .card { padding: 18px; border-radius: 20px; }
    .gallery-item img { height: 190px; }
}

.upload-panel {
    display:grid;
    gap:14px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    border: 1px dashed rgba(196,181,253,.26);
    background: rgba(255,255,255,.03);
}
.upload-label {
    display: grid;
    gap: 8px;
    font-weight: 700;
    color: white;
}
.post-video-wrap {
    margin: 16px 0 4px;
}
.post-video {
    width: 100%;
    max-height: 72vh;
    border-radius: 22px;
    background: #030712;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
}
.video-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
}
.chat-message .message-user {
    justify-content: flex-start;
}
@media (max-width: 720px) {
    .post-video { border-radius: 18px; }
}


.nav-badge {
    display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;
    border-radius:999px;background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;font-size:.78rem;font-weight:800;
}
.avatar-comment{width:34px;height:34px}
.video-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:12px}
.post-video-wrap{margin-top:14px}
.post-video{width:100%;max-height:70vh;border-radius:22px;background:#050b15;border:1px solid var(--line)}
.video-note{color:var(--muted);font-size:.88rem}
.mobile-nav{position:fixed;left:0;right:0;bottom:0;z-index:40;display:none;grid-template-columns:repeat(5,1fr);gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:rgba(7,17,31,.92);backdrop-filter:blur(16px);border-top:1px solid var(--line)}
.mobile-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#d6e2f8;font-size:.8rem;padding:6px;border-radius:14px}
.mobile-nav a span{font-size:.72rem}
.reel-open{overflow:hidden}
.reel-overlay{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:9999}
.reel-overlay.is-open{display:flex}
.reel-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.92)}
.reel-stage{position:relative;z-index:2;width:min(420px,92vw);display:grid;gap:10px}
.reel-player{width:100%;height:min(78vh,820px);border-radius:28px;background:#000;object-fit:contain;border:1px solid rgba(255,255,255,.12)}
.reel-meta{padding:0 8px 8px}
.reel-close,.reel-nav{position:absolute;z-index:3;border:none;background:rgba(15,23,42,.7);color:#fff;border:1px solid rgba(255,255,255,.15);box-shadow:none}
.reel-close{top:18px;right:18px;width:44px;height:44px;border-radius:999px;font-size:1.2rem}
.reel-nav{top:50%;transform:translateY(-50%);width:48px;height:48px;border-radius:999px;font-size:1.8rem}
.reel-nav-prev{left:max(16px,2vw)}
.reel-nav-next{right:max(16px,2vw)}
.notification-item{padding:18px}
.notification-new{border-color:rgba(196,181,253,.35);background:rgba(124,58,237,.08)}
@media (max-width: 860px){
    .grid-2,.gallery-card{grid-template-columns:1fr}
    .topbar nav{display:none}
    .main{padding-bottom:92px}
    .mobile-nav{display:grid}
    .reel-nav{display:none}
    .hero-actions,.comment-form,.inline-form,.post-actions,.profile-main,.message-user,.gallery-card-header{align-items:flex-start}
}

.btn-small{padding:10px 14px;border-radius:14px;font-size:.92rem;font-weight:700}
.btn-ghost{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.12);color:#e8eefc}
.btn-ghost:hover{background:rgba(255,255,255,.08)}
.video-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.video-tools .btn,.video-tools a{box-shadow:none}
.video-tools .is-done{border-color:rgba(74,222,128,.35);background:rgba(34,197,94,.18)}
.share-shell{max-width:900px;margin:0 auto;width:100%}
.share-post-card{padding:22px}
.share-meta-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:10px}
.embed-body{margin:0;min-height:100vh;background:radial-gradient(circle at top,#12254a 0,#07111f 45%,#030712 100%);color:#ecf3ff;font-family:Inter,system-ui,sans-serif}
.embed-shell{min-height:100vh;display:grid;place-items:center;padding:14px}
.embed-card{width:min(100%,430px);padding:16px;border-radius:24px;background:rgba(7,17,31,.94)}
.embed-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.avatar-sm{width:40px;height:40px}
.embed-caption{margin-bottom:12px}
.embed-video-wrap{margin:0}
.embed-video{width:100%;height:min(72vh,760px);max-height:none;object-fit:contain;background:#000;border-radius:22px}
.embed-actions{display:flex;justify-content:flex-end;margin-top:12px}
@media (max-width:720px){
  .video-tools{align-items:stretch}
  .video-tools .btn,.video-tools a{width:100%;justify-content:center;text-align:center}
  .share-meta-row{align-items:flex-start}
}

.nav-coins {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.95rem;
}

.video-paywall {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
}

.video-locked-preview {
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255,255,255,0.04);
}

.video-locked-poster {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.03);
    opacity: 0.9;
}


.checkbox-row{display:flex;align-items:center;gap:10px;margin:12px 0 4px;color:#eef4ff;font-weight:700}
.checkbox-row input{width:18px;height:18px}
.chat-send-form{display:grid;gap:12px}
.chat-send-form textarea{min-height:88px;resize:vertical}
.chat-send-tools{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.chat-upload-label{min-width:220px}
.coin-field{display:grid;gap:8px;color:#eef4ff;font-weight:700}
.coin-field input{max-width:150px}
.chat-attachment{margin-top:12px}
.chat-image{display:block;max-width:min(100%,320px);max-height:320px;border-radius:16px;border:1px solid rgba(255,255,255,.12);background:#020817}
.chat-coins-badge{display:inline-flex;align-items:center;gap:8px;margin-top:12px;padding:8px 12px;border-radius:999px;background:rgba(250,204,21,.14);border:1px solid rgba(250,204,21,.28);font-weight:700;color:#fde68a}
@media (max-width:720px){.chat-send-tools{align-items:stretch}.chat-send-tools > *{width:100%}.coin-field input{max-width:none}}


.upload-status {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
}
.upload-status-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.upload-progress {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}
.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(124,58,237,.95), rgba(37,99,235,.95));
    transition: width .2s ease;
}
.upload-status.is-error .upload-progress-bar {
    background: linear-gradient(90deg, rgba(239,68,68,.95), rgba(249,115,22,.95));
}

.chat-typing-indicator{margin:10px 4px 0;color:var(--muted);font-size:.95rem;min-height:20px}
.chat-read-receipt{margin-top:4px;text-align:right;color:var(--muted);font-size:.88rem;opacity:0;transition:opacity .2s ease;min-height:18px}
.chat-read-receipt.is-visible{opacity:1}
.chat-emoji-picker{display:flex;gap:8px;flex-wrap:wrap}
.chat-emoji-picker[hidden]{display:none !important}
.emoji-btn{padding:8px 10px;min-width:auto;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);line-height:1;font-size:1.15rem}
.emoji-btn:hover{background:rgba(255,255,255,.1)}

.chat-drop-zone {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 14px;
  color: #a9b7d9;
  cursor: pointer;
  transition: .2s ease;
}
.chat-drop-zone.is-dragover {
  border-color: #8a7dff;
  background: rgba(98,78,255,.12);
  color: #fff;
}
.chat-file-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}
.chat-file-card a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.chat-file-card a:hover {
  text-decoration: underline;
}

.chat-shell{padding-bottom:18px}
.chat-partner-head{align-items:flex-start}
.chat-presence-row{display:flex;align-items:center;gap:8px;margin-top:4px}
.presence-dot{width:10px;height:10px;border-radius:999px;background:rgba(148,163,184,.7);box-shadow:0 0 0 2px rgba(255,255,255,.05)}
.presence-dot.is-online{background:#22c55e;box-shadow:0 0 12px rgba(34,197,94,.45)}
.secondary-btn{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);color:#fff;border-radius:14px;padding:12px 14px;font-weight:700}
.secondary-btn:hover{background:rgba(255,255,255,.12)}
.chat-voice-status{min-height:20px;margin-top:8px}
.chat-video{display:block;max-width:min(100%,340px);max-height:340px;border-radius:16px;border:1px solid rgba(255,255,255,.12);background:#020817}
.chat-audio-card{margin-top:10px;padding:12px;border-radius:14px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08)}
.chat-audio-card audio{width:min(100%,340px)}
.message-checks{display:inline-flex;align-items:center;gap:2px;margin-left:8px;font-weight:800;letter-spacing:-1px}
.message-checks.is-read{color:#60a5fa}
.message-checks.is-delivered{color:#cbd5e1}
.message-checks.is-sent{color:#94a3b8}
#chatBox{max-height:65vh;overflow:auto;scroll-behavior:smooth}
@media (max-width:720px){.chat-send-tools{gap:10px}.secondary-btn{width:100%}.chat-upload-label{width:100%}}


.gallery-thumb-wrap{position:relative}
.gallery-badges{position:absolute;left:10px;top:10px;display:flex;gap:8px;flex-wrap:wrap}
.gallery-item-locked .gallery-caption{border-top:1px solid rgba(255,255,255,.06)}
.is-blurred{filter:blur(16px) brightness(.5);transform:scale(1.02)}
.locked-media-wrap{position:relative;overflow:hidden;border-radius:22px}
.locked-media-image{width:100%;max-height:72vh;object-fit:contain;background:#050b15}
.locked-media-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center;background:rgba(3,7,18,.38)}
.gallery-owner-actions form{display:inline-flex}

.unlock-note{padding:12px 14px;border-radius:14px;background:rgba(99,102,241,.12);border:1px solid rgba(129,140,248,.24);color:#e7ecff;font-weight:700;line-height:1.45}.gallery-thumb-wrap::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(2,6,23,0) 35%,rgba(2,6,23,.55) 100%)}.gallery-item-locked .gallery-thumb-wrap::before{content:'Gesperrt';position:absolute;right:10px;top:10px;z-index:2;padding:7px 10px;border-radius:999px;background:rgba(15,23,42,.85);border:1px solid rgba(255,255,255,.14);color:#fff;font-weight:800;font-size:.85rem}.locked-media-overlay .badge{background:rgba(15,23,42,.78);border-color:rgba(255,255,255,.18)}


.stat-chip-link {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.stat-chip-link:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.09);
    border-color: rgba(196,181,253,.35);
}
.stat-chip-link.is-active {
    background: linear-gradient(135deg, rgba(124,58,237,.32), rgba(37,99,235,.22));
    border-color: rgba(196,181,253,.35);
}
.follow-list-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.follow-list {
    display: grid;
    gap: 14px;
}
.follow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(7,17,31,.5);
}
.follow-user {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}
.follow-user strong {
    display: block;
    font-size: 1.05rem;
}
.follow-user .muted {
    overflow-wrap: anywhere;
}
.follow-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.follow-actions form {
    margin: 0;
}
@media (max-width: 720px) {
    .follow-row {
        flex-direction: column;
        align-items: stretch;
    }
    .follow-actions {
        justify-content: flex-start;
    }
}


.gallery-top-link{margin:12px 0 18px}.gallery-page-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}.gallery-grid-page{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.gallery-grid-page .gallery-item img{height:260px}@media (max-width:720px){.gallery-page-header{flex-direction:column}.gallery-grid-page .gallery-item img{height:220px}}

.messages-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
    min-height: 76vh;
}
.messages-sidebar {
    border-right: 1px solid var(--line);
    background: rgba(255,255,255,.025);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    min-height: 76vh;
}
.messages-sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.messages-sidebar-head h2 {
    margin-bottom: 6px;
}
.icon-link {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: white;
    font-size: 1.35rem;
}
.messages-search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 16px;
}
.messages-search-form input,
.messages-search-form button {
    margin-bottom: 0;
}
.messages-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.messages-filter-chip {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text);
    box-shadow: none;
}
.messages-filter-chip.is-active {
    background: white;
    color: #07111f;
}
.messages-filter-chip span {
    display: inline-flex;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(7,17,31,.14);
    margin-left: 6px;
    font-size: .8rem;
}
.messages-conversation-list {
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.conversation-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid transparent;
    background: rgba(255,255,255,.02);
    color: var(--text);
    transition: .18s ease;
}
.conversation-card:hover {
    background: rgba(255,255,255,.05);
    border-color: rgba(196,181,253,.18);
}
.conversation-card.is-active {
    background: rgba(192, 240, 144, 0.18);
    border-color: rgba(192, 240, 144, 0.32);
}
.conversation-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}
.conversation-avatar-wrap .presence-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
}
.conversation-content {
    min-width: 0;
    flex: 1;
}
.conversation-topline,
.conversation-preview-row,
.messenger-compose-bottom,
.messages-main-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.conversation-topline strong,
.conversation-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-time {
    font-size: .85rem;
    color: var(--muted);
    white-space: nowrap;
}
.conversation-subline {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: .84rem;
    margin: 4px 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-preview {
    margin: 0;
    color: #dce7fb;
    font-size: .95rem;
}
.conversation-badge {
    margin-left: auto;
    min-width: 28px;
}
.messages-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 76vh;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}
.messages-main.is-empty {
    justify-content: center;
    align-items: center;
}
.messages-main-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}
.messages-main-body {
    flex: 1;
    min-height: 0;
    padding: 18px 22px 0;
}
.messenger-chat-box {
    max-height: none;
    height: 100%;
    min-height: 360px;
    padding-bottom: 20px;
}
.messenger-compose {
    position: relative;
    padding: 12px 22px 22px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.03);
}
.messenger-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.messenger-tool-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: none;
}
.messenger-file-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.messenger-file-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}
.compact-coin-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    padding: 0 12px;
    color: var(--text);
}
.compact-coin-field input {
    width: 86px;
    background: transparent;
    border: 0;
    padding: 11px 0;
    margin: 0;
}
.messenger-compose textarea {
    min-height: 72px;
    max-height: 180px;
    resize: vertical;
    margin-bottom: 10px;
}
.messenger-compose-bottom {
    align-items: flex-end;
}
.chat-drop-zone {
    border: 1px dashed rgba(196,181,253,.25);
    border-radius: 16px;
    padding: 10px 14px;
    margin-bottom: 10px;
    color: var(--muted);
    text-align: center;
    transition: .18s ease;
}
.chat-drop-zone {
    position: relative;
    cursor: pointer;
}
.chat-drop-zone:focus-visible {
    outline: 2px solid rgba(96,165,250,.65);
    outline-offset: 2px;
}
.chat-drop-zone-link {
    color: #c4b5fd;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.chat-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.chat-drop-zone.is-dragover {
    border-color: rgba(196,181,253,.65);
    color: white;
    background: rgba(124,58,237,.08);
}
.chat-emoji-picker.is-floating {
    position: absolute;
    left: 22px;
    bottom: 150px;
    z-index: 5;
    max-width: 260px;
    background: rgba(7,17,31,.96);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    padding: 10px;
    box-shadow: var(--shadow);
}
.chat-typing-indicator,
.chat-read-receipt {
    padding: 0 22px 10px;
    color: var(--muted);
    font-size: .92rem;
}
.chat-read-receipt {
    opacity: 0;
    transition: .18s ease;
}
.chat-read-receipt.is-visible {
    opacity: 1;
}
.messages-empty-state {
    text-align: center;
    max-width: 420px;
    padding: 30px;
}
.messages-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
}

@media (max-width: 980px) {
    .messages-layout {
        grid-template-columns: 1fr;
    }
    .messages-sidebar {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .messages-main {
        min-height: 68vh;
    }
}

@media (max-width: 720px) {
    .messages-layout {
        min-height: auto;
    }
    .messages-sidebar,
    .messages-main-head,
    .messages-main-body,
    .messenger-compose {
        padding-left: 14px;
        padding-right: 14px;
    }
    .messages-search-form,
    .conversation-topline,
    .conversation-preview-row,
    .messenger-compose-bottom,
    .messages-main-head {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .conversation-time,
    .conversation-badge {
        margin-left: 0;
    }
    .chat-emoji-picker.is-floating {
        left: 14px;
        right: 14px;
        max-width: none;
        bottom: 170px;
    }
}


.sr-only{position:absolute !important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.upload-panel{display:grid;gap:14px;}
.upload-panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;}
.upload-trigger{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;}
.upload-dropzone{padding:18px;border:1px dashed rgba(148,163,184,.35);border-radius:18px;background:rgba(15,23,42,.35);}
.upload-dropzone-title{font-weight:700;margin-bottom:6px;}
.upload-status{padding:16px;border:1px solid rgba(148,163,184,.18);border-radius:18px;background:rgba(15,23,42,.45);display:grid;gap:12px;}
.upload-file-row,.upload-status-head,.upload-stats{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.upload-clear{border:1px solid rgba(148,163,184,.2);background:rgba(30,41,59,.7);color:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;}
.upload-progress{width:100%;height:12px;background:rgba(15,23,42,.8);border-radius:999px;overflow:hidden;border:1px solid rgba(148,163,184,.12);}
.upload-progress-bar{width:0%;height:100%;background:linear-gradient(90deg,#7c3aed,#2563eb);transition:width .2s ease;}
.processing-badge{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;background:rgba(59,130,246,.16);color:#dbeafe;font-weight:600;}
.processing-badge::before{content:"";width:10px;height:10px;border-radius:50%;background:#60a5fa;box-shadow:0 0 0 0 rgba(96,165,250,.8);animation:pulseUpload 1.8s infinite;}
.upload-status.is-error .upload-progress-bar{background:linear-gradient(90deg,#dc2626,#f97316);}
.upload-status.is-success .upload-progress-bar{background:linear-gradient(90deg,#22c55e,#06b6d4);}
@keyframes pulseUpload{0%{box-shadow:0 0 0 0 rgba(96,165,250,.75);}70%{box-shadow:0 0 0 10px rgba(96,165,250,0);}100%{box-shadow:0 0 0 0 rgba(96,165,250,0);}}

.upload-status[hidden], .processing-badge[hidden]{display:none !important;}
.upload-trigger{appearance:none;-webkit-appearance:none;border:none;}
