/* ==========================================================================
   Sohbet — arayüz stilleri
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #000000;
  --bg-2: #0a0a0a;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.085);
  --panel-solid: #111111;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #a3a3a3;
  --muted-2: #6f6f6f;
  --accent: #ffffff;
  --accent-2: #d4d4d4;
  --accent-3: #ffffff;
  --danger: #d4d4d4;
  --grad: linear-gradient(135deg, #ffffff 0%, #d4d4d4 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  --radius: 20px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 680px at 50% -20%, rgba(255, 255, 255, 0.055), transparent 65%),
    radial-gradient(760px 520px at 100% 105%, rgba(255, 255, 255, 0.03), transparent 65%);
  z-index: 0;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea { outline: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

[hidden] { display: none !important; }

::selection { background: rgba(255, 255, 255, 0.35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

.muted { color: var(--muted); }
.grad-text {
  background: linear-gradient(100deg, #ffffff 0%, #bdbdbd 60%, #8a8a8a 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ------------------------------- Marka ---------------------------------- */
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--grad);
  color: #000000;
  box-shadow: 0 12px 30px -14px rgba(255, 255, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.logo-mark svg { width: 24px; height: 24px; }
.logo-mark.small { width: 38px; height: 38px; border-radius: 12px; }
.logo-mark.small svg { width: 20px; height: 20px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ------------------------------- Butonlar -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn.primary {
  background: var(--grad);
  color: #000000;
  box-shadow: 0 10px 28px -16px rgba(255, 255, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn.primary:hover { background: #ffffff; box-shadow: 0 14px 32px -16px rgba(255, 255, 255, 0.55), inset 0 1px 0 #ffffff; }
.btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn.ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line-strong); }
.btn.danger {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.btn.danger:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.38); }
.btn.small { height: 38px; padding: 0 15px; font-size: 13.5px; border-radius: 11px; }
.btn.block { width: 100%; }

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn.accent {
  background: var(--grad);
  border-color: transparent;
  color: #000000;
  box-shadow: 0 10px 24px -14px rgba(255, 255, 255, 0.35);
}
.icon-btn.accent:hover { filter: brightness(1.08); }

/* ------------------------------ Giriş ekranı ----------------------------- */
.auth {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  min-height: 100dvh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 64px);
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-copy { position: relative; z-index: 1; max-width: 560px; padding: 40px 0; }
.auth-copy h1 {
  margin: 0 0 22px;
  font-size: clamp(36px, 4.8vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 750;
}
.auth-copy p {
  margin: 0 0 30px;
  max-width: 430px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}
.auth-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  color: #d4d4d4;
}
.auth-features .dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--accent-3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}
.auth-foot {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  color: var(--muted-2);
  letter-spacing: 0.01em;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
}
.glow-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 65%);
  top: -120px; right: -80px;
  animation: drift 14s ease-in-out infinite alternate;
}
.glow-2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 65%);
  bottom: -140px; left: 10%;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-30px, 40px, 0) scale(1.12); }
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent);
}
.auth-card {
  width: min(420px, 100%);
  padding: clamp(24px, 3.4vw, 36px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #101010, #080808);
  box-shadow: var(--shadow);
  animation: cardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.auth-card-head h2 {
  margin: 0 0 7px;
  font-size: 25px;
  letter-spacing: -0.03em;
}
.auth-card-head p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}
.tab {
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 6px 16px -8px rgba(0, 0, 0, 0.8);
}

.auth-form { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: #c7c7c7; letter-spacing: 0.01em; }
.field small { color: var(--muted-2); font-size: 11.5px; }
.field input, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field textarea:focus {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.13);
}
.field.compact { gap: 6px; margin-bottom: 16px; }
.field.compact input, .field.compact textarea { min-height: 42px; font-size: 13.5px; }

.hint {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted-2);
  text-align: center;
}
.hint code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: #e5e5e5;
  font-size: 12px;
}

/* ------------------------------- Uygulama -------------------------------- */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr);
  gap: 14px;
  height: 100dvh;
  padding: 14px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0d0d0d, #070707);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
}
.avatar-button {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  transition: transform 0.16s ease;
}
.avatar-button:hover { transform: scale(1.06); }

.side-actions {
  display: flex;
  gap: 9px;
  padding: 0 18px 14px;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search:focus-within {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}
.search svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; }
.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.conv-list-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 10px;
}
.conv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }

.conv {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: none;
  text-align: left;
  transition: background 0.16s, border-color 0.16s;
}
.conv:hover { background: var(--panel); }
.conv.active {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}
.conv-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.conv-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-time { flex: none; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.conv-bottom { display: flex; align-items: center; gap: 8px; }
.conv-snippet {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-snippet.typing { color: var(--accent-3); }
.unread {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--grad);
  color: #000000;
  font-size: 11px;
  font-weight: 700;
}
.conv.new-msg { animation: convPulse 0.5s ease; }
@keyframes convPulse {
  0% { background: rgba(255, 255, 255, 0.28); }
  100% { background: transparent; }
}

.side-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.side-empty p { margin: 0; }
.empty-badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--grad-soft);
  color: #e5e5e5;
}
.empty-badge svg { width: 24px; height: 24px; }
.empty-badge.large {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.empty-badge.large svg { width: 34px; height: 34px; }

.side-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #050505;
  font-size: 11.5px;
  color: var(--muted-2);
}
.conn-status { display: inline-flex; align-items: center; gap: 6px; }
.conn-dot {
  width: 7px; height: 7px;
  border-radius: 99px;
  background: #8a8a8a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}
.conn-status.online .conn-dot { background: #ffffff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14); }
.conn-status.offline .conn-dot { background: #555555; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06); }
.side-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -------------------------------- Sohbet --------------------------------- */
.chat {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(900px 520px at 72% -12%, rgba(255, 255, 255, 0.035), transparent 62%),
    #080808;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-empty {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
}
.chat-empty h2 { margin: 6px 0 0; font-size: 23px; letter-spacing: -0.03em; }
.chat-empty p { margin: 0 0 8px; max-width: 330px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.chat-empty-glow {
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 65%);
  filter: blur(30px);
  pointer-events: none;
}

.chat-active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
}
.chat-avatar { flex: none; }
.chat-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chat-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sub { margin: 0; font-size: 12px; color: var(--muted); }
.chat-sub.online { color: var(--accent-3); }
.chat-head-actions { display: flex; align-items: center; gap: 8px; }
.status-pill {
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
}
.back { display: none; }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px clamp(16px, 3.4vw, 34px) 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
}

.load-more {
  align-self: center;
  margin-bottom: 14px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  transition: background 0.18s, color 0.18s;
}
.load-more:hover { background: var(--panel-2); color: var(--text); }

.date-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 12px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.date-divider::before, .date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-top: 10px;
  animation: msgIn 0.22s ease both;
}
.msg-row.grouped { margin-top: 3px; }
.msg-row.mine { flex-direction: row-reverse; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.msg-avatar { flex: none; margin-bottom: 17px; }
.msg-avatar.spacer { width: 32px; }
.msg-content { display: grid; gap: 4px; max-width: min(72%, 620px); min-width: 0; }
.msg-row.mine .msg-content { justify-items: end; }
.msg-sender {
  padding-left: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #d4d4d4;
}
.bubble {
  position: relative;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 16px 5px;
  background: #141414;
  font-size: 14.2px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px -16px rgba(0, 0, 0, 0.9);
}
.msg-row.grouped:not(.mine) .bubble { border-top-left-radius: 8px; }
.msg-row.mine .bubble {
  border-color: transparent;
  border-radius: 16px 16px 5px 16px;
  background: var(--grad);
  color: #000000;
  box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.9);
}
.msg-row.mine.grouped .bubble { border-top-right-radius: 8px; }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: 0.92; }
.bubble a:hover { opacity: 1; }
.msg-meta {
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.msg-row.grouped .msg-meta { display: none; }

.msg-empty {
  margin: auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}
.msg-empty strong { color: var(--text); font-size: 15px; }

/* ------------------------------ Yazma alanı ------------------------------ */
.composer-wrap {
  position: relative;
  padding: 6px clamp(12px, 2.6vw, 24px) 14px;
  background: linear-gradient(180deg, transparent, #080808 45%);
}
.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0d0d0d;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.composer:focus-within {
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}
.composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 168px;
  padding: 10px 6px;
  border: 0;
  background: none;
  resize: none;
  font-size: 14.5px;
  line-height: 1.5;
}
.composer textarea::placeholder { color: var(--muted-2); }
.send-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--grad);
  color: #000000;
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.9);
  transition: background 0.18s, transform 0.12s, opacity 0.18s;
}
.send-btn svg { width: 19px; height: 19px; }
.send-btn:hover { background: #e5e5e5; }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.composer-hint {
  margin: 6px 6px 0;
  font-size: 10.5px;
  color: var(--muted-2);
  text-align: right;
}

.typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 7px;
  font-size: 12px;
  color: #d4d4d4;
}
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.emoji-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 6px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  width: 316px;
  max-height: 208px;
  overflow-y: auto;
  padding: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #0d0d0d;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
  animation: popIn 0.14s ease;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.emoji-pop button {
  display: grid;
  place-items: center;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: none;
  font-size: 19px;
  transition: background 0.12s, transform 0.12s;
}
.emoji-pop button:hover { background: var(--panel-2); transform: scale(1.15); }

/* -------------------------------- Avatarlar ------------------------------ */
.avatar-wrap { position: relative; flex: none; display: grid; place-items: center; }
.avatar {
  display: grid;
  place-items: center;
  width: var(--size, 44px);
  height: var(--size, 44px);
  border-radius: 34%;
  color: #fff;
  font-size: calc(var(--size, 44px) * 0.34);
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
  filter: grayscale(1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 20px -12px rgba(0, 0, 0, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.avatar.round { border-radius: 50%; }
.presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border: 2.5px solid #080808;
  border-radius: 50%;
  background: #4a4a4a;
}
.presence.on { background: var(--accent-3); box-shadow: 0 0 8px rgba(255, 255, 255, 0.6); }

/* ------------------------------- Modallar -------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(520px, 100%);
  max-height: min(680px, 88dvh);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #101010, #080808);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  animation: panelIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-panel.narrow { width: min(440px, 100%); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 14px;
}
.modal-head h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.02em; }
.modal-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.modal-panel .tabs { margin: 0 20px 14px; }
.small-tabs { height: 44px; }
.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 20px;
}
.modal-search { margin-bottom: 12px; }
.modal-empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #060606;
}
.modal-foot.between { justify-content: space-between; }
.modal-foot .muted { font-size: 12px; }

.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: none;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.user-item:hover { background: var(--panel); }
.user-item.selected { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.24); }
.user-item .user-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.user-item .user-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-item .user-handle { font-size: 11.5px; color: var(--muted); }
.user-item .check {
  flex: none;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
  transition: all 0.15s;
}
.user-item.selected .check {
  border-color: transparent;
  background: var(--grad);
  color: #000000;
}
.user-online { font-size: 11px; color: #d4d4d4; }

.profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 20px;
}
.profile-top strong { display: block; font-size: 15px; }
.profile-top span { font-size: 12px; }

.color-picker { display: flex; flex-wrap: wrap; gap: 9px; }
.color-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

/* -------------------------------- Toast ---------------------------------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: grid;
  gap: 8px;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #101010;
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  animation: toastIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.error { border-color: rgba(255, 255, 255, 0.5); color: #ffffff; }
.toast.success { border-color: rgba(255, 255, 255, 0.22); color: #d4d4d4; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------ Duyarlılık ------------------------------- */
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art {
    min-height: 36dvh;
    justify-content: flex-start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 26px;
  }
  .auth-copy { padding: 26px 0 0; }
  .auth-copy h1 { font-size: 32px; }
  .auth-copy p, .auth-features, .auth-foot { display: none; }
  .auth-panel { padding: 22px 18px 40px; align-content: start; }

  .app { grid-template-columns: 1fr; padding: 0; gap: 0; }
  .sidebar {
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .chat {
    position: fixed;
    inset: 0;
    z-index: 30;
    border-radius: 0;
    border: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
  }
  .app.chat-open .chat { transform: none; visibility: visible; }
  .back { display: inline-grid; }
  .chat-head { padding: 12px 14px; }
  .messages { padding: 16px 14px 8px; }
  .msg-content { max-width: 82%; }
  .composer-wrap { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer-hint { display: none; }
  .side-foot { padding-bottom: calc(11px + env(safe-area-inset-bottom)); }
  .emoji-pop { width: min(316px, calc(100vw - 32px)); }
  .modal { padding: 12px; }
}

@media (max-width: 420px) {
  .side-head { padding: 15px 14px 12px; }
  .side-actions { padding: 0 14px 12px; }
  .conv-list-wrap { padding: 0 6px 8px; }
  .auth-copy h1 { font-size: 29px; }
}

/* ------------------------------- Yönetim ---------------------------------- */
.side-head-actions { display: flex; align-items: center; gap: 8px; }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.admin-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.admin-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
}
.admin-handle { font-size: 11.5px; color: var(--muted); }
.admin-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f0f0f0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.admin-badge.owner { background: #ffffff; color: #000000; }
.admin-badge.off {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #8a8a8a;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

@media (max-width: 560px) {
  .admin-row { flex-wrap: wrap; }
  .admin-main { flex-basis: calc(100% - 56px); }
  .admin-actions { width: 100%; justify-content: flex-end; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
