/* Cıvıltı web istemcisi — mIRC 7.x (Windows 11) görünümü.
   Sistem açık/koyu temasını mIRC gibi takip eder; View > Theme ile elle de seçilebilir. */

@font-face {
  font-family: "Fixedsys Excelsior";
  src: url("../fonts/fixedsys-excelsior.woff2") format("woff2");
  font-display: block;
}

:root {
  --ui-font: "Segoe UI", "Segoe UI Variable Text", Tahoma, system-ui, sans-serif;
  --chat-font: "Fixedsys Excelsior", "Lucida Console", "Courier New", monospace;
  --chat-size: 16px;

  --title-bg: #f3f3f3;
  --bar-bg: #f0f0f0;
  --bar-fg: #000;
  --bar-line: #dadada;
  --hover-bg: #e5f3ff;
  --hover-line: #cce8ff;
  --sel-bg: #cce8ff;
  --sel-line: #99d1ff;
  --menu-bg: #f9f9f9;
  --menu-line: #ccc;
  --menu-hl: #91c9f7;
  --menu-hl-bg: #e5f3ff;
  --disabled: #a0a0a0;
  --tree-bg: #fff;
  --tree-fg: #000;
  --tree-line: #a0a0a0;
  --mdi-bg: #dfdfdf;
  --child-line: #9a9a9a;
  --child-line-inactive: #c6c6c6;
  --cap-bg: #fff;
  --cap-fg: #000;
  --cap-fg-inactive: #999;
  --chat-bg: #fff;
  --chat-line: #d9d9d9;
  --edit-bg: #fff;
  --scroll-track: #f0f0f0;
  --scroll-thumb: #a6a6a6;
  --dlg-bg: #f0f0f0;
  --btn-bg: #e1e1e1;
  --btn-line: #adadad;
  --input-bg: #fff;
  --input-line: #7a7a7a;
  --marker: #b0b0b0;
  --sb-event: #7f0000; --sb-msg: #e00000; --sb-hl: #0000fc; --sb-status: #00007f;

  /* mIRC 0-15 paleti; olay renkleri bu indekslerden gelir */
  --m0: #ffffff; --m1: #000000; --m2: #00007f; --m3: #009300;
  --m4: #ff0000; --m5: #7f0000; --m6: #9c009c; --m7: #fc7f00;
  --m8: #ffff00; --m9: #00fc00; --m10: #009393; --m11: #00ffff;
  --m12: #0000fc; --m13: #ff00ff; --m14: #7f7f7f; --m15: #d2d2d2;
  --text: var(--m1);
  color-scheme: light;
}

/* Koyu tema: sistemden (data-theme yoksa) veya elle (data-theme="dark") */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --title-bg: #202020; --bar-bg: #202020; --bar-fg: #fff; --bar-line: #3a3a3a;
    --hover-bg: #2d2d2d; --hover-line: #3d3d3d; --sel-bg: #3d3d3d; --sel-line: #5a5a5a;
    --menu-bg: #2b2b2b; --menu-line: #444; --menu-hl: #555; --menu-hl-bg: #3d3d3d; --disabled: #777;
    --tree-line: #666;
    --child-line: #555; --child-line-inactive: #3a3a3a;
    --cap-bg: #000; --cap-fg: #fff; --cap-fg-inactive: #888;
    --chat-line: #333;
    --scroll-track: #1a1a1a; --scroll-thumb: #6a6a6a;
    --dlg-bg: #2b2b2b; --btn-bg: #3a3a3a; --btn-line: #555; --input-bg: #1e1e1e; --input-line: #666;
    --marker: #555;
    --sb-event: #ff9a9a; --sb-msg: #ff5f5f; --sb-hl: #8fb3ff; --sb-status: #8fb3ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --title-bg: #202020; --bar-bg: #202020; --bar-fg: #fff; --bar-line: #3a3a3a;
  --hover-bg: #2d2d2d; --hover-line: #3d3d3d; --sel-bg: #3d3d3d; --sel-line: #5a5a5a;
  --menu-bg: #2b2b2b; --menu-line: #444; --menu-hl: #555; --menu-hl-bg: #3d3d3d; --disabled: #777;
  --tree-line: #666;
  --child-line: #555; --child-line-inactive: #3a3a3a;
  --cap-bg: #000; --cap-fg: #fff; --cap-fg-inactive: #888;
  --chat-line: #333;
  --scroll-track: #1a1a1a; --scroll-thumb: #6a6a6a;
  --dlg-bg: #2b2b2b; --btn-bg: #3a3a3a; --btn-line: #555; --input-bg: #1e1e1e; --input-line: #666;
  --marker: #555;
  --sb-event: #ff9a9a; --sb-msg: #ff5f5f; --sb-hl: #8fb3ff; --sb-status: #8fb3ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bar-bg);
  color: var(--bar-fg);
  font-family: var(--ui-font);
  font-size: 12px;
}
button, input, select, textarea { font-family: var(--ui-font); font-size: 12px; color: inherit; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* ---------- Ana pencere başlığı (Windows 11) ---------- */
.titlebar {
  flex: none;
  display: flex;
  align-items: center;
  height: 31px;
  background: var(--title-bg);
  user-select: none;
}
.titlebar .ttl {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  white-space: nowrap;
  overflow: hidden;
}
.titlebar .ttl span { overflow: hidden; text-overflow: ellipsis; }
.titlebar img { width: 16px; height: 16px; }
.capbtns { display: flex; height: 100%; flex: none; }
.capbtns button {
  width: 46px; height: 100%;
  border: 0; padding: 0; margin: 0;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--bar-fg);
}
.capbtns button:hover { background: rgba(128,128,128,.18); }
.capbtns button.x:hover { background: #e81123; color: #fff; }
.capbtns svg { width: 10px; height: 10px; }

/* ---------- Menü çubuğu ---------- */
.menubar {
  flex: none;
  display: flex;
  align-items: stretch;
  height: 21px;
  padding-left: 6px;
  background: var(--bar-bg);
  user-select: none;
}
.mb-item { display: flex; align-items: center; padding: 0 7px; cursor: default; }
.mb-item:hover, .mb-item.open { background: var(--hover-bg); outline: 1px solid var(--hover-line); outline-offset: -1px; }
.mdi-controls { margin-left: auto; display: none; align-items: stretch; }
.app.maxed .mdi-controls { display: flex; }
.mdi-controls button {
  width: 34px; border: 0; padding: 0; background: transparent;
  display: flex; align-items: center; justify-content: center; color: var(--bar-fg);
}
.mdi-controls button:hover { background: rgba(128,128,128,.18); }
.mdi-controls button.x:hover { background: #e81123; color: #fff; }
.mdi-controls svg { width: 9px; height: 9px; }

/* ---------- Araç çubuğu ---------- */
.toolbar {
  flex: none;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 4px 0 2px;
  background: var(--bar-bg);
  user-select: none;
  overflow: hidden;
}
.grip {
  width: 3px; height: 22px; margin: 0 5px 0 4px; flex: none;
  background: radial-gradient(circle, var(--tree-line) 0.8px, transparent 1px) 0 0 / 3px 3px;
}
.tb-btn {
  flex: none;
  width: 26px; height: 26px;
  padding: 0; margin: 0 1px;
  border: 1px solid transparent;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.tb-btn:hover { background: var(--hover-bg); border-color: var(--hover-line); }
.tb-btn:active { background: var(--sel-bg); border-color: var(--sel-line); }
.tb-btn svg { width: 18px; height: 18px; }
.tb-sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--bar-line); }

/* ---------- Switchbar ---------- */
.switchbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 31px;
  padding: 0 4px 0 2px;
  background: var(--bar-bg);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  user-select: none;
}
.switchbar::-webkit-scrollbar { display: none; }
.sb-grip {
  /* Görünen nokta şeridi 3px, tutma alanı 9px */
  flex: none; width: 9px; height: 24px; margin: 0 1px;
  background: radial-gradient(circle, var(--tree-line) 0.8px, transparent 1px) 3px 0 / 3px 3px repeat-y;
}
.sw-btn {
  flex: none;
  display: flex; align-items: center; gap: 5px;
  width: 128px;
  height: 25px;
  padding: 0 6px 0 4px;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  text-align: left;
}
.sw-btn:hover { background: var(--hover-bg); border-color: var(--hover-line); }
.sw-btn.active { background: var(--sel-bg); border-color: var(--sel-line); }
.sw-btn svg { width: 16px; height: 16px; flex: none; }
.sw-btn .lbl { overflow: hidden; text-overflow: ellipsis; }
/* Switchbar ve treebar, Colors penceresindeki "Treebar" öğesinin renklerini kullanır */
.switchbar { background: var(--c-tree-bg); color: var(--c-tree-fg); }
.sw-btn { color: var(--c-tree-fg); }
.sw-btn:hover { background: rgba(128,128,128,.18); border-color: rgba(128,128,128,.35); }
.sw-btn.active { background: rgba(0,120,215,.22); border-color: rgba(0,120,215,.55); }
.act-event > .lbl { color: var(--c-notice); }
.act-msg > .lbl { color: var(--c-ctcp); }
.act-hl > .lbl { color: var(--c-highlight); }
.status-on > .lbl { color: var(--c-info); }
.sw-nicks { display: none; margin-left: auto; width: auto; }
.bar-sep {
  flex: none; height: 4px;
  background: radial-gradient(circle, var(--tree-line) 0.7px, transparent 0.9px) 0 1px / 3px 4px;
  background-color: var(--bar-bg);
  margin: 0 2px;
}

/* ---------- Gövde: treebar + MDI ---------- */
.body {
  flex: 1;
  min-height: 0;
  display: flex;
}
.treebar {
  flex: none;
  width: 166px;
  background: var(--c-tree-bg);
  color: var(--c-tree-fg);
  overflow: auto;
  padding: 5px 0 5px 4px;
  border-right: 4px solid var(--bar-bg);
  user-select: none;
}
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 19px; }
.tree li { position: relative; }
.tree .node {
  display: flex; align-items: center; gap: 3px;
  height: 18px;
  white-space: nowrap;
  cursor: default;
}
.tree .exp {
  width: 9px; height: 9px; flex: none; margin: 0 3px 0 1px;
  border: 1px solid var(--tree-line);
  background: var(--c-tree-bg);
  position: relative;
}
.tree .exp::before { content: ""; position: absolute; left: 1px; right: 1px; top: 3px; height: 1px; background: var(--c-tree-fg); }
.tree .exp.closed::after { content: ""; position: absolute; top: 1px; bottom: 1px; left: 3px; width: 1px; background: var(--c-tree-fg); }
.tree .noexp { width: 14px; flex: none; }
.tree svg { width: 16px; height: 16px; flex: none; }
.tree .lbl { padding: 0 2px; }
.tree .node.active .lbl { background: var(--sel-bg); outline: 1px solid var(--sel-line); }
.tree .node:hover .lbl { background: var(--hover-bg); }
.tree ul > li::before {
  content: ""; position: absolute; left: -12px; top: 0; height: 9px; width: 10px;
  border-left: 1px dotted var(--tree-line); border-bottom: 1px dotted var(--tree-line);
}
.tree ul > li:not(:last-child)::after {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 0;
  border-left: 1px dotted var(--tree-line);
}
.tree .collapsed > ul { display: none; }

.mdi {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background: var(--c-mdi);
}

/* ---------- MDI alt pencereleri ---------- */
.child {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--cap-bg);
  border: 1px solid var(--child-line-inactive);
  min-width: 220px;
  min-height: 120px;
}
.child.active { border-color: var(--child-line); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.child[hidden] { display: none; }
.app.maxed .child { inset: 0 !important; width: auto !important; height: auto !important; border: 0; box-shadow: none; }
.app.maxed .child > .cap { display: none; }
.cap {
  flex: none;
  display: flex;
  align-items: center;
  height: 30px;
  background: var(--cap-bg);
  color: var(--cap-fg-inactive);
  user-select: none;
}
.child.active .cap { color: var(--cap-fg); }
.cap .ttl { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding-left: 8px; overflow: hidden; white-space: nowrap; }
.cap .ttl span { overflow: hidden; text-overflow: ellipsis; }
.cap svg.ico { width: 16px; height: 16px; flex: none; }
.cap .capbtns button { width: 44px; color: inherit; }
.grip-se { position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; cursor: nwse-resize; }
.app.maxed .grip-se { display: none; }

.win-main {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  background: var(--c-bg);
  padding: 0 0 0 6px;
}
.buffer {
  flex: 1;
  min-width: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 2px 2px 2px 0;
  background: transparent; /* zemin .win-main'de; keskin süzgeci saydam katman ister */
  color: var(--c-normal);
  font-family: var(--chat-font);
  font-size: var(--chat-size);
  line-height: 1;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: none;
  cursor: text;
}
.buffer .line { min-height: 1em; }
.buffer .marker { height: 0; border-top: 1px solid var(--marker); margin: 7px 0 8px; }
.buffer a { color: inherit; text-decoration: none; }
.buffer a:hover { text-decoration: underline; cursor: pointer; }
.buffer .chan { cursor: pointer; }
.buffer .chan:hover { text-decoration: underline; }
.nickpane {
  flex: none;
  display: flex;
  border-left: 1px solid var(--chat-line);
  background: var(--c-lb-bg);
}
.nicklist {
  width: 112px;
  margin: 0;
  padding: 2px 2px 2px 3px;
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--c-lb-fg);
  font-family: var(--chat-font);
  font-size: var(--chat-size);
  line-height: 1;
  font-variant-ligatures: none;
  -webkit-font-smoothing: none;
  user-select: none;
}
.nicklist li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.nicklist li.sel { background: var(--sel-bg); }
/* Keskin yazı yalnız 16 px'te (fontun çizildiği boyut); başka boyutta harf piksel ızgarasına oturmaz, süzgeç bozar */
.keskin-font .buffer, .keskin-font .nicklist, .keskin-font .editbox,
.keskin-font .nicklist li.sel > span, .keskin-font .keskin { filter: url(#keskin); }
/* Fixedsys'in kalını yok; Chrome'un yapay kalını 1 px aralıkları doldurur (m blok olur), keskin modda kalınlık verilmez */
.kalin { font-weight: bold; }
.keskin-font .buffer .kalin { font-weight: normal; }
.splitter { flex: none; width: 4px; margin-left: 2px; cursor: col-resize; background: var(--c-bg); }
.editrow { flex: none; padding: 4px 6px 6px; background: var(--c-edit-bg); border-top: 1px solid var(--chat-line); }
.editbox {
  display: block;
  width: 100%;
  height: 22px;
  padding: 1px 3px;
  border: 1px solid var(--chat-line);
  background: transparent; /* zemin .editrow'da */
  color: var(--c-edit-fg);
  font-family: var(--chat-font);
  font-size: var(--chat-size);
  font-variant-ligatures: none;
  outline: none;
  -webkit-font-smoothing: none;
}

/* mIRC olay renkleri — Colors penceresindeki şemadan gelir (js/colors.js) */
.c-normal { color: var(--c-normal); }
.c-own { color: var(--c-own); }
.c-whois { color: var(--c-whois); }
.c-action { color: var(--c-action); }
.c-other { color: var(--c-other); }
.c-ctcp { color: var(--c-ctcp); }
.c-hl { color: var(--c-highlight); }
.c-info { color: var(--c-info); }
.c-info2 { color: var(--c-info2); }
.c-quit { color: var(--c-quit); }
.c-join { color: var(--c-join); }
.c-part { color: var(--c-part); }
.c-kick { color: var(--c-kick); }
.c-mode { color: var(--c-mode); }
.c-nick { color: var(--c-nick); }
.c-topic { color: var(--c-topic); }
.c-invite { color: var(--c-invite); }
.c-notice { color: var(--c-notice); }
.c-wallops { color: var(--c-wallops); }
.nicklist li.away { color: var(--c-gray); }
.child:not(.active) .editrow { background: var(--c-inact-bg); color: var(--c-inact-fg); }
.child:not(.active) .editbox { color: var(--c-inact-fg); }

/* Kanal listesi ve URL penceresi */
.listview { flex: 1; overflow: auto; background: var(--c-lb-bg); color: var(--c-lb-fg); margin-left: -6px; }
.listview table { border-collapse: collapse; width: 100%; }
.listview th {
  position: sticky; top: 0;
  text-align: left; font-weight: normal;
  padding: 4px 8px;
  background: var(--c-lb-bg);
  color: var(--c-title);
  border-bottom: 1px solid var(--chat-line);
  border-right: 1px solid var(--chat-line);
}
.listview td { padding: 2px 8px; white-space: nowrap; cursor: default; }
.listview td:last-child { white-space: normal; }
.listview tr:hover td { background: var(--hover-bg); }
.listview tr.sel td { background: var(--sel-bg); }

/* ---------- Kaydırma çubukları (Windows 11) ---------- */
.buffer::-webkit-scrollbar, .nicklist::-webkit-scrollbar, .listview::-webkit-scrollbar, .treebar::-webkit-scrollbar { width: 12px; height: 12px; }
.buffer::-webkit-scrollbar-track, .nicklist::-webkit-scrollbar-track, .listview::-webkit-scrollbar-track, .treebar::-webkit-scrollbar-track { background: var(--scroll-track); }
.buffer::-webkit-scrollbar-thumb, .nicklist::-webkit-scrollbar-thumb, .listview::-webkit-scrollbar-thumb, .treebar::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border: 4px solid var(--scroll-track);
  border-radius: 6px;
}
.buffer::-webkit-scrollbar-thumb:hover { border-width: 2px; }

/* ---------- Açılır menüler (Windows 11) ---------- */
.ctxmenu {
  position: fixed;
  z-index: 1000;
  min-width: 170px;
  padding: 3px;
  background: var(--menu-bg);
  color: var(--bar-fg);
  border: 1px solid var(--menu-line);
  box-shadow: 2px 3px 8px rgba(0,0,0,.25);
  user-select: none;
}
.ctxmenu .mi {
  position: relative;
  display: flex; align-items: center;
  height: 22px;
  padding: 0 24px 0 28px;
  white-space: nowrap;
  cursor: default;
  border: 1px solid transparent;
}
.ctxmenu .mi:hover, .ctxmenu .mi.open { background: var(--menu-hl-bg); border-color: var(--menu-hl); }
.ctxmenu .mi.disabled { color: var(--disabled); }
.ctxmenu .mi.disabled:hover { background: transparent; border-color: transparent; }
.ctxmenu .chk { position: absolute; left: 9px; }
.ctxmenu .sub { position: absolute; right: 8px; font-size: 9px; }
.ctxmenu .key { margin-left: auto; padding-left: 24px; }
.ctxmenu .sep { height: 1px; margin: 3px 2px 3px 28px; background: var(--menu-line); }

/* ---------- Diyaloglar (Windows standart) ---------- */
.dlg-layer { position: fixed; inset: 0; z-index: 500; }
.dlg {
  position: fixed;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  background: var(--dlg-bg);
  color: var(--bar-fg);
  border: 1px solid var(--child-line);
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
}
.dlg .cap { background: var(--cap-bg); color: var(--cap-fg); }
.dlg .cap .ttl { padding-left: 10px; }
.dlg .dlg-body { padding: 12px 14px 14px; overflow: auto; }
.dlg p { margin: 0 0 8px; line-height: 1.45; }
.dlg .hint { color: var(--disabled); }
.dlg .row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.dlg .row > label:first-child { width: 86px; flex: none; }
.dlg .row input[type=text], .dlg .row input[type=password], .dlg .row select { flex: 1; min-width: 0; }
.dlg .check { display: flex; align-items: center; gap: 6px; margin: 5px 0; }
.dlg .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dlg .dlg-body button {
  min-width: 75px; height: 23px; padding: 0 10px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-line);
}
.dlg .dlg-body button:hover { background: var(--hover-bg); border-color: #0078d7; }
.dlg .dlg-body button.default { border-color: #0078d7; box-shadow: inset 0 0 0 1px #0078d7; }
.dlg input[type=text], .dlg input[type=password], .dlg select {
  height: 23px; padding: 0 4px;
  background: var(--input-bg);
  border: 1px solid var(--input-line);
}
.dlg input:focus, .dlg select:focus { outline: none; border-color: #0078d7; }
.dlg input:disabled, .dlg select:disabled, .dlg .dlg-body button:disabled { opacity: .55; }
.dlg fieldset { border: 1px solid var(--bar-line); margin: 0 0 10px; padding: 6px 10px 8px; }
.dlg legend { padding: 0 4px; }
.dlg code { font-family: var(--chat-font); font-size: 14px; }

.opt-layout { display: flex; gap: 12px; }
.opt-tree {
  width: 140px; flex: none; height: 300px; overflow: auto;
  margin: 0; padding: 4px 0;
  list-style: none;
  background: var(--input-bg);
  border: 1px solid var(--bar-line);
}
.opt-tree li { padding: 1px 8px; cursor: default; white-space: nowrap; }
.opt-tree li.sub { padding-left: 24px; }
.opt-tree li.on { background: var(--sel-bg); }
.opt-tree li.off { color: var(--disabled); }
.opt-page { flex: 1; min-width: 0; }

.fav-layout { display: flex; gap: 8px; }
.fav-list {
  flex: 1; height: 190px; margin: 0; padding: 2px; list-style: none; overflow-y: auto;
  background: var(--input-bg); border: 1px solid var(--input-line);
}
.fav-list li { padding: 1px 4px; cursor: default; }
.fav-list li.sel { background: var(--sel-bg); }
.fav-btns { display: flex; flex-direction: column; gap: 6px; }

.palette { display: grid; grid-template-columns: repeat(8, 30px); gap: 4px; }
.palette div {
  height: 22px; border: 1px solid #000;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--chat-font);
}

/* ---------- Telefon: mIRC hissi korunur, kalabalık kalkar ---------- */
@media (max-width: 760px) {
  .titlebar, .toolbar, .treebar, .bar-sep { display: none; }
  .mdi-controls { display: none !important; }
  .sw-nicks { display: flex; }
  .app:not(.has-nicks) .sw-nicks { display: none; }
  .sw-btn { width: auto; max-width: 140px; height: 28px; }
  .child { inset: 0 !important; width: auto !important; height: auto !important; border: 0 !important; box-shadow: none !important; }
  .child > .cap, .grip-se, .splitter { display: none !important; }
  .nickpane {
    display: none;
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 55%; z-index: 3;
    box-shadow: -3px 0 8px rgba(0,0,0,.3);
  }
  .nicklist { width: auto !important; flex: 1; }
  .app.show-nicks .nickpane { display: flex; }
  .editbox { height: 34px; font-size: 16px; }
  .opt-layout { flex-direction: column; }
  .opt-tree { display: none; }
}

/* ---------- Hotlink, arama, bırakma göstergeleri ---------- */
.buffer.hot { cursor: pointer; }
.buffer .url:hover { text-decoration: underline; }
.buffer .line.found { background: var(--sel-bg); outline: 1px solid var(--sel-line); }
.sb-grip { cursor: move; }
.drop-before { box-shadow: inset 3px 0 0 #0078d7 !important; }
.drop-after { box-shadow: inset -3px 0 0 #0078d7 !important; }
.treebar .drop-before { box-shadow: inset 0 2px 0 #0078d7 !important; }
.treebar .drop-after { box-shadow: inset 0 -2px 0 #0078d7 !important; }
.app.docking, .app.docking * { cursor: move !important; user-select: none; }

/* Yerleşim: switchbar üst/alt, treebar sol/sağ */
.titlebar { order: 1; } .menubar { order: 2; } .toolbar { order: 3; }
.switchbar { order: 4; } .bar-sep { order: 5; } .body { order: 6; }
.app.sb-bottom .bar-sep { order: 7; }
.app.sb-bottom .switchbar { order: 8; }
.treebar { order: 0; border-right: 0; }
.tree-resizer { order: 1; flex: none; width: 4px; cursor: col-resize; background: var(--bar-bg); }
.mdi { order: 2; }
.app.tb-right .treebar { order: 4; }
.app.tb-right .tree-resizer { order: 3; }

/* ---------- Ctrl+K renk dizini ---------- */
.colorpop {
  position: fixed; z-index: 1100;
  display: grid; grid-template-columns: repeat(8, 24px); gap: 2px;
  padding: 4px;
  background: var(--menu-bg);
  border: 1px solid var(--menu-line);
  box-shadow: 2px 3px 8px rgba(0,0,0,.25);
}
.colorpop button {
  width: 24px; height: 20px; padding: 0;
  border: 1px solid #808080;
  font-family: var(--chat-font); font-size: 12px;
}

/* ---------- Colors penceresi ---------- */
.cl-top { display: grid; grid-template-columns: auto; gap: 4px; margin-bottom: 10px; }
.cl-schemerow { display: flex; gap: 8px; align-items: center; }
.cl-schemerow select { width: 210px; }
.cl-schemerow > span { width: 210px; }
.cl-grid {
  display: grid;
  grid-template-columns: 1fr 86px;
  grid-template-rows: auto auto;
  gap: 6px;
}
.cl-box { border: 1px solid #a0a0a0; padding: 3px 5px; cursor: default; }
.cl-box.on { outline: 1px dotted #000; outline-offset: -3px; }
.cl-main { display: flex; gap: 10px; min-height: 230px; }
.cl-col { flex: 1; }
.cl-item { font-weight: bold; line-height: 17px; padding: 0 2px; width: max-content; }
.cl-item.on { outline: 1px dotted currentColor; }
.cl-side { display: flex; flex-direction: column; gap: 6px; }
.cl-lb { flex: 1.3; }
.cl-tree { flex: 1; }
.cl-mdi { flex: 1; }
.cl-grid .cl-edit { grid-column: 1; min-height: 34px; }
.cl-grid .cl-inact { grid-column: 1 / span 2; min-height: 34px; }
.cl-grid { grid-template-columns: 1fr 1fr 86px; }
.cl-main { grid-column: 1 / span 2; }
.cl-side { grid-column: 3; grid-row: 1; }
.cl-grid .cl-edit { grid-column: 1; grid-row: 2; }
.cl-grid .cl-inact { grid-column: 2 / span 2; grid-row: 2; }
.cl-bottom { display: flex; gap: 14px; margin-top: 12px; align-items: flex-start; }
.cl-palette { display: flex; flex-direction: column; gap: 2px; }
.cl-row { display: flex; gap: 2px; }
.dlg .dlg-body .cl-cell {
  min-width: 0; width: 18px; height: 16px; padding: 0;
  border: 1px solid #a0a0a0;
}
.dlg .dlg-body .cl-cell.on { outline: 1px solid #000; outline-offset: 1px; }
.cl-btns { flex: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cl-gap { flex: 1; min-height: 20px; }
.cl-hint { margin-top: 10px; font-size: 11px; }

/* ---------- Channel Central ---------- */
.cc-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--bar-line); margin-bottom: 10px; }
.dlg .dlg-body .cc-tabs button {
  min-width: 0; height: 24px; padding: 0 12px;
  border: 1px solid transparent; border-bottom: 0;
  background: transparent;
}
.dlg .dlg-body .cc-tabs button.on { background: var(--input-bg); border-color: var(--bar-line); }
.cc-hist { height: 70px !important; margin: 4px 0 10px 94px !important; }
.cc-bans { height: 180px !important; }
.cc-modes { display: flex; gap: 20px; }
.cc-modes > div { flex: 1; }
.dlg .check input.cc-small { width: 90px; flex: none; }
.dlg .check input.cc-tiny { width: 50px; flex: none; }

/* ---------- Kanal listesi arama ---------- */
.listwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: -6px; }
.listwrap .listview { margin-left: 0; }
.list-filter {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  background: var(--bar-bg); color: var(--bar-fg);
  border-bottom: 1px solid var(--chat-line);
}
.list-filter input { width: 220px; height: 22px; padding: 0 4px; border: 1px solid var(--input-line); background: var(--input-bg); }
.list-count { color: var(--disabled); }

@media (max-width: 760px) {
  .tree-resizer { display: none !important; }
  .cl-grid { grid-template-columns: 1fr 86px; }
  .cl-main { grid-column: 1; flex-direction: column; gap: 0; }
  .cl-side { grid-column: 2; }
  .cl-grid .cl-edit, .cl-grid .cl-inact { grid-column: 1 / span 2; }
  .cl-grid .cl-inact { grid-row: 3; }
  .cl-bottom { flex-direction: column; }
  .cl-btns { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cl-gap { display: none; }
  .cc-modes { flex-direction: column; gap: 0; }
  .cc-hist { margin-left: 0 !important; }
}

/* ---------- Dikey switchbar (sol/sağ) ---------- */
.app.sb-left .switchbar, .app.sb-right .switchbar {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 150px;
  height: auto;
  padding: 2px 3px 4px;
  overflow-x: hidden;
  overflow-y: auto;
}
.app.sb-left .switchbar { order: -1; border-right: 4px solid var(--bar-bg); }
.app.sb-right .switchbar { order: 9; border-left: 4px solid var(--bar-bg); }
.app:not(.sb-left):not(.sb-right) .switchbar { border-top: 1px solid var(--bar-line); }
.app.sb-left .sw-btn, .app.sb-right .sw-btn { width: auto; flex: none; }
.app.sb-left .sb-grip, .app.sb-right .sb-grip {
  width: auto; height: 9px; margin: 1px 0 2px;
  background: radial-gradient(circle, var(--tree-line) 0.8px, transparent 1px) 0 3px / 3px 3px repeat-x;
}
.app.sb-left .switchbar .drop-before { box-shadow: inset 0 2px 0 #0078d7 !important; }
.app.sb-left .switchbar .drop-after { box-shadow: inset 0 -2px 0 #0078d7 !important; }
.app.sb-right .switchbar .drop-before { box-shadow: inset 0 2px 0 #0078d7 !important; }
.app.sb-right .switchbar .drop-after { box-shadow: inset 0 -2px 0 #0078d7 !important; }

/* Büyütülmüş pencerenin ikonu menü çubuğunun en solunda (mIRC MDI) */
.mb-icon { display: none; align-items: center; justify-content: center; width: 22px; margin-right: 2px; }
.app.maxed .mb-icon:not(:empty) { display: flex; }
.mb-icon svg { width: 16px; height: 16px; }
@media (max-width: 760px) { .app.maxed .mb-icon { display: none; } }

/* ---------- Address Book ---------- */
.ab-whois { display: flex; gap: 14px; padding: 8px 4px 4px; }
.ab-grid { flex: 1; min-width: 0; display: grid; grid-template-columns: 78px 1fr; gap: 9px 8px; align-items: center; }
.ab-grid > label { text-align: right; }
.ab-grid > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 16px; }
.ab-side { display: flex; flex-direction: column; gap: 8px; }
.ab-ctcp { display: grid; grid-template-columns: repeat(2, auto); justify-content: end; gap: 8px; margin-top: 14px; }
.ab-page { min-height: 300px; }
@media (max-width: 760px) {
  .ab-whois { flex-direction: column; }
  .ab-side { flex-direction: row; flex-wrap: wrap; }
  .ab-ctcp { justify-content: start; grid-template-columns: repeat(4, auto); }
  .ab-page { min-height: 0; }
}
