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

:root {
    --bg:          #17212b;
    --bg2:         #0e1621;
    --surface:     #1f2d3d;
    --surface2:    #242f3d;
    --border:      #283444;
    --bubble:      #2b5278;
    --bubble-hover:#2e5b87;
    --text:        #e8f4ff;
    --text-muted:  #6d8fad;
    --text-time:   #5a87b5;
    --accent:      #5b9bd5;
    --accent2:     #4a90c4;
    --danger:      #e05252;
    --success:     #4caf7d;
    --radius-bubble: 14px;
    --header-h:    56px;
    --compose-h:   60px;
}

html, body { height: 100%; background: var(--bg2); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* ── Screens ──────────────────────────────────────────── */
.screen { display: flex; flex-direction: column; height: 100vh; }
.screen.hidden { display: none !important; }

/* ── Auth ─────────────────────────────────────────────── */
#auth-screen { align-items: center; justify-content: center; padding: 20px 16px; }

.auth-card {
    width: 100%; max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 28px 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.auth-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7b5ea7);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 700; color: #fff;
    box-shadow: 0 4px 16px rgba(91,155,213,.4);
}

h1 { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin: 4px 0 22px; }

.tab-bar {
    display: flex; background: var(--bg2); border-radius: 10px;
    padding: 3px; margin-bottom: 20px; gap: 3px;
}
.tab {
    flex: 1; padding: 8px; background: transparent; border: none;
    color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 500;
    border-radius: 8px; transition: background .15s, color .15s;
}
.tab.active { background: var(--surface2); color: var(--text); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; letter-spacing: .2px; }
.field input {
    width: 100%; padding: 10px 12px; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 14px; outline: none;
    transition: border-color .15s;
}
.field input:focus { border-color: var(--accent); }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: block; }

.error-msg {
    background: rgba(224,82,82,.1); border: 1px solid rgba(224,82,82,.25);
    border-radius: 8px; color: var(--danger); font-size: 12px;
    padding: 9px 12px; margin-bottom: 14px;
}

.btn-primary {
    width: 100%; padding: 11px; background: var(--accent); color: #fff;
    border: none; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .15s; letter-spacing: .1px;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
    padding: 10px 18px; background: var(--surface2); color: var(--text);
    border: 1px solid var(--border); border-radius: 10px; font-size: 13px;
    cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: var(--border); }

/* ── Header ───────────────────────────────────────────── */
.app-header {
    height: var(--header-h); flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7b5ea7);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.header-title { font-size: 15px; font-weight: 600; color: var(--text); }
.header-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.header-sub.online { color: var(--success); }

.header-right { display: flex; align-items: center; gap: 4px; }
.hdr-btn {
    width: 36px; height: 36px; border-radius: 50%; background: transparent;
    border: none; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.hdr-btn:hover { background: var(--surface2); color: var(--text); }
.hdr-btn.active { color: var(--accent); }

/* ── Search bar ───────────────────────────────────────── */
.search-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.search-bar.hidden { display: none; }
.search-icon { color: var(--text-muted); flex-shrink: 0; }
#search-input {
    flex: 1; background: transparent; border: none; color: var(--text);
    font-size: 14px; outline: none;
}
#search-input::placeholder { color: var(--text-muted); }
.search-clear {
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; border-radius: 50%;
    display: flex; align-items: center; transition: color .15s;
}
.search-clear:hover { color: var(--text); }

/* ── Feed ─────────────────────────────────────────────── */
.feed {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 12px 16px 8px;
    display: flex; flex-direction: column;
}

/* Scrollbar */
.feed::-webkit-scrollbar { width: 4px; }
.feed::-webkit-scrollbar-track { background: transparent; }
.feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.feed-loading, .feed-empty {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px;
}

/* ── Date separator ───────────────────────────────────── */
.date-sep {
    display: flex; align-items: center; justify-content: center;
    margin: 10px 0 6px;
}
.date-sep span {
    background: rgba(0,0,0,.35); backdrop-filter: blur(4px);
    color: var(--text-muted); font-size: 11.5px; font-weight: 500;
    padding: 3px 10px; border-radius: 20px; letter-spacing: .2px;
}

/* ── Bubble wrapper ───────────────────────────────────── */
.bubble-wrap {
    display: flex; justify-content: flex-end;
    margin-bottom: 3px;
}
/* Groups actions + bubble in a natural flex row so actions stay next to the bubble */
.bubble-group {
    display: flex; align-items: flex-end; gap: 4px;
}
.bubble-group:hover .bubble-actions { opacity: 1; pointer-events: all; }

/* Action buttons — flex sibling of bubble, hidden until hover */
.bubble-actions {
    display: flex; align-items: center; gap: 2px;
    opacity: 0; pointer-events: none;
    transition: opacity .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.bbl-btn {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text-muted); cursor: pointer; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.bbl-btn:hover { background: var(--bubble); color: var(--text); }
.bbl-btn.copied { color: var(--success) !important; }
.bbl-btn.danger:hover { background: rgba(224,82,82,.2); color: var(--danger); }

/* ── Bubble ───────────────────────────────────────────── */
.bubble {
    max-width: min(85vw, 560px);
    background: var(--bubble);
    border-radius: var(--radius-bubble) var(--radius-bubble) 4px var(--radius-bubble);
    padding: 8px 12px 6px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
    transition: background .12s;
    cursor: default;
    position: relative;
}

/* ── Text bubble ──────────────────────────────────────── */
.bubble-text {
    font-size: 14px; line-height: 1.55; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
}

/* ── File bubble ──────────────────────────────────────── */
.bubble-file {
    display: flex; align-items: center; gap: 10px; min-width: 200px;
}
.file-thumb {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    background: rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.file-info { flex: 1; min-width: 0; }
.file-name {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-size { font-size: 11px; color: rgba(232,244,255,.5); margin-top: 1px; }
.file-dl {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,.12); border: none;
    color: var(--text); cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.file-dl:hover { background: rgba(255,255,255,.22); }

/* ── Bubble footer (time + edited) ───────────────────── */
.bubble-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 4px; margin-top: 3px;
}
.bubble-time { font-size: 11px; color: var(--text-time); }
.bubble-edited { font-size: 11px; color: var(--text-time); font-style: italic; }

/* ── Compose ──────────────────────────────────────────── */
.compose-wrap {
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 12px;
}

.upload-progress {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.upload-progress.hidden { display: none; }
.progress-track {
    flex: 1; height: 3px; background: var(--border); border-radius: 3px; overflow: hidden;
}
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .2s; }
#progress-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.compose-bar { display: flex; align-items: flex-end; gap: 8px; }

.attach-btn {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: color .15s; margin-bottom: 0;
}
.attach-btn:hover { color: var(--accent); }

#text-input {
    flex: 1; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 20px;
    color: var(--text); font-size: 14px; font-family: inherit;
    padding: 9px 14px; resize: none; outline: none;
    max-height: 140px; overflow-y: auto; line-height: 1.45;
    transition: border-color .15s;
}
#text-input:focus { border-color: var(--accent); }
#text-input::placeholder { color: var(--text-muted); }

/* scrollbar for textarea */
#text-input::-webkit-scrollbar { width: 4px; }
#text-input::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.send-btn {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: var(--accent); border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
    box-shadow: 0 2px 8px rgba(91,155,213,.4);
}
.send-btn:hover { background: var(--accent2); }
.send-btn:active { transform: scale(.93); }
.send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Context menu ─────────────────────────────────────── */
.ctx-menu {
    position: fixed; z-index: 500;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,.55);
    animation: ctx-in .12s ease;
}
@keyframes ctx-in {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
.ctx-menu.hidden { display: none !important; }
.ctx-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 12px; background: transparent;
    border: none; border-radius: 8px; color: var(--text);
    font-size: 13.5px; cursor: pointer; text-align: left;
    transition: background .12s;
}
.ctx-item:hover { background: var(--bubble); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(224,82,82,.15); }
.ctx-sep { height: 1px; background: var(--border); margin: 3px 8px; }

/* ── Settings panel ───────────────────────────────────── */
.settings-panel {
    position: fixed; inset: 0; z-index: 200;
    display: flex; justify-content: flex-end;
}
.settings-panel.hidden { display: none !important; }
.settings-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.settings-drawer {
    position: relative; width: 320px; max-width: 92vw;
    background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; height: 100%;
    box-shadow: -8px 0 32px rgba(0,0,0,.4);
}
.settings-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 14px; border-bottom: 1px solid var(--border);
    font-size: 16px; font-weight: 600; flex-shrink: 0;
}
.settings-body { overflow-y: auto; padding: 8px 0 24px; flex: 1; }
.settings-body::-webkit-scrollbar { width: 4px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.settings-section { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: none; }
.settings-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.settings-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.settings-desc strong { color: var(--text); }

.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.settings-val { color: var(--text-muted); font-size: 13px; font-family: monospace; }

/* Toggle switch */
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 22px;
    cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
    content: ''; position: absolute; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
    transition: transform .2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.settings-key-wrap { margin-top: 8px; display: flex; gap: 8px; }
.settings-key-wrap.hidden { display: none; }
#enc-key-input {
    flex: 1; padding: 8px 10px; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 13px; outline: none;
}
#enc-key-input:focus { border-color: var(--accent); }
.btn-sm {
    padding: 8px 14px; background: var(--accent); color: #fff;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
}
.btn-sm:hover { background: var(--accent2); }

.enc-status { font-size: 12px; margin-top: 6px; min-height: 18px; }
.enc-status.ok { color: var(--success); }
.enc-status.err { color: var(--danger); }

.settings-select {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 13px;
    padding: 5px 8px; outline: none; cursor: pointer;
}
.settings-select:focus { border-color: var(--accent); }

.btn-danger-outline {
    width: 100%; padding: 10px; background: transparent;
    border: 1px solid rgba(224,82,82,.4); color: var(--danger);
    border-radius: 8px; font-size: 13px; cursor: pointer;
    transition: background .15s;
}
.btn-danger-outline:hover { background: rgba(224,82,82,.1); }

/* ── Text-view modal ──────────────────────────────────── */
#text-view-modal .modal-card {
    max-width: 640px; max-height: 82vh;
    display: flex; flex-direction: column;
    padding: 0;
}
.text-view-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.text-view-header span { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.text-view-body {
    overflow-y: auto; padding: 18px 20px 20px;
    flex: 1;
}
.text-view-body::-webkit-scrollbar { width: 5px; }
.text-view-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.text-view-content {
    font-size: 14.5px; line-height: 1.7; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
}
.text-view-actions {
    padding: 12px 18px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0;
}

/* Long-text peek */
.bubble-text-peek {
    font-size: 14px; line-height: 1.55; color: var(--text);
    white-space: pre-wrap; word-break: break-word;
    max-height: 120px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}
.peek-btn {
    display: block; background: none; border: none;
    color: var(--accent); font-size: 12px; cursor: pointer;
    padding: 3px 0; margin-top: 2px; text-align: left;
}
.peek-btn:hover { color: var(--text); }

/* ── Plan badge ───────────────────────────────────────── */
.plan-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 10px; letter-spacing: .4px;
    text-transform: uppercase;
}
.plan-badge.free { background: rgba(109,143,173,.18); color: var(--text-muted); }
.plan-badge.pro  { background: rgba(255,200,50,.15); color: #f0c040; border: 1px solid rgba(240,192,64,.3); }

/* ── Storage bar ──────────────────────────────────────── */
.storage-bar-wrap { margin-top: 8px; }
.storage-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.storage-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }

/* ── Support textarea ─────────────────────────────────── */
.support-textarea {
    width: 100%; min-height: 90px; max-height: 200px; background: var(--bg2);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text);
    font-size: 13px; font-family: inherit; line-height: 1.5; padding: 8px 10px;
    resize: vertical; margin-top: 8px;
}
.support-textarea:focus { outline: none; border-color: var(--accent); }
.btn-sm {
    background: var(--surface2); border: 1px solid var(--border); border-radius: 7px;
    color: var(--text); font-size: 12px; padding: 6px 14px; cursor: pointer; transition: background .15s;
}
.btn-sm:hover { background: var(--border); }

/* ── Modal ────────────────────────────────────────────── */
.modal {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal.hidden { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-card {
    position: relative; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; width: 100%; max-width: 520px;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; font-size: 15px; font-weight: 600;
}
.modal-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: transparent; border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }

#edit-textarea {
    width: 100%; padding: 10px 12px;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 14px; font-family: inherit;
    resize: vertical; outline: none; min-height: 120px;
}
#edit-textarea:focus { border-color: var(--accent); }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal-actions .btn-primary { width: auto; padding: 10px 22px; }

/* ── Search highlight ─────────────────────────────────── */
.hl { background: rgba(255,210,80,.25); border-radius: 2px; }

/* ── Gallery panel ────────────────────────────────────── */
.gallery-panel {
    position: fixed; inset: 0; z-index: 200;
    display: flex; justify-content: flex-end;
}
.gallery-panel.hidden { display: none !important; }
.gallery-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px); }
.gallery-drawer {
    position: relative; width: 360px; max-width: 96vw;
    background: var(--surface); border-left: 1px solid var(--border);
    display: flex; flex-direction: column; height: 100%;
}
.gallery-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 16px 0; flex-shrink: 0;
    font-size: 16px; font-weight: 600;
}
.gallery-tabs {
    display: flex; gap: 2px; padding: 12px 12px 0; flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.g-tab {
    flex: 1; padding: 8px 4px; background: transparent; border: none;
    color: var(--text-muted); font-size: 13px; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.g-tab:hover { color: var(--text); }
.g-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.gallery-body {
    flex: 1; overflow-y: auto; padding: 12px;
}
.gallery-body::-webkit-scrollbar { width: 4px; }
.gallery-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.gallery-empty, .gallery-loading {
    display: flex; align-items: center; justify-content: center;
    height: 120px; color: var(--text-muted); font-size: 13px;
}

/* Media grid */
.gallery-media-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
}
.gallery-media-cell {
    aspect-ratio: 1; overflow: hidden; border-radius: 6px;
    background: var(--surface2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.gallery-media-cell:hover { opacity: .85; }
.gallery-thumb {
    width: 100%; height: 100%; object-fit: cover;
}
.gallery-thumb-icon {
    font-size: 28px;
}
.gallery-media-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35); font-size: 22px;
}

/* List items (files / text) */
.gallery-group-label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
    margin: 12px 0 6px;
}
.gallery-group-label:first-child { margin-top: 0; }
.gallery-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: 10px;
    cursor: pointer; transition: background .12s;
}
.gallery-item:hover { background: var(--surface2); }
.gallery-item-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.gallery-item-info { flex: 1; min-width: 0; }
.gallery-item-name {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gallery-dl-btn {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.08); border: none; color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .12s, color .12s;
}
.gallery-dl-btn:hover { background: var(--accent); color: #fff; }
.gallery-dl-btn svg { pointer-events: none; }

/* ── Utilities ────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 480px) {
    .bubble { max-width: 95%; }
    .bubble-actions { display: none; }
    /* On mobile show a long-press menu instead — show actions inside footer */
    .bubble-wrap { gap: 6px; }
    .auth-card { padding: 28px 20px 22px; }
}
