/* PPLChat - Modern stiller */
:root {
  --bg: #0b0f17;
  --bg-2: #131a26;
  --bg-3: #1c2434;
  --bg-glass: rgba(28, 36, 52, 0.65);
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.12);
  --text: #e9eef5;
  --text-dim: #99a4b3;
  --muted: #6a7585;
  --brand: #5b9dff;
  --brand-2: #2b6ce8;
  --accent: #ff5fa2;
  --accent-2: #c44dff;
  --ok: #2ed391;
  --warn: #ffb547;
  --err: #ff5d6c;
  --notice: #b88af0;
  --action: #ffaa66;
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --gradient-brand: linear-gradient(135deg, #5b9dff 0%, #c44dff 50%, #ff5fa2 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
}
body.theme-light {
  --bg: #f3f5fb;
  --bg-2: #ffffff;
  --bg-3: #eef2f8;
  --bg-glass: rgba(255,255,255,0.75);
  --line: rgba(0,0,0,0.06);
  --line-2: rgba(0,0,0,0.1);
  --text: #131a26;
  --text-dim: #4a5466;
  --muted: #8693a8;
  --shadow-lg: 0 24px 60px rgba(50,80,150,0.15);
  --shadow-md: 0 8px 24px rgba(50,80,150,0.08);
  --gradient-card: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.005) 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code {
  background: var(--bg-3); padding: 2px 6px; border-radius: 5px;
  font-size: 90%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Animasyonlar ---------- */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,211,145,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(46,211,145,0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Giris ekrani ---------- */
.login {
  height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(91,157,255,0.25), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(196,77,255,0.20), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(255,95,162,0.10), transparent 60%),
    var(--bg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.login::before {
  content: '';
  position: absolute; inset: -50%;
  background: var(--gradient-brand);
  opacity: 0.04;
  filter: blur(80px);
  z-index: 0;
}
.login-card {
  width: min(440px, 100%);
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: fade-up 0.4s ease;
  position: relative; z-index: 1;
}
.login-header { margin-bottom: 18px; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--gradient-brand);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  display: grid; place-items: center;
  font-weight: 800; color: white; font-size: 24px;
  box-shadow: 0 8px 20px rgba(91,157,255,0.35);
}
.brand-text h1 {
  margin: 0; font-size: 24px;
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.brand-text p { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.field em { color: var(--muted); font-style: normal; font-size: 11px; }
.field input {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 14px;
  transition: all .2s ease;
  font-family: inherit;
}
.field input:hover { border-color: var(--line-2); }
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,157,255,0.18);
}
.advanced { margin-top: 4px; }
.advanced summary {
  cursor: pointer; color: var(--text-dim); font-size: 13px;
  padding: 6px 0; user-select: none;
}
.advanced summary:hover { color: var(--text); }
.advanced .field { margin-top: 10px; }
.btn {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 16px; cursor: pointer; font-size: 14px;
  font-family: inherit; font-weight: 500;
  transition: all .15s ease;
}
.btn:hover { background: var(--line-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gradient-brand);
  background-size: 200% 200%;
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(91,157,255,0.3);
}
.btn-primary:hover {
  background-position: 100% 50%;
  box-shadow: 0 10px 28px rgba(91,157,255,0.45);
  transform: translateY(-1px);
}
.login-error {
  margin: 0; padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(255,93,108,0.12); color: var(--err);
  font-size: 13px; border: 1px solid rgba(255,93,108,0.25);
}
.login-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; font-size: 13px; color: var(--muted);
}
.link {
  background: none; border: none; color: var(--brand);
  cursor: pointer; padding: 0; font-size: 13px; font-family: inherit;
}
.link:hover { text-decoration: underline; }

/* ---------- Sohbet ekrani ---------- */
.chat {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
  position: relative;
}
.sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--gradient-card);
}
.brand-mini {
  font-weight: 800; font-size: 17px;
  background: var(--gradient-brand);
  background-size: 200% 200%;
  animation: gradient-shift 8s ease infinite;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: -0.02em;
}
.me {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 13px; color: var(--text-dim);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: all .3s; }
.dot.online { background: var(--ok); animation: pulse-glow 2s infinite; }
.dot.connecting { background: var(--warn); }
.dot.error { background: var(--err); }

.tabs {
  flex: 1; overflow-y: auto;
  padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.tabs::-webkit-scrollbar { width: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-dim); font-size: 14px; user-select: none;
  border: 1px solid transparent;
  transition: all .15s ease;
  font-weight: 500;
}
.tab:hover {
  background: var(--bg-3); color: var(--text);
  transform: translateX(2px);
}
.tab.active {
  background: linear-gradient(135deg, rgba(91,157,255,0.18), rgba(196,77,255,0.10));
  color: var(--text);
  border-color: rgba(91,157,255,0.25);
}
.tab .tab-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.kind-channel .tab-name::before { content: "#"; color: var(--muted); margin-right: 3px; opacity: 0.7; }
.tab.kind-pm .tab-name::before { content: "@"; color: var(--accent); margin-right: 3px; }
.tab.kind-server .tab-name::before { content: "✦"; color: var(--brand); margin-right: 6px; }
.tab .badge {
  background: var(--gradient-brand); color: white; font-size: 11px;
  padding: 2px 8px; border-radius: 12px; font-weight: 600;
}
.tab .x {
  opacity: 0; padding: 0 4px; color: var(--muted);
  border: none; background: none; cursor: pointer;
  border-radius: 4px; transition: opacity .15s;
}
.tab:hover .x { opacity: 1; }
.tab .x:hover { color: var(--err); }

.sidebar-actions {
  display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line);
}
.side-btn {
  flex: 1; padding: 9px; background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-family: inherit; font-weight: 500;
  transition: all .15s;
}
.side-btn:hover { background: var(--line-2); transform: translateY(-1px); }

/* ---------- Radyo Player ---------- */
.radio-player {
  margin: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(91,157,255,0.10), rgba(196,77,255,0.08));
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.radio-player::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.radio-player.playing::before { opacity: 0.06; }

.radio-top { display: flex; align-items: center; gap: 10px; }
.radio-equalizer {
  display: flex; align-items: end; gap: 2px;
  width: 28px; height: 26px;
  flex-shrink: 0;
}
.radio-equalizer span {
  flex: 1; height: 100%;
  background: var(--gradient-brand);
  border-radius: 2px;
  transform-origin: bottom;
  transform: scaleY(0.25);
  opacity: 0.4;
  transition: opacity .3s;
}
.radio-player.playing .radio-equalizer span {
  opacity: 1;
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.radio-player.playing .radio-equalizer span:nth-child(1) { animation-delay: 0.0s; }
.radio-player.playing .radio-equalizer span:nth-child(2) { animation-delay: 0.15s; }
.radio-player.playing .radio-equalizer span:nth-child(3) { animation-delay: 0.3s; }
.radio-player.playing .radio-equalizer span:nth-child(4) { animation-delay: 0.1s; }
.radio-player.playing .radio-equalizer span:nth-child(5) { animation-delay: 0.25s; }

.radio-info { flex: 1; min-width: 0; }
.radio-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.radio-status {
  font-size: 11px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.radio-play {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--gradient-brand);
  background-size: 200% 200%;
  border: none; border-radius: 50%;
  color: white; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(91,157,255,0.35);
  transition: all .2s;
}
.radio-play:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(91,157,255,0.5);
}
.radio-play:active { transform: scale(0.95); }
.radio-play.loading svg { animation: spin 0.9s linear infinite; }

.radio-bottom {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.radio-mute {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px; display: grid; place-items: center;
  border-radius: 6px; transition: all .15s;
}
.radio-mute:hover { color: var(--text); background: var(--bg-3); }
#radio-volume {
  flex: 1; appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--bg-3); outline: none; cursor: pointer;
}
#radio-volume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--gradient-brand);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(91,157,255,0.4);
  transition: transform .15s;
}
#radio-volume::-webkit-slider-thumb:hover { transform: scale(1.2); }
#radio-volume::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; border: none;
  background: #5b9dff; cursor: pointer;
}

.sidebar-footer {
  display: flex; gap: 6px; padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--gradient-card);
}
.icon-btn {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer; font-size: 16px;
  transition: all .15s;
}
.icon-btn:hover { background: var(--line-2); transform: translateY(-1px); }

/* ---------- Ana sohbet ---------- */
.main { display: flex; flex-direction: column; min-height: 0; }
.main-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: relative;
}
.main-header::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand) 30%, var(--accent-2) 70%, transparent);
  opacity: 0.3;
}
.ch-info h2 { margin: 0; font-size: 17px; font-weight: 700; }
.ch-info .topic {
  margin: 3px 0 0; font-size: 12px; color: var(--text-dim);
  max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-actions { display: flex; gap: 6px; }

.content {
  flex: 1; display: grid; grid-template-columns: 1fr 220px;
  min-height: 0; background: var(--bg);
}
.messages {
  overflow-y: auto; padding: 14px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6;
}
.messages::-webkit-scrollbar { width: 8px; }
.messages::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.messages::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.msg {
  display: flex; gap: 10px;
  padding: 2px 0;
  animation: fade-up 0.2s ease;
}
.msg .time {
  color: var(--muted); font-size: 12px; flex-shrink: 0;
  width: 48px; opacity: 0.7;
}
.msg .nick { font-weight: 700; flex-shrink: 0; }
.msg .nick.me { color: var(--brand); }
.msg .text { word-break: break-word; flex: 1; }
.msg.system .text { color: var(--text-dim); font-style: italic; }
.msg.notice .text { color: var(--notice); }
.msg.action .text { color: var(--action); font-style: italic; }
.msg.error .text { color: var(--err); }
.msg.join .text { color: var(--ok); }
.msg.part .text, .msg.quit .text { color: var(--warn); }
.msg.kick .text { color: var(--err); }
.msg .text a { color: var(--brand); text-decoration: underline; }
.msg .text a:hover { color: var(--accent); }
.msg .text b { font-weight: 700; }
.msg .text i { font-style: italic; }
.msg .text u { text-decoration: underline; }

/* mIRC renkleri */
.c0  { color:#ffffff; } .c1  { color:#000000; } .c2  { color:#00007f; }
.c3  { color:#009300; } .c4  { color:#ff0000; } .c5  { color:#7f0000; }
.c6  { color:#9c009c; } .c7  { color:#fc7f00; } .c8  { color:#ffff00; }
.c9  { color:#00fc00; } .c10 { color:#009393; } .c11 { color:#00ffff; }
.c12 { color:#0000fc; } .c13 { color:#ff00ff; } .c14 { color:#7f7f7f; }
.c15 { color:#d2d2d2; }
.bg0 { background:#ffffff; } .bg1 { background:#000000; } .bg2 { background:#00007f; }
.bg3 { background:#009300; } .bg4 { background:#ff0000; } .bg5 { background:#7f0000; }
.bg6 { background:#9c009c; } .bg7 { background:#fc7f00; } .bg8 { background:#ffff00; }
.bg9 { background:#00fc00; } .bg10{ background:#009393; } .bg11{ background:#00ffff; }
.bg12{ background:#0000fc; } .bg13{ background:#ff00ff; } .bg14{ background:#7f7f7f; }
.bg15{ background:#d2d2d2; }

.userlist {
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column; min-height: 0;
}
.ul-head {
  padding: 12px 14px; font-size: 12px; color: var(--text-dim);
  border-bottom: 1px solid var(--line);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
#ul-list { list-style: none; padding: 6px 0; margin: 0; overflow-y: auto; }
#ul-list::-webkit-scrollbar { width: 6px; }
#ul-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
#ul-list li {
  padding: 7px 14px; cursor: pointer; font-size: 13px;
  display: flex; gap: 8px; align-items: center;
  transition: background .15s;
  border-left: 2px solid transparent;
}
#ul-list li:hover { background: var(--bg-3); border-left-color: var(--brand); }
#ul-list li .prefix {
  color: var(--muted); width: 12px; display: inline-block;
  font-weight: 700;
}
#ul-list li.op .prefix { color: var(--accent); }
#ul-list li.voice .prefix { color: var(--ok); }

/* ---------- Composer ---------- */
.composer {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 10px 12px 12px;
  position: relative;
}
.format-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-bottom: 10px;
}
.format-bar button {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 13px;
  min-width: 32px; transition: all .15s; font-family: inherit;
}
.format-bar button:hover { background: var(--line-2); transform: translateY(-1px); }
.format-bar button.active {
  background: var(--gradient-brand);
  background-size: 200% 200%;
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(91,157,255,0.3);
}
.format-bar .divider { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.format-bar .size { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.format-bar .size select {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 8px; font-family: inherit;
}
.color-swatch {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 4px; vertical-align: middle; margin-right: 6px;
  border: 1px solid var(--line-2);
}
.grow { flex: 1; }
.btn-send {
  background: var(--gradient-brand) !important;
  background-size: 200% 200% !important;
  color: white !important; border: none !important; font-weight: 700 !important;
  padding: 9px 20px !important;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgba(91,157,255,0.35);
}
.btn-send:hover {
  background-position: 100% 50% !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 8px 22px rgba(91,157,255,0.45) !important;
}
.input-row { display: flex; }
#input {
  flex: 1; padding: 12px 16px;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; outline: none; font-family: inherit;
  transition: all .2s;
}
#input:hover { border-color: var(--line-2); }
#input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,157,255,0.18);
}

/* ---------- Paletler ---------- */
.emoji-panel, .color-panel {
  position: absolute;
  bottom: 90px; left: 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 10px; box-shadow: var(--shadow-lg);
  z-index: 30; max-width: 360px;
  animation: fade-up 0.15s ease;
}
.emoji-panel {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px;
  max-height: 260px; overflow-y: auto;
}
.emoji-panel button {
  background: none; border: none; cursor: pointer; font-size: 20px;
  padding: 4px; border-radius: 6px; transition: background .15s;
}
.emoji-panel button:hover { background: var(--bg-3); }
.color-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.color-panel button {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--line-2); cursor: pointer;
  transition: transform .15s;
}
.color-panel button:hover { transform: scale(1.1); }

/* ---------- Modaller ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100; padding: 16px;
  animation: fade-up 0.2s ease;
}
.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 18px; padding: 22px;
  width: min(420px, 100%);
  box-shadow: var(--shadow-lg);
}
.modal-card.large { width: min(720px, 100%); }
.modal-card h3 { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.modal-card input {
  width: 100%; padding: 10px 13px; margin-top: 6px;
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none;
  font-family: inherit; font-size: 14px;
}
.modal-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,157,255,0.18);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.menu-list { list-style: none; padding: 0; margin: 0 0 14px; }
.menu-list li { margin: 5px 0; }
.menu-list button {
  width: 100%; text-align: left;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 11px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 14px; transition: all .15s;
}
.menu-list button:hover {
  background: var(--line-2);
  transform: translateX(2px);
  border-color: var(--brand);
}

#list-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#list-table th, #list-table td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
}
#list-table th {
  color: var(--text-dim); font-weight: 600;
  position: sticky; top: 0; background: var(--bg-2);
  text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px;
}
#list-table tbody tr { cursor: pointer; transition: background .15s; }
#list-table tbody tr:hover { background: var(--bg-3); }
.list-wrap {
  max-height: 50vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 10px;
}

/* ---------- Toggle butonlari (desktop'ta gizli) ---------- */
.icon-btn.toggle-sidebar,
.icon-btn.toggle-userlist {
  display: none;
}

/* Mobil arka plan overlayi */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
body.sidebar-open .overlay,
body.userlist-open .overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Smooth gecisler */
.sidebar { transition: transform .28s cubic-bezier(.2,.7,.3,1); }
.userlist { transition: transform .28s cubic-bezier(.2,.7,.3,1); }

/* ---------- Buyuk masaustu (>=1100px): her sey yan yana ---------- */
@media (min-width: 1100px) {
  .chat { grid-template-columns: 280px 1fr; }
  .content { grid-template-columns: 1fr 240px; }
}

/* ---------- Orta ekran / tablet (721-1099px) ---------- */
/* Sidebar gorunur, userlist gizlenebilir */
@media (min-width: 721px) and (max-width: 1099px) {
  .chat { grid-template-columns: 240px 1fr; }
  .content { grid-template-columns: 1fr; }
  .userlist {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 260px; max-width: 90vw;
    z-index: 50;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--line-2);
  }
  body.userlist-open .userlist { transform: translateX(0); }
  .icon-btn.toggle-userlist { display: inline-grid; place-items: center; }
  .ch-info .topic { max-width: 40ch; }
}

/* ---------- Telefon (<=720px): hem sidebar hem userlist gizlenebilir ---------- */
@media (max-width: 720px) {
  .chat { grid-template-columns: 1fr; }
  .content { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 280px; max-width: 85vw;
    z-index: 50;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    border-right: 1px solid var(--line-2);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }

  .userlist {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 240px; max-width: 80vw;
    z-index: 50;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--line-2);
  }
  body.userlist-open .userlist { transform: translateX(0); }

  .icon-btn.toggle-sidebar,
  .icon-btn.toggle-userlist {
    display: inline-grid; place-items: center;
  }

  .main-header { padding: 10px 12px; gap: 8px; }
  .main-header .ch-info h2 { font-size: 15px; }
  .ch-info .topic { display: none; }

  /* Login kartini telefon icin daralt */
  .login-card { padding: 22px; border-radius: 16px; }
  .brand-mark { width: 42px; height: 42px; font-size: 20px; }
  .brand-text h1 { font-size: 20px; }

  /* Composer'i sadelestir */
  .composer { padding: 8px; }
  .format-bar { gap: 4px; padding-bottom: 8px; }
  .format-bar button { padding: 6px 9px; min-width: 28px; font-size: 12px; }
  .format-bar .size { font-size: 11px; }
  .format-bar .size select { padding: 4px 6px; }
  #input { padding: 10px 12px; font-size: 14px; }
  .btn-send { padding: 8px 14px !important; }

  /* Modal mobile */
  .modal-card { padding: 18px; border-radius: 14px; }
  .modal-card.large { width: 100%; }

  /* Mesajlar daha kompakt */
  .messages { padding: 10px 12px; font-size: 13px; }
  .msg .time { width: 42px; font-size: 11px; }

  /* Emoji ve renk paneli */
  .emoji-panel { grid-template-columns: repeat(8, 1fr); max-width: calc(100vw - 24px); }
  .color-panel { grid-template-columns: repeat(8, 1fr); }
}

/* ---------- Cok dar telefon (<=400px): ekstra sikilastir ---------- */
@media (max-width: 400px) {
  .main-header { padding: 8px 10px; }
  .ch-info h2 { font-size: 14px; }
  .format-bar button { padding: 5px 7px; min-width: 26px; }
  .format-bar .divider { display: none; }
  .messages { font-size: 12.5px; }
  .msg { gap: 6px; }
  .msg .time { width: 36px; }
}

/* ---------- Klavye gorunurken (mobil): composer sabit ---------- */
@media (max-width: 720px) and (max-height: 500px) {
  .ch-info .topic { display: none; }
  .format-bar { display: none; }
}

/* ---------- Genis ekran ipucu: toggle butonlari gizle ---------- */
@media (min-width: 1100px) {
  .icon-btn.toggle-sidebar { display: none; }
  /* userlist toggle masaustunde de kullanilabilir; default gizli */
}

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

/* ---------- Baglanti durum toast'u ---------- */
.conn-toast {
  position: fixed;
  top: 16px; right: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 200;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 320px;
}
.conn-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.conn-toast.info { border-color: var(--brand); }
.conn-toast.ok { border-color: var(--ok); background: linear-gradient(135deg, rgba(46,211,145,0.15), var(--bg-2)); }
.conn-toast.warn { border-color: var(--warn); background: linear-gradient(135deg, rgba(255,181,71,0.15), var(--bg-2)); }
.conn-toast.err { border-color: var(--err); background: linear-gradient(135deg, rgba(255,93,108,0.15), var(--bg-2)); }
@media (max-width: 720px) {
  .conn-toast { top: 8px; right: 8px; left: 8px; max-width: none; }
}

/* ---------- Mention vurgusu ---------- */
.msg.mention {
  background: linear-gradient(90deg, rgba(255,181,71,0.18), rgba(255,181,71,0.04) 60%, transparent);
  border-left: 3px solid var(--warn);
  padding-left: 9px !important;
  margin-left: -12px;
  margin-right: -4px;
  border-radius: 4px;
  animation: mention-pop 0.4s ease;
}
@keyframes mention-pop {
  0% { background-color: rgba(255,181,71,0.35); }
  100% { background-color: transparent; }
}
.msg.mention .nick { color: var(--warn); }

/* ---------- Sag tik context menu (kullanici listesi) ---------- */
.ctx-menu {
  position: fixed;
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  animation: fade-up 0.12s ease;
}
.ctx-menu .ctx-header {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  font-weight: 600;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.ctx-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.ctx-menu button:hover { background: var(--bg-3); }
.ctx-menu button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}
.ctx-menu button:disabled:hover { background: none; }
.ctx-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

/* ---------- A4: Tarih ayraci ---------- */
.date-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 8px;
  user-select: none;
}
.date-sep::before,
.date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.date-sep span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 2px 10px;
  background: var(--bg-3);
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* ---------- A1: Mesaj arama cubugu ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  animation: fade-up 0.15s ease;
}
.search-bar.hidden { display: none; }
#search-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
#search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91,157,255,0.18);
}
.search-count {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  min-width: 48px;
  text-align: center;
}
.search-bar .icon-btn { padding: 6px 10px; font-size: 14px; }

/* Arama eslesme vurgusu */
.msg.search-match { background: rgba(255,181,71,0.07); }
.msg.search-current {
  background: rgba(255,181,71,0.22) !important;
  outline: 1px solid var(--warn);
  border-radius: 4px;
}
.search-hl {
  background: rgba(255,181,71,0.45);
  color: #000;
  border-radius: 2px;
  padding: 0 2px;
}

/* ---------- A6: / komut oneri panosu ---------- */
.cmd-suggest {
  position: absolute;
  bottom: 56px;
  left: 12px;
  right: 12px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
  animation: fade-up 0.12s ease;
}
.cmd-suggest.hidden { display: none; }
.cmd-item {
  display: flex; flex-direction: column;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
}
.cmd-item:hover, .cmd-item.active {
  background: linear-gradient(135deg, rgba(91,157,255,0.12), rgba(196,77,255,0.06));
}
.cmd-item .cmd-name {
  font-family: ui-monospace, monospace;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
}
.cmd-item .cmd-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ---------- B5/B6: Radyo paneli (istasyon + gecmis) ---------- */
.radio-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.radio-name:hover { color: var(--brand); }
.radio-caret { color: var(--text-dim); font-size: 10px; }

.radio-panel {
  margin-top: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 8px;
  animation: fade-up 0.15s ease;
  max-height: 300px;
  overflow-y: auto;
}
.radio-panel.hidden { display: none; }
.rp-section + .rp-section { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.rp-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.rp-list { display: flex; flex-direction: column; gap: 2px; }
.rp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: background .12s;
}
.rp-item:hover { background: var(--bg-2); }
.rp-item.active {
  background: linear-gradient(135deg, rgba(91,157,255,0.18), rgba(196,77,255,0.08));
  border-left: 2px solid var(--brand);
}
.rp-item .rp-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.rp-item.active .rp-dot { background: var(--ok); animation: pulse-glow 2s infinite; }
.rp-history .rp-item {
  cursor: default;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.rp-history .rp-item:hover { background: transparent; }
.rp-song {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-time {
  font-size: 10px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}
.rp-empty {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 8px;
  font-style: italic;
}

/* ---------- B3+B4: Gorunum ayarlari modali ---------- */
.setting-group {
  margin: 14px 0;
}
.setting-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.setting-hint {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}
.setting-select {
  width: 100%;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
}
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-3);
  cursor: pointer;
  padding: 2px;
}
#font-size-slider {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  height: 4px; border-radius: 2px;
  background: var(--bg-3); outline: none;
}
#font-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gradient-brand); cursor: pointer;
}

/* Tema kartlari */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.theme-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  background: var(--bg-3);
}
.theme-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.theme-card.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(91,157,255,0.10), rgba(196,77,255,0.06));
}
.theme-swatch {
  width: 28px; height: 28px; border-radius: 7px;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
}
.theme-card .theme-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* Yazi tipi varyantlari */
body.font-mono .messages { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
body.font-sans .messages { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
body.font-serif .messages { font-family: Georgia, 'Times New Roman', serif; }
body.font-dyslexic .messages { font-family: 'OpenDyslexic', Arial, sans-serif; letter-spacing: 0.02em; line-height: 1.7; }

/* Tema preset'leri (CSS classes on body) */
body.theme-cyberpunk {
  --bg: #0a0118;
  --bg-2: #15052e;
  --bg-3: #1f0a3e;
  --line: rgba(255,0,255,0.15);
  --line-2: rgba(255,0,255,0.25);
  --brand: #00ff9f;
  --brand-2: #00cc7a;
  --accent: #ff00ff;
  --accent-2: #ff77ff;
  --gradient-brand: linear-gradient(135deg, #00ff9f 0%, #00ffff 50%, #ff00ff 100%);
}
body.theme-pastel {
  --bg: #f9f4ff;
  --bg-2: #ffffff;
  --bg-3: #f0e9fa;
  --line: rgba(150,120,200,0.10);
  --line-2: rgba(150,120,200,0.20);
  --text: #2d2342;
  --text-dim: #6b5b8a;
  --muted: #a094b8;
  --brand: #b794f4;
  --brand-2: #9f7aea;
  --accent: #f687b3;
  --accent-2: #ed64a6;
  --gradient-brand: linear-gradient(135deg, #b794f4 0%, #f687b3 50%, #fed7aa 100%);
}
body.theme-classic {
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --bg-3: #ebebeb;
  --line: rgba(0,0,0,0.10);
  --line-2: rgba(0,0,0,0.18);
  --text: #000000;
  --text-dim: #444444;
  --muted: #777777;
  --brand: #0000cc;
  --accent: #cc0000;
  --gradient-brand: linear-gradient(135deg, #0000cc, #6600cc);
}
body.theme-highcontrast {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --bg-3: #1a1a1a;
  --line: rgba(255,255,255,0.30);
  --line-2: rgba(255,255,255,0.50);
  --text: #ffffff;
  --text-dim: #cccccc;
  --muted: #999999;
  --brand: #ffff00;
  --brand-2: #ffcc00;
  --accent: #00ffff;
  --gradient-brand: linear-gradient(135deg, #ffff00, #00ffff);
}

/* ---------- B1: Tepkiler ---------- */
.msg { position: relative; }
.msg-react {
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  margin-left: 6px;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
  vertical-align: middle;
  font-family: inherit;
}
.msg:hover .msg-react { opacity: 0.7; }
.msg-react:hover { opacity: 1 !important; background: var(--line-2); color: var(--text); }

.msg-reactions {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
  flex-wrap: wrap;
}
.rxn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 1px 8px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, background .12s;
}
.rxn:hover { background: var(--line-2); transform: scale(1.05); }

.react-picker {
  position: fixed;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 24px;
  padding: 4px 6px;
  display: flex;
  gap: 2px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: fade-up 0.12s ease;
}
.react-picker button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform .12s, background .12s;
  line-height: 1;
}
.react-picker button:hover { background: var(--bg-3); transform: scale(1.2); }

/* ---------- B2: URL onizleme kartlari ---------- */
.url-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  max-width: 480px;
  margin: 6px 0 6px 58px;
  padding: 8px 10px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background .15s;
}
.url-preview:hover { background: var(--bg-2); }
.up-image {
  width: 56px; height: 56px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  flex-shrink: 0;
}
.up-body { min-width: 0; }
.up-site {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.up-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.up-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
@media (max-width: 720px) {
  .url-preview { margin-left: 0; max-width: 100%; }
}

/* ---------- C1: Profil modali ---------- */
.profile-body {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
}
.profile-loading { color: var(--text-dim); text-align: center; padding: 8px; }
.profile-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.profile-row:last-child { border-bottom: none; }
.profile-key { color: var(--text-dim); font-size: 12px; }
.profile-val { color: var(--text); word-break: break-word; font-family: ui-monospace, monospace; }
.profile-val .badge {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  background: var(--gradient-brand); color: white; font-size: 11px; margin-right: 4px;
}
.profile-channels {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.profile-channels span {
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 10px; font-size: 11px;
}

/* ---------- C2: Arkadaslar listesi ---------- */
.friends-body { max-height: 50vh; overflow-y: auto; }
.friend-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  transition: background .15s;
}
.friend-row:hover { background: var(--bg-3); }
.friend-row .friend-status {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
}
.friend-row.online .friend-status { background: var(--ok); animation: pulse-glow 2s infinite; }
.friend-row .friend-nick { flex: 1; font-weight: 500; font-size: 13px; }
.friend-row .friend-actions { display: flex; gap: 4px; }
.friend-row .friend-actions button {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 6px; padding: 4px 8px; font-size: 11px; cursor: pointer;
}
.friend-row .friend-actions button:hover { color: var(--text); border-color: var(--brand); }

/* ---------- C3: Kanal istatistik widget'i ---------- */
.chanstats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.stat-val {
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.stat-card.wide { grid-column: span 2; }
.top-list { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12px; }
.top-list li {
  display: flex; justify-content: space-between;
  padding: 3px 0; color: var(--text-dim);
  border-bottom: 1px dashed var(--line);
}
.top-list li:last-child { border-bottom: none; }
.top-list li .nick { color: var(--text); }

/* ---------- E2: Remember password checkbox ---------- */
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.field-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.field-row span { line-height: 1.4; }

/* ---------- E3: Engelleme paneli ---------- */
.ignore-body { max-height: 50vh; overflow-y: auto; }
.ignore-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line);
  margin: 4px 0;
}
.ignore-row .ignore-nick { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }
.ignore-add {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.ignore-add input {
  flex: 1; padding: 8px 12px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 13px;
}

/* ---------- E4: NSFW mask ---------- */
.msg-mask {
  color: var(--muted) !important;
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 1px;
}
.msg-mask::after {
  content: ' (göster)';
  font-size: 10px;
  color: var(--brand);
}
.msg-mask.revealed { color: var(--text) !important; background: transparent; letter-spacing: normal; }
.msg-mask.revealed::after { content: ''; }

/* ---------- E1: E2EE indicator ---------- */
.msg .e2e-lock {
  display: inline-block;
  margin-right: 4px;
  color: var(--ok);
  font-size: 11px;
  vertical-align: middle;
}
.msg.e2e-failed .text { color: var(--err); font-style: italic; }
.e2e-prompt {
  background: rgba(46, 211, 145, 0.08);
  border: 1px dashed var(--ok);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--text-dim);
}
.e2e-prompt strong { color: var(--ok); }

/* ---------- F5: Avatar ---------- */
.avatar {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 5px;
}
.avatar-sm { width: 20px; height: 20px; margin-right: 4px; border-radius: 4px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 14px; box-shadow: var(--shadow-md); }
#ul-list li .avatar { vertical-align: middle; }

/* ---------- Birleşik Ayarlar Modali ---------- */
.settings-card {
  width: min(880px, 95vw);
  max-width: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--gradient-card);
}
.settings-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.settings-body {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 480px;
  overflow: hidden;
}
.settings-nav {
  background: var(--bg-3);
  border-right: 1px solid var(--line);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.settings-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.settings-tab:hover { background: var(--bg-2); color: var(--text); }
.settings-tab.active {
  background: linear-gradient(135deg, rgba(91,157,255,0.18), rgba(196,77,255,0.08));
  color: var(--text);
  border-left: 3px solid var(--brand);
  padding-left: 9px;
}
.settings-content {
  padding: 18px 24px;
  overflow-y: auto;
}
.settings-pane.hidden { display: none; }
.settings-pane { animation: fade-up 0.18s ease; }
.settings-section {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.settings-section:last-child { border-bottom: none; }
.settings-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.setting-row > span:first-child { color: var(--text); }
.setting-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}
.setting-row input[type="range"] { width: 60%; max-width: 240px; cursor: pointer; }
.setting-row input[type="time"],
.setting-row input[type="text"].setting-select,
.setting-row textarea.setting-select { font-family: inherit; }
.settings-section .modal-actions { padding-top: 8px; }
@media (max-width: 720px) {
  .settings-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 8px;
  }
  .settings-tab { white-space: nowrap; padding: 8px 12px; }
  .settings-tab.active { border-left: none; border-bottom: 3px solid var(--brand); padding-left: 12px; }
  .settings-content { padding: 14px; }
}

/* ---------- Mobil dokunma iyileştirmeleri ---------- */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
button, .btn, .icon-btn, .side-btn, .tab, .settings-tab, [role="button"] {
  touch-action: manipulation;  /* 300ms tap gecikmesini kaldir */
}
/* Iframe, input, textarea icin user-select kapatma (yazilabilirligi koruyalim) */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }

@media (max-width: 720px) {
  /* Touch hedefleri en az 40px */
  .btn, .icon-btn, .side-btn, .menu-list button, .modal-actions button {
    min-height: 40px;
  }
  .icon-btn { min-width: 40px; }
  .ctx-menu button { min-height: 38px; padding: 9px 12px; }
  .format-bar button { min-height: 36px; min-width: 36px; }
  /* Klavye gorununce input zoom'unu engelle (font-size >= 16px) */
  #input, .field input, .setting-select, #search-input, #ignore-input,
  #notif-highlight-words, #nsfw-words, #e2e-pass, #brand-color, #accent-color {
    font-size: 16px;
  }
  /* Modal mobile padding */
  .modal { padding: 8px; }
  .modal-card { padding: 16px; border-radius: 14px; max-height: 90vh; overflow-y: auto; }
  .modal-card h3 { font-size: 16px; margin-bottom: 12px; }
  /* Settings modal mobile - tabs daha dokunulabilir */
  .settings-tab { min-height: 44px; font-size: 14px; }
  .settings-nav { gap: 4px; }
  /* Login card mobile */
  .login { padding: 12px; }
  .login-card { padding: 24px 20px; border-radius: 16px; }
  /* Tabbar dokunma alani */
  .tab { padding: 12px; min-height: 44px; }
  /* Userlist mobile  */
  #ul-list li { padding: 10px 12px; min-height: 40px; }
  /* Composer mobile */
  #input { min-height: 44px; padding: 12px 14px; }
  .btn-send { min-height: 44px !important; }
  /* Radyo player mobile - hedefler buyuk */
  .radio-play { width: 44px !important; height: 44px !important; }
  .radio-mute { min-width: 36px; min-height: 36px; }
  /* Tab close (x) butonu da buyuk olsun */
  .tab .x { min-width: 28px; min-height: 28px; padding: 4px 8px; opacity: 1; }
}

/* iPhone notch / safe-area */
@supports (padding: max(0px)) {
  .main-header { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .composer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body.sidebar-open .sidebar { padding-left: env(safe-area-inset-left); padding-top: env(safe-area-inset-top); }
  body.userlist-open .userlist { padding-right: env(safe-area-inset-right); padding-top: env(safe-area-inset-top); }
}

/* Mobil dikey klavye gorunurken composer overflow */
@media (max-width: 720px) {
  .composer { position: sticky; bottom: 0; z-index: 5; }
}

/* === PM Aksiyon Bar (Whois / Engelle / Sesli / Görüntülü / VIP) === */
.pm-action-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--border, #2a2f3a);
  background: var(--bg-elev, rgba(255,255,255,0.03));
  flex-wrap: wrap;
}
.pm-action-bar.hidden { display: none !important; }
.pm-action-bar .pm-peer-wrap {
  font-weight: 600; color: var(--accent, #7aa7ff);
  margin-right: 6px;
}
.pm-action-bar .btn-sm {
  font-size: 13px; padding: 6px 10px; border-radius: 6px;
  background: var(--btn-bg, #2a2f3a); color: var(--text, #e6e6e6);
  border: 1px solid var(--border, #3a4150); cursor: pointer;
  transition: background .15s, transform .05s;
}
.pm-action-bar .btn-sm:hover { background: var(--btn-bg-hover, #353c4a); }
.pm-action-bar .btn-sm:active { transform: translateY(1px); }
.pm-action-bar .vip-link {
  background: linear-gradient(135deg, #f4c430 0%, #d4a017 100%);
  color: #111; border-color: #b8870a; font-weight: 600;
}
.pm-action-bar .vip-link:hover { filter: brightness(1.08); }

@media (max-width: 720px) {
  .pm-action-bar { gap: 4px; padding: 6px 8px; }
  .pm-action-bar .btn-sm { font-size: 12px; padding: 8px; min-height: 36px; }
}

/* === VIP Modal === */
.vip-body { padding: 8px 0 4px; }
.vip-why { background: rgba(244,196,48,.1); border: 1px solid #b8870a; color: #f4c430;
  padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.vip-price { font-size: 22px; margin: 8px 0; }
.vip-price b { color: #f4c430; font-size: 28px; }
.vip-perks { list-style: none; padding: 0; margin: 12px 0; }
.vip-perks li { padding: 4px 0; }
.vip-quota { background: var(--bg-elev, rgba(255,255,255,0.04)); border-radius: 6px;
  padding: 8px 10px; margin: 10px 0; font-size: 13px; }
.vip-quota div + div { margin-top: 4px; }
.vip-active { color: #5ec56e; font-weight: 600; }
.vip-inactive { color: #888; }
.vip-contact { font-size: 13px; color: var(--muted, #aaa); margin-top: 8px; }

/* === Çağrı modali === */
#modal-call .modal-card.large { max-width: 720px; }
#modal-call #call-status { font-size: 14px; color: var(--muted, #aaa); margin-bottom: 6px; }
#modal-call .modal-actions { gap: 8px; flex-wrap: wrap; }

/* === Kanal disinda userlist'i gizle === */
body.hide-userlist .userlist { display: none !important; }
body.hide-userlist .content { grid-template-columns: 1fr !important; }
body.hide-userlist .toggle-userlist { display: none !important; }

/* === PM aksiyon bar buton kontrast tazeleme === */
.pm-action-bar .btn-sm {
  background: rgba(122, 167, 255, 0.10) !important;
  color: #fff !important;
  border: 1px solid rgba(122, 167, 255, 0.45) !important;
  font-weight: 500;
  padding: 7px 12px !important;
  border-radius: 6px;
}
.pm-action-bar .btn-sm:hover {
  background: rgba(122, 167, 255, 0.20) !important;
  border-color: rgba(122, 167, 255, 0.75) !important;
}
.pm-action-bar .btn-sm[data-act="pm-voice"] {
  background: rgba(94, 197, 110, 0.14) !important;
  border-color: rgba(94, 197, 110, 0.55) !important;
}
.pm-action-bar .btn-sm[data-act="pm-voice"]:hover { background: rgba(94, 197, 110, 0.26) !important; }
.pm-action-bar .btn-sm[data-act="pm-video"] {
  background: rgba(255, 159, 67, 0.14) !important;
  border-color: rgba(255, 159, 67, 0.55) !important;
}
.pm-action-bar .btn-sm[data-act="pm-video"]:hover { background: rgba(255, 159, 67, 0.26) !important; }
.pm-action-bar .btn-sm[data-act="pm-ignore"] {
  background: rgba(255, 93, 108, 0.12) !important;
  border-color: rgba(255, 93, 108, 0.45) !important;
}
.pm-action-bar .btn-sm[data-act="pm-ignore"]:hover { background: rgba(255, 93, 108, 0.24) !important; }
body.theme-light .pm-action-bar .btn-sm { color: #1a1f2c !important; }

/* === Gomulu cagri penceresi: kendi kontrol bari === */
.call-controls {
  display: flex; gap: 10px; justify-content: center;
  padding: 12px; flex-wrap: wrap;
}
.call-controls .call-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--border, #3a4150);
  background: var(--btn-bg, #2a2f3a); color: #fff;
  cursor: pointer; font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .05s;
}
.call-controls .call-btn:hover { background: var(--btn-bg-hover, #353c4a); }
.call-controls .call-btn:active { transform: scale(0.94); }
.call-controls .call-btn.off {
  background: rgba(255, 93, 108, 0.22);
  border-color: rgba(255, 93, 108, 0.6);
}
.call-controls .call-btn.danger {
  background: #d94454; border-color: #b3343f; color: #fff;
}
.call-controls .call-btn.danger:hover { background: #c93444; }
.call-controls .call-label {
  display: block; font-size: 11px; margin-top: 4px; color: var(--muted, #aaa);
  text-align: center;
}
.call-ctrl-wrap { display: inline-flex; flex-direction: column; align-items: center; }

/* Jitsi iframe icindeki default toolbar'i tamamen sakla */
.call-jitsi-frame {
  width: 100%; height: 56vh; border: 0; border-radius: 8px;
  display: block; background: #000;
}
#call-container { display: block; min-height: 56vh; }

/* === Sesli arama paneli (timer + avatar) === */
.call-voice-panel {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px; gap: 12px;
  background: linear-gradient(180deg, rgba(122,167,255,0.08), rgba(94,197,110,0.04));
  border-radius: 12px; margin: 10px 0;
}
.call-voice-panel.hidden { display: none; }
.call-voice-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, #4a76d4 0%, #6ed085 100%);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff; box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  animation: callPulse 2s ease-in-out infinite;
}
@keyframes callPulse {
  0%   { box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 0 rgba(94,197,110,0.55); }
  70%  { box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 18px rgba(94,197,110,0); }
  100% { box-shadow: 0 6px 18px rgba(0,0,0,0.35), 0 0 0 0 rgba(94,197,110,0); }
}
.call-voice-panel.connected .call-voice-avatar { animation: none; }
.call-voice-peer { font-size: 22px; font-weight: 600; color: var(--text, #fff); }
.call-voice-state { font-size: 14px; color: var(--muted, #aaa); }
.call-voice-timer {
  font-size: 38px; font-variant-numeric: tabular-nums;
  letter-spacing: 2px; color: #fff; font-weight: 500;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.call-voice-timer.warn { color: #ffb84a; }
.call-voice-timer.crit { color: #ff5d6c; }
.call-voice-progress {
  width: min(360px, 90%); height: 6px; background: rgba(255,255,255,0.1);
  border-radius: 3px; overflow: hidden;
}
.call-voice-progress-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #5ec56e 0%, #ffb84a 70%, #ff5d6c 100%);
  transition: width 1s linear;
}

/* Light tema */
body.theme-light .call-voice-timer { color: #1a1f2c; }
body.theme-light .call-voice-peer  { color: #1a1f2c; }
body.theme-light .call-voice-progress { background: rgba(0,0,0,0.08); }

/* Sesli aramada Jitsi iframe gizli; sadece arka planda calisir */
#modal-call.voice-mode #call-container { display: none !important; }
#modal-call.voice-mode #call-container iframe { width: 0 !important; height: 0 !important; }


/* === Üst yatay menü çubuğu === */
.top-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: var(--bg-elev, rgba(255,255,255,0.03));
  border-bottom: 1px solid var(--border, #2a2f3a);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.top-bar::-webkit-scrollbar { height: 4px; }
.top-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
.top-grow { flex: 1; min-width: 0; }
.top-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text, #e6e6e6);
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.top-btn:hover  { background: rgba(122,167,255,0.10); border-color: rgba(122,167,255,0.32); }
.top-btn:active { transform: translateY(1px); }
.top-btn .top-ico { font-size: 18px; line-height: 1; }
.top-btn .top-lbl { font-weight: 500; }
.top-btn.vip-top {
  background: linear-gradient(135deg, rgba(244,196,48,0.18), rgba(212,160,23,0.18));
  border-color: rgba(244,196,48,0.45);
  color: #f4c430;
}
.top-btn.vip-top:hover { background: linear-gradient(135deg, rgba(244,196,48,0.30), rgba(212,160,23,0.30)); }
body.theme-light .top-bar { background: rgba(0,0,0,0.03); }
body.theme-light .top-btn { color: #1a1f2c; }
body.theme-light .top-btn:hover { background: rgba(122,167,255,0.12); }

/* Mobilde sadece ikonlar */
@media (max-width: 720px) {
  .top-bar { padding: 6px 8px; gap: 4px; }
  .top-btn { padding: 8px; min-height: 40px; min-width: 40px; justify-content: center; }
  .top-btn .top-lbl { display: none; }
  .top-btn .top-ico { font-size: 20px; }
}

/* === Settings nav: mobilde yatay scroll === */
.settings-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  white-space: nowrap;
}
.settings-tab { white-space: nowrap; }
@media (max-width: 720px) {
  .settings-tab { padding: 10px 12px; font-size: 13px; }
}

/* === Ses & Arama paneli === */
.calls-usage {
  display: grid; gap: 8px;
  background: var(--bg-elev, rgba(255,255,255,0.04));
  padding: 12px; border-radius: 8px; margin-bottom: 10px;
}
.calls-usage-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
}
.calls-usage-row b { color: var(--accent, #5ec56e); font-size: 16px; }

/* === Menu modal section title === */
.menu-list .menu-section-title {
  list-style: none;
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted, #8a92a3);
  margin: 10px 8px 4px;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.menu-list .menu-section-title:first-child { margin-top: 4px; }
body.theme-light .menu-list .menu-section-title { border-bottom-color: rgba(0,0,0,0.08); }


/* ================================================================
   Modern arama modali (Discord/Telegram tarzi, tema-uyumlu)
   - Dark tema: koyu yuzey, beyaz metin
   - Light tema: beyaz yuzey, koyu metin
   - Vurgu renkleri (yesil/kirmizi/mavi/turuncu) iki temada da ayni
   ================================================================ */

/* Renk tokenleri */
:root {
  --call-bg:        #1e1f22;
  --call-surface:   #2b2d31;
  --call-ctrl-bg:   #3a3c43;
  --call-ctrl-hov:  #4a4d56;
  --call-text:      #f2f3f5;
  --call-muted:     #b5bac1;
  --call-border:    rgba(255,255,255,0.06);
  --call-divider:   rgba(255,255,255,0.08);
  --call-overlay:   rgba(0,0,0,0.55);
  --call-progress-track: rgba(255,255,255,0.10);
  --call-accept:    #23a559;
  --call-accept-soft: rgba(35,165,89,0.16);
  --call-hangup:    #ed4245;
  --call-hangup-soft: rgba(237,66,69,0.16);
  --call-video:     #4f9eff;
  --call-video-soft: rgba(79,158,255,0.16);
  --call-warn:      #ed4245;
  --call-warn-soft: rgba(237,66,69,0.16);
  --call-video-bg:  #0e0e10;
  --call-video-tile:#1f2937;
}
body.theme-light {
  --call-bg:        #ffffff;
  --call-surface:   #f4f4f5;
  --call-ctrl-bg:   #e4e4e7;
  --call-ctrl-hov:  #d4d4d8;
  --call-text:      #18181b;
  --call-muted:     #71717a;
  --call-border:    rgba(0,0,0,0.06);
  --call-divider:   rgba(0,0,0,0.08);
  --call-overlay:   rgba(0,0,0,0.40);
  --call-progress-track: rgba(0,0,0,0.10);
  --call-video-bg:  #18181b;
}

/* Modal genel */
#modal-call.modal { background: var(--call-overlay); }
#modal-call .call-modal-card {
  background: var(--call-bg);
  color: var(--call-text);
  border: 1px solid var(--call-border);
  border-radius: 16px;
  padding: 26px 24px 22px;
  max-width: 440px;
  width: 95%;
}
#modal-call.voice-mode .call-modal-card { padding: 22px 22px 20px; max-width: 380px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Durum rozeti */
.call-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
  background: var(--call-accept-soft); color: var(--call-accept);
  margin: 0 auto 14px; width: fit-content;
}
.call-badge.is-incoming { background: var(--call-accept-soft); color: var(--call-accept); }
.call-badge.is-active   { background: var(--call-accept-soft); color: var(--call-accept); }
.call-badge.is-video    { background: var(--call-video-soft);  color: var(--call-video); }
.call-badge.is-ended    { background: var(--call-hangup-soft); color: var(--call-hangup); }
.call-badge .ti { font-size: 13px; }
#modal-call { text-align: center; }

/* SESLI panel */
.call-voice-panel { display: flex; flex-direction: column; align-items: center; padding: 8px 0 0; }
.call-voice-panel.hidden { display: none; }
.call-voice-avatar {
  width: 116px; height: 116px; border-radius: 50%;
  background: #5865f2; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 500;
  border: 2px solid var(--call-border);
  margin: 6px 0 14px;
  position: relative;
}
.call-voice-avatar .ti { font-size: 54px; }
.call-voice-panel:not(.connected) .call-voice-avatar::before,
.call-voice-panel:not(.connected) .call-voice-avatar::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--call-accept);
  opacity: 0.0; animation: callPulse 2.1s ease-out infinite;
}
.call-voice-panel:not(.connected) .call-voice-avatar::after { animation-delay: 0.9s; }
@keyframes callPulse {
  0%   { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.45); opacity: 0; }
}
.call-voice-peer  { font-size: 20px; font-weight: 500; margin: 0; color: var(--call-text); }
.call-voice-state { font-size: 13px; color: var(--call-muted); margin: 4px 0 0; }
.call-voice-timer {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 38px; font-weight: 500;
  letter-spacing: 2px;
  margin: 18px 0 4px;
  color: var(--call-text);
}
.call-voice-timer.warn { color: #ffb84a; }
.call-voice-timer.crit { color: var(--call-hangup); }
.call-voice-quota { font-size: 11px; color: var(--call-muted); margin: 0 0 12px; }
.call-voice-progress {
  width: min(360px, 90%); height: 5px; border-radius: 3px;
  background: var(--call-progress-track); overflow: hidden;
  margin: 0 auto 18px;
}
.call-voice-progress-fill {
  height: 100%; width: 100%;
  background: var(--call-accept);
  border-radius: 3px;
  transition: width 1s linear, background-color 0.4s ease;
}
.call-voice-timer.warn ~ .call-voice-progress .call-voice-progress-fill,
.call-voice-progress-fill.warn { background: #ffb84a; }
.call-voice-timer.crit ~ .call-voice-progress .call-voice-progress-fill,
.call-voice-progress-fill.crit { background: var(--call-hangup); }

/* GORUNTULU panel */
.call-video-frame {
  background: var(--call-video-bg);
  border: 1px solid var(--call-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  text-align: left;
  margin: 0 0 16px;
}
.call-video-frame.hidden { display: none; }
.call-video-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 12px;
}
.call-video-peer { display: inline-flex; align-items: center; gap: 8px; }
.call-video-rec  { width: 8px; height: 8px; border-radius: 50%; background: var(--call-hangup); display: inline-block; animation: callRec 1.6s ease-in-out infinite; }
@keyframes callRec { 50% { opacity: 0.3; } }
.call-video-time { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.call-video-quota { color: var(--call-muted); font-size: 11px; }
.call-video-stage { min-height: 240px; background: #1f2937; position: relative; }
.call-video-stage iframe { width: 100% !important; height: 100% !important; min-height: 240px; border: 0; display: block; }
.call-video-progress { height: 4px; background: var(--call-progress-track); }
.call-video-progress-fill { height: 100%; width: 100%; background: var(--call-accept); transition: width 1s linear, background-color 0.4s ease; }
.call-video-progress-fill.warn { background: #ffb84a; }
.call-video-progress-fill.crit { background: var(--call-hangup); }

/* Sade alt-status */
.call-substatus { font-size: 12px; color: var(--call-muted); margin: 6px 0 12px; min-height: 16px; }

/* ZIL aksiyonlari (Cevapla / Reddet) */
.call-ring-actions { display: flex; justify-content: center; gap: 32px; padding: 6px 0 0; }
.call-ring-actions.hidden { display: none; }
.call-ring-actions .call-btn { width: 60px; height: 60px; font-size: 26px; }
.call-ring-actions .call-label { margin-top: 8px; }

/* AKTIF kontroller (mic / engelle / kapat) */
.call-controls { display: flex; justify-content: center; gap: 22px; padding: 6px 0 0; flex-wrap: wrap; }
.call-controls.hidden { display: none; }

/* Daire buton ortak */
.call-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--call-ctrl-bg);
  color: var(--call-text);
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.05s, color 0.15s;
}
.call-btn .ti { font-size: 22px; line-height: 1; }
.call-btn:hover  { background: var(--call-ctrl-hov); }
.call-btn:active { transform: scale(0.94); }
.call-btn-accept { background: var(--call-accept); color: #fff; }
.call-btn-accept:hover { background: #1f8b4c; }
.call-btn-danger { background: var(--call-hangup); color: #fff; }
.call-btn-danger:hover { background: #c83a3c; }
.call-btn-warn   { background: var(--call-warn-soft); color: var(--call-warn); }
.call-btn-warn:hover { background: rgba(237,66,69,0.28); }
.call-btn.off    { background: var(--call-hangup-soft); color: var(--call-hangup); position: relative; }
.call-btn.off::after {
  content: ''; position: absolute; left: 14%; right: 14%; top: 50%;
  height: 2px; background: currentColor; transform: rotate(-45deg);
  border-radius: 1px;
}
.call-ctrl-wrap { display: inline-flex; flex-direction: column; align-items: center; }
.call-label { font-size: 11px; color: var(--call-muted); margin-top: 6px; }

/* Sesli moddayken eski jitsi container'i sakla, video moddayken voice paneli */
#modal-call.voice-mode #call-video-frame { display: none !important; }
#modal-call.video-mode #call-voice-panel { display: none !important; }
#modal-call.voice-mode #call-container   { display: none !important; }

/* Mobil */
@media (max-width: 720px) {
  #modal-call .call-modal-card { padding: 20px 16px; }
  .call-voice-avatar { width: 96px; height: 96px; }
  .call-voice-avatar .ti { font-size: 44px; }
  .call-voice-timer { font-size: 32px; }
  .call-ring-actions { gap: 22px; }
  .call-ring-actions .call-btn { width: 56px; height: 56px; }
  .call-controls { gap: 14px; }
  .call-btn { width: 48px; height: 48px; }
  .call-btn .ti { font-size: 20px; }
}

