/* ════════════════════════════════════════════════════════
   lahorechitchat.com — Redesigned Stylesheet (Light, Minimal)
   Drop-in replacement for css/style.css
   Linear / Notion-inspired · Inter · single coral accent
   All original class names preserved for JS compatibility.
════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Tokens ─── */
:root {
  --bg:        #FAFAF7;
  --bg2:       #F4F3EE;
  --surface:   #FFFFFF;
  --surface2:  #F4F3EE;
  --surface3:  #EDECE6;
  --hover:     #F0EFE9;
  --border:    #E8E6DE;
  --border2:   #DCDAD0;

  --text:      #0A0A0A;
  --text2:     #1F1F1D;
  --muted:     #6B6A63;
  --muted2:    #9A998F;

  --rose:      oklch(0.66 0.16 25);
  --rose2:     oklch(0.58 0.17 25);
  --rose-glow: oklch(0.92 0.04 25);
  --rose-ink:  oklch(0.45 0.14 25);
  --gold:      oklch(0.78 0.13 75);
  --cream:     #F4F3EE;

  --super:     oklch(0.78 0.13 75);
  --admin-c:   oklch(0.66 0.16 25);
  --mod-c:     oklch(0.62 0.13 240);
  --user-c:    #6B6A63;

  --danger:    oklch(0.62 0.20 25);
  --success:   oklch(0.65 0.15 155);
  --warning:   oklch(0.78 0.13 75);

  --radius:    14px;
  --shadow:    0 24px 60px rgba(20,20,15,.10), 0 2px 6px rgba(20,20,15,.05);
  --shadow-sm: 0 1px 2px rgba(20,20,15,.04);
  --shadow-rose: 0 8px 24px rgba(20,20,15,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex; flex-direction: column;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11','ss01';
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ─── Topbar ─── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 50; position: relative;
}
.topbar::after { display: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 0; position: relative;
}
.brand-logo::after {
  content: ''; position: absolute; inset: 6px;
  border-radius: 3px; background: var(--rose);
}
.brand-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600;
  color: var(--text); letter-spacing: -0.02em;
  background: none; -webkit-background-clip: initial; -webkit-text-fill-color: initial;
}
.topbar-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

.online-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--surface2); border: 1px solid transparent;
  border-radius: 99px; font-size: 12px; color: var(--muted); font-weight: 500;
}
.online-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: blink 2.4s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ─── Buttons ─── */
.tb-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.tb-btn:hover { background: var(--hover); border-color: var(--border2); }
.tb-btn.active { background: var(--text); border-color: var(--text); color: #fff; }
.tb-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer; transition: border-color .12s;
  flex-direction: row-reverse;
}
.user-chip:hover { border-color: var(--border2); }
.chip-name { font-size: 13px; font-weight: 500; max-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-badge { font-size: 9.5px; padding: 1px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-super { background: rgba(240,184,96,.12); color: oklch(0.55 0.13 75); }
.badge-admin { background: var(--rose-glow); color: var(--rose-ink); }
.badge-mod   { background: rgba(96,128,232,.10); color: var(--mod-c); }
.badge-user  { background: var(--surface2); color: var(--muted); }

.av {
  width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px; color: #fff;
  flex-shrink: 0; position: relative;
  background: linear-gradient(135deg,#FFB088,#FF6B8B);
}
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--surface);
}
.av.offline::after { background: var(--muted2); }

.ic-btn {
  background: none; border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px; border-radius: 7px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all .12s;
}
.ic-btn:hover { border-color: var(--border2); color: var(--text); background: var(--hover); }
.ic-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: transparent; }

/* ─── Layout ─── */
.main-layout { display: flex; flex: 1; overflow: hidden; position: relative; background: var(--bg); }

/* ─── Rooms sidebar ─── */
.rooms-sidebar {
  width: 240px; background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-head {
  padding: 16px 16px 8px;
  flex-shrink: 0;
}
.sidebar-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted2);
}
.room-list { overflow-y: auto; flex: 1; padding: 4px 8px; }
.room-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
  position: relative; margin-bottom: 1px;
  font-size: 13.5px; color: var(--text2);
}
.room-item:hover { background: var(--hover); }
.room-item.active { background: var(--surface2); color: var(--text); font-weight: 500; }
.room-item.active .room-item-name { color: var(--text); font-weight: 500; }
.room-icon { font-size: 13px; color: var(--muted2); width: 16px; text-align: center; flex-shrink: 0; }
.room-item.active .room-icon { color: var(--text); }
.room-item-name { font-size: 13.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.room-badge {
  min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--rose); color: #fff;
  font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.room-unread { display: none; }
.room-item.has-unread .room-unread { display: flex; }
.active-bar { display: none; }

.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.invite-btn {
  width: 100%; padding: 8px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .12s, border-color .12s;
  box-shadow: none;
}
.invite-btn:hover { background: var(--hover); border-color: var(--border2); }
.invite-btn:active { transform: scale(.99); }

/* ─── Chat area ─── */
.chat-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; min-width: 0; background: var(--surface); }
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-icon { font-size: 16px; color: var(--muted); }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text);
}
.chat-header-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.chat-header-right { display: flex; gap: 6px; }

.messages-container {
  flex: 1; overflow-y: auto;
  padding: 16px 24px;
  display: flex; flex-direction: column; gap: 2px;
  scroll-behavior: smooth;
}

/* ─── Messages ─── */
.msg {
  display: flex; gap: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-inline: -8px;
  transition: background .12s;
  animation: msgIn .2s ease-out both;
}
@keyframes msgIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
.msg:hover { background: var(--hover); }
.msg-av {
  width: 36px; height: 36px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg,#FFB088,#FF6B8B);
}
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.msg-name { font-weight: 600; font-size: 13.5px; color: var(--text); letter-spacing: -0.005em; }
.msg-time { font-size: 11px; color: var(--muted2); }
.msg-badge { font-size: 9.5px; padding: 1px 5px; border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.msg-text { font-size: 14px; line-height: 1.55; color: var(--text2); word-break: break-word; text-wrap: pretty; }
.msg-text.filtered { color: var(--muted); font-style: italic; }
.msg-actions { display: none; gap: 4px; margin-left: auto; flex-shrink: 0; }
.msg:hover .msg-actions { display: flex; }
.msg.system { justify-content: center; }
.sys-pill {
  font-size: 11.5px; color: var(--muted);
  background: var(--surface2);
  padding: 3px 12px; border-radius: 99px;
  border: none;
}

/* ─── Attachments ─── */
.att-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; margin-top: 6px; max-width: 360px;
}
.att-icon2 { font-size: 18px; flex-shrink: 0; color: var(--muted); }
.att-meta2 { flex: 1; min-width: 0; }
.att-name2 { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sz { font-size: 11px; color: var(--muted); margin-top: 1px; }
.att-ok {
  font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 4px;
  background: rgba(72,184,120,.12); color: var(--success);
}
.att-dl {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); font-size: 12px; padding: 3px 10px; cursor: pointer; transition: all .12s;
}
.att-dl:hover { border-color: var(--border2); color: var(--text); background: var(--hover); }
.att-img2 {
  max-width: 280px; max-height: 200px; border-radius: 10px;
  display: block; margin-top: 6px; cursor: zoom-in; border: 1px solid var(--border);
}

/* ─── Input ─── */
.input-area {
  padding: 12px 24px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.attach-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.a-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px 8px; font-size: 12px;
}
.a-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.input-row {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.input-row:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(10,10,10,.05);
}
.chat-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-family: inherit;
  font-size: 14px; resize: none; max-height: 120px; min-height: 22px; line-height: 1.5;
}
.chat-input::placeholder { color: var(--muted2); }
.input-tools { display: flex; gap: 2px; align-items: center; }
.i-btn {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer;
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s;
}
.i-btn:hover { background: var(--hover); color: var(--text); }
.send-btn {
  background: var(--rose);
  border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 9px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: filter .12s, transform .1s;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.send-btn:hover { filter: brightness(.96); }
.send-btn:active { transform: scale(.96); }

/* ─── Emoji ─── */
.emoji-picker {
  position: absolute; bottom: 84px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
  z-index: 300; display: none;
  flex-direction: column; gap: 8px; width: 320px;
  animation: popUp .18s ease-out;
}
.emoji-picker.open { display: flex; }
@keyframes popUp { from{opacity:0;transform:scale(.96) translateY(8px)} to{opacity:1;transform:none} }
.e-cats { display: flex; gap: 2px; overflow-x: auto; }
.e-cat-btn {
  background: none; border: none; font-size: 17px; cursor: pointer;
  padding: 5px 7px; border-radius: 6px; flex-shrink: 0;
  transition: background .12s;
}
.e-cat-btn:hover, .e-cat-btn.on { background: var(--hover); }
.e-grid { display: grid; grid-template-columns: repeat(8,1fr); gap: 2px; max-height: 180px; overflow-y: auto; }
.e-btn {
  background: none; border: none; font-size: 19px; cursor: pointer;
  padding: 4px; border-radius: 6px; transition: background .1s;
}
.e-btn:hover { background: var(--hover); }
.e-search {
  background: var(--surface2); border: 1px solid transparent;
  border-radius: 8px; padding: 7px 11px;
  color: var(--text); font-size: 13px; outline: none; width: 100%;
  font-family: inherit;
}
.e-search:focus { border-color: var(--text); background: var(--surface); }

/* ─── Overlay panels ─── */
.overlay-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,15,.32);
  backdrop-filter: blur(2px);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.overlay-backdrop.visible { opacity: 1; pointer-events: all; }
@media(min-width:769px) {
  .overlay-backdrop.visible { opacity: 0 !important; pointer-events: none !important; }
}
.side-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 380px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 210; display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  box-shadow: -16px 0 48px rgba(20,20,15,.06);
}
.side-panel.open { transform: translateX(0); }
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.panel-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text);
  flex: 1;
}
.panel-close {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface2); border: 1px solid transparent;
  color: var(--muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.panel-close:hover { border-color: var(--border); color: var(--text); }
.panel-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 18px; }

/* ─── Panel sections ─── */
.p-section { display: flex; flex-direction: column; gap: 10px; }
.p-label {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted2);
}
.p-note {
  font-size: 12.5px; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
.protected-note {
  border-color: rgba(240,184,96,.25);
  background: rgba(240,184,96,.06);
  color: oklch(0.45 0.10 75);
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--surface2);
  border-radius: 10px; border: 1px solid var(--border);
  font-size: 13px;
}
.tog {
  width: 36px; height: 20px;
  background: var(--border2); border-radius: 99px;
  cursor: pointer; position: relative; border: none;
  transition: background .2s; flex-shrink: 0;
}
.tog.on { background: var(--text); }
.tog::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: left .2s;
  box-shadow: var(--shadow-sm);
}
.tog.on::after { left: 18px; }

.f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.f-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--rose-glow);
  border: 1px solid transparent;
  border-radius: 99px; font-size: 12px;
  color: var(--rose-ink); font-weight: 500;
}
.f-tag button { background: none; border: none; color: var(--rose-ink); cursor: pointer; font-size: 14px; line-height: 1; }
.f-row { display: flex; gap: 6px; }
.f-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 11px;
  color: var(--text); font-size: 13px; outline: none; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.f-input:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(10,10,10,.05); }
.f-add {
  background: var(--text); border: none;
  border-radius: 9px; color: #fff;
  padding: 8px 14px; font-size: 13px; cursor: pointer; font-weight: 500;
  font-family: inherit;
  transition: background .12s;
}
.f-add:hover { background: var(--text2); }

.u-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface);
  border-radius: 10px; border: 1px solid var(--border);
  transition: border-color .12s, background .12s;
}
.u-row:hover { background: var(--hover); border-color: var(--border2); }
.u-info { flex: 1; min-width: 0; }
.u-name-r { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-email-r { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.u-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.u-role-badge { font-size: 9.5px; padding: 2px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.b-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--surface2);
  border-radius: 8px; font-size: 13px;
}
.unblock-btn {
  margin-left: auto; background: none;
  border: 1px solid var(--border); color: var(--danger);
  border-radius: 6px; padding: 3px 9px; font-size: 11.5px;
  cursor: pointer; transition: all .12s; font-family: inherit;
}
.unblock-btn:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.p-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 14px; border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all .12s; width: 100%;
}
.p-btn:hover { background: var(--hover); border-color: var(--border2); }
.p-btn.danger { color: var(--danger); }
.p-btn.danger:hover { border-color: var(--danger); background: rgba(232,80,96,.06); }
.p-btn.gold { color: oklch(0.55 0.13 75); }
.p-btn.gold:hover { background: rgba(240,184,96,.06); border-color: rgba(240,184,96,.4); }

.audit-item {
  padding: 9px 12px; border-radius: 8px;
  background: var(--surface2);
  border-left: 3px solid var(--border2);
  font-size: 12.5px; line-height: 1.5;
}
.audit-item.ok { border-left-color: var(--success); }
.audit-item.denied { border-left-color: var(--danger); }
.audit-item.role { border-left-color: var(--rose); }
.audit-ts { font-size: 10.5px; color: var(--muted); }

/* ─── Modals ─── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(20,20,15,.45);
  backdrop-filter: blur(3px);
  z-index: 500; display: none;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 28px;
  width: 440px; max-width: 96vw; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow);
  animation: popUp .22s ease-out;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.modal::before { display: none; }
.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--text);
}
.modal-sub { font-size: 14px; color: var(--muted); }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer;
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.modal-close:hover { background: var(--hover); color: var(--text); }

.m-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
  color: var(--text); font-family: inherit;
  font-size: 14px; outline: none; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
.m-input:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(10,10,10,.05); }
.m-input::placeholder { color: var(--muted2); }

.m-btn {
  padding: 12px;
  border-radius: 10px;
  background: var(--text);
  border: none; color: #fff;
  font-family: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer; transition: background .12s, opacity .12s;
  width: 100%;
}
.m-btn:hover { background: var(--text2); }

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted2);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.oauth-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .12s, border-color .12s;
  width: 100%; font-family: inherit;
  justify-content: center;
}
.oauth-btn:hover { background: var(--hover); border-color: var(--border2); }
.o-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.invite-link-box {
  display: flex; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; align-items: center;
}
.inv-link {
  flex: 1; font-size: 12.5px; color: var(--muted);
  font-family: ui-monospace, 'SF Mono', monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn {
  background: var(--text); border: none; color: #fff;
  padding: 6px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 500; cursor: pointer; flex-shrink: 0;
  font-family: inherit;
}
.copy-btn:hover { background: var(--text2); }

.share-row { display: flex; gap: 8px; justify-content: center; }
.shr-btn {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s, transform .12s, background .12s;
}
.shr-btn:hover { border-color: var(--border2); background: var(--hover); transform: translateY(-1px); }

/* ─── Members ─── */
.members-sidebar {
  width: 220px; background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.members-inner { overflow-y: auto; flex: 1; padding: 4px 8px; }
.member-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer; transition: background .12s;
}
.member-item:hover { background: var(--hover); }
.mem-name { font-size: 13px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text2); }

/* ─── Toast ─── */
.toast-wrap {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 900; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--text); color: #fff;
  border: 1px solid var(--text);
  border-radius: 10px; padding: 10px 18px;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
  animation: toastIn .25s ease-out;
  white-space: nowrap;
}
@keyframes toastIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
.toast.ok   { background: var(--success); border-color: var(--success); }
.toast.warn { background: var(--warning); border-color: var(--warning); color: var(--text); }
.toast.err  { background: var(--danger); border-color: var(--danger); }
.toast.info { background: var(--text); }

/* ─── Lightbox ─── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20,20,15,.92);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: 8px; object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,.1); border: none; color: #fff;
  font-size: 22px; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ─── Discover / Swipe ─── */
.disc-tab {
  flex: 1; padding: 12px; background: none; border: none;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .12s; font-family: inherit;
}
.disc-tab.active { color: var(--text); border-bottom-color: var(--text); }

.swipe-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 20px; cursor: pointer; transition: transform .12s, background .12s;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.swipe-btn:hover { transform: scale(1.05); background: var(--hover); }
.swipe-btn.pass { color: var(--muted); }
.swipe-btn.like { color: var(--rose); border-color: var(--rose); width: 64px; height: 64px; }

.swipe-card {
  position: absolute; inset: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  cursor: grab; user-select: none;
  transition: transform .15s, opacity .15s;
  box-shadow: var(--shadow-rose);
}
.swipe-card:active { cursor: grabbing; }
.swipe-card .card-photo {
  width: 100%; height: 280px; object-fit: cover;
  background: linear-gradient(135deg, #FFB088, #FF6B8B);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: #fff;
}
.swipe-card .card-info { padding: 16px 18px 18px; }
.swipe-card .card-name { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }
.swipe-card .card-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.swipe-card .card-bio  { font-size: 13.5px; color: var(--text2); margin-top: 10px; line-height: 1.5; text-wrap: pretty; }
.swipe-card .card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.swipe-card .card-tag  {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 99px; padding: 3px 10px; font-size: 11.5px; color: var(--text2);
}

.swipe-indicator {
  position: absolute; top: 24px;
  font-size: 28px; font-weight: 700;
  opacity: 0; transition: opacity .1s;
  border-radius: 8px; padding: 4px 14px;
  border: 3px solid;
  letter-spacing: 0.04em;
}
.swipe-indicator.like { left: 20px; color: var(--rose); border-color: var(--rose); }
.swipe-indicator.pass { right: 20px; color: var(--muted); border-color: var(--muted); }

/* ─── Profile setup ─── */
.gender-btn {
  flex: 1; padding: 11px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 13px; cursor: pointer;
  transition: all .12s; font-family: inherit;
}
.gender-btn:hover { background: var(--hover); border-color: var(--border2); }
.gender-btn.active {
  border-color: var(--text); background: var(--surface);
  color: var(--text); font-weight: 500;
  box-shadow: 0 0 0 3px rgba(10,10,10,.05);
}

.int-btn {
  padding: 6px 12px;
  border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text2);
  font-size: 12.5px; cursor: pointer; transition: all .12s;
  font-family: inherit;
}
.int-btn:hover { background: var(--hover); border-color: var(--border2); }
.int-btn.active {
  border-color: var(--text); background: var(--text); color: #fff;
}

/* ─── Match cards ─── */
.match-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 8px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.match-card:hover { background: var(--hover); border-color: var(--border2); }

@keyframes matchPop {
  from { transform: scale(.5); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* ─── Coin balance & wallet ─── */
#coinBalance {
  background: var(--rose) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 99px;
}
#coinBalance:hover { filter: brightness(.96); }

.scal-day {
  flex: 1; min-width: 32px; height: 44px;
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface2); color: var(--muted);
  gap: 2px;
}
.scal-day.done {
  background: var(--text); border-color: var(--text); color: #fff;
}
.scal-day.today {
  background: var(--surface); border: 1.5px solid var(--text); color: var(--text);
}

/* ─── Onboarding ─── */
.onb-step {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--surface2); border: none;
  transition: all .2s;
}
.onb-step.active { background: var(--text); }
.onb-step.done   { background: var(--text); }

/* ─── Mobile responsive ─── */
@media(max-width:780px) {
  .brand-name { font-size: 14px; }
  .topbar { padding: 0 12px; }
  .topbar-center { display: none; }
  .online-pill { padding: 4px 8px; font-size: 11px; }
  .chip-name { max-width: 70px; }

  .rooms-sidebar { width: 56px; flex-shrink: 0; }
  .sidebar-head { padding: 10px 6px; }
  .sidebar-head .sidebar-label { display: none; }
  .room-list { padding: 4px; }
  .room-item { justify-content: center; padding: 10px 6px; gap: 0; border-radius: 8px; }
  .room-item-name, .room-badge { display: none; }
  .room-icon { font-size: 18px; }
  .room-item.has-unread .room-unread {
    display: flex !important;
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; font-size: 9px;
  }
  .sidebar-bottom { padding: 8px 6px; }
  .invite-btn { font-size: 0; padding: 10px; border-radius: 9px; }
  .invite-btn::before { content: '+'; font-size: 18px; color: var(--muted); }

  .members-sidebar { display: none; }
  .side-panel { width: min(360px,96vw); }

  .messages-container { padding: 12px; }
  .msg-av { width: 32px; height: 32px; font-size: 12px; }

  .input-area { padding: 10px 12px; }
  .chat-input { font-size: 14px; }

  .toast { font-size: 12px; padding: 8px 14px; white-space: normal; text-align: center; }
  .toast-wrap { bottom: 70px; max-width: 90vw; }
}

@media(max-width:500px) {
  .topbar { height: 50px; padding: 0 10px; gap: 4px; }
  .brand-logo { width: 24px; height: 24px; flex-shrink: 0; }
  .brand-logo::after { inset: 5px; }
  .brand-name { font-size: 13px; }
  .tb-btn { padding: 5px 8px; font-size: 11.5px; height: 30px; }
  .chip-badge { display: none; }
  .chip-name { max-width: 60px; font-size: 12px; }
  .av { width: 26px; height: 26px; font-size: 11px; }

  #discoverBtn, #dmInboxBtn { font-size: 14px; padding: 5px 7px; }
  #signOutBtn { display: none !important; }
  #signInBtn  { font-size: 11.5px; padding: 5px 8px; }
  .online-pill { display: none; }

  .rooms-sidebar { display: none; }
  .chat-area { width: 100%; }

  .chat-header { padding: 10px 14px; min-height: 56px; }
  .chat-header-name { font-size: 14px; }
  .chat-header-desc { display: none; }

  .messages-container { padding: 10px 12px; gap: 2px; }
  .msg { padding: 4px 6px; }
  .msg-av { width: 30px; height: 30px; font-size: 12px; }
  .msg-name { font-size: 13px; }
  .msg-text { font-size: 13.5px; }
  .msg-time { font-size: 10.5px; }
  .msg-badge { font-size: 9px; padding: 1px 4px; }

  .input-area { padding: 8px 10px 12px; }
  .input-row { padding: 8px 10px; border-radius: 12px; gap: 6px; }
  .chat-input { font-size: 15px; min-height: 24px; }
  .i-btn { font-size: 18px; }
  .send-btn { width: 38px; height: 38px; font-size: 15px; border-radius: 10px; }

  .emoji-picker { right: 10px; left: 10px; width: auto; bottom: 70px; }
  .e-grid { grid-template-columns: repeat(7,1fr); }

  .side-panel { width: 100vw; }

  .modal { padding: 24px 18px; border-radius: 14px; max-height: 95vh; }
  .modal-title { font-size: 18px; }

  .toast-wrap { bottom: 60px; left: 10px; right: 10px; transform: none; }
  .toast { justify-content: center; font-size: 12px; }

  #discoverBtn, #dmInboxBtn, #signOutBtn { display: none !important; }
}

/* ─── Mobile bottom nav ─── */
@media(max-width:500px) {
  .main-layout { padding-bottom: 56px; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 400;
    align-items: stretch;
  }

  .mobile-nav-btn {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; background: none; border: none;
    color: var(--muted2);
    font-size: 10px; font-family: inherit;
    cursor: pointer; transition: color .12s;
    position: relative;
  }
  .mobile-nav-btn:hover, .mobile-nav-btn.active { color: var(--text); }
  .mobile-nav-btn .nav-icon { font-size: 19px; line-height: 1; }
  .mobile-nav-btn .nav-label { font-size: 10px; font-weight: 500; }

  .mobile-nav-btn .nav-badge {
    position: absolute; top: 6px; right: calc(50% - 14px);
    min-width: 16px; height: 16px;
    border-radius: 99px; background: var(--rose);
    color: #fff; font-size: 9px; font-weight: 700;
    display: none; align-items: center; justify-content: center;
    padding: 0 4px;
  }
  .mobile-nav-btn.has-unread .nav-badge { display: flex; }
}

@media(min-width:501px) {
  .mobile-nav { display: none; }
}

/* ─── Mobile room drawer ─── */
.room-drawer { position: fixed; inset: 0; z-index: 600; display: none; }
.room-drawer.open { display: block; }
.room-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,15,.45);
  backdrop-filter: blur(2px);
}
.room-drawer-panel {
  position: absolute;
  bottom: 56px; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 16px;
  max-height: 70vh; overflow-y: auto;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp { from{transform:translateY(100%)} to{transform:none} }
.room-drawer-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 14px; text-align: center; color: var(--text);
}
.room-drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.room-drawer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.room-drawer-item:hover, .room-drawer-item.active {
  background: var(--hover); border-color: var(--border2);
}
.room-drawer-item .room-icon { font-size: 18px; }
.room-drawer-item .room-name { font-size: 13px; font-weight: 500; }

/* ─── Touch device tweaks ─── */
@media(hover:none) {
  .room-item { min-height: 44px; }
  .i-btn { min-width: 36px; min-height: 36px; }
  .ic-btn { min-width: 32px; min-height: 32px; }
  .tb-btn { min-height: 36px; }
  .send-btn { min-width: 44px; min-height: 44px; }
  .m-btn { min-height: 48px; font-size: 15px; }
  .oauth-btn { min-height: 48px; }
  .m-input { font-size: 16px; }
}

/* ─── Safe area for notched phones ─── */
@supports(padding-bottom: env(safe-area-inset-bottom)) {
  .input-area { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mobile-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(56px + env(safe-area-inset-bottom)); }
}

/* ─── SuperLike button ─── */
.swipe-btn.superlike {
  width: 50px; height: 50px;
  border: 1.5px solid #4a90e2;
  color: #4a90e2;
  background: var(--surface);
  position: relative;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s;
}
.swipe-btn.superlike:hover {
  background: #4a90e2;
  color: #fff;
  transform: scale(1.05);
}


/* ─── Blog link in topbar ─── */
.tb-btn.tb-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ─── Better responsive shrinking ─── */
@media(max-width: 900px) {
  /* Hide blog link on tablet — accessible via mobile nav */
  #blogLink { display: none !important; }
  /* Tighter brand name */
  .brand-name { font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media(max-width: 780px) {
  /* Hide audit too on smaller tablet */
  #auditBtn { display: none !important; }
  /* Make brand name short to ensure topbar doesn't overflow */
  .brand-name { font-size: 13px; max-width: 100px; }
}

@media(max-width: 500px) {
  /* Brand name even shorter on phone */
  .brand-name { font-size: 12px; max-width: 90px; }
  /* Online pill very compact */
  .online-pill { padding: 3px 6px; font-size: 10px; }
  /* User chip ultra-compact */
  .user-chip { padding: 2px 4px 2px 6px; gap: 3px; }
  .chip-name { max-width: 50px; font-size: 11px; }
  .chip-badge { display: none; }
}

@media(max-width: 380px) {
  /* Truly tiny phone */
  .brand-name { display: none; }
  .topbar { padding: 0 8px; gap: 4px; }
  .chip-name { max-width: 40px; }
}

/* ─── Mobile blog button in bottom nav ─── */
@media(max-width: 500px) {
  #mobileBlogBtn { display: flex !important; }
}
