:root {
  color-scheme: dark;
  --bg: #111318;
  --bg-2: #171a20;
  --bg-3: #1e222a;
  --bg-4: #282d38;
  --bg-deep: #0c0e12;
  --line: #2a303b;
  --text: #e8eaef;
  --muted: #959cab;
  --faint: #687080;
  --accent: #2ec4b6;
  --accent-2: #26a99d;
  --accent-ink: #04201d;
  --danger: #f05d5d;
  --warn: #f2b84b;
  --ok: #3fcf8e;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.spacer { flex: 1; }
h2 { font-size: 20px; margin: 0; }

/* ---------- ortak bileşenler ---------- */
.logo { display: block; width: 34px; height: 34px; border-radius: 22%; flex: none; object-fit: cover; }
.logo.sm { width: 28px; height: 28px; }
.login-card .logo { width: 52px; height: 52px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg-3); color: var(--text);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px;
}
.btn:hover { background: var(--bg-4); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; padding: 11px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-4); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.off { color: var(--danger); }
.icon-btn.on { background: var(--accent); color: var(--accent-ink); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
  transition: box-shadow .12s;
}
.avatar.xs { width: 22px; height: 22px; font-size: 11px; }
.avatar.online::after {
  content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--ok); border: 2px solid var(--bg-2);
}
.badge {
  font-size: 10px; font-weight: 700; background: var(--bg-4); color: var(--accent);
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em;
}

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select, textarea { font: inherit; color: var(--text); }
input:not([type=checkbox]), select {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.error { color: var(--danger); font-size: 14px; min-height: 1.2em; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: calc(100% - 32px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--bg-4); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); }

.dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); color: var(--text);
  padding: 0; width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
}
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dialog h3 { margin: 10px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.dialog-footer { display: flex; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- giriş ---------- */
.login-view {
  min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(900px 500px at 20% -10%, rgba(46,196,182,.14), transparent 60%), var(--bg);
}
.login-card {
  width: min(380px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.login-card p { margin: 0 0 4px; }

/* ---------- ana düzen ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr) 232px; height: 100dvh; }
.scrim { display: none; }

.sidebar { background: var(--bg-2); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.server-header {
  height: 54px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  font-weight: 800; font-size: 16px; border-bottom: 1px solid var(--line);
}
.channel-scroll { flex: 1; overflow-y: auto; padding: 6px 8px 12px; }
.section-title {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint);
  font-weight: 700; padding: 16px 8px 6px;
}
.channel-list, .voice-members, .member-list { list-style: none; margin: 0; padding: 0; }
.channel {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; margin: 1px 0;
  border: 0; background: none; border-radius: 6px; color: var(--muted); cursor: pointer; text-align: left;
}
.channel:hover { background: var(--bg-3); color: var(--text); }
.channel.active { background: var(--bg-4); color: var(--text); }
.channel.unread { color: var(--text); font-weight: 650; }
.channel.unread::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.ch-icon svg { width: 18px; height: 18px; display: block; opacity: .8; }
.section-title.has-action { display: flex; align-items: center; justify-content: space-between; }
.section-add {
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none;
  color: var(--faint); cursor: pointer; display: grid; place-items: center;
}
.section-add:hover, .section-add[aria-expanded="true"] { color: var(--text); background: var(--bg-3); }
.section-add svg { width: 15px; height: 15px; }
.channel.dm { padding: 5px 8px; }
.channel.dm .avatar { width: 24px; height: 24px; font-size: 11px; }
.channel.has-unread { color: var(--text); font-weight: 650; }
.unread-count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.dm-empty { font-size: 12.5px; padding: 4px 8px 6px; line-height: 1.4; }
.dm-picker {
  margin: 2px 0 6px; padding: 6px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.dm-picker-title { font-size: 12px; color: var(--faint); font-weight: 700; padding: 2px 6px 6px; }
.dm-pick {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 0; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; text-align: left; font: inherit; font-size: 14px;
}
.dm-pick:hover, .dm-pick:focus-visible { background: var(--bg-3); }
.dm-pick .muted { margin-left: auto; font-size: 12px; }
.avatar.xs.online::after, .channel.dm .avatar.online::after { width: 9px; height: 9px; right: -3px; bottom: -3px; }
.pc-dm { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pc-dm svg { width: 15px; height: 15px; display: block; }
.pc-body .btn + .btn { margin-top: 6px; }
#btn-menu.has-unread { position: relative; }
#btn-menu.has-unread::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.welcome > .avatar.lg { margin-bottom: 8px; cursor: pointer; }
.ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-members { padding: 2px 0 6px 26px; }
.vm { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; color: var(--muted); font-size: 14px; }
.vm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm.speaking .avatar { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--ok); }
.vm.speaking .vm-name { color: var(--text); }
.vm-icons { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--faint); }
.vm-icons svg { width: 15px; height: 15px; display: block; }
.vm-icons .danger { color: var(--danger); }
.live { font-size: 9.5px; font-weight: 800; background: var(--danger); color: #fff; border-radius: 4px; padding: 1px 5px; letter-spacing: .03em; border: 0; font-family: inherit; }
button.live { cursor: pointer; }
button.live:hover { filter: brightness(1.15); }

.voice-panel { position: relative; border-top: 1px solid var(--line); padding: 10px 12px; }
.voice-status {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 6px; margin: -4px -6px;
  border: 0; border-radius: 6px; background: none; cursor: pointer; text-align: left; color: var(--ok);
}
.voice-status:hover { background: var(--bg-3); }
.voice-status-text { min-width: 0; }
.voice-status-text strong { display: block; font-size: 14px; white-space: nowrap; }
.voice-status-text small { display: block; color: var(--muted); }
.ping { font-weight: 600; font-variant-numeric: tabular-nums; }
.signal { width: 18px; height: 16px; flex: none; fill: currentColor; }
.signal rect { transition: opacity .2s; }

/* bağlantı kalitesi renkleri ve sinyal çubukları */
.q-good { color: var(--ok); }
.q-ok { color: var(--warn); }
.q-bad { color: var(--danger); }
.q-wait { color: var(--faint); }
.q-ok .signal rect:nth-child(3) { opacity: .25; }
.q-bad .signal rect:nth-child(n+2) { opacity: .25; }
.q-wait .signal rect { opacity: .35; animation: signal-wait 1.2s infinite; }
.q-wait .signal rect:nth-child(2) { animation-delay: .2s; }
.q-wait .signal rect:nth-child(3) { animation-delay: .4s; }
@keyframes signal-wait { 50% { opacity: 1; } }

.voice-details {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 20;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 8px; font-size: 13.5px;
}
.nd-title { font-weight: 700; font-size: 14px; }
.nd-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; margin-top: 4px; }
.nd-row { display: flex; align-items: flex-start; gap: 8px; }
.nd-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; margin-top: 6px; }
.nd-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.nd-label small { display: block; color: var(--muted); font-size: 12px; }
.nd-value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nd-note { margin: 2px 0 0; color: var(--faint); font-size: 12px; }
.voice-actions { display: flex; gap: 6px; margin-top: 10px; }
.voice-actions .icon-btn { flex: 1; background: var(--bg-3); }
.voice-actions .icon-btn.on { background: var(--accent); }

.user-panel { display: flex; align-items: center; gap: 6px; padding: 9px 8px 9px 10px; background: var(--bg-deep); }
.user-meta { flex: 1; min-width: 0; margin-left: 4px; }
.user-meta strong, .user-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 14px; }
.user-meta small { color: var(--muted); font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main-header {
  height: 54px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-bottom: 1px solid var(--line); font-size: 16px;
}
.main-header .hash svg { width: 20px; height: 20px; display: block; color: var(--faint); }
.mobile-only { display: none; }

/* ---------- görüntü alanı ---------- */
.stage { flex: 0 1 auto; max-height: 60%; overflow: auto; padding: 12px; background: var(--bg-deep); border-bottom: 1px solid var(--line); }
.video-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.video-grid[data-count="1"] { grid-template-columns: minmax(0, 960px); justify-content: center; }
.video-grid.has-focus { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.video-grid.has-focus .tile.focused { grid-column: 1 / -1; order: -1; }
.video-grid.has-focus .tile:not(.focused) .tile-stats, .video-grid.has-focus .tile:not(.focused) .tile-actions { display: none; }
.tile {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9;
  cursor: pointer; box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s;
}
.tile.speaking { box-shadow: 0 0 0 2px var(--ok); }
.tile video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.tile.mirror video { transform: scaleX(-1); }
.tile:fullscreen { aspect-ratio: auto; border-radius: 0; }
.tile-label {
  position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 56px);
  background: rgba(0,0,0,.62); padding: 3px 9px; border-radius: 6px; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile:hover 
/* ---------- sohbet ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 8px 0; overscroll-behavior: contain; }
.welcome { padding: 28px 18px 12px; }
.welcome-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-4); display: grid; place-items: center; margin-bottom: 10px; }
.welcome-icon svg { width: 28px; height: 28px; }
.welcome h2 { font-size: 24px; }
.welcome p { margin: 4px 0 0; }
.empty { padding: 20px 18px; }
.day-sep {
  display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 600; margin: 16px 18px 4px;
}
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; grid-template-columns: 60px minmax(0, 1fr); padding: 3px 18px 3px 0; margin-top: 12px; }
.msg > .avatar { width: 38px; height: 38px; margin: 2px auto 0; font-size: 16px; }
.msg.grouped { margin-top: 0; padding-top: 1px; padding-bottom: 1px; }
.msg:hover { background: rgba(255,255,255,.025); }
.msg-head { display: flex; gap: 8px; align-items: baseline; }
.msg-head strong { font-size: 15px; }
.msg-head time { font-size: 12px; color: var(--faint); }
.hover-time { font-size: 11px; color: var(--faint); text-align: center; visibility: hidden; padding-top: 3px; }
.msg.grouped:hover .hover-time { visibility: visible; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.typing { height: 20px; padding: 0 18px; font-size: 12.5px; color: var(--muted); }
.composer { padding: 2px 16px 16px; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; }
.composer-row:focus-within { border-color: var(--accent); }
.composer-row .icon-btn { margin-bottom: 3px; }
.composer textarea {
  flex: 1; width: 100%; resize: none; max-height: 200px; display: block;
  background: transparent; border: 0; padding: 9px 6px; line-height: 1.4; outline: none;
}

/* ---------- üyeler ---------- */
.members { background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; padding: 0 8px 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; }
.member:hover { background: var(--bg-3); }
.member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-voice svg { width: 15px; height: 15px; display: block; color: var(--ok); }

/* ---------- duyarlı ---------- */
@media (max-width: 1050px) {
  .app { grid-template-columns: 248px minmax(0, 1fr); }
  .members { display: none; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .app.sidebar-open .sidebar { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.5); }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.5); }
  .app.sidebar-open .scrim { display: block; }
  .mobile-only { display: inline-grid; }
  .main-header { padding: 0 8px; }
  .main-header .btn span { display: none; }
  .msg { grid-template-columns: 52px minmax(0, 1fr); padding-right: 12px; }
  .composer { padding: 2px 10px calc(10px + env(safe-area-inset-bottom)); }
  .video-grid { grid-template-columns: minmax(0, 1fr); }
  }

/* ---------- yönetici paneli ---------- */
.admin-header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.admin-header .brand { font-size: 18px; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat small { display: block; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.stat strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; }
.card h2 small { font-weight: 500; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px; font-weight: 700; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
td.nowrap { white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell small { display: block; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pill.on { color: var(--ok); } .pill.on::before { background: var(--ok); }
.pill.bad { color: var(--danger); } .pill.bad::before { background: var(--danger); }
.pill.warn { color: var(--warn); } .pill.warn::before { background: var(--warn); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sessions { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pw-box {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  font: 600 20px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em;
  background: var(--bg); border: 1px dashed var(--accent); padding: 12px 14px; border-radius: 8px; user-select: all;
}

/* ---------- profil fotoğrafı ---------- */
.avatar.has-photo { background: var(--bg-4); }
.avatar > img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.profile-row { display: flex; align-items: center; gap: 16px; }
.profile-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.profile-info strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- yama notları ---------- */
.icon-btn.has-dot { position: relative; color: var(--text); }
.icon-btn.has-dot::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}
.dialog.wide { width: min(560px, calc(100% - 32px)); }
.news-list { display: flex; flex-direction: column; gap: 18px; max-height: 60dvh; overflow-y: auto; padding-right: 4px; }
.news-entry header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.news-entry header time { font-size: 13px; margin-left: auto; }
.news-entry ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }
.news-entry li::marker { color: var(--accent); }
.news-version {
  font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-4); color: var(--muted);
}
.news-version.latest { background: var(--accent); color: var(--accent-ink); }

/* ---------- güncelleme uyarısı ---------- */
.update-banner {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; flex: none;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg)); border-bottom: 1px solid var(--line); font-size: 14px;
}
.update-banner span { flex: 1; }

/* ---------- ekran paylaşımı: kalite seçimi ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { flex-direction: row; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 84px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  color: var(--text); font-weight: 600; font-size: 14px; transition: .12s;
}
.chip span small { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.chip:hover span { border-color: var(--faint); }
.chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.small-note { font-size: 12.5px; margin: 0; }

/* ---------- yayın üstü bilgiler ---------- */
.tile-stats {
  position: absolute; left: 8px; top: 8px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 90px);
  background: rgba(0,0,0,.62); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-stats span { color: #fff; overflow: hidden; text-overflow: ellipsis; }
.tile-stats .signal { width: 14px; height: 12px; }
.tile.cam .tile-stats { opacity: 0; transition: opacity .12s; }
.tile.cam:hover .tile-stats { opacity: 1; }
.tile-actions { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .12s; }
.tile:hover .tile-actions, .tile.focused .tile-actions { opacity: 1; }
.tile-btn {
  width: 30px; height: 30px; border: 0; border-radius: 6px; background: rgba(0,0,0,.62); color: #fff;
  cursor: pointer; display: grid; place-items: center;
}
.tile-btn:hover { background: rgba(0,0,0,.85); }
.tile-btn svg { width: 16px; height: 16px; }
.tile.offer { display: grid; place-items: center; background: var(--bg-3); cursor: default; }
.offer-body { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; }
.offer-body > div:nth-child(2) { display: flex; align-items: center; gap: 8px; }
.offer-body p { margin: 0 0 4px; }
@media (max-width: 720px) { .tile-actions { opacity: 1; } }

/* ---------- yükleme çubuğu ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--bg-4); overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.card .small-note { margin-top: 10px; }

/* ---------- mikrofon testi ---------- */
.mic-test { display: flex; align-items: center; gap: 12px; }
.mic-test .level { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-4); overflow: hidden; }
.mic-test .level > div { height: 100%; width: 0; background: var(--ok); transition: width .06s linear; }

/* ---------- giriş hassasiyeti ---------- */
.gate-meter { display: flex; flex-direction: column; gap: 6px; }
.gate-bar { position: relative; height: 10px; border-radius: 5px; background: var(--bg-4); overflow: visible; }
.gate-bar > #gate-level { height: 100%; width: 0; border-radius: 5px; background: var(--faint); transition: width .05s linear; }
.gate-bar > #gate-level.open { background: var(--ok); }
.gate-bar > #gate-mark { position: absolute; top: -3px; width: 3px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--warn); left: 0; }
#gate-range { width: 100%; accent-color: var(--warn); }


/* ---------- mesaj işlemleri ---------- */
.msg { position: relative; }
.msg-actions { position: absolute; right: 14px; top: -10px; display: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.msg:hover .msg-actions { display: flex; }
.msg-act { width: 30px; height: 28px; border: 0; background: none; color: var(--muted); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.msg-act svg { width: 16px; height: 16px; }
.msg-act.danger:hover { background: var(--danger); color: #fff; }
.msg.grouped .msg-main { grid-column: 2; }
[data-user] { cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
@media (hover: none) { .msg-actions { display: flex; top: 2px; opacity: .8; } }

/* ---------- ekler ---------- */
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-img { display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: var(--bg-3);
  max-width: min(420px, 100%); max-height: 320px; }
.att-img img { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; object-fit: contain; }
.att-video { max-width: min(480px, 100%); max-height: 320px; border-radius: 8px; background: #000; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 240px; max-width: 420px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
a.att-file:hover { border-color: var(--accent); }
.att-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--bg-4); color: var(--accent); }
.att-ico svg { width: 20px; height: 20px; }
.att-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 4px; }
.att-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-meta audio { width: 100%; height: 32px; }
.att-dl svg { width: 18px; height: 18px; color: var(--muted); }

/* yüklenmeyi bekleyen dosyalar */
.pending { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pend { position: relative; display: flex; align-items: center; gap: 8px; width: 270px; padding: 8px 30px 12px 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pend img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.pend-meta { display: flex; flex-direction: column; min-width: 0; }
.pend-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pend-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bg-4); }
.pend-bar > div { height: 100%; background: var(--accent); transition: width .15s; }
.pend.done .pend-bar > div { background: var(--ok); }
.pend.error { border-color: var(--danger); }
.pend.error small { color: var(--danger); }
.pend-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.pend-x:hover { background: var(--danger); color: #fff; }
.pend-x svg { width: 14px; height: 14px; }
.chat { position: relative; }
.drop-hint { position: absolute; inset: 8px; z-index: 5; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); font-size: 18px; font-weight: 700; color: var(--accent); }

/* ---------- profil kartı ---------- */
.avatar.xl { width: 84px; height: 84px; font-size: 34px; }
.profile-card { position: fixed; z-index: 60; width: 300px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.pc-banner { height: 64px; opacity: .85; }
.pc-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.pc-body > .avatar { margin-top: -44px; border: 5px solid var(--bg-2); box-sizing: content-box; }
.pc-name { display: flex; align-items: center; gap: 8px; font-size: 19px; margin-top: 6px; }
.pc-status { font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pc-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.pc-status.on { color: var(--ok); }
.pc-status.on::before { background: var(--ok); }
.pc-section { margin-top: 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.pc-bio { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.pc-body .btn { margin-top: 12px; }
#in-bio { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; resize: vertical; font: inherit; color: var(--text); }

/* ---------- resim görüntüleyici ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 24px 24px 72px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.lightbox-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: rgba(0,0,0,.6); }
.lightbox-bar span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- yayın: başlat/durdur ---------- */
.icon-btn.live-btn { background: var(--danger) !important; color: #fff !important; }

/* ---------- tam ekran ---------- */
.tile:fullscreen { border-radius: 0; background: #000; }
.tile:fullscreen video { object-fit: contain; }
.tile:fullscreen .tile-actions { opacity: 1; }
.tile.idle, .tile.idle * { cursor: none !important; }
.tile.idle .tile-actions, .tile.idle .tile-stats, .tile.idle .tile-label { opacity: 0 !important; transition: opacity .3s; }
.tile:fullscreen .tile-btn { width: 38px; height: 38px; }

/* ---------- sinema modu ---------- */
.app.cinema { grid-template-columns: minmax(0, 1fr); }
.app.cinema .sidebar, .app.cinema .members, .app.cinema .chat, .app.cinema .main-header, .app.cinema .update-banner { display: none !important; }
.app.cinema .stage { max-height: none; flex: 1; border: 0; padding: 10px; display: flex; }
.app.cinema .video-grid { flex: 1; align-content: start; }
.app.cinema .video-grid .tile.focused { aspect-ratio: auto; height: calc(100dvh - 20px - 110px); }
.app.cinema .video-grid[data-count="1"] .tile.focused { height: calc(100dvh - 20px); }
.app.cinema .video-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.app.cinema .video-grid.has-focus { grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); }
.app.cinema .tile.focused .tile-actions { opacity: 1; }
.app.cinema.idle, .app.cinema.idle * { cursor: none; }
.app.cinema.idle .tile-actions, .app.cinema.idle .tile-stats, .app.cinema.idle .tile-label { opacity: 0 !important; transition: opacity .3s; }
.exit-cinema { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; background: rgba(0,0,0,.7); border-color: transparent; }
.app.cinema.idle ~ .exit-cinema { opacity: 0; transition: opacity .3s; }


/* ---------- yayın göstergesi (Discord düzeni) ---------- */
.tile-top { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.live-badge { background: var(--danger); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .05em; padding: 3px 7px; border-radius: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.viewers { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.62); color: #fff; padding: 3px 7px; border-radius: 5px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viewers svg { width: 13px; height: 13px; display: block; }
.tile-stats { left: auto !important; top: auto !important; right: 8px; bottom: 8px; max-width: 48% !important; }
.tile-label { max-width: 48% !important; }
.tile.screen .tile-stats { opacity: .9; }
.video-grid.has-focus .tile:not(.focused) .tile-top .viewers { display: none; }
.video-grid.has-focus .tile:not(.focused) .live-badge { font-size: 9px; padding: 2px 5px; }
.tile.idle .tile-top, .app.cinema.idle .tile-top { opacity: 0; transition: opacity .3s; }
/* Sinema modu: çıkış butonu yayının üstüne binmesin — yayının üstünde kendi şeridinde durur */
.app.cinema .stage { padding-top: 48px; }
.app.cinema .video-grid .tile.focused { height: calc(100dvh - 58px - 110px); }
.app.cinema .video-grid[data-count="1"] .tile.focused { height: calc(100dvh - 58px); }
.exit-cinema { top: 9px !important; }
