html, body { height:100%; overflow:hidden; overscroll-behavior:none; -webkit-overflow-scrolling:touch; }
body { padding:0; position:fixed; top:0; left:0; right:0; bottom:0; width:100%; }
.overlay {
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
}

.app-wrap {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  position:fixed;
  top:0; left:0; right:0; bottom:0;
  width:100%;
  height:100%;
  max-width:100vw;
  overflow:hidden;
}

/* ── Login screen ──────────────────────────────────────────────────────── */
.login-screen {
  padding-top:20vh;
  padding-left:16px; padding-right:16px;
  height:100%; width:100%;
  overflow-y:auto;
  text-align:center;
}
.login-screen h1 { font-size:18px; font-weight:600; margin-bottom:4px; }
.login-screen p { font-size:11px; color:var(--text-muted); margin-bottom:16px; }
.login-screen > div {
  width:260px; max-width:100%;
  margin-left:auto; margin-right:auto;
  text-align:left;
}
.login-screen .inp { width:100%; margin-bottom:8px; display:block; }
.login-screen .btn { margin-bottom:4px; display:block; width:100%; }
.login-hint { font-size:10px; color:var(--text-muted); margin-bottom:12px; text-align:center; }
.login-error { font-size:10px; color:var(--danger); margin-top:4px; min-height:14px; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  width:180px; min-width:180px;
  background:var(--bg-panel); border-right:1px solid var(--border);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:horizontal; -webkit-box-direction:normal;
  -ms-flex-direction:row; flex-direction:row;
  height:100%; position:relative;
  -webkit-transition:width .2s ease, min-width .2s ease;
  -o-transition:width .2s ease, min-width .2s ease;
  transition:width .2s ease, min-width .2s ease;
}
.sidebar.collapsed {
  width:26px; min-width:26px;
}
.sidebar-expanded {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  width:100%; min-width:0; overflow:hidden;
}
.sidebar.collapsed .sidebar-expanded { display:none; }
.sidebar-collapsed {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  width:100%; height:100%;
}
.sb-col-top {
  padding-top:6px;
  -webkit-box-flex:1; -ms-flex:1; flex:1;
}
.sb-col-bottom {
  padding-bottom:6px;
  border-top:1px solid var(--border);
}
.sb-icon-btn {
  position:relative; cursor:pointer; color:var(--text-muted);
  padding:4px; border-radius:2px; margin-bottom:2px;
}
.sb-icon-btn svg { width:16px; height:16px; }
.sb-icon-btn:hover { background:var(--bg-hover); color:var(--text); }
.sb-icon-badge {
  position:absolute; top:0; right:-2px;
  padding:1px 3px; font-size:7px; border-radius:2px;
  background:var(--accent); color:#fff;
  min-width:10px; text-align:center; line-height:1.3;
}
.sidebar-toggle {
  position:absolute; top:50%; right:-12px;
  -webkit-transform:translateY(-50%);
  -ms-transform:translateY(-50%);
  transform:translateY(-50%);
  width:24px; height:24px; border-radius:50%;
  background:var(--bg-panel); border:1px solid var(--border);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  cursor:pointer; z-index:10; color:var(--text-muted);
  -webkit-transition:-webkit-transform .2s ease;
  -o-transition:transform .2s ease;
  transition:transform .2s ease, -webkit-transform .2s ease;
}
.sidebar-toggle:hover { color:var(--text); background:var(--bg-hover); }
.sidebar.collapsed .sidebar-toggle {
  -webkit-transform:translateY(-50%) rotate(180deg);
  -ms-transform:translateY(-50%) rotate(180deg);
  transform:translateY(-50%) rotate(180deg);
}
.sidebar-hdr {
  padding:8px 10px;
  border-bottom:1px solid var(--border);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
}
.sidebar-hdr .user-name { font-size:11px; font-weight:600; }
.sidebar-user {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  min-width:0;
}
.sidebar-user-info {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -ms-flex-direction:column; flex-direction:column;
  min-width:0;
}
.user-tagline {
  font-size:9px; color:var(--text-muted); line-height:1.3;
  overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  max-width:120px;
}
.sidebar-avatar-placeholder {
  width:28px; height:28px; min-width:28px; border-radius:50%;
  background:var(--bg-input); color:var(--text-muted);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:11px; font-weight:600; margin-right:6px;
  overflow:hidden;
}
.sidebar-avatar-placeholder img {
  width:100%; height:100%; object-fit:cover;
}
.sb-col-avatar-placeholder {
  width:24px; height:24px; min-width:24px; border-radius:50%;
  background:var(--bg-input); color:var(--text-muted);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:10px; font-weight:600;
  overflow:hidden;
}
.sb-col-avatar-placeholder img {
  width:100%; height:100%; object-fit:cover;
}
.sb-avatar-btn { padding:6px 0 2px; }
.sidebar-section {
  padding:8px 0;
}
.sidebar-section-hdr {
  padding:0 10px 4px;
  font-size:10px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
  -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
}
.sidebar-section-hdr button {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  font-size:14px; line-height:1; padding:0 2px;
}
.sidebar-section-hdr button:hover { color:var(--text); }
.sidebar-list { list-style:none; }
.sidebar-item {
  padding:3px 10px;
  cursor:pointer;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
  font-size:11px;
}
.sidebar-item:hover { background:var(--bg-hover); }
.sidebar-item.active { background:var(--accent); color:#fff; border-radius:2px; }
.sidebar-item.active .badge { background:rgba(255,255,255,.3); color:#fff; }
.sidebar-item .item-name {
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0;
}
.sidebar-bottom {
  margin-top:auto;
  padding:8px 10px;
  border-top:1px solid var(--border);
}
.admin-panel-btn {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  cursor:pointer; color:var(--text-muted); padding:2px 0; margin-bottom:4px;
}
.admin-panel-btn:hover { color:var(--text); }
.admin-panel-lbl { font-size:10px; margin-left:6px; }
.settings-btn {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  cursor:pointer; color:var(--text-muted); padding:2px 0;
}
.settings-btn:hover { color:var(--text); }
.settings-lbl { font-size:10px; margin-left:6px; }
.admin-modal {
  width:560px; max-width:96vw;
  max-height:calc(100vh - 40px);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
}
.admin-modal > .modal-body {
  overflow-y:auto; -webkit-overflow-scrolling:touch;
  min-height:0; -webkit-box-flex:1; -ms-flex:1; flex:1;
}
.admin-section { margin-bottom:12px; }
.admin-section-hdr {
  font-size:10px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em; margin-bottom:8px;
}
.admin-role-hint { font-weight:400; text-transform:none; letter-spacing:0; }
.admin-actions { display:-webkit-box; display:-ms-flexbox; display:flex; -ms-flex-wrap:wrap; flex-wrap:wrap; }
.admin-actions > * + * { margin-left:6px; }
.admin-actions .btn svg { margin-right:4px; vertical-align:middle; }
.admin-user-list {
  max-height:260px; overflow-y:auto;
  display:grid; grid-template-columns:1fr auto auto auto auto;
  row-gap:0; column-gap:8px;
  -webkit-box-align:center; align-items:center;
}
.admin-grid-hdr {
  font-size:9px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em;
  padding-bottom:3px; text-align:left;
}
.admin-grid-sep {
  grid-column:1 / -1; height:0;
  border-top:1px solid var(--border); margin-bottom:2px;
}
.admin-grid-cell {
  padding:4px 0;
  border-bottom:1px solid var(--border-light);
}
.admin-grid-cell:nth-last-child(-n+5) { border-bottom:none; }
.admin-export-btn {
  background:none; border:1px solid var(--border); border-radius:2px;
  color:var(--text-muted); cursor:pointer; padding:2px 6px;
  font-size:9px; line-height:1;
}
.admin-export-btn:hover { color:var(--text); border-color:var(--text-muted); }
.admin-delete-btn {
  background:none; border:1px solid var(--danger); border-radius:2px;
  color:var(--danger); cursor:pointer; padding:2px 6px;
  font-size:9px; line-height:1;
}
.admin-delete-btn:hover { background:var(--danger); color:#fff; }
.delete-user-modal { width:340px; }
.delete-warn {
  font-size:12px; color:var(--danger); font-weight:600;
  margin:0 0 8px; line-height:1.4;
}
.delete-user-target {
  font-size:11px; color:var(--text); font-weight:600;
  margin:0 0 8px; padding:6px 8px;
  background:var(--bg-input); border-radius:2px;
}
.delete-info { font-size:11px; color:var(--text-muted); margin:0 0 10px; line-height:1.4; }
.delete-download-btn { width:100%; }
.btn-danger {
  background:var(--danger); color:#fff; border-color:var(--danger); width:100%;
}
.btn-danger:hover { opacity:.85; }
.admin-user-info { min-width:0; }
.admin-user-name {
  font-size:11px; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.admin-user-email {
  font-size:9px; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.admin-user-role .badge {
  font-size:9px; padding:1px 5px; border-radius:2px;
}
.role-owner { background:var(--warning); color:#000; }
.role-admin { background:var(--accent); color:#fff; }
.role-user { background:var(--bg-input); color:var(--text-muted); }
.admin-grid-cell .tog-chip.disabled { pointer-events:none; }
.settings-modal { width:280px; }
.setting-row {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
  padding:6px 0;
}
.setting-row + .setting-row { border-top:1px solid var(--border); }
.setting-info { -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0; }
.setting-name { font-size:11px; color:var(--text); }
.setting-desc { font-size:10px; color:var(--text-muted); margin-top:1px; }
.setting-toggle {
  -ms-flex-negative:0; flex-shrink:0; margin-left:8px;
}
.setting-hint {
  font-size:10px; color:var(--text-muted); padding:4px 0 0;
}
.setting-link-row { cursor:pointer; text-decoration:none; color:inherit; }
.setting-link-row:hover { text-decoration:none; }
.setting-link-row:hover .setting-name { color:var(--accent); }
.setting-link-arrow { color:var(--text-muted); -ms-flex-negative:0; flex-shrink:0; margin-left:8px; }
.setting-link-row:hover .setting-link-arrow { color:var(--accent); }
.add-to-home-row { cursor:pointer; }
.add-to-home-row:hover .setting-name { color:var(--accent); }
.add-home-arrow { color:var(--text-muted); -ms-flex-negative:0; flex-shrink:0; margin-left:8px; }
.add-home-instructions { padding:6px 0 0; }
.add-home-steps { padding:0; }
.add-home-step {
  font-size:11px; color:var(--text); padding:4px 0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.add-home-step + .add-home-step { border-top:1px solid var(--border); }
.step-num {
  width:18px; height:18px; border-radius:50%;
  background:var(--accent); color:#fff; font-size:10px; font-weight:700;
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  -ms-flex-negative:0; flex-shrink:0; margin-right:6px;
}
.share-icon-inline {
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  vertical-align:middle; color:var(--accent); margin:0 2px;
}
.sidebar-scroll {
  overflow-y:auto; -webkit-box-flex:1; -ms-flex:1; flex:1;
}

/* ── Badge ─────────────────────────────────────────────────────────────── */
.badge {
  padding:1px 5px; font-size:9px; border-radius:2px;
  background:var(--accent); color:#fff;
  margin-left:4px; -ms-flex-negative:0; flex-shrink:0;
}

/* ── Main area ─────────────────────────────────────────────────────────── */
.main-area {
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  overflow:hidden;
}
.main-hdr {
  padding:8px 12px;
  border-bottom:1px solid var(--border);
  font-size:12px; font-weight:600;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
}
.hdr-actions {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.hdr-actions > * + * { margin-left:6px; }
.hidden { display:none !important; }
.main-content {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-height:0;
  overflow:hidden;
}
.chat-area {
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  overflow:hidden;
}

/* ── Messages ──────────────────────────────────────────────────────────── */
.messages-list {
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  overflow-y:auto; overflow-x:hidden; padding:8px 12px;
  overscroll-behavior:contain;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
}
.messages-list::before {
  content:"";
  -webkit-box-flex:1; -ms-flex:1 1 auto; flex:1 1 auto;
}
.msg {
  padding:4px 0;
  -ms-flex-negative:0; flex-shrink:0;
}
.msg:hover { background:var(--bg-panel); border-radius:2px; }
.msg-avatar {
  width:28px; height:28px; border-radius:50%;
  vertical-align:middle; margin-right:6px;
}
.msg-avatar-placeholder {
  width:28px; height:28px; border-radius:50%;
  background:var(--bg-input);
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:11px; font-weight:600; color:var(--text-muted);
  vertical-align:middle; margin-right:6px;
}
.msg-meta {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -ms-flex-wrap:wrap; flex-wrap:wrap;
}
.msg-meta > * + * { margin-left:6px; }
.msg-author { font-size:11px; font-weight:600; }
.msg-time { font-size:9px; color:var(--text-muted); }
.msg-edited-tag { font-size:9px; color:var(--text-muted); font-style:italic; }
.msg-action-icon {
  background:none; border:none; cursor:pointer; padding:2px; border-radius:2px;
  color:var(--text-muted); opacity:0; -webkit-transition:opacity .15s; transition:opacity .15s;
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.msg:hover .msg-action-icon { opacity:1; }
.msg-action-icon:hover { color:var(--accent); background:var(--bg-input); }
.msg-delete-btn:hover { color:var(--danger); }
.msg-edit-area { padding-left:13px; margin-top:4px; }
.msg-edit-ta { width:100%; min-height:40px; font-size:11px; resize:vertical; }
.msg-edit-btns {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  margin-top:4px;
}
.msg-edit-btns .btn { margin-right:6px; }
.btn-sm { font-size:10px; padding:2px 10px; }
.btn-cancel { background:var(--bg-input); color:var(--text); }
.btn-cancel:hover { background:var(--bg-panel); }
.msg-text { font-size:11px; line-height:1.5; word-break:break-word; margin-top:1px; padding-left:13px; }
.msg-slideshow { margin-left:13px; }
.link-previews { margin-left:13px; }
.msg-actions {
  margin-top:2px; padding-left:13px;
}
.msg-reply-btn {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  font-size:10px; padding:1px 4px; border-radius:2px;
}
.msg-reply-btn:hover { color:var(--accent); background:var(--bg-input); }
.msg-reply-count {
  font-size:10px; color:var(--text-muted); cursor:pointer;
  margin-left:4px;
}
.msg-reply-count.has-new { color:var(--accent); font-weight:600; }
.msg-reply-count:hover { text-decoration:underline; }
.emoji-summary { margin-left:6px; display:inline; }
.emoji-chip {
  font-size:10px; display:inline-block; background:var(--bg-input);
  border-radius:8px; padding:0 5px; margin-left:3px;
  color:var(--text-muted); vertical-align:middle; line-height:18px;
  position:relative; cursor:pointer;
  -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
}
.emoji-chip:hover {
  background:var(--bg-hover);
}
.emoji-chip.emoji-pop {
  -webkit-animation: emojiPop 0.4s ease;
  animation: emojiPop 0.4s ease;
}
@-webkit-keyframes emojiPop {
  0% { -webkit-transform:scale(1); transform:scale(1); }
  50% { -webkit-transform:scale(1.4); transform:scale(1.4); }
  100% { -webkit-transform:scale(1); transform:scale(1); }
}
@keyframes emojiPop {
  0% { -webkit-transform:scale(1); transform:scale(1); }
  50% { -webkit-transform:scale(1.4); transform:scale(1.4); }
  100% { -webkit-transform:scale(1); transform:scale(1); }
}
.emoji-particle {
  position:absolute; pointer-events:none; font-size:16px; z-index:999;
}
.emoji-particle.emoji-float {
  -webkit-animation: emojiFloat 1.2s ease-out forwards;
  animation: emojiFloat 1.2s ease-out forwards;
}
@-webkit-keyframes emojiFloat {
  0% { opacity:1; -webkit-transform:translate(0,0); transform:translate(0,0); }
  100% { opacity:0; -webkit-transform:translate(var(--drift-x),-60px); transform:translate(var(--drift-x),-60px); }
}
@keyframes emojiFloat {
  0% { opacity:1; -webkit-transform:translate(0,0); transform:translate(0,0); }
  100% { opacity:0; -webkit-transform:translate(var(--drift-x),-60px); transform:translate(var(--drift-x),-60px); }
}
.emoji-particle.emoji-burst {
  -webkit-animation: emojiBurst 0.8s ease-out forwards;
  animation: emojiBurst 0.8s ease-out forwards;
}
@-webkit-keyframes emojiBurst {
  0% { opacity:1; -webkit-transform:translate(0,0) scale(1); transform:translate(0,0) scale(1); }
  100% { opacity:0; -webkit-transform:translate(var(--burst-x),var(--burst-y)) scale(0.5); transform:translate(var(--burst-x),var(--burst-y)) scale(0.5); }
}
@keyframes emojiBurst {
  0% { opacity:1; -webkit-transform:translate(0,0) scale(1); transform:translate(0,0) scale(1); }
  100% { opacity:0; -webkit-transform:translate(var(--burst-x),var(--burst-y)) scale(0.5); transform:translate(var(--burst-x),var(--burst-y)) scale(0.5); }
}

/* ── Links in messages ─────────────────────────────────────────────────── */
.msg-link {
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  color:var(--accent);
  text-decoration:none;
  vertical-align:middle;
  width:1.1em; height:1.1em;
  margin:0 2px;
  -webkit-transition:opacity 0.15s; -o-transition:opacity 0.15s; transition:opacity 0.15s;
}
.msg-link:hover {
  opacity:0.7;
}
.msg-link svg {
  width:1em; height:1em;
}

/* ── Link preview cards ───────────────────────────────────────────────── */
.link-previews { margin-top:4px; }
.link-preview-card {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  background:var(--bg-input);
  border:1px solid var(--border);
  border-left:3px solid var(--accent);
  border-radius:2px;
  padding:6px 8px;
  margin-top:4px;
  max-width:360px;
  cursor:pointer;
  text-decoration:none;
  color:var(--text);
  -webkit-transition:background 0.15s;
  -o-transition:background 0.15s;
  transition:background 0.15s;
  overflow:hidden;
}
.link-preview-card:hover { background:var(--bg-hover); }
.link-preview-site {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  margin-bottom:2px;
}
.link-preview-favicon {
  width:14px; height:14px; border-radius:2px;
  margin-right:5px; -ms-flex-negative:0; flex-shrink:0;
}
.link-preview-sitename {
  font-size:9px; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.link-preview-title {
  font-size:11px; font-weight:600; line-height:1.3;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.link-preview-url {
  font-size:10px; color:var(--text-muted); line-height:1.3;
  margin-top:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.link-preview-desc {
  font-size:10px; color:var(--text-muted); line-height:1.4;
  margin-top:2px;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.link-preview-img {
  width:100%; max-height:140px;
  -o-object-fit:cover; object-fit:cover;
  border-radius:2px;
  margin-top:4px;
}

/* ── YouTube embed ────────────────────────────────────────────────────── */
.yt-embed {
  position:relative;
  width:480px; max-width:100%;
  padding-top:0;
  margin-top:4px;
  border-radius:2px;
  overflow:hidden;
}
.yt-embed:before {
  content:"";
  display:block;
  padding-top:56.25%;
}
.yt-iframe {
  position:absolute;
  top:0; left:0;
  width:100%; height:100%;
  border:none;
  display:block;
}

/* ── Spotify embed ───────────────────────────────────────────────────── */
.spotify-embed {
  position:relative;
  width:480px; max-width:100%;
  height:352px;
  margin-top:4px;
  border-radius:12px;
  overflow:hidden;
}
.spotify-iframe {
  position:absolute;
  top:0; left:0;
  width:100%; height:100%;
  border:none;
  display:block;
  border-radius:12px;
}

/* ── Ad embed ────────────────────────────────────────────────────────── */
.ad-embed {
  margin-top:4px;
}
.ad-iframe {
  border:none;
  display:block;
}
.ad-tag-toggle-row {
  margin-top:3px;
}
.ad-tag-toggle {
  background:none;
  border:1px solid var(--border);
  border-radius:2px;
  color:var(--text-muted);
  font-size:9px;
  padding:2px 8px;
  cursor:pointer;
  -webkit-transition:color 0.15s, border-color 0.15s;
  -o-transition:color 0.15s, border-color 0.15s;
  transition:color 0.15s, border-color 0.15s;
}
.ad-tag-toggle:hover {
  color:var(--text);
  border-color:var(--text-muted);
}
.ad-tag-code {
  margin-top:4px;
  padding:6px 8px;
  background:var(--bg-input);
  border:1px solid var(--border);
  border-radius:2px;
  font-size:10px;
  line-height:1.4;
  color:var(--text-muted);
  white-space:pre-wrap;
  word-break:break-all;
  max-width:480px;
  max-height:200px;
  overflow:auto;
}

/* ── Load older messages button ───────────────────────────────────────── */
.load-older-btn {
  display:block;
  margin:8px auto;
  padding:5px 16px;
  border:1px solid var(--border);
  border-radius:2px;
  background:transparent;
  color:var(--muted);
  font-size:10px;
  cursor:pointer;
  -ms-flex-negative:0; flex-shrink:0;
  -webkit-transition:color 0.15s, border-color 0.15s;
  -o-transition:color 0.15s, border-color 0.15s;
  transition:color 0.15s, border-color 0.15s;
}
.load-older-btn:hover {
  color:var(--fg);
  border-color:var(--fg);
}

/* ── Shared images in messages ────────────────────────────────────────── */
.msg-image {
  max-width:100%;
  max-height:200px;
  border-radius:2px;
  cursor:pointer;
  display:block;
  -webkit-transition:opacity 0.15s; -o-transition:opacity 0.15s; transition:opacity 0.15s;
}
.msg-image:hover { opacity:0.85; }

/* ── Video player ─────────────────────────────────────────────────────── */
.vid-player {
  position:relative;
  display:inline-block;
  max-width:100%;
}
.msg-video {
  max-width:100%;
  max-height:200px;
  border-radius:2px;
  display:block;
  background:#000;
}
.vid-ctrl {
  position:absolute;
  width:28px; height:28px;
  border-radius:50%;
  background:rgba(0,0,0,0.55);
  color:#fff;
  border:none; cursor:pointer;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  padding:0;
  -webkit-transition:background 0.15s; -o-transition:background 0.15s; transition:background 0.15s;
  z-index:3;
  opacity:0.85;
}
.vid-ctrl:hover { background:rgba(0,0,0,0.8); opacity:1; }
.vid-play { bottom:6px; left:6px; }
.vid-mute { bottom:6px; right:6px; }
.vid-fs   { top:6px; right:6px; }

/* ── Slideshow ────────────────────────────────────────────────────────── */
.msg-slideshow {
  position:relative;
  display:block;
  width:320px;
  max-width:100%;
  margin:4px 0;
}
.slide-media-wrap {
  width:100%;
  height:200px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  overflow:hidden;
  border-radius:2px;
  background:rgba(0,0,0,0.15);
}
.slide-arrow {
  position:absolute;
  top:50%;
  -webkit-transform:translateY(-50%); -ms-transform:translateY(-50%); transform:translateY(-50%);
  width:28px; height:28px;
  border-radius:50%;
  background:rgba(0,0,0,0.55);
  color:#fff;
  border:none; cursor:pointer;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  padding:0;
  -webkit-transition:background 0.15s; -o-transition:background 0.15s; transition:background 0.15s;
  z-index:2;
}
.slide-arrow:hover { background:rgba(0,0,0,0.75); }
.slide-prev { left:4px; }
.slide-next { right:4px; }
.slide-counter {
  position:absolute;
  bottom:6px; left:50%;
  -webkit-transform:translateX(-50%); -ms-transform:translateX(-50%); transform:translateX(-50%);
  background:rgba(0,0,0,0.55);
  color:#fff;
  font-size:11px;
  padding:1px 8px;
  border-radius:2px;
  z-index:2;
}

/* ── Image preview / drop zone ───────────────────────────────────────── */
.img-preview {
  display:none;
  margin-bottom:6px;
}
.img-preview-item {
  position:relative;
  display:inline-block;
  margin-right:6px;
  margin-bottom:4px;
}
.img-preview-item img,
.img-preview-item video {
  max-width:60px; max-height:50px;
  border-radius:2px;
  border:1px solid var(--border);
  vertical-align:middle;
}
.img-preview-item video {
  pointer-events:none;
}
.vid-cam-badge {
  position:absolute;
  top:50%; left:50%;
  -webkit-transform:translate(-50%,-50%); -ms-transform:translate(-50%,-50%); transform:translate(-50%,-50%);
  color:#fff;
  pointer-events:none;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
.img-preview-remove {
  position:absolute; top:-6px; right:-6px;
  width:16px; height:16px;
  border-radius:50%;
  background:var(--danger); color:#fff;
  border:none; cursor:pointer;
  font-size:11px; line-height:14px;
  padding:0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
}
.img-drop-error {
  color:var(--danger);
  font-size:11px;
  padding:2px 0 4px;
}
.invite-feedback {
  font-size:11px;
  margin-top:4px;
}
.invite-feedback-err { color:var(--danger); }
.invite-feedback-ok { color:var(--success); }
.msg-input-area.drag-over {
  background:rgba(88,166,255,0.08);
  outline:2px dashed var(--accent);
  outline-offset:-2px;
}

/* ── Message compose (extends .ta from shared.css) ─────────────────────── */
.msg-input-area {
  padding:8px 12px;
  border-top:1px solid var(--border);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -ms-flex-wrap:wrap; flex-wrap:wrap;
  min-width:0;
  -ms-flex-negative:0; flex-shrink:0;
  -webkit-box-align:end; -ms-flex-align:end; align-items:flex-end;
  position:relative;
  z-index:10;
}
.msg-input-area .img-preview,
.msg-input-area .img-drop-error { width:100%; }
.compose-wrap {
  position:relative;
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  min-width:0;
}
.msg-compose {
  width:100%;
  resize:none; min-height:32px; max-height:120px;
  overflow-y:auto;
  min-width:0;
  border-radius:2px;
  caret-color:var(--accent);
  padding-right:56px;
}
.compose-icons {
  position:absolute;
  right:6px; bottom:5px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.compose-icons > * + * { margin-left:2px; }
.compose-icon-btn {
  width:26px; height:26px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  background:transparent; border:none; border-radius:2px;
  cursor:pointer; color:var(--text-muted); padding:0;
}
.compose-icon-btn:hover { color:var(--text); }
.send-arrow { color:var(--accent); }
.send-arrow:hover { color:#6db3ff; }
.emoji-picker-wrap { position:relative; z-index:201; }
.emoji-flyout {
  display:none; position:absolute; bottom:calc(100% + 6px); right:0;
  background:var(--bg); border:1px solid var(--border); border-radius:2px;
  padding:4px; z-index:200; box-shadow:0 2px 8px rgba(0,0,0,.4);
}
.emoji-flyout.open { display:block; }
.emoji-flyout .icon-grid {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -ms-flex-wrap:nowrap; flex-wrap:nowrap;
}
.emoji-opt {
  font-size:20px; width:32px; height:32px;
}
.emoji-opt:hover { background:var(--bg-hover); }
@media (max-width:600px) {
  .inp, .ta, select, input, textarea, .msg-compose {
    font-size:16px !important;
  }
  #members-btn {
    font-size:0; padding:4px 6px;
  }
  #members-btn svg {
    margin-right:0;
  }
  .overlay.open {
    -webkit-box-align:start; -ms-flex-align:start; align-items:flex-start;
    padding-top:60px;
  }
}

/* ── Inline thread ─────────────────────────────────────────────────────── */
.inline-thread {
  display:none;
  margin-top:6px;
  margin-left:13px;
  background:var(--bg-input);
  border-left:2px solid var(--border);
  border-bottom:1px solid var(--border);
  border-right:1px solid var(--border);
  -webkit-border-radius:0 0 4px 4px; border-radius:0 0 4px 4px;
  padding:6px 10px 6px 10px;
}
.inline-thread.open {
  display:block;
}
.inline-thread-replies {
  max-height:300px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.inline-thread-input {
  padding-top:6px;
  margin-top:4px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -ms-flex-wrap:wrap; flex-wrap:wrap;
  -webkit-box-align:end; -ms-flex-align:end; align-items:flex-end;
}
.inline-thread-input .compose-wrap {
  position:relative;
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  min-width:0;
  overflow:visible;
}
.inline-thread-input .msg-compose {
  width:100%;
  resize:none; min-height:28px; max-height:80px;
  overflow-y:auto;
  min-width:0;
  border-radius:2px;
  caret-color:var(--accent);
  padding-right:56px;
  font-size:11px;
}
.inline-thread-input .compose-icons {
  position:absolute;
  right:6px; bottom:3px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.inline-thread-input .compose-icons > * + * { margin-left:2px; }
.inline-thread-input .emoji-picker-wrap { z-index:301; }
.inline-thread-input .emoji-flyout { z-index:300; }

/* ── Header action dropdowns (uses kit adv-wrap / adv-panel) ─────────── */
.hdr-actions .btn-s {
  height:24px; line-height:14px;
  -webkit-box-sizing:border-box; box-sizing:border-box;
}
.hdr-dd.adv-wrap { position:relative; }
.hdr-panel.adv-panel {
  left:auto; right:0;
  width:240px;
  background:var(--bg-panel);
}
.hdr-list.adv-list { max-height:260px; }
.hdr-panel .adv-item {
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
}
.hdr-panel .adv-item + .adv-item { border-top:1px solid var(--border-light); }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty-state {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  color:var(--text-muted); font-size:11px;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:var(--bg-hover); }

/* ── Light mode scrollbar ──────────────────────────────────────────────── */
body.light-mode ::-webkit-scrollbar-thumb,
html.light-preload body ::-webkit-scrollbar-thumb {
  background:#b0b0b0;
}
body.light-mode ::-webkit-scrollbar-thumb:hover,
html.light-preload body ::-webkit-scrollbar-thumb:hover {
  background:#999999;
}

/* ── Light mode overrides for hardcoded colors ────────────────────────── */
body.light-mode .emoji-flyout,
html.light-preload body .emoji-flyout {
  box-shadow:0 2px 8px rgba(0,0,0,.15);
}
body.light-mode .adv-panel,
body.light-mode .hdr-panel.adv-panel,
html.light-preload body .adv-panel,
html.light-preload body .hdr-panel.adv-panel {
  box-shadow:0 4px 12px rgba(0,0,0,.12);
}
body.light-mode .vid-cam-badge,
html.light-preload body .vid-cam-badge {
  filter:drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
body.light-mode .slide-media-wrap,
html.light-preload body .slide-media-wrap {
  background:rgba(0,0,0,0.06);
}
body.light-mode .msg-input-area.drag-over,
html.light-preload body .msg-input-area.drag-over {
  background:rgba(43,125,233,0.06);
}
.mod-toggle-row {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  margin-bottom:6px;
}
.mod-toggle-row > * + * { margin-left:6px; }
.mod-toggle {
  background:none;
  border:1px solid var(--border);
  border-radius:2px;
  color:var(--text-muted);
  font-size:9px;
  padding:2px 8px;
  cursor:pointer;
  -webkit-transition:color 0.15s, border-color 0.15s, background 0.15s;
  -o-transition:color 0.15s, border-color 0.15s, background 0.15s;
  transition:color 0.15s, border-color 0.15s, background 0.15s;
}
.mod-toggle:hover {
  color:var(--text);
  border-color:var(--text-muted);
}
.mod-toggle.off {
  color:var(--danger);
  border-color:var(--danger);
}
.msg.mod-hidden {
  opacity:0.35;
}
.profile-modal { width:220px; }
.profile-avatar-section {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.profile-avatar-section > * + * { margin-left:8px; }
.profile-avatar-preview {
  width:36px; height:36px; min-width:36px; border-radius:50%;
  background:var(--bg-input); color:var(--text-muted);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:14px; font-weight:600;
  overflow:hidden;
}
.profile-avatar-preview img {
  width:100%; height:100%; object-fit:cover;
}
.profile-modal .lbl {
  margin-top:4px;
}
.profile-tagline-inp {
  resize:none; line-height:1.4;
}
.profile-error {
  color:var(--danger); font-size:11px; min-height:16px; margin-top:4px;
}
.profile-card {
  position:fixed; z-index:2000;
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:4px;
  -webkit-box-shadow:0 4px 16px rgba(0,0,0,0.3);
  box-shadow:0 4px 16px rgba(0,0,0,0.3);
  padding:8px; min-width:180px; max-width:220px;
}
.profile-card-inner {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -ms-flex-direction:column; flex-direction:column;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.profile-card-avatar {
  width:36px; height:36px; min-width:36px; border-radius:50%;
  background:var(--bg-input); color:var(--text-muted);
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:14px; font-weight:600; margin-bottom:6px;
  overflow:hidden;
}
.profile-card-avatar img {
  width:100%; height:100%; object-fit:cover;
}
.profile-card-info {
  text-align:center; margin-bottom:8px; width:100%;
}
.profile-card-name {
  font-size:11px; font-weight:600; color:var(--text);
}
.profile-card-role {
  font-size:10px; color:var(--accent); margin-top:2px;
}
.profile-card-tagline {
  font-size:10px; color:var(--text-muted); margin-top:4px;
  line-height:1.3; word-break:break-word;
}
.profile-card-dm-btn {
  width:100%; font-size:10px; padding:3px 0;
}
.msg-avatar, .msg-avatar-placeholder { cursor:pointer; }
.msg-author { cursor:pointer; }
.admin-custom-role-wrap {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  margin-top:2px;
}
.admin-custom-role-input {
  font-size:10px; padding:2px 4px; width:90px;
  background:var(--bg-input); border:1px solid var(--border);
  color:var(--text); border-radius:2px; margin-right:4px;
}
.admin-custom-role-save {
  font-size:9px; padding:2px 6px; cursor:pointer;
  background:var(--accent); color:#fff; border:none; border-radius:2px;
}

.dash-overview {
  display:grid; grid-template-columns:repeat(4, 1fr);
  column-gap:8px; row-gap:8px; margin-bottom:12px;
}
.dash-card {
  background:var(--bg-input); border:1px solid var(--border);
  border-radius:2px; padding:8px 10px; text-align:center;
}
.dash-card-val {
  font-size:18px; font-weight:700; color:var(--text);
  line-height:1.2;
}
.dash-card-lbl {
  font-size:9px; color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.04em; margin-top:2px;
}
.dash-section { margin-bottom:12px; }
.dash-section-hdr {
  font-size:10px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px;
}
.dash-chart { min-height:80px; overflow:hidden; }
.dash-row {
  display:-webkit-box; display:-ms-flexbox; display:flex;
}
.dash-row > .dash-col { -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0; }
.dash-row > .dash-col + .dash-col { margin-left:10px; }
.dash-accordion { margin-top:8px; }
.dash-accord-item {
  border:1px solid var(--border); border-radius:2px; margin-bottom:6px;
  background:var(--bg-card);
}
.dash-accord-btn {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:justify; -ms-flex-pack:justify; justify-content:space-between;
  width:100%; padding:6px 8px; border:none; background:none; cursor:pointer;
  font-size:10px; font-weight:600; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em; text-align:left;
}
.dash-accord-btn:hover { color:var(--text); }
.dash-accord-chevron {
  color:inherit;
  -webkit-transition:-webkit-transform .2s ease;
  -o-transition:transform .2s ease;
  transition:transform .2s ease, -webkit-transform .2s ease;
}
.dash-accord-item.open .dash-accord-chevron {
  -webkit-transform:rotate(180deg);
  -ms-transform:rotate(180deg);
  transform:rotate(180deg);
}
.dash-accord-body { padding:0 8px 8px; }
.dash-rankings-row {
  display:-webkit-box; display:-ms-flexbox; display:flex;
}
.dash-rankings-col {
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0;
}
.dash-rankings-col + .dash-rankings-col { margin-left:10px; }
.dash-storage-bar-wrap {
  background:var(--bg-input); border:1px solid var(--border);
  border-radius:2px; height:14px; position:relative;
  overflow:hidden; margin-bottom:6px;
}
.dash-storage-bar-fill {
  position:absolute; top:0; left:0; bottom:0;
  background:var(--accent); border-radius:2px;
  -webkit-transition:width .3s ease; -o-transition:width .3s ease; transition:width .3s ease;
}
.dash-storage-txt {
  font-size:10px; color:var(--text-muted); margin-bottom:4px;
}
.dash-tbl {
  width:100%; border-collapse:collapse; font-size:10px;
}
.dash-tbl th {
  text-align:left; font-size:9px; font-weight:600;
  color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.04em; padding:2px 6px 4px 0;
  border-bottom:1px solid var(--border);
}
.dash-tbl td {
  padding:3px 6px 3px 0; border-bottom:1px solid var(--border-light);
  color:var(--text);
}
.dash-tbl td:last-child, .dash-tbl th:last-child { text-align:right; }
@media (max-width:520px) {
  .dash-overview { grid-template-columns:repeat(2, 1fr); }
  .dash-row {
    -webkit-box-orient:vertical; -webkit-box-direction:normal;
    -ms-flex-direction:column; flex-direction:column;
  }
  .dash-row > .dash-col + .dash-col { margin-left:0; margin-top:10px; }
  .dash-rankings-row {
    -webkit-box-orient:vertical; -webkit-box-direction:normal;
    -ms-flex-direction:column; flex-direction:column;
  }
  .dash-rankings-col + .dash-rankings-col { margin-left:0; margin-top:10px; }
}

/* ── Feed ─────────────────────────────────────────────────────────────── */
.feed-area {
  -webkit-box-flex:1; -ms-flex:1; flex:1; min-width:0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-orient:vertical; -webkit-box-direction:normal;
  -ms-flex-direction:column; flex-direction:column;
  overflow:hidden;
}
.feed-list {
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  overflow-y:auto; overflow-x:hidden; padding:8px 12px;
  overscroll-behavior:contain;
}
.feed-card {
  background:var(--bg-panel); border:1px solid var(--border);
  border-radius:2px; padding:8px 10px; margin-bottom:8px;
  cursor:pointer;
  -webkit-transition:border-color .15s; -o-transition:border-color .15s; transition:border-color .15s;
}
.feed-card:hover { border-color:var(--accent); }
.feed-card-source {
  font-size:9px; color:var(--text-muted); margin-bottom:4px;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.feed-card-source > * + * { margin-left:4px; }
.feed-card-followed {
  color:var(--accent); font-weight:600;
}
.feed-card-meta {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  margin-bottom:4px;
}
.feed-card-meta > * + * { margin-left:6px; }
.feed-card-avatar {
  width:24px; height:24px; border-radius:50%;
  vertical-align:middle;
}
.feed-card-avatar-placeholder {
  width:24px; height:24px; border-radius:50%;
  background:var(--bg-input);
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  font-size:10px; font-weight:600; color:var(--text-muted);
  vertical-align:middle;
}
.feed-card-author { font-size:11px; font-weight:600; }
.feed-card-time { font-size:9px; color:var(--text-muted); }
.feed-card-text {
  font-size:11px; line-height:1.5; word-break:break-word;
  color:var(--text);
  overflow:hidden;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical;
}
.feed-card-stats {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  margin-top:4px; font-size:9px; color:var(--text-muted);
}
.feed-card-stats > * + * { margin-left:8px; }
.feed-empty {
  text-align:center; padding:40px 20px;
  color:var(--text-muted); font-size:11px;
}
.feed-empty-title {
  font-size:13px; font-weight:600; color:var(--text);
  margin-bottom:6px;
}

.feed-card-images {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -ms-flex-wrap:wrap; flex-wrap:wrap;
  margin-top:6px;
}
.feed-card-images > * + * { margin-left:4px; }
.feed-card-thumb {
  width:64px; height:64px; border-radius:2px;
  object-fit:cover; border:1px solid var(--border);
}
.feed-card-more-media {
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -webkit-box-pack:center; -ms-flex-pack:center; justify-content:center;
  width:64px; height:64px; border-radius:2px;
  background:var(--bg-input); font-size:10px; color:var(--text-muted);
}
.feed-card-previews { margin-top:6px; }
.feed-card-previews .link-preview-card {
  max-width:100%;
}
.feed-highlight {
  -webkit-animation:feedFlash 2s ease-out;
  -o-animation:feedFlash 2s ease-out;
  animation:feedFlash 2s ease-out;
}
@-webkit-keyframes feedFlash {
  0%,30% { background:rgba(99,102,241,0.2); }
  100% { background:transparent; }
}
@keyframes feedFlash {
  0%,30% { background:rgba(99,102,241,0.2); }
  100% { background:transparent; }
}

/* ── Profile card btns ────────────────────────────────────────────────── */
.profile-card-btns {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.profile-card-btns > * + * { margin-left:4px; }
.profile-card-follow-btn {
  font-size:10px; padding:3px 10px;
}
.profile-card-follow-btn.following {
  background:var(--accent); color:#fff; border-color:var(--accent);
}

/* ── Search ───────────────────────────────────────────────────────────── */
.search-bar {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  padding:6px 12px;
  border-bottom:1px solid var(--border);
  background:var(--bg-panel);
}
.search-bar > * + * { margin-left:8px; }
.search-input {
  -webkit-box-flex:1; -ms-flex:1; flex:1;
  min-width:0; font-size:11px; padding:4px 8px;
}
.search-scope-toggle {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -ms-flex-negative:0; flex-shrink:0;
  border:1px solid var(--border); border-radius:2px;
  overflow:hidden;
}
.search-scope-btn {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  font-size:10px; padding:3px 8px; white-space:nowrap;
}
.search-scope-btn:hover { color:var(--text); }
.search-scope-btn.active {
  background:var(--accent); color:#fff;
}
.search-close-btn {
  background:none; border:none; color:var(--text-muted); cursor:pointer;
  padding:2px; border-radius:2px; -ms-flex-negative:0; flex-shrink:0;
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
}
.search-close-btn:hover { color:var(--text); background:var(--bg-hover); }
.search-results {
  padding:8px 12px;
}
.search-results-hdr {
  font-size:10px; color:var(--text-muted); margin-bottom:6px;
}
.search-result-card {
  padding:6px 8px; border-radius:2px; cursor:pointer;
  border:1px solid var(--border); margin-bottom:4px;
}
.search-result-card:hover { background:var(--bg-hover); border-color:var(--text-muted); }
.search-result-meta {
  display:-webkit-box; display:-ms-flexbox; display:flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  -ms-flex-wrap:wrap; flex-wrap:wrap;
  margin-bottom:2px;
}
.search-result-meta > * + * { margin-left:6px; }
.search-result-author { font-size:10px; font-weight:600; color:var(--text); }
.search-result-source { font-size:9px; color:var(--text-muted); }
.search-result-time { font-size:9px; color:var(--text-muted); }
.search-result-content {
  font-size:11px; color:var(--text); line-height:1.4;
  overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
}
.search-highlight {
  background:var(--warning); color:#000; border-radius:2px;
  padding:0 1px;
}
.search-empty {
  font-size:11px; color:var(--text-muted); text-align:center; padding:20px 0;
}

/* ── Custom cursors ───────────────────────────────────────────────────── */
/* Crosshair */
body.cursor-crosshair { cursor:url('/cursors/crosshair.svg') 16 16, crosshair; }
body.cursor-crosshair a,
body.cursor-crosshair button,
body.cursor-crosshair [role="button"],
body.cursor-crosshair select,
body.cursor-crosshair label[for],
body.cursor-crosshair .sidebar-item,
body.cursor-crosshair .msg-action-icon,
body.cursor-crosshair .msg-reply-btn,
body.cursor-crosshair .msg-reply-count,
body.cursor-crosshair .emoji-chip,
body.cursor-crosshair .msg-avatar,
body.cursor-crosshair .msg-avatar-placeholder,
body.cursor-crosshair .msg-author,
body.cursor-crosshair .tog,
body.cursor-crosshair .tog-chip,
body.cursor-crosshair .btn,
body.cursor-crosshair .cursor-picker-btn,
body.cursor-crosshair [onclick],
body.cursor-crosshair summary { cursor:url('/cursors/crosshair-pointer.svg') 10 4, pointer; }
body.cursor-crosshair input[type="text"],
body.cursor-crosshair input[type="email"],
body.cursor-crosshair input[type="search"],
body.cursor-crosshair input[type="password"],
body.cursor-crosshair textarea,
body.cursor-crosshair [contenteditable="true"] { cursor:url('/cursors/crosshair-text.svg') 16 16, text; }
body.cursor-crosshair .drag-h,
body.cursor-crosshair .grad-stop { cursor:url('/cursors/crosshair-grab.svg') 17 16, grab; }

/* Dot */
body.cursor-dot { cursor:url('/cursors/dot.svg') 16 16, default; }
body.cursor-dot a,
body.cursor-dot button,
body.cursor-dot [role="button"],
body.cursor-dot select,
body.cursor-dot label[for],
body.cursor-dot .sidebar-item,
body.cursor-dot .msg-action-icon,
body.cursor-dot .msg-reply-btn,
body.cursor-dot .msg-reply-count,
body.cursor-dot .emoji-chip,
body.cursor-dot .msg-avatar,
body.cursor-dot .msg-avatar-placeholder,
body.cursor-dot .msg-author,
body.cursor-dot .tog,
body.cursor-dot .tog-chip,
body.cursor-dot .btn,
body.cursor-dot .cursor-picker-btn,
body.cursor-dot [onclick],
body.cursor-dot summary { cursor:url('/cursors/dot-pointer.svg') 10 4, pointer; }
body.cursor-dot input[type="text"],
body.cursor-dot input[type="email"],
body.cursor-dot input[type="search"],
body.cursor-dot input[type="password"],
body.cursor-dot textarea,
body.cursor-dot [contenteditable="true"] { cursor:url('/cursors/dot-text.svg') 16 16, text; }
body.cursor-dot .drag-h,
body.cursor-dot .grad-stop { cursor:url('/cursors/dot-grab.svg') 17 16, grab; }

/* Neon */
body.cursor-neon { cursor:url('/cursors/neon.svg') 4 4, default; }
body.cursor-neon a,
body.cursor-neon button,
body.cursor-neon [role="button"],
body.cursor-neon select,
body.cursor-neon label[for],
body.cursor-neon .sidebar-item,
body.cursor-neon .msg-action-icon,
body.cursor-neon .msg-reply-btn,
body.cursor-neon .msg-reply-count,
body.cursor-neon .emoji-chip,
body.cursor-neon .msg-avatar,
body.cursor-neon .msg-avatar-placeholder,
body.cursor-neon .msg-author,
body.cursor-neon .tog,
body.cursor-neon .tog-chip,
body.cursor-neon .btn,
body.cursor-neon .cursor-picker-btn,
body.cursor-neon [onclick],
body.cursor-neon summary { cursor:url('/cursors/neon-pointer.svg') 10 4, pointer; }
body.cursor-neon input[type="text"],
body.cursor-neon input[type="email"],
body.cursor-neon input[type="search"],
body.cursor-neon input[type="password"],
body.cursor-neon textarea,
body.cursor-neon [contenteditable="true"] { cursor:url('/cursors/neon-text.svg') 16 16, text; }
body.cursor-neon .drag-h,
body.cursor-neon .grad-stop { cursor:url('/cursors/neon-grab.svg') 17 16, grab; }

/* Retro */
body.cursor-retro { cursor:url('/cursors/retro.svg') 4 2, default; }
body.cursor-retro a,
body.cursor-retro button,
body.cursor-retro [role="button"],
body.cursor-retro select,
body.cursor-retro label[for],
body.cursor-retro .sidebar-item,
body.cursor-retro .msg-action-icon,
body.cursor-retro .msg-reply-btn,
body.cursor-retro .msg-reply-count,
body.cursor-retro .emoji-chip,
body.cursor-retro .msg-avatar,
body.cursor-retro .msg-avatar-placeholder,
body.cursor-retro .msg-author,
body.cursor-retro .tog,
body.cursor-retro .tog-chip,
body.cursor-retro .btn,
body.cursor-retro .cursor-picker-btn,
body.cursor-retro [onclick],
body.cursor-retro summary { cursor:url('/cursors/retro-pointer.svg') 12 2, pointer; }
body.cursor-retro input[type="text"],
body.cursor-retro input[type="email"],
body.cursor-retro input[type="search"],
body.cursor-retro input[type="password"],
body.cursor-retro textarea,
body.cursor-retro [contenteditable="true"] { cursor:url('/cursors/retro-text.svg') 15 16, text; }
body.cursor-retro .drag-h,
body.cursor-retro .grad-stop { cursor:url('/cursors/retro-grab.svg') 14 14, grab; }

.cursor-picker-btn {
  display:-webkit-inline-box; display:-ms-inline-flexbox; display:inline-flex;
  -webkit-box-align:center; -ms-flex-align:center; align-items:center;
  background:var(--bg-input); border:1px solid var(--border); border-radius:2px;
  color:var(--text); cursor:pointer; padding:3px 8px; font-size:10px;
}
.cursor-picker-btn:hover { border-color:var(--text-muted); }
.cursor-picker-btn svg { width:14px; height:14px; margin-right:4px; -ms-flex-negative:0; flex-shrink:0; }
