/* ================================================================ Tema değişkenleri */
:root, [data-theme="dark"] {
  --bg-rail: #1b1c1f;
  --bg-side: #26272b;
  --bg-chat: #2f3035;
  --bg-elev: #1f2023;
  --bg-float: #18191c;
  --bg-input: #393a40;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: rgba(255, 255, 255, 0.09);
  --bg-msg-hover: rgba(0, 0, 0, 0.09);
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(0, 0, 0, 0.28);
  --text: #dcdde1;
  --text-strong: #f4f4f6;
  --text-muted: #9a9ca5;
  --text-faint: #6d6f78;
  --scroll: rgba(0, 0, 0, 0.45);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --code-bg: #1f2023;
  --skeleton: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg-rail: #e3e5e8;
  --bg-side: #f2f3f5;
  --bg-chat: #ffffff;
  --bg-elev: #ebedef;
  --bg-float: #ffffff;
  --bg-input: #ebedef;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --bg-active: rgba(0, 0, 0, 0.08);
  --bg-msg-hover: rgba(0, 0, 0, 0.03);
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.1);
  --text: #2e3338;
  --text-strong: #060607;
  --text-muted: #5c5e66;
  --text-faint: #80848e;
  --scroll: rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  --code-bg: #f2f3f5;
  --skeleton: rgba(0, 0, 0, 0.07);
  color-scheme: light;
}
:root {
  --brand: #7c5cff;
  --brand-hover: #6a4bf0;
  --brand-soft: rgba(124, 92, 255, 0.16);
  --brand-text: #a995ff;
  --green: #2fbf71;
  --red: #f04a4a;
  --yellow: #f3b23c;
  --gray: #80848e;
  --mention-bg: rgba(243, 178, 60, 0.09);
  --mention-line: #f3b23c;
  --link: #6aa7ff;
  --chat-font: 15px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;
}
[data-theme="light"] { --brand-text: #5b3ff0; --link: #0a64d6; --mention-bg: rgba(243, 178, 60, 0.14); }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg-rail);
  color: var(--text);
  font: 15px/1.375 var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.center { display: flex; justify-content: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
svg { flex-shrink: 0; display: block; }
.ic { display: inline-flex; flex-shrink: 0; }
kbd {
  font: 600 11px var(--font); padding: 1px 5px; border-radius: 4px;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--text-muted);
}
code { font-family: var(--mono); }

/* ================================================================ Logo */
/* Renkli logo (yükleniyor, giriş, hakkında, boş sayfa) */
.loading-logo, .auth-logo, .logo-mark.big, .empty-state .logo-mark {
  display: inline-block;
  background: url("icon.png") center / contain no-repeat !important;
  -webkit-mask: none !important;
  mask: none !important;
}
/* Tek renkli logo (sunucu şeridi, küçük simgeler) */
.logo-mark {
  display: inline-block;
  background: var(--brand);
  -webkit-mask: url("logo-mask.png") center / contain no-repeat;
  mask: url("logo-mask.png") center / contain no-repeat;
}
.logo-mark.tiny { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; background: var(--text-muted); }
.logo-mark.big { width: 64px; height: 64px; }

/* ================================================================ Yükleniyor */
.loading {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--bg-rail); color: var(--text-muted);
}
.loading-logo { width: 64px; height: 64px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.88); opacity: 0.6; } }

/* ================================================================ Giriş */
.auth {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(124, 92, 255, 0.25), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(243, 178, 60, 0.14), transparent 60%),
    var(--bg-rail);
}
.auth-card { width: 100%; max-width: 440px; padding: 32px; background: var(--bg-side); border-radius: 12px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text-strong); margin-bottom: 18px; }
.auth-logo { width: 40px; height: 40px; }
.auth-card h1 { margin: 0 0 4px; font-size: 24px; color: var(--text-strong); }
.auth-card > .muted { margin: 0 0 20px; }
.auth-server { margin: 4px 0 12px; font-size: 13px; color: var(--text-muted); }
.auth-server summary { cursor: pointer; padding: 4px 0; }
.auth-server b { color: var(--text); font-weight: 600; }
.auth-server .field { margin-top: 8px; }
.auth-switch { margin: 14px 0 0; font-size: 14px; color: var(--text-muted); }

/* ================================================================ Form öğeleri */
.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; margin-bottom: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted);
}
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--bg-elev); border: 1px solid transparent; border-radius: 6px; outline: none; color: var(--text);
}
.input:focus { border-color: var(--brand); }
.input.big { height: 46px; font-size: 16px; }
.input.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; line-height: 1.4; }
select.input { padding-right: 8px; cursor: pointer; }
.textarea-wrap { position: relative; }
.textarea-wrap .counter { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--text-faint); }
.form-error { margin: 0 0 12px; color: #ff7c7c; font-size: 14px; }
.form-error:empty { display: none; }

.btn {
  height: 38px; padding: 0 16px; border: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; font-size: 14px; transition: background 0.15s, opacity 0.15s; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #28a862; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { text-decoration: underline; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d93a3a; }
.btn-danger-outline { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-danger-outline:hover { background: var(--red); color: #fff; }
.btn-secondary { background: #4a4c54; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #55575f; }
[data-theme="light"] .btn-secondary { background: #d7d9dc; color: #2e3338; }
[data-theme="light"] .btn-secondary:hover:not(:disabled) { background: #c7c9cd; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.link { background: none; border: 0; padding: 0; color: var(--brand-text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.link:hover { text-decoration: underline; }

.icon-btn {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger { color: var(--red); }
.icon-btn.on { color: var(--text-strong); }

/* Anahtar (switch) */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
.switch-input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 40px; height: 24px; border-radius: 12px; background: #72767d; position: relative; transition: background 0.15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch-input:checked + .switch-track { background: var(--green); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

.range { width: 100%; accent-color: var(--brand); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row .big-a { font-size: 22px; color: var(--text-muted); }
.range-val { min-width: 44px; text-align: right; color: var(--text-muted); font-size: 13px; }

/* ================================================================ Yerleşim */
.app { display: flex; height: 100vh; }

/* Sunucu şeridi */
.rail {
  width: 72px; flex-shrink: 0; padding: 12px 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-rail); overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-group { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rail-group:empty { display: none; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line); flex-shrink: 0; }
.rail-item { position: relative; width: 72px; display: flex; justify-content: center; flex-shrink: 0; }
.rail-item.drop-target::after { content: ""; position: absolute; top: -5px; left: 16px; right: 16px; height: 2px; background: var(--green); border-radius: 1px; }
.rail-btn {
  width: 48px; height: 48px; border: 0; padding: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-chat); color: var(--text-strong);
  font-weight: 600; font-size: 15px; letter-spacing: -0.02em;
  transition: border-radius 0.18s, background 0.18s, color 0.18s; user-select: none;
}
.rail-btn:hover, .rail-item.active .rail-btn { border-radius: 15px; background: var(--brand); color: #fff; }
.rail-btn.has-img:hover, .rail-item.active .rail-btn.has-img { background: transparent; }
.rail-btn.add { color: var(--green); }
.rail-btn.add:hover { background: var(--green); color: #fff; }
.rail-btn.home .logo-mark { width: 30px; height: 30px; background: currentColor; }
.rail-btn.dm-btn { background: transparent; }
.rail-btn.dm-btn .avatar { width: 48px; height: 48px; }
.rail-item.muted .rail-btn { opacity: 0.6; }
.server-img { width: 100%; height: 100%; object-fit: cover; }
.server-initials { pointer-events: none; }
.rail-pill {
  position: absolute; left: 0; top: 50%; width: 4px; height: 8px; margin-top: -4px;
  background: var(--text-strong); border-radius: 0 4px 4px 0;
  transform: scale(0); transition: transform 0.18s, height 0.18s, margin 0.18s;
}
.rail-item.unread .rail-pill { transform: scale(1); }
.rail-item:hover .rail-pill { transform: scale(1); height: 20px; margin-top: -10px; }
.rail-item.active .rail-pill { transform: scale(1); height: 40px; margin-top: -20px; }
.badge {
  position: absolute; right: 10px; bottom: -2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--bg-rail); box-sizing: content-box; pointer-events: none;
}

/* Kenar çubuğu */
.sidebar { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg-side); border-radius: 12px 0 0 0; overflow: hidden; }
.sidebar-header {
  height: 48px; flex-shrink: 0; padding: 0 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line-strong);
  font-weight: 700; color: var(--text-strong);
}
.sidebar-header.clickable { cursor: pointer; }
.sidebar-header.clickable:hover { background: var(--bg-hover); }
.sidebar-header .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-header .muted-ic { color: var(--text-faint); }
.sidebar-header.search-header { padding: 0 10px; }
.fake-search {
  flex: 1; height: 30px; padding: 0 8px; border: 0; border-radius: 6px;
  background: var(--bg-elev); color: var(--text-muted); font-size: 13px; font-weight: 500; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-list { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.sidebar-hint { padding: 8px; font-size: 13px; color: var(--text-muted); margin: 0; }

.category {
  display: flex; align-items: center; gap: 2px; padding: 16px 4px 4px 2px; cursor: pointer; user-select: none;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-muted);
}
.category:hover { color: var(--text); }
.category.static { cursor: default; padding-left: 8px; }
.category.static:hover { color: var(--text-muted); }
.category > span:not(.ic) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category .cat-arrow { transition: transform 0.15s; }
.category.collapsed .cat-arrow { transform: rotate(-90deg); }
.category .icon-btn { width: 20px; height: 20px; color: var(--text-muted); }
.category .icon-btn:hover { color: var(--text-strong); background: none; }

.channel {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 8px; margin: 1px 0; border-radius: 6px;
  color: var(--text-muted); cursor: pointer; user-select: none;
}
.channel:hover { background: var(--bg-hover); color: var(--text); }
.channel.active, .channel.connected { background: var(--bg-active); color: var(--text-strong); }
.channel.unread { color: var(--text-strong); font-weight: 600; }
.channel.unread::before {
  content: ""; position: absolute; left: -8px; top: 50%; width: 4px; height: 8px; margin-top: -4px;
  background: var(--text-strong); border-radius: 0 4px 4px 0;
}
.channel.muted { opacity: 0.45; }
.channel.muted:hover, .channel.muted.active { opacity: 0.75; }
.channel .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel .name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.channel .name-wrap .name { flex: none; }
.channel .sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.channel .ch-icon { color: var(--text-faint); }
.channel.active .ch-icon, .channel:hover .ch-icon { color: var(--text-muted); }
.channel .actions { display: none; gap: 2px; }
.channel:hover .actions, .channel.active .actions { display: flex; }
.channel .actions .icon-btn { width: 22px; height: 22px; color: var(--text-muted); }
.channel .actions .icon-btn:hover { color: var(--text-strong); background: none; }
.count {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
}
.channel.big { height: 42px; font-weight: 500; }
.channel.dm { height: 44px; }
.channel .close-dm { width: 20px; height: 20px; display: none; }
.channel.dm:hover .close-dm { display: inline-flex; }
.channel.dm:hover .count { display: none; }

.voice-users { padding: 0 0 4px 30px; }
.voice-user { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--text-muted); font-size: 14px; cursor: pointer; }
.voice-user:hover { background: var(--bg-hover); color: var(--text); }
.voice-user .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-user .state { display: flex; gap: 3px; color: var(--red); }
.voice-user[data-speaking="1"] .avatar { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--green); }

/* Avatar */
.avatar {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--av); color: #fff; font-weight: 700; user-select: none;
  width: 32px; height: 32px; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.s16 { width: 16px; height: 16px; font-size: 8px; }
.avatar.s20 { width: 20px; height: 20px; font-size: 10px; }
.avatar.s24 { width: 24px; height: 24px; font-size: 11px; }
.avatar.s32 { width: 32px; height: 32px; }
.avatar.s40 { width: 40px; height: 40px; font-size: 17px; }
.avatar.s48 { width: 48px; height: 48px; font-size: 19px; }
.avatar.s80 { width: 80px; height: 80px; font-size: 32px; }
.avatar .status {
  position: absolute; right: -2px; bottom: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  --ring: var(--bg-side);
  border: 3px solid var(--ring); box-sizing: content-box; background: var(--gray);
}
.avatar.s24 .status { width: 8px; height: 8px; border-width: 2px; }
.avatar.s40 .status { width: 12px; height: 12px; }
.avatar.s80 .status { width: 16px; height: 16px; border-width: 5px; right: 0; bottom: 0; }
.s-online { background: var(--green) !important; }
.s-idle { background: var(--yellow) !important; }
.s-dnd { background: var(--red) !important; }
.s-offline { background: var(--gray) !important; }
.status.s-idle::after { content: ""; position: absolute; width: 62%; height: 62%; left: -8%; top: -8%; border-radius: 50%; background: var(--ring); }
.status.s-dnd::after { content: ""; position: absolute; left: 20%; right: 20%; top: 40%; height: 20%; background: var(--ring); border-radius: 2px; }
.status.s-offline::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: var(--ring); }

/* Ses paneli */
.voice-panel { padding: 10px 10px 10px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; background: var(--bg-elev); }
.voice-panel .info { flex: 1; min-width: 0; cursor: pointer; }
.voice-panel .status-line { color: var(--green); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.voice-panel .where { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-panel .info:hover .where { text-decoration: underline; }

/* Kullanıcı paneli */
.user-panel { height: 56px; flex-shrink: 0; padding: 0 8px; display: flex; align-items: center; gap: 2px; background: var(--bg-elev); }
.user-panel .avatar .status { --ring: var(--bg-elev); }
.user-panel .me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px 6px 4px 2px; border: 0; border-radius: 6px; background: none; text-align: left; }
.user-panel .me:hover { background: var(--bg-hover); }
.user-panel .who { min-width: 0; }
.user-panel .who .name { font-weight: 600; font-size: 14px; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel .who .sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================ Sohbet */
.chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-chat); }
.chat-header {
  height: 48px; flex-shrink: 0; padding: 0 12px 0 16px;
  display: flex; align-items: center; gap: 8px; min-width: 0;
  border-bottom: 1px solid var(--line-strong);
}
.chat-header .title { font-weight: 700; color: var(--text-strong); white-space: nowrap; }
.chat-header .title.clickable { cursor: pointer; }
.chat-header .title.clickable:hover { text-decoration: underline; }
.chat-header .ch-icon { color: var(--text-faint); }
.chat-header .divider { width: 1px; height: 24px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.chat-header .topic { font-size: 14px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; }
.chat-header .topic.clickable { cursor: pointer; }
.chat-header .topic.clickable:hover { color: var(--text); }
.chat-header .spacer { flex: 1; }
.tab-btn { height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab-btn:hover { background: var(--bg-hover); color: var(--text); }
.tab-btn.active { background: var(--bg-active); color: var(--text-strong); }
.tab-btn.add-friend { background: var(--green); color: #fff; }
.tab-btn.add-friend.active { background: transparent; color: var(--green); }

.chat-body { flex: 1; min-height: 0; display: flex; }
.chat-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px 0 8px; outline: none; font-size: var(--chat-font); }
.messages .loader { text-align: center; color: var(--text-muted); padding: 12px; font-size: 13px; min-height: 40px; }

.skeleton { padding: 16px; display: flex; flex-direction: column; gap: 22px; justify-content: flex-end; min-height: 100%; }
.sk-row { display: flex; gap: 16px; }
.sk-av { width: 40px; height: 40px; border-radius: 50%; background: var(--skeleton); flex-shrink: 0; }
.sk-lines { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.sk-line { height: 12px; border-radius: 6px; background: var(--skeleton); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 50% { opacity: 0.45; } }

.welcome { padding: 16px 16px 8px; margin-bottom: 8px; }
.welcome .big-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-input); color: var(--text-strong); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.welcome h2 { margin: 8px 0 4px; font-size: 30px; color: var(--text-strong); line-height: 1.2; }
.welcome p { margin: 0 0 8px; color: var(--text-muted); }
.welcome .row { margin-top: 12px; }

.day-divider, .new-divider { display: flex; align-items: center; margin: 16px 16px 4px; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.new-divider { color: var(--red); margin: 8px 16px 0; }
.new-divider::before { content: ""; flex: 1; height: 1px; background: var(--red); }
.new-divider span { background: var(--red); color: #fff; padding: 0 6px; border-radius: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; line-height: 16px; }

.blocked-run { display: flex; align-items: center; gap: 8px; margin: 8px 16px; padding: 6px 12px; border-radius: 6px; color: var(--text-muted); font-size: 13px; background: var(--bg-hover); }

.msg { position: relative; padding: 2px 48px 2px 72px; min-height: 22px; }
.msg.first { margin-top: 16px; }
.msg:hover { background: var(--bg-msg-hover); }
.msg.mentioned { background: var(--mention-bg); }
.msg.mentioned::before, .msg.replying::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--mention-line); }
.msg.replying { background: var(--brand-soft); }
.msg.replying::before { background: var(--brand); }
.msg.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(243, 178, 60, 0.22); } }
.msg .msg-avatar { position: absolute; left: 16px; top: 4px; cursor: pointer; }
.msg.first .reply-ref + .msg-avatar { top: 26px; }
.msg .meta { display: flex; align-items: baseline; gap: 6px; }
.msg .author { font-weight: 600; color: var(--text-strong); cursor: pointer; }
.msg .author:hover { text-decoration: underline; }
.role-ic.owner { color: var(--yellow); }
.role-ic.admin { color: var(--brand-text); }
.msg .role-ic { align-self: center; }
.msg .time { font-size: 12px; color: var(--text-faint); margin-left: 2px; }
.msg .hover-time { position: absolute; left: 0; width: 72px; top: 4px; text-align: center; font-size: 11px; color: var(--text-faint); display: none; }
.msg:not(.first):hover .hover-time { display: block; }
.msg .content { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.content .edited { font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.msg.pending .content { opacity: 0.55; }
.msg.failed .content { color: var(--red); }
.fail-note { font-size: 12px; color: var(--red); }
.content-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.content a, .content-text a { color: var(--link); text-decoration: none; }
.content a:hover, .content-text a:hover { text-decoration: underline; }
.content code, .content-text code { font-size: 0.86em; background: var(--code-bg); padding: 1px 4px; border-radius: 4px; }
.content pre { margin: 6px 0; padding: 8px 10px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; white-space: pre; max-width: 100%; }
.content pre code { background: none; padding: 0; }
.content blockquote { margin: 2px 0; padding-left: 10px; border-left: 4px solid var(--text-faint); }
.content .jumbo { font-size: 2.6em; line-height: 1.2; }
.mention { background: var(--brand-soft); color: var(--brand-text); padding: 0 2px; border-radius: 3px; font-weight: 500; cursor: pointer; }
.mention:hover { background: var(--brand); color: #fff; }
.mention.me { background: rgba(243, 178, 60, 0.18); color: #e0a030; }
[data-theme="dark"] .mention.me { color: #ffd58a; }
.spoiler { background: #17181a; color: transparent; border-radius: 3px; padding: 0 2px; cursor: pointer; transition: color 0.1s, background 0.1s; }
.spoiler:hover { background: #222327; }
.spoiler.revealed { background: var(--bg-hover); color: inherit; cursor: text; }

/* Sıkışık görünüm */
.messages.compact .msg { padding: 1px 48px 1px 16px; }
.messages.compact .msg.first { margin-top: 6px; }
.messages.compact .msg > .c-time { font-size: 11px; color: var(--text-faint); margin-right: 6px; display: inline-block; width: 40px; }
.messages.compact .msg > .author { margin-right: 6px; }
.messages.compact .msg > .content { display: inline; }
.messages.compact .msg > .role-ic { display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.messages.compact .reply-ref { margin-left: 46px; }

.reply-ref { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin: 0 0 2px; cursor: pointer; position: relative; min-width: 0; }
.reply-ref::before { content: ""; position: absolute; left: -36px; top: 50%; width: 30px; height: 12px; border-left: 2px solid var(--text-faint); border-top: 2px solid var(--text-faint); border-radius: 6px 0 0 0; opacity: 0.6; }
.reply-ref .reply-name { font-weight: 600; white-space: nowrap; }
.reply-ref .reply-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.reply-ref:hover .reply-text { color: var(--text); }
.muted-text { font-style: italic; }

.msg-tools {
  position: absolute; right: 16px; top: -16px; display: none; z-index: 2;
  background: var(--bg-side); border: 1px solid var(--line); border-radius: 8px; padding: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.msg:hover .msg-tools { display: flex; }
.msg-tools .icon-btn { width: 32px; height: 30px; }
.msg-tools .emoji-btn { font-size: 17px; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction {
  height: 26px; padding: 0 7px; border-radius: 8px; border: 1px solid transparent;
  background: var(--bg-elev); display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--text-muted);
}
.reaction:hover { border-color: var(--line); }
.reaction.me { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.reaction .r-count { font-size: 13px; font-weight: 600; }
.reaction.add { opacity: 0; transition: opacity 0.1s; }
.msg:hover .reaction.add { opacity: 1; }

.attachment { margin-top: 6px; max-width: min(420px, 100%); }
.attachment img, .attachment video { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; cursor: zoom-in; background: var(--bg-elev); }
.attachment video { cursor: default; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; max-width: 400px; background: var(--bg-side); border: 1px solid var(--line); border-radius: 8px; }
.file-card .fname { color: var(--link); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.file-card a.fname:hover { text-decoration: underline; }
.file-card .ic { color: var(--text-muted); }
.file-card audio { width: 100%; margin-top: 6px; height: 36px; }

.edit-box textarea { width: 100%; min-height: 40px; padding: 10px 12px; border: 0; border-radius: 8px; background: var(--bg-input); color: var(--text); resize: none; outline: none; font-size: var(--chat-font); }
.edit-box .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.edit-box .hint b { color: var(--link); cursor: pointer; font-weight: 500; }

.jump-bottom {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 3;
  padding: 6px 14px; border: 0; border-radius: 16px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
}

/* Yazma alanı */
.composer-wrap { position: relative; padding: 0 16px; flex-shrink: 0; }
.composer { display: flex; align-items: flex-end; gap: 2px; background: var(--bg-input); border-radius: 10px; padding: 4px 6px; }
.composer textarea { flex: 1; min-height: 40px; max-height: 40vh; padding: 10px 4px; border: 0; outline: none; resize: none; background: transparent; line-height: 1.375; font-size: var(--chat-font); }
.composer textarea::placeholder { color: var(--text-faint); }
.composer .icon-btn { width: 40px; height: 40px; border-radius: 8px; }
.reply-bar + .attachment-preview, .reply-bar:not(.hidden) + .attachment-preview.hidden + .composer-blocked + .composer, .reply-bar:not(.hidden) ~ .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--text-muted); background: var(--bg-elev); border-radius: 10px 10px 0 0; }
.reply-bar b { color: var(--text); }
.reply-mention { border: 0; background: none; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.reply-mention.on { color: var(--brand-text); }
.composer-blocked { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 10px; background: var(--bg-input); color: var(--text-muted); font-size: 14px; }
.typing { height: 24px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; padding-left: 4px; }
.typing b { color: var(--text); font-weight: 600; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.attachment-preview { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-input); border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); }
.attachment-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.attachment-preview .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.attachment-preview .sub { font-size: 12px; color: var(--text-muted); }
.attachment-preview:not(.hidden) + .composer-blocked + .composer { border-top-left-radius: 0; border-top-right-radius: 0; }

.autocomplete { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); z-index: 10; background: var(--bg-float); border-radius: 8px; padding: 6px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.ac-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 4px 8px 6px; }
.ac-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 4px; background: none; text-align: left; }
.ac-item .name { color: var(--text-strong); }
.ac-item .muted { margin-left: auto; font-size: 13px; }
.ac-item.active { background: var(--bg-active); }
.ac-at { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); }

.drop-overlay { position: absolute; inset: 8px; z-index: 5; border-radius: 12px; background: rgba(124, 92, 255, 0.85); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: 700; pointer-events: none; }
.drop-overlay div { border: 2px dashed rgba(255, 255, 255, 0.7); padding: 40px 60px; border-radius: 12px; }

.empty-state { height: 100%; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); text-align: center; padding: 24px; }
.empty-state .logo-mark { width: 88px; height: 88px; opacity: 0.85; margin-bottom: 8px; }
.empty-state h2 { margin: 0; color: var(--text-strong); font-size: 20px; }
.empty-state .row { margin-top: 12px; justify-content: center; }

/* Üye listesi */
.members { width: 240px; flex-shrink: 0; overflow-y: auto; padding: 8px 8px 16px; background: var(--bg-side); }
.member { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 4px 8px; border-radius: 6px; cursor: pointer; color: var(--text-muted); }
.member:hover { background: var(--bg-hover); color: var(--text); }
.member.offline { opacity: 0.4; }
.member.offline:hover { opacity: 1; }
.member .name-wrap, .friend-row .name-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member .name { display: flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }
.member .sub, .friend-row .sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .members { display: none; } }

/* Arkadaşlar sayfası */
.friends-page { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 20px 24px 30px; }
.friends-search { position: relative; margin-bottom: 8px; }
.friends-search .input { padding-right: 36px; }
.friends-search .ic { position: absolute; right: 10px; top: 11px; color: var(--text-muted); }
.friends-page > .category { padding-left: 0; }
.friend-list { display: flex; flex-direction: column; }
.friend-row { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 10px; margin: 0 -10px; border-top: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.friend-row:hover { background: var(--bg-hover); border-top-color: transparent; }
.friend-row:hover + .friend-row { border-top-color: transparent; }
.friend-row .name { font-weight: 600; color: var(--text-strong); }
.friend-actions { display: flex; gap: 10px; }
.round-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--bg-side); color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.friend-row:hover .round-btn { background: var(--bg-elev); }
.round-btn:hover { color: var(--text-strong); }
.round-btn.ok:hover { color: var(--green); }
.round-btn.no:hover { color: var(--red); }
.friends-add { max-width: 760px; }
.friends-add h2 { margin: 6px 0 4px; font-size: 18px; color: var(--text-strong); text-transform: uppercase; letter-spacing: 0.02em; }
.add-friend-form { display: flex; gap: 8px; align-items: center; margin-top: 14px; padding: 6px 6px 6px 4px; background: var(--bg-elev); border-radius: 10px; border: 1px solid transparent; }
.add-friend-form:focus-within { border-color: var(--brand); }
.add-friend-form .input { background: transparent; border: 0; }
.add-msg { margin: 8px 2px; font-size: 14px; }
.add-msg.ok { color: var(--green); }
.add-msg.err { color: var(--red); }

/* ================================================================ Sağ tık menüsü */
.ctx-menu {
  position: fixed; z-index: 120; min-width: 210px; max-width: 300px; padding: 6px;
  background: var(--bg-float); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  animation: pop 0.1s ease-out; user-select: none;
}
@keyframes pop { from { opacity: 0; transform: scale(0.98); } }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 8px;
  background: none; border: 0; border-radius: 4px; text-align: left; font-size: 14px; color: var(--text);
}
.ctx-item:hover:not(.disabled), .ctx-item.has-sub:hover { background: var(--brand); color: #fff; }
.ctx-item.danger { color: #ff6b6b; }
.ctx-item.danger:hover { background: var(--red); color: #fff; }
.ctx-item.disabled { opacity: 0.45; cursor: not-allowed; }
.ctx-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctx-label small { font-size: 12px; opacity: 0.7; }
.ctx-hint { font-size: 12px; opacity: 0.6; }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.ctx-check { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--text-muted); display: flex; align-items: center; justify-content: center; }
.ctx-check.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ctx-item:hover .ctx-check { border-color: #fff; }
.ctx-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--text-muted); flex-shrink: 0; position: relative; }
.ctx-radio.on { border-color: var(--brand); }
.ctx-radio.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.ctx-item:hover .ctx-radio { border-color: #fff; }
.ctx-item:hover .ctx-radio.on::after { background: #fff; }
.ctx-custom { padding: 4px 8px; }
.vol-wrap { padding: 2px 0 6px; }
.vol-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.vol-val { font-weight: 600; }
.quick-reactions { display: flex; gap: 2px; }
.quick-reactions .emoji-cell { width: 34px; height: 34px; }

/* ================================================================ Açılır kartlar */
.popover {
  position: fixed; z-index: 60;
  background: var(--bg-float); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow);
  animation: pop 0.12s ease-out;
}

.profile-card { width: 320px; overflow: hidden; border-radius: 10px; }
.profile-card.static { position: relative; background: var(--bg-float); border: 1px solid var(--line); box-shadow: var(--shadow); }
.banner-strip { height: 64px; position: relative; }
.banner-strip .more-btn { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, 0.35); color: #fff; }
.profile-card .inner { padding: 0 16px 16px; }
.pc-avatar { margin-top: -42px; display: inline-block; cursor: pointer; }
.pc-avatar .avatar { border: 6px solid var(--bg-float); box-sizing: content-box; }
.pc-avatar .avatar .status { --ring: var(--bg-float); }
.pc-box { background: var(--bg-elev); border-radius: 8px; padding: 12px; margin-top: 10px; }
.pc-box h3 { margin: 0; color: var(--text-strong); font-size: 20px; word-break: break-word; }
.pc-username { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.pill { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.pc-custom { margin-top: 8px; font-size: 14px; color: var(--text); }
.pc-sep { height: 1px; background: var(--line); margin: 12px 0; }
.pc-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-strong); margin: 10px 0 6px; letter-spacing: 0.02em; }
.pc-label:first-of-type { margin-top: 0; }
.pc-text { font-size: 14px; color: var(--text); }
.pc-member-since { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.pc-member-since > span { display: inline-flex; align-items: center; gap: 4px; }
.pc-member-since .server-img.tiny, .pc-member-since .server-initials.tiny { width: 16px; height: 16px; border-radius: 50%; font-size: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-input); object-fit: cover; }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); }
.roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--bg-input); color: var(--text); white-space: nowrap; }
.role-chip.owner .ic { color: var(--yellow); }
.role-chip.admin .ic { color: var(--brand-text); }
.pc-actions { margin-top: 14px; display: flex; gap: 8px; }
.pc-actions .btn { flex: 1; }

.status-pop { width: 290px; padding: 8px; }
.sp-head { display: flex; gap: 10px; align-items: center; padding: 6px 6px 10px; }
.sp-head .avatar .status { --ring: var(--bg-float); }
.sp-head b { color: var(--text-strong); }
.sp-head .muted { font-size: 13px; }
.status-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 4px; background: none; text-align: left; color: var(--text); font-size: 14px; }
.status-opt:hover { background: var(--brand); color: #fff; }
.status-opt.active b { color: var(--brand-text); }
.status-opt:hover b, .status-opt:hover small { color: #fff; }
.status-opt small { display: block; font-size: 12px; color: var(--text-muted); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin: 0 3px; }

.pins-pop { width: 420px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.pins-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; color: var(--text-strong); border-bottom: 1px solid var(--line); }
.pins-list { overflow-y: auto; padding: 8px; }
.pins-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px; color: var(--text-muted); }
.pins-empty p { margin: 8px 0 0; }
.pin-item { display: flex; gap: 10px; padding: 10px; border-radius: 6px; background: var(--bg-elev); margin-bottom: 8px; position: relative; }
.pin-item .meta { display: flex; gap: 6px; align-items: baseline; }
.pin-item .author { font-weight: 600; color: var(--text-strong); }
.pin-item .time { font-size: 11px; color: var(--text-faint); }
.pin-item .content { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.pin-tools { display: none; position: absolute; right: 8px; top: 8px; gap: 4px; }
.pin-item:hover .pin-tools { display: flex; }

.emoji-picker { width: 340px; height: 380px; display: flex; flex-direction: column; overflow: hidden; }
.emoji-grid { flex: 1; overflow-y: auto; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); align-content: start; gap: 2px; }
.emoji-cat-title { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 4px 4px 6px; }
.emoji-cell { height: 38px; border: 0; border-radius: 6px; background: none; font-size: 22px; padding: 0; line-height: 1; }
.emoji-cell:hover { background: var(--bg-active); }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-top: 1px solid var(--line); background: var(--bg-elev); }
.emoji-tab { flex: 1; height: 32px; border: 0; border-radius: 6px; background: none; font-size: 18px; filter: grayscale(1); opacity: 0.7; }
.emoji-tab:hover, .emoji-tab.active { filter: none; opacity: 1; background: var(--bg-active); }
.emoji-hint { font-size: 11px; color: var(--text-faint); padding: 0 10px 6px; background: var(--bg-elev); }

/* ================================================================ Pencereler */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg-chat); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); animation: pop 0.15s ease-out; }
.modal-head { padding: 20px 48px 0 20px; position: relative; }
.modal-head h2 { margin: 0; font-size: 20px; color: var(--text-strong); }
.modal-head p { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }
.modal-head .close { position: absolute; right: 10px; top: 10px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-text { margin: 0 0 12px; color: var(--text); }
.modal-foot { padding: 14px 20px; background: var(--bg-side); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.modal-foot .left { margin-right: auto; }
.warn-box { padding: 10px 12px; border-radius: 6px; background: rgba(240, 74, 74, 0.12); border-left: 4px solid var(--red); color: var(--text); margin: 0 0 16px; }
.msg-preview { padding: 10px 12px; border-radius: 6px; background: var(--bg-elev); margin-bottom: 12px; }
.msg-preview .content { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; max-height: 200px; overflow: hidden; }

.choice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg-side); cursor: pointer; border: 1px solid transparent; }
.choice:hover { background: var(--bg-active); }
.choice.selected { border-color: var(--brand); background: var(--brand-soft); }
.choice .t { font-weight: 600; color: var(--text-strong); }
.choice .d { font-size: 13px; color: var(--text-muted); }
.choice input { margin-left: auto; accent-color: var(--brand); width: 18px; height: 18px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-elev); border-radius: 8px; margin-bottom: 18px; }
.tab { flex: 1; height: 34px; border: 0; border-radius: 6px; background: transparent; font-weight: 600; color: var(--text-muted); }
.tab.active { background: var(--bg-input); color: var(--text-strong); }

.icon-upload { width: 84px; height: 84px; border-radius: 50%; border: 2px dashed var(--text-muted); background: none; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 16px; overflow: hidden; padding: 0; }
.icon-upload:hover { border-color: var(--brand); color: var(--brand-text); }
.icon-upload img { width: 100%; height: 100%; object-fit: cover; }
.invite-preview { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--bg-elev); margin: -6px 0 12px; }
.fp-sicon, .qs-sicon { width: 40px; height: 40px; border-radius: 14px; background: var(--bg-input); display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 700; font-size: 14px; flex-shrink: 0; color: var(--text-strong); }
.qs-sicon { width: 24px; height: 24px; border-radius: 8px; font-size: 9px; }

.invite-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--bg-elev); border-radius: 6px; }
.invite-box code { flex: 1; font-size: 18px; letter-spacing: 0.08em; color: var(--text-strong); user-select: all; }
.invite-box.big code { font-size: 22px; }
.pick-list { max-height: 320px; overflow-y: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.pick-list.short { max-height: 200px; margin: 0 0 16px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; text-align: left; color: var(--text); }
.pick-row:not(.static):hover { background: var(--bg-hover); }
.pick-row .name { flex: 1; font-weight: 500; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 40px; height: 40px; border-radius: 8px; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; color: #fff; }
.swatch.selected { border-color: var(--text-strong); }
.color-input { width: 40px; height: 40px; border: 0; padding: 0; border-radius: 8px; background: none; cursor: pointer; }

/* Büyük profil */
.fp-modal .modal-head { padding: 0; height: 0; }
.fp-modal .modal-head .close { z-index: 2; background: rgba(0, 0, 0, 0.35); color: #fff; }
.fp-modal .modal-body { padding: 0 0 16px; }
.fp-head .banner-strip { height: 110px; }
.fp-ident { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 20px; margin-top: -46px; }
.fp-ident .avatar { border: 7px solid var(--bg-chat); box-sizing: content-box; }
.fp-ident .avatar .status { --ring: var(--bg-chat); }
.fp-actions { display: flex; gap: 8px; padding-bottom: 6px; }
.fp-head h2 { margin: 8px 20px 0; color: var(--text-strong); }
.fp-head > .muted { margin: 0 20px; font-size: 14px; }
.fp-tabs { display: flex; gap: 6px; padding: 12px 20px 0; border-bottom: 1px solid var(--line); }
.fp-tabs .tab-btn { border-radius: 0; border-bottom: 2px solid transparent; height: 36px; }
.fp-tabs .tab-btn.active { background: none; border-bottom-color: var(--text-strong); }
.fp-body { padding: 12px 20px; min-height: 160px; max-height: 340px; overflow-y: auto; }
.fp-body p { margin: 0 0 8px; }
.fp-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; cursor: pointer; }
.fp-row:hover { background: var(--bg-hover); }
.fp-row .name { flex: 1; font-weight: 600; color: var(--text-strong); }

/* Hızlı geçiş */
.qs-modal { background: var(--bg-side); }
.qs-modal .modal-head { padding: 0; height: 0; }
.qs-modal .modal-head .close { display: none; }
.qs-head { margin: 0 0 12px; text-align: center; color: var(--text-muted); font-size: 13px; }
.qs-list { margin-top: 12px; max-height: 340px; overflow-y: auto; }
.qs-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 4px 8px; }
.qs-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 8px; border: 0; border-radius: 4px; background: none; text-align: left; color: var(--text-muted); }
.qs-item .name { color: var(--text); }
.qs-item.unread .name { font-weight: 700; color: var(--text-strong); }
.qs-item .muted { margin-left: auto; font-size: 12px; text-transform: uppercase; font-weight: 600; }
.qs-item.active { background: var(--bg-active); }
.qs-tip { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }
.qs-tip b { color: var(--text); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; cursor: zoom-out; animation: fade 0.15s; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 6px; }
.lightbox a { color: #ccc; font-size: 14px; }

/* İpucu */
.tooltip { position: fixed; z-index: 130; pointer-events: none; padding: 6px 10px; background: #111214; color: #f4f4f6; border-radius: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

/* Bağlantı şeridi ve bildirimler */
.banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 140; padding: 6px 14px; border-radius: 0 0 8px 8px; background: var(--yellow); color: #1b1c1f; font-weight: 600; font-size: 13px; }
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 8px; background: var(--bg-float); color: var(--text-strong); box-shadow: var(--shadow); font-size: 14px; border-left: 4px solid var(--brand); animation: pop 0.15s ease-out; transition: opacity 0.3s; }
.toast.out { opacity: 0; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

/* ================================================================ Ayar sayfaları */
.settings-layer { position: fixed; inset: 0; z-index: 80; display: flex; background: var(--bg-chat); animation: settingsIn 0.18s ease-out; }
@keyframes settingsIn { from { opacity: 0; transform: scale(1.03); } }
.settings-side { flex: 1 0 218px; display: flex; justify-content: flex-end; background: var(--bg-side); overflow-y: auto; }
.settings-nav { width: 218px; padding: 60px 6px 60px 20px; }
.snav-heading { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: 6px 10px; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snav-item { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 10px; margin-bottom: 2px; border: 0; border-radius: 4px; background: none; text-align: left; color: var(--text-muted); font-size: 15px; font-weight: 500; }
.snav-item:hover { background: var(--bg-hover); color: var(--text); }
.snav-item.active { background: var(--bg-active); color: var(--text-strong); }
.snav-item.danger { color: #ff6b6b; }
.snav-sep { height: 1px; margin: 8px 10px; background: var(--line); }
.settings-main { flex: 1 1 800px; display: flex; overflow: hidden; }
.settings-content { flex: 1; max-width: 740px; padding: 60px 40px 80px; overflow-y: auto; position: relative; }
.settings-title { font-size: 20px; margin: 0 0 20px; color: var(--text-strong); }
.settings-sub { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 28px 0 10px; letter-spacing: 0.02em; }
.settings-close { padding: 60px 20px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.close-circle { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--text-muted); background: none; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.close-circle:hover { border-color: var(--text-strong); color: var(--text-strong); background: var(--bg-hover); }

.setting-row { display: flex; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-text { flex: 1; }
.setting-title { font-weight: 600; color: var(--text-strong); }
.setting-desc { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.acct-card { border-radius: 10px; overflow: hidden; background: var(--bg-rail); }
.acct-card .banner-strip { height: 100px; }
.acct-head { display: flex; align-items: flex-end; gap: 16px; padding: 0 16px; margin-top: -36px; }
.acct-head .avatar { border: 7px solid var(--bg-rail); box-sizing: content-box; }
.acct-head .avatar .status { --ring: var(--bg-rail); }
.acct-head h2 { flex: 1; margin: 0 0 10px; color: var(--text-strong); font-size: 20px; }
.acct-head .btn { margin-bottom: 12px; }
.acct-body { margin: 12px 16px 16px; padding: 16px; border-radius: 8px; background: var(--bg-side); display: flex; flex-direction: column; gap: 20px; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.acct-value { color: var(--text-strong); margin-top: 2px; word-break: break-all; }

.profile-editor { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
.profile-preview .pc-label { margin-bottom: 10px; }
@media (max-width: 1100px) { .profile-editor { grid-template-columns: 1fr; } }

.save-bar { position: sticky; bottom: 0; margin-top: 24px; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 8px; background: var(--bg-float); box-shadow: var(--shadow); grid-column: 1 / -1; animation: pop 0.15s; }
.save-bar span { flex: 1; font-weight: 500; }

.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 8px; background: var(--bg-side); text-align: left; color: var(--text); }
.radio-card:hover { background: var(--bg-active); }
.radio-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.radio-card b { display: block; color: var(--text-strong); }
.radio-card small { color: var(--text-muted); }
.theme-swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.theme-swatch.dark { background: #2f3035; }
.theme-swatch.light { background: #fff; }
.theme-swatch.system { background: linear-gradient(135deg, #fff 50%, #2f3035 50%); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mic-test { display: flex; align-items: center; gap: 16px; }
.meter { position: relative; flex: 1; height: 10px; border-radius: 5px; background: var(--bg-elev); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--yellow); transition: width 0.05s; }
.meter-fill.open { background: var(--green); }
.meter-threshold { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text-strong); }

.keybinds { display: flex; flex-direction: column; }
.kb-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kb-keys { display: flex; gap: 4px; }
.kb-keys kbd { font-size: 12px; padding: 3px 8px; }

.list-box { border-radius: 8px; background: var(--bg-side); overflow: hidden; margin-top: 10px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 48px; }
.list-row:last-child { border-bottom: 0; }
.list-row .name { font-weight: 600; color: var(--text-strong); }
.list-row code { font-size: 13px; color: var(--text-muted); }
.member-admin-row .joined { width: 90px; text-align: right; }
.about-card { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.about-card h2 { margin: 0; color: var(--text-strong); }
.about-card p { margin: 4px 0 0; }

.server-icon-edit { display: flex; gap: 16px; align-items: center; }
.big-server-icon { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: var(--text-strong); flex-shrink: 0; }

.role-card { padding: 16px; border-radius: 8px; background: var(--bg-side); margin-top: 12px; }
.role-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-strong); margin-bottom: 12px; }
.role-title .ic { color: var(--brand-text); }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.perm { display: flex; gap: 10px; align-items: flex-start; }
.perm b { display: block; font-size: 14px; color: var(--text); }
.perm small { color: var(--text-muted); font-size: 12px; }
.perm-ic { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.perm-ic.yes { background: var(--green); }
.perm-ic.no { background: var(--gray); }

@media (max-width: 900px) {
  .settings-side { flex: 0 0 200px; }
  .settings-nav { padding-left: 10px; }
  .settings-content { padding: 40px 20px; }
  .two-col, .perm-list { grid-template-columns: 1fr; }
}
.friends-page .avatar .status, .chat-header .avatar .status, .modal .avatar .status, .welcome .avatar .status { --ring: var(--bg-chat); }
.autocomplete .avatar .status, .popover .avatar .status { --ring: var(--bg-float); }

/* ================================================================ Etkinlikler */
.spacer { flex: 1; }
.clickable { cursor: pointer; }
.count.brand { background: var(--brand); }
.events-sep { height: 1px; background: var(--line); margin: 8px 10px 0; }
.channel.events-btn { height: 46px; margin-bottom: 2px; }
.channel.events-btn .ch-icon { color: var(--brand-text); }
.channel.events-btn.live { background: linear-gradient(100deg, rgba(124, 92, 255, 0.28), transparent 85%); color: var(--text-strong); }
.channel.events-btn .sub { font-size: 11.5px; }
.live-tag {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.03em;
  border-radius: 4px; padding: 2px 6px;
}
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: 0.35; } }

.events-page { flex: 1; min-width: 0; overflow-y: auto; padding: 20px 32px 32px; }
.events-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.events-toolbar .tab-btn { height: 32px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.events-group { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.03em; margin: 18px 2px 10px; }
.events-toolbar + .events-group { margin-top: 0; }
.events-empty { text-align: center; color: var(--text-muted); padding: 60px 20px; max-width: 420px; margin: 0 auto; }
.events-empty-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }

.ev-card { display: flex; background: var(--bg-side); border-radius: 12px; overflow: hidden; margin-bottom: 12px; border: 1px solid transparent; }
.ev-card:hover { border-color: var(--line); }
.ev-card.live { border-color: var(--ev); box-shadow: 0 0 0 1px var(--ev) inset; }
.ev-card.past { opacity: 0.7; }
.ev-date {
  width: 84px; flex-shrink: 0; background: var(--ev); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 4px; padding: 12px 0;
}
.ev-date span { font-size: 11px; font-weight: 700; opacity: 0.85; }
.ev-date b { font-size: 30px; }
.ev-body { flex: 1; min-width: 0; padding: 14px 18px; }
.ev-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ev-tag { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 3px 7px; background: var(--bg-hover); color: var(--text-muted); }
.ev-tag.soon { background: rgba(243, 178, 60, 0.15); color: var(--yellow); }
.ev-tag.brand { background: var(--brand-soft); color: var(--brand-text); }
.ev-title { font-size: 18px; font-weight: 700; color: var(--text-strong); margin-top: 7px; overflow-wrap: anywhere; }
.ev-desc { font-size: 14px; color: var(--text-muted); margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--text-muted); }
.ev-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ev-meta b { color: var(--text); font-weight: 600; }
.ev-meta .clickable:hover { color: var(--text-strong); text-decoration: underline; }
.ev-side { width: 268px; flex-shrink: 0; padding: 14px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.ev-faces { display: flex; align-items: center; gap: 10px; }
.face-stack { display: flex; }
.face-stack .avatar { box-shadow: 0 0 0 2px var(--bg-side); margin-left: -6px; }
.face-stack .avatar:first-child { margin-left: 0; }
.ev-actions { display: flex; gap: 6px; }
.btn.icon-only { width: 32px; padding: 0; justify-content: center; }
.btn-warn { background: var(--yellow); color: #2a1d00; }
.danger-text { color: var(--red) !important; }
.modal-foot .spacer { flex: 1; }
@media (max-width: 1100px) {
  .ev-card { flex-wrap: wrap; }
  .ev-side { width: 100%; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; align-items: center; }
}

.event-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.event-form .form-grid.three { grid-template-columns: 1.4fr 1fr 1fr; }
.event-form .form-grid .span2 { grid-column: span 1; }
.event-form select.input { padding-right: 8px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  height: 32px; border-radius: 16px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: transparent; color: var(--text);
}
.chip:hover { background: var(--bg-hover); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--text-strong); }
.swatches { display: flex; gap: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg-float), 0 0 0 4px var(--text-strong); }
.event-modal .modal-body { max-height: 70vh; overflow-y: auto; }

.ev-mini-date {
  width: 40px; height: 40px; border-radius: 8px; background: var(--ev); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.ev-mini-date span { font-size: 9px; font-weight: 700; }
.ev-mini-date b { font-size: 15px; margin-top: 2px; }
.ev-admin-row.past { opacity: 0.6; }
.attendees .events-group:first-child { margin-top: 0; }

.event-toast {
  pointer-events: auto; width: 380px; display: flex; gap: 12px; padding: 14px;
  background: var(--bg-float); border-radius: 12px; box-shadow: var(--shadow); border-left: 4px solid var(--ev); animation: pop 0.18s ease-out;
}
.event-toast .et-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--yellow); color: #1b1c1f; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.event-toast .et-text { flex: 1; min-width: 0; }
.event-toast .et-kicker { font-size: 11px; font-weight: 700; color: var(--yellow); letter-spacing: 0.03em; }
.event-toast .et-title { font-size: 15px; font-weight: 700; color: var(--text-strong); margin-top: 2px; }
.event-toast .et-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.event-toast .icon-btn { width: 24px; height: 24px; color: var(--text-muted); }

/* ================================================================ Dil seçimi */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lang-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-side); color: var(--text-strong); text-align: left; font-size: 15px; font-weight: 600; }
.lang-card:hover { background: var(--bg-hover); }
.lang-card.active { border-color: var(--brand); background: var(--brand-soft); }
.lang-card .lang-code { width: 36px; height: 26px; border-radius: 6px; background: var(--bg-input); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--text-muted); }
.lang-card.active .lang-code { background: var(--brand); color: #fff; }
.lang-card .lang-name { flex: 1; }
.lang-card .ic { color: var(--brand-text); }
.auth-lang { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 14px; color: var(--text-muted); font-size: 13px; }
.auth-lang select { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; color: var(--text); }
.auth-lang select option { background: var(--bg-side); }

/* ================================================================ Etkinlik görseli (A: sağa yaslı, sola doğru eriyen) */
.ev-body { position: relative; }
.ev-body > *:not(.ev-cover) { position: relative; z-index: 1; }
.ev-cover {
  position: absolute; top: 0; right: 0; bottom: 0; width: 62%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 55%);
  mask-image: linear-gradient(to right, transparent 0%, #000 55%);
}
.ev-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg-side) 0%, transparent 70%); }
.ev-card.has-cover .ev-tag { backdrop-filter: blur(4px); }
.ev-card.has-cover .ev-meta { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.ev-card.has-cover .ev-title { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }

/* Kapak seçici */
.event-form .field > span .opt { font-style: normal; font-weight: 500; text-transform: none; color: var(--text-faint); }
.cover-pick { position: relative; height: 140px; border-radius: 10px; overflow: hidden; background: var(--bg-elev); }
.cover-pick.drag { outline: 2px solid var(--brand); outline-offset: 2px; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty {
  width: 100%; height: 100%; border: 2px dashed var(--line); border-radius: 10px; background: transparent; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.cover-empty:hover { border-color: var(--brand); color: var(--text); }
.cover-empty b { color: var(--text); font-weight: 600; }
.cover-empty small { font-size: 12px; }
.cover-hint { position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 3px 7px; }
.cover-actions { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; }
.cover-btn { background: rgba(0, 0, 0, 0.6) !important; color: #fff; }

/* Şablonlar */
.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 16px; border-radius: 10px; background: var(--bg-elev); }
.tpl-bar:empty { display: none; }
.tpl-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-right: 4px; }
.tpl-chip { display: inline-flex; align-items: center; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-side); overflow: hidden; }
.tpl-chip:hover { border-color: var(--ev); }
.tpl-apply { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 4px; border: 0; background: none; color: var(--text-strong); font-size: 13px; font-weight: 600; }
.tpl-apply img, .tpl-apply i { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--ev); flex-shrink: 0; }
.tpl-del { width: 24px; height: 30px; border: 0; background: none; color: var(--text-faint); display: inline-flex; align-items: center; justify-content: center; }
.tpl-del:hover { color: var(--red); }
.tpl-save { padding-top: 12px; border-top: 1px solid var(--line); }
.tpl-thumb { width: 56px; height: 34px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }

/* ================================================================ Sunucu afişi */
.sidebar-header.has-banner {
  height: 136px; align-items: flex-end; padding-bottom: 12px; position: relative;
  background-size: cover; background-position: center; color: #fff; border-bottom: 0;
}
.sidebar-header.has-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.75) 100%); }
.sidebar-header.has-banner > * { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.sidebar-header.has-banner .muted-ic { color: rgba(255, 255, 255, 0.85); }
.sidebar-header.has-banner.clickable:hover { background-color: transparent; filter: brightness(1.08); }
.banner-edit {
  width: 300px; height: 136px; border-radius: 10px; background: var(--bg-elev) center / cover no-repeat; border: 2px dashed var(--line);
  display: flex; align-items: flex-end; padding: 12px 14px; position: relative; overflow: hidden;
}
.banner-edit.has { border: 0; }
.banner-edit.has::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.75)); }
.banner-edit .banner-name { position: relative; font-weight: 700; color: var(--text-strong); }
.banner-edit.has .banner-name { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }

/* Etkinlik saatleri: UTC ipucu */
.ev-local { font-size: 11.5px; color: var(--text-faint); font-weight: 500; }
.ev-meta .ev-local { margin-left: 4px; }
.tz-hint { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; font-size: 12.5px; color: var(--text-muted); }
.tz-hint b { color: var(--text); font-weight: 600; }

/* Özel tekrar ("Diğer") */
.repeat-custom { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--bg-elev); display: flex; flex-direction: column; gap: 10px; }
.repeat-custom[hidden] { display: none; }
.repeat-every { display: flex; gap: 8px; align-items: center; }
.repeat-every .input.every { width: 76px; text-align: center; }
.repeat-every select.input { width: auto; min-width: 150px; }
.chip.day { min-width: 46px; justify-content: center; }
.repeat-sum { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand-text); font-weight: 600; }

/* Sohbetteki etkinlik duyurusu (sistem mesajı) — kullanıcı mesajlarından belirgin */
.msg.sys-event { padding-top: 6px; padding-bottom: 6px; }
.msg.sys-event:hover { background: transparent; }
.sys-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.sys-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-text); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; font-size: 11px;
}
.sys-by { color: var(--text-muted); }
.sys-head .time { color: var(--text-faint); font-size: 12px; }
.sys-card {
  position: relative; display: flex; max-width: 620px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ev) 22%, var(--bg-side)) 0%, var(--bg-side) 60%);
  border: 1px solid color-mix(in srgb, var(--ev) 55%, transparent);
  box-shadow: 0 6px 22px -10px color-mix(in srgb, var(--ev) 70%, transparent);
}
.sys-card.gone { align-items: center; gap: 10px; padding: 14px 16px; color: var(--text-muted); background: var(--bg-side); border-color: var(--line); box-shadow: none; }
.sys-stripe { width: 5px; flex-shrink: 0; background: var(--ev); }
.sys-body { position: relative; flex: 1; min-width: 0; padding: 14px 18px 14px 16px; }
.sys-body > *:not(.ev-cover) { position: relative; z-index: 1; }
.sys-body .ev-cover::after { background: linear-gradient(90deg, color-mix(in srgb, var(--ev) 10%, var(--bg-side)) 0%, transparent 70%); }
.sys-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ev); filter: brightness(1.25); }
.sys-title { font-size: 20px; font-weight: 800; color: var(--text-strong); margin-top: 4px; overflow-wrap: anywhere; }
.sys-card.has-cover .sys-title { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.sys-card.has-cover .ev-meta { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.sys-body .ev-desc { margin-top: 8px; max-width: 70%; }
.sys-body .ev-local { margin-top: 4px; }
.sys-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.repeat-custom .input { background: var(--bg-main, var(--bg-side)); }

/* Mesaj çevirisi */
.msg .translation { margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--brand); }
.msg .translation .tr-text { color: var(--text-strong); line-height: 1.45; overflow-wrap: anywhere; }
.msg .translation .tr-foot { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.msg .translation .tr-foot .link { font-size: 12px; color: var(--brand-text); font-weight: 600; }
.msg .translation.loading { display: flex; flex-direction: column; gap: 6px; max-width: 420px; padding-top: 4px; }
.msg .translation .shimmer { display: block; height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-elev) 0%, color-mix(in srgb, var(--bg-elev) 60%, white) 50%, var(--bg-elev) 100%); background-size: 200% 100%; animation: tr-shimmer 1.2s linear infinite; }
.msg .translation.error { border-left-color: var(--red, #f04a4a); }
@keyframes tr-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.msg-tools .icon-btn.active { color: var(--brand-text); background: var(--brand-soft); }

/* ================================================================ Atmosferik temalar (Turkuaz / Altın / Mor / Kızıl Gece)
   Tüm pencerenin arkasında bir sahne resmi durur; paneller yarı saydam, kenarları vurgu rengiyle parlar.
   --theme-bg-img: kullanıcının yüklediği resim (yoksa temanın kendi sahnesi). */
[data-theme="ice"], [data-theme="gold"], [data-theme="amethyst"], [data-theme="crimson"] {
  color-scheme: dark;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-msg-hover: rgba(0, 0, 0, 0.22);
  --line-strong: rgba(0, 0, 0, 0.35);
  --scroll: rgba(255, 255, 255, 0.16);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  --skeleton: rgba(255, 255, 255, 0.07);
  --bg-dim: 0.2;
}
[data-theme="ice"] {
  --scene: url("themes/ice.jpg");
  --scene-pos: 75% center;
  --base: #03090f;
  --bg-rail: rgba(3, 12, 19, 0.65);
  --bg-side: rgba(4, 16, 25, 0.65);
  --bg-chat: rgba(3, 12, 19, 0.65);
  --bg-elev: rgba(2, 10, 16, 0.94);
  --bg-float: #07161f;
  --bg-input: rgba(8, 30, 44, 0.94);
  --bg-active: rgba(34, 211, 238, 0.16);
  --line: rgba(95, 240, 255, 0.12);
  --glow: rgba(34, 211, 238, 0.55);
  --glow-soft: rgba(34, 211, 238, 0.22);
  --text: #def3f8;
  --text-strong: #f4fdff;
  --text-muted: #8fb6c3;
  --text-faint: #5f8794;
  --code-bg: rgba(2, 10, 16, 0.8);
  --brand: #18b8d8;
  --brand-hover: #12a3c1;
  --brand-soft: rgba(34, 211, 238, 0.18);
  --brand-text: #7deeff;
  --link: #6fe4ff;
}
[data-theme="gold"] {
  --scene: url("themes/gold.jpg");
  --scene-pos: 52% center;
  --base: #080502;
  --bg-rail: rgba(12, 8, 3, 0.65);
  --bg-side: rgba(16, 11, 4, 0.65);
  --bg-chat: rgba(10, 7, 3, 0.65);
  --bg-elev: rgba(10, 7, 2, 0.94);
  --bg-float: #170f05;
  --bg-input: rgba(36, 24, 8, 0.94);
  --bg-active: rgba(245, 180, 42, 0.16);
  --line: rgba(255, 207, 74, 0.13);
  --glow: rgba(245, 180, 42, 0.55);
  --glow-soft: rgba(245, 180, 42, 0.22);
  --text: #f1e7d2;
  --text-strong: #fff8e8;
  --text-muted: #b9a888;
  --text-faint: #85775d;
  --code-bg: rgba(10, 7, 2, 0.8);
  --brand: #d99a12;
  --brand-hover: #c48a0c;
  --brand-soft: rgba(245, 180, 42, 0.18);
  --brand-text: #ffd36b;
  --link: #ffc857;
}
[data-theme="amethyst"] {
  --scene: url("themes/amethyst.jpg");
  --scene-pos: 75% center;
  --base: #07030f;
  --bg-rail: rgba(10, 5, 22, 0.65);
  --bg-side: rgba(14, 7, 30, 0.65);
  --bg-chat: rgba(9, 4, 20, 0.65);
  --bg-elev: rgba(8, 3, 18, 0.94);
  --bg-float: #140a26;
  --bg-input: rgba(30, 14, 56, 0.94);
  --bg-active: rgba(168, 85, 247, 0.18);
  --line: rgba(199, 125, 255, 0.13);
  --glow: rgba(168, 85, 247, 0.6);
  --glow-soft: rgba(168, 85, 247, 0.24);
  --text: #ebe4fb;
  --text-strong: #faf6ff;
  --text-muted: #ab9dc8;
  --text-faint: #7a6c96;
  --code-bg: rgba(8, 3, 18, 0.8);
  --brand: #9b4dff;
  --brand-hover: #8a3cf0;
  --brand-soft: rgba(168, 85, 247, 0.2);
  --brand-text: #d3a8ff;
  --link: #c79bff;
}

[data-theme="crimson"] {
  --scene: url("themes/crimson.jpg");
  --scene-pos: 77% center;
  --base: #0a0203;
  --bg-rail: rgba(14, 3, 4, 0.65);
  --bg-side: rgba(20, 4, 6, 0.65);
  --bg-chat: rgba(12, 3, 4, 0.65);
  --bg-elev: rgba(12, 2, 3, 0.94);
  --bg-float: #1a0507;
  --bg-input: rgba(44, 8, 11, 0.94);
  --bg-active: rgba(239, 52, 64, 0.17);
  --line: rgba(255, 90, 100, 0.13);
  --glow: rgba(239, 52, 64, 0.58);
  --glow-soft: rgba(239, 52, 64, 0.24);
  --text: #f3e0e0;
  --text-strong: #fff5f5;
  --text-muted: #c39a9c;
  --text-faint: #8d6466;
  --code-bg: rgba(12, 2, 3, 0.8);
  --brand: #d92b3a;
  --brand-hover: #c21f2e;
  --brand-soft: rgba(239, 52, 64, 0.2);
  --brand-text: #ff8a92;
  --link: #ff7c86;
  --mention-bg: rgba(243, 178, 60, 0.12);
}

[data-fx] body {
  background-color: var(--base);
  background-image: linear-gradient(rgba(0, 0, 0, var(--bg-dim)), rgba(0, 0, 0, var(--bg-dim))), var(--theme-bg-img, var(--scene));
  background-size: cover;
  background-position: var(--scene-pos, center);
  background-attachment: fixed;
}
[data-fx] .app { padding: 6px 6px 6px 0; gap: 6px; }
[data-fx] .rail { background: transparent; }
[data-fx] .sidebar, [data-fx] .chat {
  border-radius: 14px;
  border: 1px solid var(--glow-soft);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 22px -6px var(--glow), inset 0 0 30px -18px var(--glow);
}
[data-fx] .chat { background: var(--bg-chat); overflow: hidden; }
[data-fx] .members { background: var(--bg-side); border-left: 1px solid var(--glow-soft); }
[data-fx] .chat-header { border-bottom-color: var(--glow-soft); }
[data-fx] .user-panel { background: rgba(0, 0, 0, 0.28); border-top: 1px solid var(--line); }
[data-fx] .composer { border: 1px solid var(--glow-soft); box-shadow: 0 0 16px -8px var(--glow); }
[data-fx] .channel.active { box-shadow: inset 0 0 0 1px var(--glow-soft), 0 0 14px -6px var(--glow); color: var(--text-strong); }
[data-fx] .channel.active .ch-icon { color: var(--brand-text); }
[data-fx] .rail-btn { box-shadow: 0 0 0 1px var(--glow-soft), 0 0 14px -4px var(--glow); }
[data-fx] .rail-item.active .rail-btn { box-shadow: 0 0 0 2px var(--glow), 0 0 18px -2px var(--glow); }
[data-fx] .rail-pill { background: var(--brand-text); box-shadow: 0 0 8px var(--glow); }
[data-fx] .msg.mentioned, [data-fx] .msg.highlight { box-shadow: inset 2px 0 0 var(--brand-text); }
[data-fx] .modal, [data-fx] .settings-layer, [data-fx] .menu, [data-fx] .popover { border: 1px solid var(--glow-soft); }
[data-fx] .modal { background: var(--bg-float); }
[data-fx] .settings-layer { background: var(--base); background-image: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), var(--theme-bg-img, var(--scene)); background-size: cover; background-position: var(--scene-pos, center); }
[data-fx] .settings-side { background: var(--bg-side); }
[data-fx] .modal-foot { background: rgba(0, 0, 0, 0.25); }
[data-fx] .members .member-group, [data-fx] .members h3 { color: var(--brand-text); }
[data-fx] ::selection { background: var(--brand-soft); }
/* Resmin üstündeki yazılar okunabilsin */
[data-fx] .messages, [data-fx] .chat-header, [data-fx] .sidebar-list, [data-fx] .members { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85), 0 0 8px rgba(0, 0, 0, 0.45); }
[data-fx] .msg .time, [data-fx] .day-divider span { color: var(--text-muted); }

/* Tema seçim kartlarındaki küçük önizlemeler */
.theme-swatch.scene { background-size: cover; background-position: 70% center; border: 1px solid rgba(255, 255, 255, 0.15); }
.theme-swatch.ice { background-image: url("themes/ice-thumb.jpg"); background-position: 75% center; box-shadow: 0 0 10px -2px rgba(34, 211, 238, 0.8); }
.theme-swatch.gold { background-image: url("themes/gold-thumb.jpg"); background-position: 52% center; box-shadow: 0 0 10px -2px rgba(245, 180, 42, 0.8); }
.theme-swatch.amethyst { background-image: url("themes/amethyst-thumb.jpg"); background-position: 75% center; box-shadow: 0 0 10px -2px rgba(168, 85, 247, 0.85); }
.theme-swatch.crimson { background-image: url("themes/crimson-thumb.jpg"); background-position: 77% center; box-shadow: 0 0 10px -2px rgba(239, 52, 64, 0.85); }
.bg-preview { width: 220px; height: 124px; border-radius: 10px; background-size: cover; background-position: center; border: 1px solid var(--glow-soft, var(--line)); flex-shrink: 0; }

/* ================================================================ Pencere başlık çubuğu (masaüstü uygulaması)
   Sağdaki küçült/büyüt/kapat düğmelerini Windows çizer; rengi --titlebar ile aynı yapılır. */
:root, [data-theme="dark"] { --titlebar: #1b1c1f; --titlebar-fg: #dcdde1; }
[data-theme="light"] { --titlebar: #e3e5e8; --titlebar-fg: #2e3338; }
[data-theme="ice"] { --titlebar: #04121b; --titlebar-fg: #bff6ff; }
[data-theme="gold"] { --titlebar: #120c04; --titlebar-fg: #ffe2a0; }
[data-theme="amethyst"] { --titlebar: #0f0720; --titlebar-fg: #e6ccff; }
[data-theme="crimson"] { --titlebar: #150406; --titlebar-fg: #ffc4c8; }
.titlebar {
  position: fixed; top: 0; left: 0; right: 0; height: 32px; z-index: 200;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--titlebar); color: var(--titlebar-fg);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  -webkit-app-region: drag; user-select: none;
}
.titlebar .tb-logo { width: 16px; height: 16px; background: url("icon.png") center / contain no-repeat; }
[data-fx] .titlebar { border-bottom: 1px solid var(--glow-soft); box-shadow: 0 0 14px -6px var(--glow); }
html.has-tb { --tb-h: 32px; }
html.has-tb .app { height: calc(100vh - 32px); margin-top: 32px; }
html.has-tb .loading, html.has-tb .auth, html.has-tb .modal-backdrop, html.has-tb .lightbox, html.has-tb .settings-layer { top: 32px; }
html.has-tb .modal { max-height: calc(100vh - 64px); }
.beta-tag { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-text); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: 1px; }

/* Güncelleme düğmesi (başlık çubuğunda; pencere düğmelerinin solunda) */
.update-pill { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.titlebar .update-pill { margin-left: auto; margin-right: 150px; -webkit-app-region: no-drag; }
body > .update-pill { position: fixed; right: 16px; bottom: 16px; z-index: 150; background: var(--bg-float); padding: 8px 12px; border-radius: 10px; box-shadow: var(--shadow); }
.update-pill.busy { color: var(--text-muted); }
.update-pill.ready button { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: 6px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; }
.update-pill.ready button:hover { filter: brightness(1.1); }
