/* ================================================================ tokens */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg-rail: #e3e5e8;
  --bg-side: #f2f3f5;
  --bg-main: #ffffff;
  --bg-panel: #ebedef;
  --bg-input: #ebedef;
  --bg-hover: rgba(116, 127, 141, .12);
  --bg-active: rgba(116, 127, 141, .22);
  --bg-float: #ffffff;
  --bg-modal: #ffffff;
  --bg-mention: rgba(250, 168, 26, .12);
  --border: rgba(6, 6, 7, .08);
  --shadow: 0 8px 24px rgba(0, 0, 0, .16);

  --text: #2e3338;
  --text-strong: #060607;
  --text-muted: #5c5e66;
  --text-faint: #80848e;

  --accent: #5b5bf0;
  --accent-hover: #4949d6;
  --accent-soft: rgba(91, 91, 240, .14);
  --green: #23a55a;
  --red: #da373c;
  --yellow: #f0b232;
  --talk: #23a55a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-rail: #1b1c20;
    --bg-side: #232429;
    --bg-main: #2c2d33;
    --bg-panel: #1f2024;
    --bg-input: #383940;
    --bg-hover: rgba(78, 80, 88, .32);
    --bg-active: rgba(78, 80, 88, .6);
    --bg-float: #1b1c20;
    --bg-modal: #2c2d33;
    --bg-mention: rgba(240, 178, 50, .1);
    --border: rgba(255, 255, 255, .06);
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --text: #dbdee1;
    --text-strong: #f2f3f5;
    --text-muted: #a3a6ad;
    --text-faint: #7d8089;
    --accent: #6c6cff;
    --accent-hover: #5a5af0;
    --accent-soft: rgba(108, 108, 255, .18);
  }
}
:root[data-theme="dark"] {
  --bg-rail: #1b1c20; --bg-side: #232429; --bg-main: #2c2d33; --bg-panel: #1f2024; --bg-input: #383940;
  --bg-hover: rgba(78, 80, 88, .32); --bg-active: rgba(78, 80, 88, .6); --bg-float: #1b1c20; --bg-modal: #2c2d33;
  --bg-mention: rgba(240, 178, 50, .1); --border: rgba(255, 255, 255, .06); --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --text: #dbdee1; --text-strong: #f2f3f5; --text-muted: #a3a6ad; --text-faint: #7d8089;
  --accent: #6c6cff; --accent-hover: #5a5af0; --accent-soft: rgba(108, 108, 255, .18);
}

/* ================================================================ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text);
  font: 15px/1.375 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.hidden { display: none !important; }
.grow { flex: 1; }
svg.i { width: 20px; height: 20px; flex: none; display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 6px;
  font-weight: 500; font-size: 14px; transition: background .15s;
  background: var(--bg-active); color: var(--text-strong);
}
.btn:hover { filter: brightness(1.1); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); filter: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); filter: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { color: var(--accent); font-size: 14px; padding: 6px 0; }
.btn-link:hover { text-decoration: underline; }
#login-use-link, #login-link-back { display: block; margin: 10px auto 0; }
.link-code { font: 700 34px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: var(--text-strong); background: var(--bg-input); border-radius: 10px; padding: 14px 10px; margin: 6px 0 4px; user-select: all; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 6px; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon-btn:hover { color: var(--text-strong); background: var(--bg-hover); }
.icon-btn.on { color: var(--text-strong); }

.field { display: block; margin-bottom: 16px; }
.field > span, .label {
  display: block; margin-bottom: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted);
}
.input, .login-form input, select.input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: 6px; background: var(--bg-input); color: var(--text-strong);
}
.input:focus, .login-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }

input[type=range] { width: 100%; accent-color: var(--accent); }

/* ================================================================ login */
.login {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(108, 108, 255, .35), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(35, 165, 90, .25), transparent 60%),
    var(--bg-rail);
  overflow: auto;
}
.login-card {
  width: 100%; max-width: 440px; padding: 32px;
  background: var(--bg-modal); border-radius: 12px; box-shadow: var(--shadow); text-align: center;
}
.login-logo { display: block; width: 84px; height: 84px; margin: 0 auto 14px; filter: drop-shadow(0 8px 18px rgba(40, 20, 140, .35)); }
.login-card h1 { margin: 0; font-size: 24px; color: var(--text-strong); }
.login-sub { margin: 6px 0 24px; color: var(--text-muted); }
.login-form { text-align: left; }
.login-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; background: var(--bg-input, rgba(0,0,0,.2)); border-radius: 8px; }
.login-tabs button { flex: 1; padding: 8px; border-radius: 6px; font-weight: 600; color: var(--text-faint); }
.login-tabs button.active { background: var(--accent); color: #fff; }
.login-form input + label { margin-top: 14px; }
.acc-row { padding: 12px; }
.acc-row .roles { margin-top: 8px; }
.login-form label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .02em; }
.login-form .req { color: var(--red); }
.login-form button[type=submit] { margin-top: 20px; height: 44px; font-size: 16px; }
.code-input { font-size: 22px !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; height: 52px !important; }
.hint { margin: 10px 0 0; font-size: 13px; color: var(--text-faint); }
.login-error { min-height: 1.2em; margin: 12px 0 0; color: var(--red); font-size: 14px; }

/* ================================================================ layout */
.app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 72px 248px 1fr 248px;
}
.app.no-members { grid-template-columns: 72px 248px 1fr 0; }
.app.no-members .members { display: none; }

/* rail */
.rail {
  background: var(--bg-rail); display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 12px 0;
}
.rail-server {
  position: relative; width: 48px; height: 48px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #9b5cff); color: #fff;
  font-weight: 700; font-size: 16px; transition: border-radius .2s;
}
.rail-server:hover { border-radius: 14px; }
.rail-server.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--text-strong);
}
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--bg-active); }
.rail-btn {
  width: 48px; height: 48px; border-radius: 50%; background: var(--bg-side); color: var(--green);
  transition: border-radius .2s, background .2s, color .2s;
}
.rail-btn:hover { border-radius: 16px; background: var(--green); color: #fff; }
.rail-btn:last-child { margin-top: auto; }

/* sidebar */
.sidebar { background: var(--bg-side); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.server-header {
  height: 48px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 16px; font-weight: 600; color: var(--text-strong); text-align: left;
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border);
}
.server-header:hover { background: var(--bg-hover); }
.server-header #server-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 8px 16px; }
.cat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 8px 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text-faint);
}
.cat-btn { width: 18px; height: 18px; color: var(--text-faint); }
.cat-btn:hover { color: var(--text-strong); }
.cat-btn svg.i { width: 16px; height: 16px; }

.text-ch, .voice-ch {
  width: 100%; display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 8px; border-radius: 6px; color: var(--text-faint); text-align: left;
}
.text-ch:hover, .voice-ch:hover { background: var(--bg-hover); color: var(--text); }
.text-ch.active { background: var(--bg-active); color: var(--text-strong); }
.text-ch.disabled { opacity: .5; }
.text-ch .tc-name, .voice-ch .vc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.text-ch.unread { color: var(--text-strong); }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.voice-ch.current { color: var(--text-strong); }
.voice-ch.drop { background: var(--accent-soft); outline: 1px dashed var(--accent); }
.voice-ch .vc-meta { font-size: 11px; color: var(--text-faint); flex: none; }
.voice-ch .vc-join { opacity: 0; font-size: 12px; font-weight: 600; color: var(--green); flex: none; }
.voice-ch:hover .vc-join { opacity: 1; }
@media (hover: none) { .voice-ch .vc-join { opacity: 1; } }
.voice-ch svg.i { width: 18px; height: 18px; }
.vc-children { margin-left: 14px; }
.vc-spacer { padding: 10px 8px 2px; font-size: 11px; color: var(--text-faint); text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.vc-spacer.line { height: 1px; padding: 0; margin: 10px 8px; background: var(--border); }

.vc-users { padding: 2px 0 4px 28px; }
.vu {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 32px; padding: 0 8px; border-radius: 6px; color: var(--text-muted); text-align: left;
}
.vu:hover { background: var(--bg-hover); color: var(--text); }
.vu.me { color: var(--text); }
.vu .vu-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.vu .vu-icons { display: flex; gap: 2px; color: var(--text-faint); }
.vu .vu-icons svg.i { width: 15px; height: 15px; }
.vu .vu-icons .red { color: var(--red); }
.vu[draggable=true] { cursor: grab; }

/* avatars */
.avatar {
  --size: 40px;
  position: relative; flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: inline-grid; place-items: center; color: #fff; font-weight: 600;
  font-size: calc(var(--size) * .42); user-select: none;
  transition: box-shadow .12s;
}
.avatar.xs { --size: 22px; font-size: 10px; }
.avatar.sm { --size: 32px; }
.avatar.lg { --size: 80px; }
.avatar.talking { box-shadow: 0 0 0 2px var(--bg-side), 0 0 0 4px var(--talk); }
.avatar .status {
  position: absolute; right: -2px; bottom: -2px; width: 40%; height: 40%; min-width: 10px; min-height: 10px;
  border-radius: 50%; background: var(--green); border: 3px solid var(--bg-side);
}
.avatar .status.away { background: var(--yellow); }
.avatar .status.off { background: var(--text-faint); }

/* user panel */
.userpanel {
  flex: none; height: 56px; display: flex; align-items: center; gap: 2px; padding: 0 8px;
  background: var(--bg-panel);
}
.up-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 6px; text-align: left; }
.up-me:hover { background: var(--bg-hover); }
.up-text { min-width: 0; display: flex; flex-direction: column; }
.up-name { font-size: 14px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-btn { width: 32px; height: 32px; border-radius: 6px; color: var(--text-muted); }
.up-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.up-btn.off { color: var(--red); }
.up-btn, .rail-btn { position: relative; }
.has-dot::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--bg-panel); }
.rail-btn.has-dot::after { top: 6px; right: 6px; box-shadow: 0 0 0 2px var(--bg-rail); }
.banner.warn { background: rgba(240, 178, 50, .16); }
.status-pill.warn { background: rgba(240, 178, 50, .18); color: var(--yellow); }
.ver-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 14px; }
.ver-row span:first-child { color: var(--text-faint); }
.up-btn:disabled { opacity: .4; cursor: not-allowed; }
.avatar .status { border-color: var(--bg-panel); }
.sidebar-scroll .avatar .status, .members .avatar .status { border-color: var(--bg-side); }

/* chat */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-main); }
.chat-header {
  height: 48px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border); min-width: 0;
}
.chat-header h2 { margin: 0; font-size: 16px; color: var(--text-strong); white-space: nowrap; }
.ch-hash { color: var(--text-faint); }
.chat-topic {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--text-muted); padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--border);
}
.chat-topic:empty { display: none; }
.conn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); padding: 0 8px; white-space: nowrap; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.conn.on .conn-dot { background: var(--green); }
.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages { flex: 1; overflow-y: auto; padding: 16px 0 8px; }
.welcome { padding: 16px 16px 24px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.welcome .w-icon {
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-active); color: var(--text-strong); margin-bottom: 8px;
}
.welcome .w-icon svg.i { width: 40px; height: 40px; }
.welcome h3 { margin: 0 0 4px; font-size: 28px; color: var(--text-strong); }
.welcome p { margin: 0; color: var(--text-muted); }
.welcome .w-motd { margin-top: 10px; white-space: pre-wrap; color: var(--text); }

.msg { display: flex; gap: 16px; padding: 2px 16px 2px 16px; position: relative; }
.msg.first { margin-top: 16px; }
.msg:hover { background: var(--bg-hover); }
.msg .m-gutter { width: 40px; flex: none; }
.msg .m-gutter .m-time-sm {
  visibility: hidden; font-size: 11px; color: var(--text-faint); line-height: 22px; display: block; text-align: right;
}
.msg:hover .m-time-sm { visibility: visible; }
.msg .m-body { min-width: 0; flex: 1; }
.msg .m-head { display: flex; align-items: baseline; gap: 8px; }
.msg .m-author { font-weight: 600; color: var(--text-strong); cursor: pointer; }
.msg .m-author:hover { text-decoration: underline; }
.msg .m-time { font-size: 12px; color: var(--text-faint); }
.msg .m-tag { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); text-transform: uppercase; }
.msg .m-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.msg .m-text a { color: var(--accent); }
.msg .m-edited { font-size: 11px; color: var(--text-muted, #949ba4); white-space: nowrap; }
.msg .m-edit-box { margin: 4px 0; }
.msg .m-edit-box .m-edit { width: 100%; resize: vertical; min-height: 40px; font: inherit; }
.msg.mention { background: var(--bg-mention); box-shadow: inset 2px 0 0 var(--yellow); }
.msg.sys { align-items: center; color: var(--text-muted); font-size: 14px; }
.msg.sys .m-gutter { display: flex; justify-content: center; color: var(--green); }
.msg.sys.leave .m-gutter { color: var(--red); }
.msg.sys b { color: var(--text-strong); font-weight: 600; cursor: pointer; }
.msg.sys .m-time { margin-left: 6px; }
.day-sep { display: flex; align-items: center; gap: 8px; margin: 20px 16px 4px; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.empty-chat { padding: 32px 16px; text-align: center; color: var(--text-faint); }

.banner {
  margin: 0 16px 8px; padding: 8px 8px 8px 12px; border-radius: 8px;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
  background: var(--accent-soft); color: var(--text-strong);
}
.banner > span:nth-child(2) { flex: 1; }
.composer {
  margin: 0 16px 20px; display: flex; align-items: flex-end; gap: 4px;
  background: var(--bg-input); border-radius: 8px; padding: 4px 4px 4px 16px;
}
/* Simgeler (32px) tek satirlik yazi alaninda (40px) dikey ortada dursun; cok satirda altta kalir */
.composer > .icon-btn { margin-bottom: 4px; }
.composer textarea {
  flex: 1; border: 0; background: transparent; resize: none; max-height: 40vh;
  padding: 9px 0; line-height: 22px; color: var(--text-strong); outline: none;
}
.composer textarea::placeholder { color: var(--text-faint); }
.composer.disabled { opacity: .6; }

/* members */
.members { background: var(--bg-side); overflow-y: auto; padding: 8px 8px 16px; min-width: 0; }
.members .cat { padding-top: 20px; }
.member { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border-radius: 6px; text-align: left; }
.member:hover { background: var(--bg-hover); }
.member .mb-text { min-width: 0; display: flex; flex-direction: column; }
.member .mb-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .mb-sub { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.away { opacity: .6; }

/* ================================================================ floating */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#layer > * { pointer-events: auto; }
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

.menu {
  position: fixed; min-width: 200px; max-width: 260px; padding: 6px; border-radius: 8px;
  background: var(--bg-float); box-shadow: var(--shadow); animation: pop .1s;
}
.menu button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 8px; border-radius: 4px; font-size: 14px; font-weight: 500; color: var(--text); text-align: left;
}
.menu button:hover { background: var(--accent); color: #fff; }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: var(--red); color: #fff; }
.menu button svg.i { width: 18px; height: 18px; }
.menu hr { border: 0; height: 1px; background: var(--border); margin: 4px; }
.menu .menu-label { padding: 6px 8px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-faint); }
.menu .menu-slider { padding: 4px 8px 8px; }
.menu .menu-slider label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

.profile {
  position: fixed; width: 320px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: 10px; background: var(--bg-float); box-shadow: var(--shadow); animation: pop .12s;
}
.profile .p-banner { height: 64px; }
.profile .p-head { padding: 0 16px; margin-top: -40px; display: flex; align-items: flex-end; justify-content: space-between; }
.profile .p-head .avatar { box-shadow: 0 0 0 6px var(--bg-float); }
.profile .p-head .avatar .status { border-color: var(--bg-float); }
.profile .p-card { margin: 12px; padding: 12px; border-radius: 8px; background: var(--bg-main); }
.profile .p-name { font-size: 20px; font-weight: 700; color: var(--text-strong); overflow-wrap: anywhere; }
.profile .p-status { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.profile .p-sec { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.profile .p-sec:first-of-type { border-top: 0; padding-top: 0; }
.profile dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.profile dt { color: var(--text-faint); }
.profile dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.roles { display: flex; flex-wrap: wrap; gap: 4px; }
.role {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; background: var(--bg-active); color: var(--text);
}
.role .dot { width: 10px; height: 10px; border-radius: 50%; }
.role button { width: 14px; height: 14px; color: var(--text-faint); display: inline-grid; place-items: center; }
.role button:hover { color: var(--red); }
.role button svg.i { width: 12px; height: 12px; }
.role.add { cursor: pointer; }
.role.add select { background: transparent; border: 0; color: var(--text); font-size: 12px; max-width: 140px; }
.p-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.p-row > .input { flex: 1; height: 34px; }
.p-row .btn { flex: none; }
.p-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.slider-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.slider-row output { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.note { font-size: 13px; color: var(--text-faint); margin-top: 6px; }

/* modal */
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--bg-modal); border-radius: 10px; box-shadow: var(--shadow); animation: pop .15s;
}
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 0; }
.modal h2 { margin: 0; font-size: 20px; color: var(--text-strong); }
.modal .m-content { padding: 16px 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px; background: var(--bg-side); }
.modal.wide { max-width: 760px; }

.settings { display: grid; grid-template-columns: 180px 1fr; min-height: 420px; }
.settings nav { background: var(--bg-side); padding: 20px 8px; display: flex; flex-direction: column; gap: 2px; }
.settings nav .label { padding: 0 10px; }
.settings nav button { text-align: left; padding: 7px 10px; border-radius: 4px; color: var(--text-muted); font-weight: 500; }
.settings nav button:hover { background: var(--bg-hover); color: var(--text); }
.settings nav button.active { background: var(--bg-active); color: var(--text-strong); }
.settings nav .sep { height: 1px; background: var(--border); margin: 8px 10px; }
.settings nav button.logout { color: var(--red); }
.settings .s-pane { padding: 20px 24px; min-width: 0; position: relative; }
.settings .s-pane h3 { margin: 0 0 16px; font-size: 18px; color: var(--text-strong); }
.settings .s-close { position: absolute; top: 14px; right: 14px; }
.s-card { background: var(--bg-side); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--border); }
.toggle-row .t-text b { display: block; color: var(--text-strong); font-weight: 500; }
.toggle-row .t-text span { font-size: 13px; color: var(--text-faint); }
.switch { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--text-faint); flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.status-pill.ok { background: rgba(35, 165, 90, .15); color: var(--green); }
.status-pill.bad { background: rgba(218, 55, 60, .15); color: var(--red); }
.steps { margin: 12px 0 0; padding-left: 20px; }
.steps li { margin: 6px 0; }
.theme-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opts button { padding: 14px 8px; border-radius: 8px; background: var(--bg-side); border: 2px solid transparent; font-weight: 500; }
.theme-opts button.active { border-color: var(--accent); }
.kbd { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--bg-active); font-size: 12px; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.stat { background: var(--bg-side); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 20px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-faint); }
.motd { white-space: pre-wrap; background: var(--bg-side); border-radius: 8px; padding: 12px; font-size: 14px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 10px 16px; border-radius: 8px; background: var(--bg-float); color: var(--text-strong); box-shadow: var(--shadow); font-size: 14px; animation: pop .15s; }
.toast.err { background: var(--red); color: #fff; }

.only-mobile { display: none; }
.scrim { display: none; }

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .app, .app.no-members { grid-template-columns: 72px 240px 1fr; }
  .members {
    position: fixed; top: 0; right: 0; bottom: 0; width: 260px; z-index: 30;
    transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow);
  }
  .app.members-open .members { transform: none; display: block; }
  .app.no-members .members { display: block; }
  .app.members-open .scrim { display: block; }
}
@media (max-width: 760px) {
  .app, .app.no-members { grid-template-columns: 1fr; }
  .rail { display: none; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 85vw); z-index: 30;
    transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow);
  }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .scrim { display: block; }
  .only-mobile { display: inline-flex; }
  .chat-topic, .conn #conn-text { display: none; }
  .chat-header { padding-left: 8px; }
  .composer { margin: 0 8px 12px; }
  .msg { padding-left: 8px; padding-right: 8px; gap: 12px; }
  .settings { grid-template-columns: 1fr; }
  .settings nav { flex-direction: row; overflow-x: auto; padding: 12px; }
  .settings nav .label, .settings nav .sep { display: none; }
  .settings nav button { white-space: nowrap; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; }

/* ================================================================ masaustu */
.mode-opts button { text-align: left; padding: 12px; }
.mode-opts button .note { margin: 2px 0 0; display: block; }
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--bg-active); overflow: hidden; margin: 6px 0 10px; }
.meter-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--yellow); transition: width .08s linear; }
.meter-bar.over { background: var(--green); }
.meter-mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text-strong); }

.desk-dl { display: block; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none; }
.desk-dl span { display: block; font-weight: 400; color: var(--text-faint); font-size: 12px; margin-top: 2px; }
.desk-dl:hover { text-decoration: underline; }
.is-desktop .desk-dl { display: none; }

/* ================================================================ ozel mesajlar */
.dm-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; text-align: left; color: var(--text-faint); }
.dm-item:hover { background: var(--bg-hover); color: var(--text); }
.dm-item.active { background: var(--bg-active); color: var(--text-strong); }
.dm-item.unread .dm-name { color: var(--text-strong); font-weight: 700; }
.dm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-prev { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-empty { padding: 4px 8px 8px; font-size: 12px; color: var(--text-faint); }
.welcome .avatar.lg { margin-bottom: 4px; }

/* ================================================================ yonetici denetimi */
.audit-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.audit-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg-side); text-align: left; width: 100%; }
button.audit-row:hover { background: var(--bg-hover); }
.audit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.audit-main .note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-meta { font-size: 12px; color: var(--text-faint); text-align: right; flex: none; }

/* ================================================================ ekran paylasimi */
.live-pill { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; flex: none; }
.live-pill.clickable { cursor: pointer; }
.live-pill.clickable:hover { filter: brightness(1.15); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; box-shadow: 0 0 0 3px rgba(218, 55, 60, .25); }
.up-btn.live { color: #fff; background: var(--red); }
.chat { position: relative; }
.stage { position: absolute; inset: 48px 0 0 0; z-index: 5; display: flex; flex-direction: column; background: #000; }
.stage-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-panel); color: var(--text-strong); flex-wrap: wrap; }
.stage-vol { display: inline-flex; align-items: center; gap: 6px; }
.stage-vol input { width: 90px; }
.stage-video { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.stage-video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage-wait { position: absolute; color: #aaa; font-size: 14px; }
.stage:fullscreen .stage-head { position: absolute; top: 0; left: 0; right: 0; opacity: 0; transition: opacity .2s; z-index: 2; }
.stage:fullscreen:hover .stage-head { opacity: .95; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; }
.src-label { grid-column: 1 / -1; margin: 6px 0 0; }
.src { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 8px; background: var(--bg-side); border: 2px solid transparent; text-align: left; }
.src:hover { background: var(--bg-hover); }
.src.active { border-color: var(--accent); }
.src img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 4px; }
.src span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================ etkinlik */
.vu-act { font-size: 13px; flex: none; opacity: .85; }
.act-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; background: var(--bg-side); }
.act-icon { font-size: 26px; line-height: 1; }
.act-card b { color: var(--text-strong); }

/* ================================================================ sohbet medyasi */
.m-media { display: grid; gap: 4px; margin-top: 4px; max-width: min(440px, 100%); }
.m-media.multi { grid-template-columns: 1fr 1fr; }
.m-img, .m-vid { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; background: var(--bg-active); cursor: zoom-in; }
.m-vid { cursor: auto; object-fit: contain; background: #000; }
.m-media:not(.multi) .m-img { width: auto; max-width: 100%; object-fit: contain; }
.attach-tray { display: flex; gap: 8px; margin: 0 16px 6px; padding: 8px; border-radius: 8px; background: var(--bg-input); overflow-x: auto; }
.attach-tray.uploading { opacity: .6; }
.att-chip { position: relative; display: flex; flex-direction: column; gap: 4px; width: 120px; flex: none; }
.att-chip img, .att-chip video { width: 120px; height: 80px; object-fit: cover; border-radius: 6px; background: #000; }
.att-name { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; }
.att-x:hover { background: var(--red); }
.chat.drop-files::after { content: "Göndermek için bırak"; position: absolute; inset: 48px 0 0 0; z-index: 6; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: #fff; background: rgba(91, 91, 240, .55); border: 3px dashed #fff; border-radius: 10px; pointer-events: none; }
.lightbox { padding: 24px; }
.lb-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 100%; max-height: 100%; }
.lb-inner img { max-width: calc(100vw - 48px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
.lb-bar { display: flex; align-items: center; gap: 10px; color: #ddd; font-size: 13px; }

/* ================================================================ goruntulu konusma */
.cam-ico { font-size: 12px; cursor: pointer; flex: none; }
.cam-pill { font-size: 11px; font-weight: 700; padding: 0 6px; height: 18px; display: inline-flex; align-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); cursor: pointer; flex: none; }
.cam-pill:hover { background: var(--accent); color: #fff; }
.grid-stage { background: var(--bg-main); }
.tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); grid-auto-rows: 1fr; gap: 8px; padding: 8px; }
.tile { position: relative; min-height: 0; border-radius: 10px; overflow: hidden; background: var(--bg-panel); display: grid; place-items: center; cursor: pointer; outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .12s; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.tile.has-video video { opacity: 1; }
.tile.has-video .tile-wait { display: none; }
.tile.me video { transform: scaleX(-1); }
.tile.talking { outline-color: var(--talk); }
.tile-name { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 600; }
.grid-stage.has-focus .tiles { grid-template-columns: 1fr; grid-auto-rows: auto; grid-template-rows: 1fr; }
.grid-stage.has-focus .tile:not(.focus) { display: none; }
.screen-tile { border: 0; color: var(--text); text-align: center; }
.screen-tile:hover { background: var(--bg-hover); }
.screen-label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; }
.screen-label > :first-child { font-size: 30px; }
.screen-label span { color: var(--text-faint); font-size: 12px; }
.grid-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-muted); text-align: center; }

/* ================================================================ ses cubugu (kullanici panelinin ustu) */
.voicebar { flex: none; display: flex; align-items: center; gap: 2px; padding: 6px 8px 6px 12px; background: var(--bg-panel); border-bottom: 1px solid var(--border); }
.vb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vb-status { font-size: 13px; font-weight: 700; color: var(--green); }
.vb-status.warn { color: var(--yellow, #f0b232); }
#bunker-voice .cat span { color: var(--accent, inherit); }
.vb-chan { font-size: 12px; color: var(--text-faint); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-chan:hover { color: var(--text); text-decoration: underline; }

/* ================================================================ ayarlar penceresi: sabit boyut */
/* Uygulama penceresine oranli, sekme degisince boyutu degismez; sadece sag taraf kayar */
.modal.settings-modal { width: min(1100px, 92vw); height: min(780px, 88vh); max-width: none; max-height: none; overflow: hidden; display: flex; }
.settings-modal .settings { flex: 1; min-height: 0; min-width: 0; grid-template-columns: 220px 1fr; }
.settings-modal .settings nav { overflow-y: auto; padding: 24px 10px; }
.settings-modal .s-main { position: relative; min-width: 0; min-height: 0; display: flex; }
.settings-modal .s-pane { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 40px 32px 28px; scrollbar-gutter: stable; }
.settings-modal .s-close { position: absolute; top: 14px; right: 18px; z-index: 2; }
.settings-modal .s-pane > h3 { padding-right: 40px; }
@media (max-width: 760px) {
  .modal.settings-modal { width: 100%; height: calc(100vh - 32px); }
  .settings-modal .settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .settings-modal .settings nav { overflow-x: auto; overflow-y: hidden; }
  .settings-modal .s-pane { padding: 16px; }
}
.act-details { color: var(--text); font-size: 13px; margin-top: 1px; overflow-wrap: anywhere; }

/* ================================================================ kanal olustur: tur secimi */
.type-opts { display: grid; gap: 8px; }
.type-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; background: var(--bg-side); border: 2px solid transparent; text-align: left; }
.type-opt:hover { background: var(--bg-hover); }
.type-opt.active { border-color: var(--accent); }
.type-opt b { display: block; color: var(--text-strong); }
.type-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-active); flex: none; }
textarea.input { min-height: 120px; font-family: inherit; }

/* Profil / sunucu fotografi */
.avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.rail-server { display: grid; place-items: center; }
.rail-server > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.srv-photo { display: flex; align-items: center; gap: 14px; }
.srv-photo .rail-server { flex: none; }
.zoomable { cursor: zoom-in; }
.srv-hero { display: flex; justify-content: center; margin-bottom: 14px; }
.srv-hero img { width: 112px; height: 112px; border-radius: 30px; object-fit: cover; display: block; }
.lb-inner img.photo-big { width: min(512px, calc(100vw - 48px), calc(100vh - 120px)); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.crop-box { display: flex; flex-direction: column; align-items: center; }
.crop-stage canvas { display: block; border-radius: 33%; background: var(--bg-rail); cursor: grab; touch-action: none; box-shadow: 0 0 0 1px var(--bg-active); }
.crop-stage.round canvas { border-radius: 50%; }
.crop-stage canvas.dragging { cursor: grabbing; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 300px; max-width: 100%; margin-top: 14px; }
.crop-zoom input { flex: 1; }
.crop-zoom .note { margin: 0; font-size: 18px; }

/* Emoji secici */
.composer > .emoji-open { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .7; transition: filter .12s, opacity .12s, transform .12s; }
.composer > .emoji-open:hover { filter: none; opacity: 1; transform: scale(1.12); }
.menu.emoji-picker { width: 352px; max-width: calc(100vw - 16px); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.emoji-tabs { display: flex; gap: 2px; }
.menu.emoji-picker .emoji-tab { flex: 1; width: auto; display: block; text-align: center; color: inherit; font-size: 18px; padding: 4px 0; border-radius: 6px; }
.menu.emoji-picker .emoji-tab:hover { background: var(--bg-hover, var(--bg-active)); }
.emoji-grid { height: 300px; overflow-y: auto; }
.emoji-sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-faint); margin: 8px 2px 4px; }
.emoji-sec:first-child .emoji-sec-title { margin-top: 0; }
.emoji-row { display: grid; grid-template-columns: repeat(8, 1fr); }
.menu.emoji-picker .emoji-btn { width: auto; padding: 0; justify-content: center; font-size: 24px; line-height: 1; aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; }
.menu.emoji-picker .emoji-btn:hover { background: var(--bg-active); }
.emoji-empty { text-align: center; padding: 24px 0; }
.m-text.jumbo { font-size: 44px; line-height: 1.2; }

.text-ch .tc-link { flex: none; width: 14px; height: 14px; opacity: .6; margin-left: auto; }
.text-ch .tc-link + .badge { margin-left: 6px; }

/* rol (rutbe) ikonlari */
.g-ico { width: 16px; height: 16px; flex: none; image-rendering: auto; vertical-align: -3px; }
.vu .g-ico { margin-left: 4px; }
.vu .g-ico + .g-ico { margin-left: 2px; }
.mb-name .g-ico { margin-left: 5px; }
.role .g-ico { margin-right: 2px; }
/* ikon ismin hemen yaninda dursun, kalan bosluk ikondan sonra */
.vu:has(> .g-ico) .vu-name { flex: 0 1 auto; }
.vu > .g-ico:last-of-type { margin-right: auto; }
.m-deleted { font-size: 12px; color: var(--red); opacity: .8; margin-top: 2px; }

/* Mesaj islemleri: arac cubugu, tepkiler, yanit */
.msg .m-tools {
  position: absolute; right: 16px; top: -14px; display: none; gap: 2px; padding: 2px;
  background: var(--bg-float); border-radius: 8px; box-shadow: var(--shadow); z-index: 2;
}
.msg:hover .m-tools, .msg .m-tools:focus-within { display: flex; }
.msg .m-tools button { min-width: 30px; height: 28px; border-radius: 6px; font-size: 16px; line-height: 1; padding: 0 5px; }
.msg .m-tools button:hover { background: var(--bg-hover); }
.msg .m-tools .mt-ico { font-size: 15px; color: var(--text-muted); }
.msg .m-tools .danger:hover { background: rgba(237, 66, 69, .15); }
.m-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.m-react { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 8px; background: var(--bg-input); border: 1px solid transparent; font-size: 13px; color: var(--text-muted); }
.m-react .re { font-size: 15px; line-height: 1; }
.m-react:hover { border-color: var(--text-faint); }
.m-react.mine { background: var(--accent-soft); border-color: var(--accent); color: var(--text-strong); }
.msg { flex-wrap: wrap; }
.msg .m-reply { flex-basis: 100%; display: flex; align-items: center; gap: 6px; padding-left: 20px; margin-bottom: 2px; font-size: 13px; color: var(--text-muted); cursor: pointer; min-width: 0; position: relative; }
.msg .m-reply .mr-line { position: absolute; left: 34px; top: 9px; width: 24px; height: 10px; border-left: 2px solid var(--text-faint); border-top: 2px solid var(--text-faint); border-top-left-radius: 6px; }
.msg .m-reply .avatar { margin-left: 44px; --size: 16px; font-size: 8px; }
.msg .m-reply b { color: var(--text); font-weight: 600; flex: none; }
.msg .m-reply .mr-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg .m-reply:hover .mr-text { color: var(--text-strong); }
.msg.flash { background: var(--accent-soft); transition: background .3s; }
.msg.deleted .m-gone { font-style: italic; color: var(--text-faint); }
.reply-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 16px; padding: 6px 8px 6px 14px; background: var(--bg-side); border-radius: 8px 8px 0 0; font-size: 13px; color: var(--text-muted); }
.reply-bar b { color: var(--text-strong); }
.reply-bar .rb-text { opacity: .8; }
.reply-bar + .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
@media (max-width: 760px) { .reply-bar { margin: 0 8px; } .msg .m-tools { right: 8px; } }

/* dolu ses kanali */
.voice-ch .vc-meta.full { color: var(--red); font-weight: 600; }

/* roller ve yetkiler */
.perm-wrap { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.perm-roles { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; max-height: 70vh; overflow-y: auto; }
.perm-role { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; text-align: left; color: var(--text-muted); background: none; border: 0; cursor: pointer; }
.perm-role:hover { background: var(--bg-hover, rgba(255,255,255,.05)); color: var(--text); }
.perm-role.active { background: var(--bg-active, rgba(255,255,255,.09)); color: var(--text); }
.perm-role .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.perm-role .g-ico { width: 16px; height: 16px; flex: none; }
.perm-role .pr-text { display: flex; flex-direction: column; min-width: 0; }
.perm-role .pr-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-role .pr-text span { font-size: 11px; color: var(--text-faint); }
.perm-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; font-size: 16px; }
.perm-cat { margin: 16px 0 4px; }
.perm-main .perm-cat:first-of-type { margin-top: 4px; }
@media (max-width: 700px) {
  .perm-wrap { grid-template-columns: 1fr; }
  .perm-roles { position: static; max-height: 220px; }
}
.acc-badge { margin-left: 6px; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
#vb-music.live { background: var(--green); }

.typing-bar { min-height: 16px; padding: 0 18px 4px; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* metin icindeki ikonlar (yazi boyutunda) */
.ii { display: inline-flex; vertical-align: -0.15em; }
.ii svg.i { width: 1.05em; height: 1.05em; }
.btn .ii { margin-right: 2px; }
.mt-ico svg.i { width: 16px; height: 16px; }
.act-icon svg.i { width: 22px; height: 22px; }
.grid-empty-ico svg.i { width: 40px; height: 40px; margin: 0 auto; opacity: .6; }
.up-btn svg.i { width: 20px; height: 20px; }

/* ===================== cok sunuculu yapi: en sol bar, ana sayfa, arkadaslar, kesfet ===================== */
.rail { overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-guilds { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail-home, .rail-guild { position: relative; width: 48px; height: 48px; flex: none; }
.rail-home { border-radius: 50%; background: var(--bg-side); color: var(--text); display: grid; place-items: center; transition: border-radius .2s, background .2s, color .2s; }
.rail-home svg.i { width: 24px; height: 24px; }
.rail-home:hover, .rail-home.active { border-radius: 16px; background: var(--accent); color: #fff; }
.rail-home.has-dot::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--red, #e5484d); box-shadow: 0 0 0 3px var(--bg-rail); }
.rail-guild .g-icon { width: 48px; height: 48px; border-radius: 50%; transition: border-radius .2s; font-size: 15px; }
.rail-guild:hover .g-icon, .rail-guild.active .g-icon { border-radius: 16px; }
.rail-guild .rg-pill { position: absolute; left: -12px; top: 50%; width: 4px; height: 0; border-radius: 0 4px 4px 0; background: var(--text-strong); transform: translateY(-50%); transition: height .15s; }
.rail-guild:hover .rg-pill { height: 20px; }
.rail-guild.active .rg-pill, .rail-home.active::before { height: 40px; }
.rail-add { flex: none; }
#rail-theme { margin-top: auto; }
.rail-btn:last-child { margin-top: 0; }
.g-icon { display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; flex: none; border-radius: 50%; width: 40px; height: 40px; font-size: 14px; user-select: none; }
.g-icon img { width: 100%; height: 100%; object-fit: cover; }
.g-icon.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.g-icon.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.g-icon.xl { width: 80px; height: 80px; font-size: 26px; border-radius: 24px; margin: 0 auto 8px; }
.server-header.is-home { cursor: default; }
.server-header.is-home [data-icon="chevron"] { display: none; }
.app.home-view .members { display: none; }
.app.home-view { grid-template-columns: 72px 248px 1fr 0; }

.home-page { flex: 1; overflow-y: auto; min-height: 0; }
.home-wrap { max-width: 860px; margin: 0 auto; padding: 0 0 32px; }
.home-tabs { display: flex; align-items: center; gap: 6px; padding: 12px 20px; border-bottom: 1px solid var(--border, rgba(127,127,127,.15)); flex-wrap: wrap; }
.home-tabs .home-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text-strong); margin-right: 12px; }
.home-tabs > button:not(.btn) { padding: 4px 10px; border-radius: 6px; color: var(--text-muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.home-tabs > button:not(.btn):hover { background: var(--bg-hover); color: var(--text); }
.home-tabs > button.active { background: var(--bg-active); color: var(--text-strong); }
.home-tabs .btn { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.home-tabs .btn svg.i { width: 16px; height: 16px; }
.home-body { padding: 16px 20px; }
.home-body h3 { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); }
.home-count { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.home-empty { color: var(--text-muted); padding: 24px 0; text-align: center; }
.friend-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--border, rgba(127,127,127,.12)); border-radius: 8px; cursor: pointer; }
.friend-row:hover { background: var(--bg-hover); }
.fr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-text b { color: var(--text-strong); }
.fr-acts { display: flex; gap: 6px; align-items: center; }
.fr-acts .icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-side); }
.fr-acts .icon-btn.ok { color: var(--green); }
.discover-hero { text-align: center; padding: 40px 20px 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent); border-radius: 0 0 16px 16px; }
.discover-hero h1 { margin: 0 0 6px; font-size: 26px; color: var(--text-strong); }
.discover-hero p { margin: 0 0 18px; color: var(--text-muted); }
.search-box { display: flex; align-items: center; gap: 8px; max-width: 520px; margin: 0 auto; padding: 0 12px; background: var(--bg-input, var(--bg-side)); border-radius: 10px; border: 1px solid var(--border, rgba(127,127,127,.2)); }
.search-box svg.i { color: var(--text-muted); width: 18px; height: 18px; }
.search-box .search-input { border: 0; background: transparent; padding: 12px 0; flex: 1; font-size: 15px; outline: none; }
.server-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.server-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--bg-side); border-radius: 12px; }
.server-card .sc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.server-card .sc-text b { color: var(--text-strong); font-size: 15px; }
.server-card .btn { align-self: flex-start; }
.discover-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 24px; }
.discover-actions .s-card { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.discover-actions .btn { align-self: flex-start; }
.mutual { display: flex; gap: 6px; flex-wrap: wrap; }
.mutual-g { padding: 0; border-radius: 10px; }
.invite-join { text-align: center; padding-top: 24px; }
.invite-join h2 { margin: 6px 0; color: var(--text-strong); }
.member.offline { opacity: .5; }
.avatar .status.off { background: var(--text-muted); }
@media (max-width: 760px) { .app.home-view { grid-template-columns: 1fr; } }
.home-hide { display: none !important; }
.sc-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.sc-badge { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.sc-badge.open { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.sc-badge.ask { color: #f0a020; background: color-mix(in srgb, #f0a020 14%, transparent); }
/* Sunucu ayarlari: uyeler */
.srv-member { padding: 10px 12px; margin-bottom: 8px; }
.srv-mrow { display: flex; align-items: center; gap: 10px; }
.srv-mname { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srv-mname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-mrow .p-row { margin-top: 0; }
.srv-member .roles { margin-top: 8px; }
.srv-member .roles:empty { display: none; }
.srv-inline { flex-wrap: wrap; }
