:root {
  --bg: #111315;
  --panel: #1a1d20;
  --tile: #23272b;
  --tile-hover: #2b3035;
  --line: #2f3439;
  --text: #f1f4f2;
  --muted: #9aa39e;
  --accent: #2ecc71;
  --accent-dark: #123524;
  --on-accent: #07150d;
  --danger: #e5484d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100%; background: var(--bg); }

/* Yan menü */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; }
.brand-logo { width: 40px; height: 40px; flex: none; margin: -6px -4px -6px -6px; }

/* Bağlantı kalitesi */
.clock { margin-top: auto; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--tile); border-radius: 10px; font-size: 16px; font-weight: 600; color: #d5dbd7; }
.clock-date { display: flex; flex-wrap: wrap; gap: 5px; }
.clock-time { color: var(--text); font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.topbar-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.call-timer { color: var(--accent); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.call-stats { padding: 2px 10px; background: var(--tile); border-radius: 999px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-stats[data-level="3"], .call-stats[data-level="4"] { color: var(--accent); }
.call-stats[data-level="2"] { color: #f5b83d; }
.call-stats[data-level="1"] { color: #ff8b8e; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; cursor: pointer; }
.check-row input { margin: 0; accent-color: var(--accent); }
.toast.info { border-color: var(--accent); }
.message-image { display: block; max-width: 100%; max-height: 220px; margin-top: 4px; padding: 0; background: none; border: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.message-image img { display: block; max-width: 100%; max-height: 220px; }
.image-dialog { width: auto; max-width: 92vw; max-height: 92vh; padding: 0; background: #000; cursor: zoom-out; }
.image-dialog img { display: block; max-width: 92vw; max-height: 92vh; }
.connection { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--tile); border-radius: 8px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; flex: none; }
.bars i { width: 5px; background: #5f676e; border-radius: 2px; }
.bars i:nth-child(1) { height: 25%; }
.bars i:nth-child(2) { height: 50%; }
.bars i:nth-child(3) { height: 75%; }
.bars i:nth-child(4) { height: 100%; }
.connection[data-level="4"] .bars i,
.connection[data-level="3"] .bars i:nth-child(-n+3) { background: var(--accent); }
.connection[data-level="2"] .bars i:nth-child(-n+2) { background: #f5b83d; }
.connection[data-level="1"] .bars i:nth-child(1) { background: var(--danger); }
.connection-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.connection-label { font-size: 13px; font-weight: 600; }
.connection-detail { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-ms { margin-left: auto; flex: none; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.connection[data-level="3"] .connection-ms, .connection[data-level="4"] .connection-ms { color: var(--accent); }
.connection[data-level="2"] .connection-ms { color: #f5b83d; }
.connection[data-level="1"] .connection-ms { color: #ff8b8e; }

.tile-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 0 8px; }
.tile-badge { width: 30px; height: 30px; display: grid; place-items: center; background: var(--danger); border-radius: 50%; color: #fff; }
.tile-badge svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tile.has-video .tile-badges { position: absolute; top: 10px; right: 10px; padding: 0; justify-content: flex-end; z-index: 2; }

/* Konuşan kişinin kutusu yeşil çerçeve alır. */
.tile.speaking { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* Sol üstteki tutamaç: kutuyu sürükleyip başka kutunun yerine bırakınca yer değiştirir. */
.tile-drag { position: absolute; top: 8px; left: 8px; z-index: 3; display: none; align-items: center; gap: 6px; padding: 6px 9px; background: rgba(0, 0, 0, .7); border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; color: #fff; font-size: 13px; cursor: grab; touch-action: none; user-select: none; }
.tile-drag svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.tile-drag:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile:hover .tile-drag, .tile:focus-within .tile-drag, .tile.dragging .tile-drag { display: flex; }
.tile:fullscreen .tile-drag { display: none !important; }
.tile.dragging { z-index: 10; opacity: .85; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); cursor: grabbing; transition: none; }
.tile.dragging .tile-drag { cursor: grabbing; }
.tile.drop-target { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent); }
.tile.drop-target::after { content: "Buraya bırak"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(46, 204, 113, .18); color: #fff; font-size: 18px; font-weight: 700; z-index: 4; }
.videos.dragging-active .tile { transition: none; }

/* Mikrofon ayarları */
.popover h3 output { float: right; color: var(--text); letter-spacing: 0; }
.popover input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); }
.meter { position: relative; height: 8px; margin-top: 8px; background: var(--tile); border-radius: 4px; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.meter.closed i { background: #5f676e; }
.meter b { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented input:disabled + span { opacity: .45; cursor: not-allowed; }

/* Kişiye özel ses */
.volume-popover { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); width: min(260px, calc(100% - 16px)); padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; z-index: 3; font-size: 13px; }
.volume-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.volume-head output { font-weight: 600; color: var(--accent); }
.volume-popover input { width: 100%; margin: 0; accent-color: var(--accent); }
.volume-ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

/* Sohbet */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 16px; }
.chat-head .sidebar-toggle { margin: 0; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.chat-empty { margin: auto; color: var(--muted); font-size: 14px; text-align: center; }
/* Karşının mesajları solda, sizinkiler sağda. */
.message { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.message.theirs { align-self: flex-start; }
.message.mine { align-self: flex-end; flex-direction: row-reverse; }
.message .avatar.small { width: 30px; height: 30px; font-size: 13px; }
.bubble { min-width: 0; padding: 7px 10px 5px; background: var(--tile); border-radius: 12px 12px 12px 4px; }
.message.mine .bubble { background: #11512f; border-radius: 12px 12px 4px 12px; }
.message.flash .bubble { box-shadow: 0 0 0 2px var(--accent); }
.message-meta { font-size: 13px; font-weight: 700; color: var(--accent); }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-foot { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: 11px; color: #a8b3ad; }
.ticks { display: inline-flex; color: #a8b3ad; }
.ticks svg { width: 18px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ticks[data-state="read"] { color: #53bdeb; }
.reply-quote { display: block; width: 100%; margin: 2px 0 5px; padding: 4px 8px; background: rgba(0, 0, 0, .28); border: 0; border-left: 3px solid var(--accent); border-radius: 6px; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.reply-quote strong { display: block; color: var(--accent); font-size: 12px; }
.reply-quote span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9d0cc; max-width: 220px; }
.message-reply { align-self: center; width: 30px; height: 30px; flex: none; display: grid; place-items: center; padding: 0; background: var(--tile); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; opacity: 0; }
.message:hover .message-reply, .message-reply:focus-visible { opacity: 1; }
.message-reply:hover { color: var(--accent); border-color: var(--accent); }
.message-reply svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reply-bar { display: flex; align-items: center; gap: 8px; margin: 8px 12px 0; padding: 6px 6px 6px 10px; background: var(--tile); border-left: 3px solid var(--accent); border-radius: 8px; }
.reply-bar-text { flex: 1; min-width: 0; font-size: 13px; }
.reply-bar-text strong { display: block; color: var(--accent); }
.reply-bar-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c9d0cc; }
.reply-bar .sidebar-toggle { margin: 0; width: 30px; height: 30px; }
.typing { padding: 6px 14px 0; color: var(--accent); font-size: 13px; font-style: italic; }
.emoji-panel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 12px 0; }
.emoji-panel button { padding: 6px 0; background: none; border: 0; border-radius: 8px; font-size: 22px; line-height: 1.2; cursor: pointer; }
.emoji-panel button:hover { background: var(--tile); }
.chat-form { padding: 10px 12px 12px; }
.chat-form textarea { width: 100%; padding: 8px 10px; background: var(--tile); border: 1px solid var(--line); border-radius: 8px; color: var(--text); font: inherit; resize: none; }
.chat-tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.chat-tool { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: var(--tile); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.chat-tool:hover { background: var(--tile-hover); }
.chat-tool:disabled { opacity: .45; cursor: not-allowed; }
.chat-tool[aria-pressed="true"] { background: var(--danger); border-color: var(--danger); color: #fff; }
.chat-tool[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.chat-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-send { margin-left: auto; }
.chat-toggle { position: fixed; right: 12px; bottom: 12px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; background: var(--accent); border: 0; border-radius: 12px; color: var(--on-accent); cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); z-index: 15; }
.chat-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chat-unread { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; background: var(--danger); border-radius: 10px; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

.control-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 8px 12px; background: rgba(229, 72, 77, .14); border: 1px solid var(--danger); border-radius: 10px; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.dialog-text { margin: 0 0 12px; color: var(--muted); }

.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border: 1px dashed #f5b83d; border-radius: 10px; font-size: 13px; }
.demo-bar strong { color: #f5b83d; }
.demo-bar .button { padding: 4px 10px; font-size: 13px; }
.sidebar-toggle {
  margin-left: auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.sidebar-toggle:hover { background: var(--tile); color: var(--text); }
.sidebar-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.section-title {
  margin: 28px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.rooms { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }
.room {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.room:hover { background: var(--tile); color: var(--text); }
.room[aria-current="true"] { background: var(--accent-dark); color: var(--accent); font-weight: 600; }
.room svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room-member { display: flex; align-items: center; gap: 8px; padding: 2px 10px 6px 40px; font-size: 14px; }
.room-member span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 6px 4px;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.profile:hover .gear { color: var(--accent); }
.profile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profile-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-state { color: var(--muted); font-size: 13px; }
.gear { width: 18px; height: 18px; flex: none; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Görüntü alanı */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 18px 22px; gap: 16px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar h1 { margin: 0; font-size: 18px; }
.status { color: var(--muted); background: var(--tile); padding: 3px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap; }
.status.live { color: var(--accent); background: var(--accent-dark); }

/* Kutuların yeri ve boyutu app.js içindeki layoutVideos ile hesaplanır. */
.videos { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.tile {
  position: absolute;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}
.screen-tile { background: #000; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile video.mirror { transform: scaleX(-1); }

/* Sabitle ve tam ekran */
.tile.pinned { border-color: var(--accent); }
.room-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.app.collapsed .room-count { display: none; }
.tile.compact .avatar { width: 48px; height: 48px; font-size: 20px; }
.tile.compact:not(:hover):not(:focus-within) .tile-actions { display: none; }

.hidden-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.hidden-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--tile); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.hidden-chip:hover { border-color: var(--accent); color: var(--accent); }
.hidden-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tile-actions {
  display: none;
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 44px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.tile-action { pointer-events: auto; }
.tile-action:disabled { opacity: .55; cursor: not-allowed; background: rgba(0, 0, 0, .68); border-color: rgba(255, 255, 255, .16); color: #fff; }
/* Düğmeler yalnızca fare o kutunun üstündeyken görünür. */
.tile.has-video:hover .tile-actions, .tile.person:hover .tile-actions,
.tile.has-video:focus-within .tile-actions, .tile.person:focus-within .tile-actions,
.tile.menu-open .tile-actions { display: flex; }
.tile.dragging .tile-actions { display: none !important; }
.tile-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, .68);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.tile-action:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile-action[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tile:fullscreen { left: 0 !important; top: 0 !important; width: 100vw !important; height: 100vh !important; border: 0; border-radius: 0; background: #000; }
.tile:fullscreen video, .tile.pinned video { object-fit: contain; }
.tile:fullscreen .tile-actions, .tile:fullscreen .tile-label { transition: opacity .2s; }
.tile.idle { cursor: none; }
.tile.idle .tile-actions, .tile.idle .tile-label { opacity: 0; pointer-events: none; }
.screen-tile video { object-fit: contain; }
.tile-note { color: var(--muted); font-size: 14px; text-align: center; padding: 0 12px; }
.tile-label {
  position: absolute; left: 10px; bottom: 10px; right: auto;
  max-width: calc(100% - 20px);
  background: rgba(0, 0, 0, .6);
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--accent) center / cover no-repeat;
  color: var(--on-accent);
  font-size: 34px; font-weight: 700;
}
.avatar.small { width: 36px; height: 36px; font-size: 15px; }
.avatar.tiny { width: 22px; height: 22px; font-size: 11px; }
.avatar.muted { background: var(--line); color: var(--muted); }

/* Alt düğmeler */
.controls { position: relative; padding-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.control-group { display: flex; min-width: 0; }
.control {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.control-group .control { border-radius: 10px 0 0 10px; border-right: 0; }
.control svg, .chevron svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.control:hover, .chevron:hover { background: var(--tile-hover); }
.control[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.control.leave { background: var(--danger); border-color: var(--danger); color: #fff; }
.control.leave:disabled { opacity: .4; cursor: default; }
.chevron {
  width: 22px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.chevron svg { width: 16px; height: 16px; transition: transform .12s; }
.chevron[aria-expanded="true"] { color: var(--accent); }
.chevron[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Açılır menü */
.popover {
  position: absolute;
  bottom: 100%;
  margin-bottom: 8px;
  left: 0;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  z-index: 20;
}
.popover h3 { margin: 12px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.popover h3:first-child { margin-top: 0; }
.popover select {
  width: 100%;
  padding: 8px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.device { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.device:hover { background: var(--tile); }
.device input { accent-color: var(--accent); flex: none; margin: 0; }
.device span { overflow-wrap: anywhere; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: block;
  padding: 8px;
  text-align: center;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Düğme ve profil penceresi */
.button { padding: 8px 14px; background: var(--tile); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.button:hover { background: var(--tile-hover); }
.button.ghost { background: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 22px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin: 0 0 16px; font-size: 18px; }
.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.field { display: block; margin-top: 18px; }
.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.field input { width: 100%; padding: 9px 10px; background: var(--tile); border: 1px solid var(--line); border-radius: 8px; }
.form-error { min-height: 20px; margin: 8px 0 0; color: #ff8b8e; font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Üstten gelen bildirimler: koyu zemin, kalın ve büyük yazı. */
.notices { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; z-index: 60; pointer-events: none; }
.notice { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; background: #050607; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, .7); color: #fff; animation: notice-in .18s ease-out; }
.notice.leaving { opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.notice.error { border-color: var(--danger); }
.notice.leave { border-color: #f5b83d; }
.notice.clickable .notice-body { cursor: pointer; }
.notice .avatar.small { width: 42px; height: 42px; font-size: 18px; }
.notice-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 22px; font-weight: 800; }
.notice.error .notice-icon { background: var(--danger); color: #fff; }
.notice-body { flex: 1; min-width: 0; }
.notice-title { display: block; font-size: 18px; font-weight: 700; line-height: 1.3; }
.notice-text { margin: 3px 0 0; font-size: 17px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.notice-title + .notice-text { color: #e6ebe8; }
.notice-steps { margin: 8px 0 0; padding-left: 20px; font-size: 15px; font-weight: 500; line-height: 1.4; color: #e6ebe8; }
.notice-steps li + li { margin-top: 3px; }
.notice-close { flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 8px; color: #bfc6c2; font-size: 22px; line-height: 1; cursor: pointer; }
.notice-close:hover { background: var(--tile); color: #fff; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-10px); } }

/* Mikrofon düğmesindeki ses dalgası: konuşurken yeşil, yüksek seste sarı, çok yüksekte kırmızı. */
.control svg { flex: none; }
.control:has(.mic-wave:not([hidden])) > span { display: none; }
.mic-wave { display: flex; align-items: center; gap: 2px; height: 18px; padding: 2px 4px; background: rgba(0, 0, 0, .55); border-radius: 5px; flex: none; }
.mic-wave i { width: 3px; height: 4px; background: rgba(255, 255, 255, .22); border-radius: 2px; transition: height .06s linear; }
.mic-wave i:nth-child(1) { --h: 6px; }
.mic-wave i:nth-child(2) { --h: 9px; }
.mic-wave i:nth-child(3) { --h: 14px; }
.mic-wave i:nth-child(4) { --h: 9px; }
.mic-wave i:nth-child(5) { --h: 6px; }
.mic-wave i.on { height: var(--h); background: var(--accent); }
.mic-wave[data-color="yellow"] i.on { background: #f5b83d; }
.mic-wave[data-color="red"] i.on { background: var(--danger); }

/* Flaş: pencerenin kenarları beyaz yanar. */
body.flash { background: #fff; padding: var(--flash-size, 40px); }
body.flash .app { border-radius: 14px; overflow: hidden; }

/* Giriş ekranındaki test alanı */
.lobby { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.lobby-title { margin: 6px 0 0; font-size: clamp(22px, 2.4vw, 34px); font-weight: 800; line-height: 1.2; letter-spacing: .01em; color: var(--accent); text-align: center; }
.lobby-sub { margin: 0; color: #c9d0cc; font-size: 16px; text-align: center; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.lobby-card { display: flex; flex-direction: column; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.lobby-card h3 { margin: 0 0 12px; font-size: 18px; }
.lobby-card .field { margin-top: 12px; }
.lobby-card select { width: 100%; padding: 9px 10px; background: var(--tile); border: 1px solid var(--line); border-radius: 8px; }
.lobby-preview { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.lobby-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lobby-preview video.mirror { transform: scaleX(-1); }
.lobby-empty { color: var(--muted); font-size: 16px; }
.lobby-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.lobby-info { color: #c9d0cc; font-size: 14px; }
.lobby-meter { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding: 10px; background: #000; border-radius: 10px; }
.lobby-meter i { flex: 1; height: 8%; background: #2a2f33; border-radius: 3px; transition: height .06s linear; }
.lobby-meter i.on { background: var(--accent); }
.lobby-meter i.on.yellow { background: #f5b83d; }
.lobby-meter i.on.red { background: var(--danger); }
.lobby-card > .lobby-info { margin: 10px 0 0; font-size: 15px; font-weight: 600; }

/* Denetim için kişi seçme listesi */
.control-picker { position: absolute; left: 50%; bottom: 88px; transform: translateX(-50%); width: min(280px, calc(100% - 16px)); padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; z-index: 5; font-size: 14px; }
.control-picker h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.control-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; background: none; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.control-person:hover { background: var(--accent-dark); color: var(--accent); }
.control-picker .hint { margin-top: 6px; font-size: 12px; }

/* Daraltılmış yan menü: düğmeler ulaşılabilir kalsın diye ince bir şerit olur */
@media (min-width: 761px) {
  .app.chat-open { grid-template-columns: 280px minmax(0, 1fr) 320px; }
  .app.collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  .app.collapsed.chat-open { grid-template-columns: 76px minmax(0, 1fr) 320px; }
  .app.collapsed .sidebar { padding: 14px 8px; }
  .app.collapsed .brand { flex-direction: column; gap: 10px; }
  .app.collapsed .clock { flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; font-size: 13px; text-align: center; }
  .app.collapsed .clock-date { flex-direction: column; align-items: center; gap: 0; line-height: 1.25; }
  .app.collapsed .clock-time { font-size: 19px; }
  .app.collapsed .control { position: relative; }
  .app.collapsed .mic-wave { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%) scale(.7); transform-origin: bottom center; }
  .app.collapsed .connection { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 0; }
  .app.collapsed .connection-ms { margin: 0; font-size: 13px; }
  .app.collapsed .connection-text,
  .app.collapsed .brand-text,
  .app.collapsed .section-title,
  .app.collapsed .room-name,
  .app.collapsed .room-member,
  .app.collapsed .control span,
  .app.collapsed .profile-text,
  .app.collapsed .gear { display: none; }
  .app.collapsed .sidebar-toggle { margin-left: 0; color: var(--accent); }
  .app.collapsed .rooms { margin-top: 18px; }
  .app.collapsed .room { justify-content: center; padding: 10px 0; }
  .app.collapsed .controls { grid-template-columns: 1fr; }
  .app.collapsed .chevron { width: 20px; }
  .app.collapsed .control.leave { padding: 8px 0; }
  .app.collapsed .profile { justify-content: center; padding-left: 0; padding-right: 0; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .app.collapsed .rooms, .app.collapsed .profile { display: none; }
  .clock { margin: 10px 0 0; }
  .connection { margin-top: 10px; }
  .chat { position: fixed; inset: 0; z-index: 40; border-left: 0; }
  .controls { grid-template-columns: repeat(4, 1fr); margin-top: 10px; padding-top: 0; }
  .control span { display: none; }
  .popover { position: fixed; left: 16px; right: 16px; top: 150px; bottom: auto; width: auto; margin: 0; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .section-title { display: none; }
  .rooms { flex-direction: row; margin-top: 10px; }
  .room-member { display: none; }
  .profile { margin-top: 10px; }
  .stage { padding: 14px 16px; }
}

/* Masaüstü uygulaması */
.desktop-box { margin-top: auto; margin-bottom: 10px; display: grid; gap: 4px; padding: 10px 12px; background: var(--tile); border: 1px solid var(--line); border-radius: 10px; }
.desktop-box + .clock { margin-top: 0; }
.desktop-box.problem { border-color: var(--danger); }
.desktop-box-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.desktop-box-value { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: text; }
.desktop-box-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.button.small { padding: 4px 10px; font-size: 13px; }
.app.collapsed .desktop-box { display: none; }
.app.collapsed .desktop-box + .clock { margin-top: auto; }

.screen-picker { width: min(860px, calc(100vw - 32px)); }
.picker-tabs { max-width: 320px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; max-height: 52vh; overflow: auto; padding: 2px; }
.picker-card { display: grid; gap: 6px; padding: 8px; background: var(--tile); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; }
.picker-card:hover { background: var(--tile-hover); }
.picker-card[aria-pressed="true"] { border-color: var(--accent); }
.picker-card img, .picker-blank { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #000; border-radius: 6px; display: block; }
.picker-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Denetim: karşının ekranını kontrol ederken */
.tile.controlling video { cursor: default; touch-action: none; }
.tile.controlling { box-shadow: inset 0 0 0 2px #f5a524; }
.tile.keyboard-remote { box-shadow: inset 0 0 0 3px var(--accent); }
.tile-actions .unavailable { opacity: .6; }
