/* Temsilci paneli yerleşimi */
.panel-body { overflow: hidden; }
.app {
  --nav-w: 220px;
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  transition: grid-template-columns .18s ease;
  grid-template-rows: 56px 1fr;
  grid-template-areas: "top top" "nav main";
}

/* Üst çubuk */
.topbar {
  grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--navy); color: var(--on-navy); border-bottom: 1px solid var(--navy);
}
/* Üst çubuk lacivert: içindeki kontroller açık renkli */
.topbar .btn-ghost { color: var(--on-navy); }
.topbar .btn-ghost:hover { background: var(--navy-hover); }
.topbar .avatar { background: var(--brand); color: var(--brand-text); }
.topbar .user-chip-text small { color: rgba(253, 253, 253, .72); }
.topbar .status-select { border-color: rgba(253, 253, 253, .24); background: transparent; color: var(--on-navy); }
.topbar .status-select select { color: var(--on-navy); }
.topbar .status-select option { color: var(--text); background: var(--surface); }
.topbar-left { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: -6px; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conn-state { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
/* Masaüstü bildirim izni verilmedi (tek seferlik): Hesabım > Bildirimler'e götürür */
.notify-warn { text-decoration: none; white-space: nowrap; }
.notify-warn:hover { text-decoration: underline; }
.status-select {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.status-select select { border: 0; background: transparent; outline: none; cursor: pointer; padding-right: 4px; }
#btn-sound .mute-line { display: none; }
#btn-sound.off .mute-line { display: inline; }
#btn-sound.off { color: rgba(253, 253, 253, .5); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 0 6px; min-width: 0; }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-chip-text strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-text small { font-size: 11px; color: var(--text-3); }

.avatar {
  position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-ink);
}
.avatar .presence {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--border-strong); border: 2px solid var(--surface);
}
.avatar .presence.on { background: #22c55e; }

/* Sol menü */
.sidenav {
  grid-area: nav; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px;
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 3px 0 0 var(--brand); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; }

/* Daraltılmış menü: yalnızca ikonlar */
.app.nav-collapsed { --nav-w: 60px; }
.app.nav-collapsed .sidenav { padding: 12px 8px; }
.app.nav-collapsed .nav-item { justify-content: center; padding: 0; position: relative; }
.app.nav-collapsed .nav-label { display: none; }
.app.nav-collapsed .nav-item .count {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px;
}

.main { grid-area: main; min-width: 0; min-height: 0; overflow: hidden; }
.view { height: 100%; }
.page { overflow-y: auto; padding: 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 20px; }

/* Canlı görünüm: liste | sohbet | müşteri bilgisi. Bilgi sütunu sohbetin üstüne binmez,
   yalnızca bir sohbet açıkken yanında açılır. */
.live { --list-w: 300px; --info-w: 300px; display: grid; grid-template-columns: var(--list-w) minmax(0, 1fr); }
.live.has-chat:not(.info-closed) { grid-template-columns: var(--list-w) minmax(0, 1fr) var(--info-w); }
.live:not(.has-chat) .info-pane, .live.info-closed .info-pane { display: none; }
.conv-list { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.conv-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; }

/* Ekip: listenin altında katlanır bölüm */
.team-dock { flex: none; border-top: 1px solid var(--border); background: var(--surface); }
.team-summary {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 16px; border: 0; background: transparent;
  cursor: pointer; font-size: 13px; color: var(--text-2);
}
.team-summary:hover { background: var(--surface-2); }
.team-stat { display: inline-flex; align-items: center; gap: 6px; }
.team-stat strong { color: var(--text); }
.team-summary .chevron { width: 16px; height: 16px; margin-left: auto; transition: transform .15s; }
.team-summary[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.team-panel { max-height: 45vh; overflow-y: auto; padding: 10px 10px 4px; border-bottom: 1px solid var(--border); }
.team-panel h4 { padding: 4px 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); }
.team-panel h4 + .team { margin-bottom: 8px; }
.team { list-style: none; margin: 0; padding: 0; }
.list-group { padding: 8px 10px 4px; }
.list-group.is-empty { display: none; }
.list-group h3 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 6px 8px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3);
}
.list-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.empty { margin: 0; padding: 4px 6px 8px; font-size: 13px; color: var(--text-3); }

.conv-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
}
.conv-item:hover { background: var(--surface-3); }
.conv-item > * { pointer-events: none; } /* tıklama hedefi her zaman sabit buton olsun */
.conv-item.selected { background: var(--brand-soft); }
.conv-item.is-new { animation: pulse-bg 1.2s ease-in-out 3; }
@keyframes pulse-bg { 50% { background: var(--warn-soft); } }
.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-top strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.conv-preview { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview em { color: var(--brand-ink); }
.conv-agent { font-size: 11.5px; color: var(--text-3); }
.conv-await { font-size: 11.5px; font-weight: 600; color: var(--warn); }
.conv-item.awaiting .avatar { box-shadow: 0 0 0 2px var(--brand); }

/* Sona eren sohbetler: katlanır başlık, soluk satırlar, satır üstüne gelince "kaldır" düğmesi */
.group-toggle {
  flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px;
  padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; white-space: nowrap;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
}
.group-toggle .group-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.group-toggle .chevron { flex: none; width: 14px; height: 14px; transition: transform .15s; }
.group-toggle[aria-expanded="false"] .chevron { transform: rotate(-90deg); }
.ended-clear {
  flex: none; white-space: nowrap; padding: 0; border: 0; background: transparent; cursor: pointer;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-3);
}
.ended-clear:hover { color: var(--text); text-decoration: underline; }
.ended-item { position: relative; }
.ended-item .conv-item { padding-right: 34px; }
.ended-item .conv-item .avatar { opacity: .6; }
.ended-item .conv-top strong { color: var(--text-2); }
.conv-ended { font-size: 11.5px; color: var(--text-3); }
.ended-dismiss {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 26px; height: 26px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-3); opacity: 0;
}
.ended-item:hover .ended-dismiss, .ended-dismiss:focus-visible { opacity: 1; }
.ended-dismiss:hover { background: var(--surface-3); color: var(--text); }
@media (hover: none) { .ended-dismiss { opacity: 1; } }

.team li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13px; }
/* Tıklanabilir satır: li'nin içinde tüm satırı kaplayan düğme (klavyeyle Tab + Enter) */
.team li.clickable { padding: 0; }
.team-row {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.team-row:hover { background: var(--surface-3); }
.team-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.team li .team-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team li small { margin-left: auto; color: var(--text-3); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.team li.empty-team { color: var(--text-3); }

/* Sohbet alanı */
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 24px; text-align: center; max-width: 360px; margin: 0 auto;
}
.chat-empty svg { width: 44px; height: 44px; color: var(--border-strong); margin-bottom: 6px; }
.chat-active { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.chat-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chat-subtitle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.chat-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-notice { padding: 8px 14px; font-size: 13px; background: var(--brand-soft); color: var(--text-2); border-bottom: 1px solid var(--border); }
.chat-notice.warn { background: var(--warn-soft); color: var(--warn); }

.messages { flex: 1; overflow-y: auto; padding: 16px 18px 8px; display: flex; flex-direction: column; }
/* Mesaj alanı + yukarı kaydırılmışken gelen mesaj düğmesi ("↓ N yeni mesaj") */
.messages-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.messages-wrap > .messages { flex: 1; min-height: 0; }
.new-below {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3;
  height: 28px; padding: 0 12px; border: 1px solid var(--brand); border-radius: 999px; cursor: pointer;
  background: var(--brand); color: var(--brand-text); font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.new-below:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.msg { display: flex; flex-direction: column; max-width: min(72%, 560px); margin-top: 10px; }
.msg.cont { margin-top: 2px; }
.msg.visitor { align-self: flex-start; align-items: flex-start; }
.msg.agent { align-self: flex-end; align-items: flex-end; }
.msg-name { font-size: 12px; color: var(--text-3); margin: 0 4px 3px; }
.bubble { padding: 8px 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.msg.visitor .bubble { border-bottom-left-radius: 4px; }
.msg.agent .bubble { background: var(--bubble-agent); color: var(--bubble-agent-text); border-color: transparent; border-bottom-right-radius: 4px; }
.msg.agent.other .bubble { background: var(--bubble-other); color: var(--text); }
.msg.agent.bot .bubble { background: var(--surface-3); color: var(--text); border: 1px dashed var(--border-strong); }
.msg-tag { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); margin-right: 4px; }
.qr-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; margin-top: 4px; }
.qr-chips span { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 11.5px; color: var(--text-2); }
.msg-time { display: block; font-size: 10.5px; opacity: .65; text-align: right; margin-top: 2px; }
.msg.system { align-self: center; max-width: 90%; margin: 12px 0 4px; }
.msg.system span {
  display: inline-block; padding: 3px 10px; border-radius: 999px; text-align: center;
  background: var(--surface-3); color: var(--text-3); font-size: 12px;
}
.messages .loading { margin: auto; color: var(--text-3); }

/* Mesaj geri çekme */
.msg-retract {
  margin: 2px 4px 0; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; color: var(--text-3); opacity: 0; transition: opacity .12s;
}
.msg:hover .msg-retract, .msg-retract:focus-visible { opacity: 1; }
.msg-retract:hover { color: var(--danger); text-decoration: underline; }
@media (hover: none) { .msg-retract { opacity: 1; } }
.msg.retracted .bubble { opacity: .55; }
.msg.retracted .msg-text:not(.msg-retracted) { text-decoration: line-through; }
.msg-retracted { font-style: italic; }
.msg-retracted-note { margin: 2px 4px 0; font-size: 11.5px; color: var(--danger); }

/* Ekip sohbeti: alttaki ekip çubuğunun yukarı açılan panelinde (liste ↔ sohbet) */
.team li .count { flex: none; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
.team li .team-name + .count { margin-left: auto; }
.team li small + .count { margin-left: -2px; }
.team-hash { width: 8px; text-align: center; font-weight: 700; font-size: 13px; color: var(--text-3); flex: none; }
.team-hint { margin: 2px 0 6px; padding: 0 6px; font-size: 11.5px; color: var(--text-3); }
.team-unread {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 2px 8px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 600;
}
.team-unread svg { width: 12px; height: 12px; }
.team-unread:not([hidden]) + .chevron { margin-left: 4px; }

.team-panel.chatting { max-height: none; height: min(480px, 60vh); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.team-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.team-chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-bottom: 1px solid var(--border); }
.team-chat-head .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.team-chat-head .chat-head-text strong { font-size: 13.5px; }
.avatar.avatar-channel { background: var(--surface-3); color: var(--text-2); font-size: 14px; }
.tc-subtitle { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-messages { padding: 6px 10px 8px; background: var(--bg); }
.team-messages .msg { max-width: 88%; margin-top: 8px; }
.team-messages .msg.cont { margin-top: 2px; }
.team-messages .bubble { padding: 6px 10px 4px; font-size: 13px; }
.team-messages .loading { padding: 0 12px; text-align: center; font-size: 12.5px; }
.load-older { align-self: center; margin: 4px 0 6px; }
.team-composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--border); background: var(--surface); }
.team-composer textarea.input { min-height: 36px; height: 36px; max-height: 120px; padding: 8px 10px; resize: none; font-size: 13px; line-height: 1.35; }
.team-composer .btn { flex: none; width: 36px; height: 36px; }
.team-composer .btn svg { width: 16px; height: 16px; }

.typing { display: flex; align-items: center; gap: 8px; padding: 4px 18px 8px; font-size: 12.5px; color: var(--text-3); min-width: 0; }
#typing-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typing-dots { display: inline-flex; gap: 3px; flex: none; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.composer { position: relative; display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; background: var(--surface); border-top: 1px solid var(--border); }

/* Sürükleyerek boyutlandırma: mesaj kutusunun yüksekliği, sağ bölmenin genişliği (tarayıcıda hatırlanır) */
.resizer { position: absolute; z-index: 5; touch-action: none; outline: none; }
.resizer::after { content: ''; position: absolute; border-radius: 2px; transition: background .15s; }
.resizer-y { left: 0; right: 0; top: -5px; height: 10px; cursor: ns-resize; }
.resizer-y::after { left: 50%; top: 4px; width: 44px; height: 3px; margin-left: -22px; background: var(--border-strong); }
.resizer-x { top: 0; bottom: 0; left: -4px; width: 8px; cursor: ew-resize; }
.resizer-x::after { top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; }
.resizer:hover::after, .resizer:focus-visible::after, .resizer.dragging::after { background: var(--brand); }
body.resizing { user-select: none; }
body.resizing-x, body.resizing-x * { cursor: ew-resize !important; }
body.resizing-y, body.resizing-y * { cursor: ns-resize !important; }
.composer textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 160px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); outline: none; line-height: 1.45;
}
.composer textarea:focus { border-color: var(--brand); }
.composer .btn { height: 44px; }
.composer-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: none; }
.note-switch { justify-content: flex-end; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap; user-select: none; }
.note-switch .switch-track { width: 30px; height: 16px; }
.note-switch .switch-track::after { width: 12px; height: 12px; }
.composer .note-switch input:checked + .switch-track { background: var(--warn); }
.composer .note-switch input:checked + .switch-track::after { transform: translateX(14px); }
.composer.note-mode { background: var(--warn-soft); border-top-color: var(--warn); }
.composer.note-mode textarea { border-color: var(--warn); background: var(--surface); }
.composer.note-mode .note-switch { color: var(--warn); }
.composer.note-mode .btn-primary { background: var(--warn); border-color: var(--warn); color: var(--surface); }
/* Ekip notu: sohbet içinde yalnızca panelde görünen kutu */
.msg.note { align-self: flex-end; align-items: flex-end; }
.msg.note .bubble { background: var(--warn-soft); color: var(--text); border: 1px dashed var(--warn); border-bottom-right-radius: 4px; }
.note-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--warn); }
.note-tag svg { width: 11px; height: 11px; }
.composer .attach-btn { width: 40px; color: var(--text-3); }
.composer .attach-btn:hover { color: var(--brand-ink); }
.msg.agent:not(.other):not(.bot) .att-file { background: rgba(255, 255, 255, .18); }

/* Botun topladığı bilgiler (sağ bölme) */
.info-section.collected { margin: 0 -6px; padding: 12px; border-radius: 10px; background: var(--brand-soft); }
.secret { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-ink); cursor: pointer; font-size: 12px; text-decoration: underline; }
.collected-value { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.copy-btn {
  flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-2);
  font-size: 13px; line-height: 1; cursor: pointer;
}
.copy-btn:hover { color: var(--brand-ink); border-color: var(--brand-ink); }
.collected-file { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.collected-file .att-image img { max-width: 100%; max-height: 160px; }
.collected-file .att-image, .collected-file .att-file { margin: 0; }
/* Başlık + "Kopyala" (yatırım kontrolü bilgileri tek seferde) */
.collected-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.collected-head h4 { margin: 0; }
.info-section.collected .collected-head + .info-list { margin-top: 8px; }
.collected-value .tone-ok { color: var(--ok); font-weight: 600; }
.collected-value .tone-warn { color: var(--warn); font-weight: 600; }
.collected-value .tone-bad { color: var(--danger); font-weight: 600; }

/* Bot düzenleyici: "Bilgi topla" soruları */
.q-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.q-row { display: flex; align-items: center; gap: 6px; }
.q-row .input { height: 34px; }
.q-row select.input { width: auto; flex: none; }
.q-row .check { margin: 0; font-size: 12.5px; flex: 1; }
.q-card textarea.input { min-height: 54px; }
.q-card .q-hint { font-size: 12px; color: var(--text-3); line-height: 1.4; }
.check-text-note { display: block; margin-top: 4px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.check-text-note.warn-text { color: var(--warn); }
.f-collect svg { color: #7c3aed; }
.composer-field { flex: 1; min-width: 0; position: relative; display: flex; }

/* "#" hazır yazı öneri kutusu */
.canned-popup {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 10;
  max-height: 300px; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.canned-option { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.canned-option.active { background: var(--brand-soft); }
.canned-head { display: flex; align-items: center; gap: 8px; }
.canned-head strong { font-size: 13px; color: var(--brand-ink); }
.canned-head .badge { height: 18px; font-size: 11px; }
.canned-text { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canned-empty { padding: 10px; font-size: 13px; color: var(--text-3); }
.canned-hint { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--border); margin-top: 4px; }

/* Sağ bölme: Müşteri / Geçmiş sekmeleri */
.info-pane { position: relative; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.info-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); flex: none; }
.info-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--text-3);
}
.info-tab:hover { color: var(--text); }
.info-tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-size: 11px;
}
.info-tab.active .tab-count { background: var(--brand-soft); color: var(--brand-ink); }
.info-tabs .info-toggle { margin-left: auto; }
.info-body { flex: 1; overflow-y: auto; padding: 14px 14px 20px; line-height: 1.45; }
.info-empty { margin: 0; }
.info-section + .info-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
/* (Dolgulu kutu bölüm çizgisi almaz; altındaki bölüm de.) */
.info-section + .info-section.collected { margin-top: 16px; padding-top: 12px; border-top: 0; }
.info-section.collected + .info-section { border-top: 0; }
.info-section h4 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 10px; }
.chat-head .info-toggle.on { background: var(--brand-soft); color: var(--brand-ink); }

/* Dış sistemden gelecek üye bilgileri için ayrılan alan */
.member-box { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); container-type: inline-size; }
.member-box.empty { display: flex; flex-direction: column; gap: 4px; border-style: dashed; text-align: center; padding: 12px; font-size: 13px; }
.member-box.empty > strong { font-size: 13px; color: var(--text-2); }
/* Belirsiz eşleşme (kullanıcı adı birden çok üyeye düşüyor): sunucunun uyarı satırı (tone warn) */
.member-box.empty > .tone-warn { color: var(--warn); font-weight: 600; }
.member-links { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 13px; }
/* Sıkı iki sütun: etiket | değer (müşteri ve üye bilgileri; Yardımcılar ekranın altına itilmesin) */
.info-list.kv { grid-template-columns: max-content minmax(0, 1fr); gap: 7px 12px; align-items: baseline; }
.info-list.kv > div { display: contents; }
.info-list.kv dt { margin: 0; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.info-list.kv dd { font-size: 13px; }
.member-box .copy-btn { width: 22px; height: 22px; font-size: 12px; }
.member-box .badge, .assist-card .badge { height: 18px; padding: 0 6px; font-size: 11px; }
.member-box .collected-value .tone-ok { color: var(--ok); }
.member-box .collected-value .tone-warn { color: var(--warn); font-weight: 600; }
.member-box .collected-value .tone-bad { color: var(--danger); font-weight: 600; }
/* Dar bölmede (ör. 861–1360 px pencere; kartın içi ~210 px'ten dar) üye kartı tek sütun: değer ve rozetler kartın tüm
   genişliğini kullanır. Geniş bölmede (300 px; içi ~224 px) iki sütun kalır. */
@container (max-width: 210px) {
  .member-box .info-list.kv { grid-template-columns: minmax(0, 1fr); row-gap: 1px; }
  .member-box .info-list.kv > div:not(:first-child) > dt { margin-top: 7px; }
}
.member-source { margin: 8px 0 0; font-size: 11px; color: var(--text-3); }
.member-box.empty .member-source { margin-top: 6px; }
.member-warning { margin: 6px 0 0; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 12px; text-align: left; }

/* Üye kartı (sıkı düzen): ad, kimlik etiketleri, özet kutucukları, uyarılar, kısa satırlar, hareket sekmeleri */
.member-box.compact { padding: 10px; }
.mb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.mb-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.mb-ids { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mb-id {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 24px; padding: 0 1px 0 7px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: 12px; font-variant-numeric: tabular-nums;
}
.mb-id-label { color: var(--text-3); font-size: 11px; }
.mb-id-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-box .mb-id .copy-btn { width: 20px; height: 20px; border: 0; background: none; font-size: 11px; }
/* Kutucuklar tek şerit: aralarında 1px çizgi (şeridin zemini); 3 ve altı tek satır, 4'lü dar panelde 2×2 */
.mb-tiles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--border); overflow: hidden;
}
.mb-tiles.n1 { grid-template-columns: minmax(0, 1fr); }
.mb-tiles.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (min-width: 340px) { .mb-tiles.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mb-tile { display: flex; flex-direction: column; min-width: 0; padding: 4px 7px 5px; background: var(--surface); line-height: 1.3; }
.mb-tile-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
.mb-tile strong { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-tile-sub { font-size: 10.5px; color: var(--text-3); overflow-wrap: anywhere; }
.mb-tile.tone-warn { background: var(--warn-soft); }
.mb-tile.tone-warn strong { color: var(--warn); }
.mb-alert { margin: 6px 0 0; padding: 5px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 12px; overflow-wrap: anywhere; }
.mb-lines { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; margin: 8px 0 0; font-size: 12px; text-align: left; }
.mb-lines > div { display: contents; }
.mb-lines dt { color: var(--text-3); }
.mb-lines dd { margin: 0; overflow-wrap: anywhere; }
.mb-lines .tone-warn dd { color: var(--warn); font-weight: 600; }
.mb-activity { margin-top: 8px; text-align: left; }
.mb-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.mb-tab {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer;
}
.mb-tab:hover { border-color: var(--brand); color: var(--brand-ink); }
.mb-tab.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.mb-tab-count { font-size: 11px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mb-tab.active .mb-tab-count { color: var(--brand-ink); }
.mb-activity .tx-list { max-height: 260px; overflow-y: auto; }

/* İşlem satırları (üye bilgileri ve yardımcı kartları) */
.tx-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.tx-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 8px;
  padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.tx-list li:first-child { border-top: 0; }
.tx-main { min-width: 0; overflow-wrap: anywhere; }
.tx-main strong { font-variant-numeric: tabular-nums; }
.tx-main .badge { margin-left: 6px; }
.tx-meta { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tx-note { flex-basis: 100%; font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }

/* Yardımcılar: müşterinin konusuna göre kontroller ve hazır yazı önerileri */
.assist-stale { margin: 0 0 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 12px; }
.assist-card { border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.assist-card + .assist-card { margin-top: 10px; }
.assist-card.tone-ok { border-left-color: var(--ok); }
.assist-card.tone-info { border-left-color: var(--text-3); }
.assist-card.tone-warn { border-left-color: var(--warn); }
.assist-card.tone-bad { border-left-color: var(--danger); }
.assist-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 8px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 10px;
}
.assist-head:hover .assist-title { color: var(--brand-ink); }
.assist-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.assist-title { min-width: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assist-tone { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.assist-tone.tone-ok { background: var(--ok-soft); color: var(--ok); }
.assist-tone.tone-info { background: var(--surface-3); color: var(--text-2); }
.assist-tone.tone-warn { background: var(--warn-soft); color: var(--warn); }
.assist-tone.tone-bad { background: var(--danger-soft); color: var(--danger); }
.assist-chevron { flex: none; margin-left: auto; color: var(--text-3); font-size: 12px; }
/* Müşterinin mesajı tek satır (tamamı üzerine gelince) */
.assist-quote {
  display: flex; gap: 6px; margin: 0 12px 10px; padding: 5px 9px; border-radius: 6px; background: var(--surface-3);
  font-size: 12.5px; color: var(--text-2);
}
.assist-quote-text { flex: 1; min-width: 0; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assist-quote time { flex: none; font-size: 11.5px; color: var(--text-3); }
.assist-mentioned { margin: 0 12px 10px; font-size: 12.5px; color: var(--text-2); }
/* Müşterinin bahsettiği işlem (kartın en üstünde): satırı ve kararı */
.assist-focus {
  margin: 0 12px 10px; padding: 9px 11px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.assist-focus.tone-ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.assist-focus.tone-warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.assist-focus.tone-bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.assist-focus-label { display: block; margin-bottom: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.assist-focus > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 3px 8px; font-size: 13.5px; color: var(--text); }
.assist-focus > div strong { font-size: 15px; }
.assist-focus-verdict { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 7px; align-items: start; margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.assist-focus-verdict .assist-fact { font-weight: 600; }
.assist-focus-verdict small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.assist-focus-verdict.tone-ok .assist-icon { color: var(--ok); }
.assist-focus-verdict.tone-info .assist-icon { color: var(--text-3); }
.assist-focus-verdict.tone-warn .assist-icon { color: var(--warn); }
.assist-focus-verdict.tone-bad .assist-icon { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.assist-facts { list-style: none; margin: 0 12px 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assist-facts li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 7px; align-items: start; font-size: 13px; line-height: 1.45; }
.assist-facts li small { display: block; margin-top: 1px; font-size: 12px; line-height: 1.4; color: var(--text-3); overflow-wrap: anywhere; }
.assist-facts li.quiet { font-size: 12px; color: var(--text-3); }
.assist-facts li.assist-more { display: block; padding-left: 21px; }
.assist-icon {
  width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid currentColor; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 9px; font-weight: 700; font-style: normal; line-height: 1;
}
.assist-facts .tone-ok .assist-icon { color: var(--ok); }
.assist-facts .tone-info .assist-icon { color: var(--text-3); }
.assist-facts .tone-warn .assist-icon { color: var(--warn); }
.assist-facts .tone-bad .assist-icon { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.assist-rows-wrap { margin: 0 12px 10px; }
.assist-rows-toggle { font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.assist-rows-toggle:hover { color: var(--brand-ink); text-decoration: underline; }
.assist-rows { margin: 4px 0 0; }
.assist-rows li.match { margin: 0 -6px; padding: 6px; border-radius: 4px; background: var(--brand-soft); }
.assist-canned { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 12px 12px; }
/* Kart eylemi (ör. "Hesapla"): çiplerden ayrışsın diye köşeli, nötr düğme */
.assist-action {
  height: 22px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; cursor: pointer;
  background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.assist-action:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-ink); }
.assist-action:disabled { opacity: .6; cursor: progress; }
.assist-chip {
  height: 22px; padding: 0 8px; border: 1px solid var(--brand); border-radius: 999px; cursor: pointer;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 11.5px; font-weight: 600;
}
.assist-chip:hover { background: var(--brand); color: var(--brand-text); }
.assist-kb { margin-left: auto; font-size: 11.5px; white-space: nowrap; }

.related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.related-item {
  width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.related-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.related-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.related-meta { font-size: 12px; color: var(--text-3); }
.related-preview { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-list { margin: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.info-list > div { min-width: 0; }
.info-list dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); margin-bottom: 2px; }
.info-list dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.info-list.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; }
.stars-inline { color: #f59e0b; letter-spacing: 1px; }

/* Tablolar, filtreler */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 140px; }
.filters .grow { flex: 1 1 240px; }
.input-auto { width: auto; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: var(--surface-2); }
.table td small { display: block; color: var(--text-3); font-size: 12px; }
.table .empty-row td { text-align: center; color: var(--text-3); padding: 28px; }
.table td.wrap { white-space: pre-wrap; min-width: 260px; max-width: 560px; overflow-wrap: anywhere; }
.table td .actions { display: inline-flex; gap: 6px; }
.table code { white-space: nowrap; }
.page-intro { max-width: 860px; margin: -6px 0 16px; font-size: 13px; line-height: 1.6; }
.page-head .actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.page-head h2 .badge { vertical-align: middle; margin-left: 6px; }
.field-row.wide-first { grid-template-columns: 2fr 1fr; }

/* Mesaj kutusunun üstündeki yazım önerileri */
.spell-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 14px;
  background: var(--surface); border-top: 1px solid var(--border); font-size: 12.5px;
}
.spell-label { color: var(--text-3); font-weight: 600; }
.spell-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-size: 12.5px;
}
.spell-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.spell-chip del, .spell-group del { color: var(--danger); }
.spell-chip ins { color: var(--ok); font-weight: 600; text-decoration: none; }
/* Olası yazım hatası: kesik çizgili grup; adaylardan biri tıklanır veya "+" ile kelime sözlüğe eklenir */
.spell-group {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px;
  border: 1px dashed var(--border-strong); background: var(--surface-2); font-size: 12.5px;
}
.spell-alt {
  height: 20px; padding: 0 7px; border: 1px solid transparent; border-radius: 999px; background: transparent;
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.spell-alt.first { color: var(--ok); font-weight: 600; }
.spell-alt:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.spell-add {
  width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text-3);
  font-weight: 700; line-height: 1; cursor: pointer;
}
.spell-add:hover { background: var(--brand-soft); color: var(--brand-ink); }
.spell-all {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-text); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.spell-all:hover { background: var(--brand-hover); }
.spell-all kbd { background: rgba(253, 253, 253, .5); border-color: rgba(19, 15, 40, .25); color: var(--brand-text); }

/* Ayarlar: sohbet öncesi ekran görselleri */
.image-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.image-thumb {
  width: 120px; height: 90px; flex: none; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; font-size: 12px; color: var(--text-3);
}
.image-thumb.wide { width: 240px; height: 72px; }
.image-thumb.has-image { border-style: solid; }
.image-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Hesabım: bildirim ve yazım düzeltme tercihleri */
.pref-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pref-row .check { margin: 0; }
.volume { flex: 1 1 140px; max-width: 220px; accent-color: var(--brand); }

/* Hesabım > Bildirimler: olay | ses | dinle */
#notify-form { max-width: 640px; }
.sound-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.sound-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 36px; align-items: center; gap: 10px; padding: 10px 12px; }
.sound-row + .sound-row { border-top: 1px solid var(--border); }
.sound-row .check { margin: 0; align-items: flex-start; }
.sound-row .check input { margin-top: 3px; flex: none; }
.sound-row .check > span, .sound-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sound-row small { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.sound-row strong { font-size: 13.5px; font-weight: 600; }
.sound-row > select.input { height: 34px; padding: 0 8px; }
.sound-label { padding-left: 24px; }
.sound-label .input-sm { width: auto; height: 30px; padding: 0 8px; margin-top: 4px; align-self: flex-start; font-size: 13px; }
@media (max-width: 560px) {
  .sound-row { grid-template-columns: minmax(0, 1fr) 36px; }
  .sound-row > select.input { grid-column: 1; grid-row: 2; }
  .sound-row > button { grid-column: 2; grid-row: 2; }
}
.notify-permission { margin: -8px 0 14px 26px; color: var(--text-3); }
.ok-text { color: var(--ok); }
.radio-list .check { margin-bottom: 8px; }

/* Klavye kısayolları (Hesabım) */
.shortcut-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.shortcut-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; }
.shortcut-row + .shortcut-row { border-top: 1px solid var(--border); }
.shortcut-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shortcut-label strong { font-size: 13.5px; font-weight: 600; }
.shortcut-label small { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.shortcut-key {
  font: inherit; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace; min-width: 130px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap;
}
.shortcut-key:hover { border-color: var(--brand); }
.shortcut-key.unset, .shortcut-key.recording { font-family: inherit; font-style: italic; color: var(--text-3); }
.shortcut-key.recording { border-color: var(--brand); box-shadow: 0 0 0 3px var(--surface-3); color: var(--text-2); }
.card h3 .badge { vertical-align: middle; margin-left: 6px; }
kbd {
  display: inline-block; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px;
  background: var(--surface-2); font: 600 11px/1.6 var(--font); color: var(--text-2);
}

/* Değişkenler */
.vars-group { margin-bottom: 18px; }
.vars-table td { vertical-align: top; }
.vars-table td.var-key { width: 260px; white-space: normal; }
.vars-table td.var-key code { font-size: 13px; font-weight: 600; }
.vars-table td.var-key small { margin-top: 3px; }
.vars-table td.var-value { width: 100%; min-width: 240px; }
.vars-table td.var-value textarea { min-height: 38px; resize: vertical; font-size: 13px; line-height: 1.5; }
.vars-table td.var-usage { color: var(--text-3); font-size: 12.5px; }
/* Yardımcılar'daki çekim kontrolünün değer olarak okuduğu değişkenler (silinirse kontrol kapanır) */
.vars-table td.var-usage .var-assist { display: block; margin-top: 2px; font-size: 11.5px; }
.vars-table tr.changed td.var-key { box-shadow: inset 3px 0 0 var(--warn); }

/* Yardımcılar ayarları */
.assist-tabs { margin-bottom: 14px; }
.assist-rules h3:first-child { margin-top: 0; }
.field-row.triple { grid-template-columns: repeat(3, 1fr); }
.add-row { display: flex; gap: 8px; align-items: center; margin: 10px 0 18px; max-width: 520px; }
.add-row .input { flex: 1; min-width: 0; }
.tiers-table td { width: 42%; }
.tiers-table input { max-width: 180px; }
.assist-methods-table td, .assist-families-table td { vertical-align: top; }
.assist-families-table td small { display: block; color: var(--text-3); font-size: 11.5px; }
/* Yalnızca kişisel kopyası olan kısayol: kart sadece o temsilcide gösterir */
.page-intro code.personal, .muted code.personal { color: var(--warn); text-decoration: underline dotted; }

/* Yardımcılar → Kartlar: kart türüne göre katlanır bölümler */
.ka-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ka-intro p { margin: 0; max-width: 860px; }
.ka-intro .actions { display: flex; gap: 4px; flex: none; }
.ka-kind { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.ka-kind.open { border-color: var(--border-strong); }
.ka-kind-head {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--radius);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.ka-kind-head:hover { background: var(--surface-2); }
.ka-kind-head:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ka-chevron { flex: none; width: 14px; color: var(--text-3); }
.ka-kind-title { flex: 1; min-width: 0; }
.ka-kind-title strong { display: block; font-size: 15px; }
.ka-kind-title small { display: block; margin-top: 2px; color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.ka-kind-meta { display: flex; gap: 6px; flex: none; }
.ka-kind-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; padding: 0 14px 14px; }
.ka-kind-body.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1180px) { .ka-kind-body { grid-template-columns: minmax(0, 1fr); } }
.ka-main { min-width: 0; }
.ka-block { padding: 12px 0 4px; border-top: 1px solid var(--border); }
.ka-block h4 { margin: 0 0 4px; font-size: 13.5px; }
.ka-block h5 { margin: 8px 0 2px; font-size: 13px; }
.ka-block > p.muted { margin: 0 0 8px; max-width: 860px; }
.ka-intent { padding: 7px 0 7px calc(var(--depth, 0) * 18px); border-bottom: 1px dashed var(--border); }
.ka-intent:last-child { border-bottom: 0; }
.ka-intent-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ka-intent-name { flex: 0 0 230px; min-width: 0; font-size: 13.5px; }
.ka-intent-name small { display: block; color: var(--text-3); font-size: 11.5px; }
.ka-intent.inherit .ka-intent-name { color: var(--text-2); }
.ka-adv-toggle { margin-left: auto; }
.ka-intent-adv { margin: 8px 0 4px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ka-intent-adv .check-list small { display: block; margin-left: 22px; color: var(--text-3); }
.ka-adv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ka-add-intent { max-width: 420px; }
.canned-list { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.canned-chip {
  display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 9px; border: 1px solid var(--brand); border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-ink); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.canned-chip:has(.chip-x) { padding-right: 3px; }
.canned-chip.token { border-style: dashed; background: var(--surface-3); color: var(--text-2); }
.canned-chip.missing { border-color: var(--danger); background: transparent; color: var(--danger); }
.canned-chip.missing > span:first-child { text-decoration: line-through; }
.canned-chip.personal { border-color: var(--warn); background: transparent; color: var(--warn); }
.canned-chip.struck { opacity: .65; border-color: var(--border-strong); background: transparent; color: var(--text-3); }
.canned-chip.struck > span { text-decoration: line-through; }
.chip-x { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 999px; background: none; color: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.chip-x:hover { background: color-mix(in srgb, currentColor 18%, transparent); }
.canned-add { height: 24px; padding: 0 8px; }
.canned-picker {
  position: fixed; z-index: 60; display: flex; flex-direction: column; max-height: 340px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg);
}
.canned-picker > .input { margin: 8px; width: auto; }
.canned-pick-list { list-style: none; margin: 0; padding: 0 4px 6px; overflow: auto; }
.canned-pick-list li.empty { padding: 8px 10px; }
.canned-pick-list button {
  display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.canned-pick-list button:hover, .canned-pick-list button.active { background: var(--surface-3); }
.canned-pick-list code { font-weight: 600; }
.canned-pick-list button.missing code { color: var(--danger); }
.canned-pick-list button.personal code { color: var(--warn); }
.canned-pick-list small { display: block; overflow: hidden; color: var(--text-3); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
.ka-sit, .ka-text { padding: 9px 0 9px 10px; border-left: 3px solid transparent; border-bottom: 1px dashed var(--border); }
.ka-sit:last-child, .ka-text:last-child { border-bottom: 0; }
.ka-sit.changed, .ka-text.changed { border-left-color: var(--warn); }
.ka-row-head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.ka-row-head strong { font-size: 13px; }
.ka-reset { margin-left: auto; }
.ka-help { display: block; margin-top: 1px; font-size: 12px; }
.ka-sit-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
@media (max-width: 760px) { .ka-sit-lists { grid-template-columns: 1fr; } }
.ka-list-label { display: block; margin-bottom: 4px; color: var(--text-3); font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ka-text textarea.input { field-sizing: content; min-height: 36px; margin-top: 4px; resize: vertical; }
.ka-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.ka-ph-btn {
  height: 22px; padding: 0 7px; border: 1px dashed var(--border-strong); border-radius: 5px; background: var(--surface-2);
  color: var(--text-2); font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; cursor: pointer;
}
.ka-ph-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.ka-text-sample { margin-top: 6px; color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.ka-warn { color: var(--danger); }
.ka-preview { position: sticky; top: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.ka-preview h4 { margin: 0 0 8px; font-size: 13px; }
.ka-preview .field { margin-bottom: 8px; }
.ka-preview-card { margin-top: 4px; }
.ka-preview-head { padding: 10px 12px 6px; }
.ka-preview-sit { margin: 0 12px 8px; color: var(--text-2); font-size: 12px; }
.ka-preview-chips { margin-top: 0; }
.ka-preview-chips .assist-chip { display: inline-flex; align-items: center; cursor: default; }
.ka-preview-chips .assist-chip.from-durum { border-style: dashed; }
.ka-preview-dropped { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ka-preview-note { margin: 10px 0 0; }
.ka-stale { margin-top: 18px; }
.ka-always { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ka-always h4 { margin: 0 0 4px; font-size: 13.5px; }
.ka-always p { margin: 0 0 8px; }
/* Çakışma uyarısı (409 / başka yönetici kaydetti) içindeki "Yenile" */
.alert .conflict-reload { vertical-align: middle; margin-left: 4px; }
/* Kullanıcılar > Son işlemler */
.audit-title { margin-top: 26px; }
.audit-intro { max-width: 860px; margin: -4px 0 12px; }
.audit-table td.wrap { min-width: 160px; }
.kinds-table input { max-width: 320px; }
.assist-methods-table code, .assist-families-table code { font-weight: 600; }
.assist-methods-table .input, .assist-families-table .input { min-width: 140px; }
.copy-key { margin-left: 4px; }

/* Bilgi bankası */
.kb-list { display: flex; flex-direction: column; gap: 8px; max-width: 980px; }
.kb-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.kb-item > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 14px;
}
.kb-item > summary::-webkit-details-marker { display: none; }
.kb-item > summary::before { content: '›'; color: var(--text-3); font-size: 18px; line-height: 1; transition: transform .15s; }
.kb-item[open] > summary::before { transform: rotate(90deg); }
.kb-item > summary .badge { margin-left: auto; }
.kb-body { padding: 0 16px 12px 34px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.kb-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px 34px; font-size: 12px; color: var(--text-3); }
.kb-foot .actions { margin-left: auto; display: inline-flex; gap: 6px; }
.kb-preview {
  max-height: 260px; overflow-y: auto; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; color: var(--text-2);
}
.kb-empty { padding: 28px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Sohbet ekranındaki "Bilgi" sekmesi */
.info-kb { display: flex; flex-direction: column; gap: 10px; }
.info-kb .kb-item > summary { padding: 9px 10px; font-size: 13px; }
.info-kb .kb-item > summary .badge { font-size: 10.5px; }
.info-kb .kb-body { padding: 0 10px 8px 10px; font-size: 12.5px; max-height: 320px; overflow-y: auto; }
.info-kb .kb-foot { padding: 0 10px 10px 10px; }

/* Segment düğmeleri (filtre / kapsam seçimi) */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-3); }
.segmented button, .segmented label {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-2); font-weight: 500; cursor: pointer; font-size: 13px;
}
.segmented button.active, .segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.radio { display: flex; }
.segmented.radio label { flex: 1; justify-content: center; }
.segmented.radio input { margin: 0; }
.segmented small { color: var(--text-3); font-weight: 400; }
.segmented label:has(input:disabled) { cursor: not-allowed; opacity: .6; }

.prefixed { display: flex; align-items: center; }
.prefixed > span {
  height: 38px; padding: 0 10px; display: grid; place-items: center; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-3);
}
.prefixed .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-list .check { margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.check-list .check:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }

/* KPI kutucukları */
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); margin: 6px 0 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.kpi-label { font-size: 13px; color: var(--text-2); }
.kpi-value { font-size: 26px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--text-3); }

/* Kartlar */
.card { padding: 18px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-width: 760px; }
.card h3 { font-size: 15px; margin-bottom: 6px; }
.card p { margin: 0 0 12px; }
.card.narrow { max-width: 420px; }
.code {
  margin: 0 0 12px; padding: 12px; border-radius: var(--radius-sm); overflow-x: auto;
  background: var(--surface-3); border: 1px solid var(--border); font-size: 12.5px; white-space: pre-wrap; word-break: break-all;
}
.small { font-size: 12px; }
code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.role-help { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--text-2); }
.role-help .badge { min-width: 88px; justify-content: center; margin-right: 6px; }

/* Diyaloglar */
.dialog {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dialog-head h3 { font-size: 16px; }
.dialog-body { padding: 16px; max-height: calc(100dvh - 200px); overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.transcript { display: flex; flex-direction: column; gap: 14px; }
.transcript .messages { padding: 12px; border-radius: var(--radius-sm); background: var(--bg); min-height: 200px; max-height: 50dvh; flex: none; }
.transfer-list { display: flex; flex-direction: column; gap: 6px; }
.transfer-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.transfer-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.transfer-option small { margin-left: auto; color: var(--text-3); }

.mobile-only { display: none; }

/* Ayarlar formu */
.card.wide-ish { max-width: 620px; }
.card h3.mt { margin-top: 22px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); transition: background .15s;
}
.switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- Chatbot düzenleyici */
.bot-editor { display: flex; flex-direction: column; min-height: 0; }
.bot-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.bot-toolbar h2 { font-size: 18px; }
.bot-toolbar-actions { margin-left: auto; display: flex; gap: 8px; }
/* Akış sunucuda değişti uyarısı (araç çubuğunun altında, tuvalin üstünde) */
.bot-conflict { flex: none; margin: 10px 20px 0; }
.bot-error { margin-bottom: 12px; }
.bot-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; }
.bot-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--surface); }
.bot-side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.bot-side-body h3 { font-size: 15px; margin-bottom: 4px; }
.bot-side-body .field textarea.input { min-height: 72px; }
/* Alan sayacı: "n / sınır" (sunucu sınırı aşan metni kırpmaz, reddeder) */
.field-counter { text-align: right; margin-top: -2px; font-variant-numeric: tabular-nums; }
.field-counter.over { color: var(--danger); font-weight: 600; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.inspector-note { font-size: 12.5px; color: var(--text-3); margin: 0 0 14px; line-height: 1.55; }
.bot-side-body h3.mt-s { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
/* Etiketler komşu düğümlerin etiketleriyle çakışmasın */
.f-item-intent .f-caption { bottom: calc(100% + 10px); max-width: 120px; }
.f-item-response .f-caption, .f-item-transfer .f-caption { max-width: 100%; }

/* Akış tuvali: yatay ağaç */
.flow-canvas {
  --flow-line: #94a3b8;
  overflow: auto; padding: 36px 40px 60px; min-height: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 22px 22px;
}
.ft { display: flex; align-items: center; }
.ft-node { flex: none; display: flex; align-items: center; }
.ft-children { position: relative; display: flex; flex-direction: column; padding-left: 40px; }
.ft-children::before { content: ''; position: absolute; left: 0; top: 50%; width: 20px; border-top: 1.5px solid var(--flow-line); }
.ft-children > .ft { position: relative; padding: 15px 0; } /* üstteki etiketlere yer */
.ft-children > .ft::before { content: ''; position: absolute; left: -20px; top: 50%; width: 20px; border-top: 1.5px solid var(--flow-line); }
.ft-children > .ft::after { content: ''; position: absolute; left: -20px; top: 0; bottom: 0; border-left: 1.5px solid var(--flow-line); }
.ft-children > .ft:first-child::after { top: 50%; }
.ft-children > .ft:last-child::after { bottom: 50%; }
.ft-children > .ft:only-child::after { display: none; }
.f-pair { display: flex; align-items: center; }
.f-link { width: 72px; border-top: 1.5px solid var(--flow-line); }

.f-item { position: relative; display: flex; flex-direction: column; align-items: center; }
.f-caption {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  max-width: 170px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.f-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.f-chip svg { width: 16px; height: 16px; flex: none; }
.f-chip:hover { border-color: var(--border-strong); }
.f-chip.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.f-chip.hit { animation: f-hit 1.6s ease-out; }
@keyframes f-hit { 0%, 40% { box-shadow: 0 0 0 5px rgba(34, 197, 94, .45); } 100% { box-shadow: var(--shadow-sm); } }
.f-start { background: #64748b; color: #fff; }
.f-ai { background: var(--navy); color: var(--on-navy); }
.f-response svg { color: var(--brand-ink); }
.f-transfer svg { color: #ea580c; }
.f-success svg { color: #16a34a; }
.f-failure svg { color: #dc2626; }
.f-add { height: 30px; padding: 0 12px; border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; color: var(--text-2); font-weight: 500; }
.f-add:hover { border-color: var(--brand); color: var(--brand-ink); }
/* Niyet: eşkenar dörtgen */
.f-intent { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; transform: rotate(45deg); background: #334155; color: #fff; }
.f-intent svg { transform: rotate(-45deg); }
.f-intent.selected { border-color: var(--brand); }

/* Test penceresi */
.bot-sim { display: flex; flex-direction: column; gap: 10px; }
.sim-messages { flex: 1; min-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--bg); }
.sim-msg { max-width: 88%; padding: 7px 11px; border-radius: 12px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sim-msg.user { align-self: flex-end; background: var(--brand); color: var(--brand-text); }
.sim-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.sim-msg.note { align-self: center; max-width: 100%; background: var(--warn-soft); color: var(--warn); font-size: 12px; }
.sim-msg.meta { align-self: flex-start; background: transparent; color: var(--text-3); font-size: 11.5px; padding: 0 4px; }
.sim-qr { display: flex; flex-wrap: wrap; gap: 4px; }
.sim-qr button { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--brand); background: var(--surface); color: var(--brand-ink); font-size: 12px; cursor: pointer; }

/* Chatbot düzenleyici: yanıt araç çubuğu (değişken / bağlantı ekle), bağlantı formu, bağlantı butonları, önizleme */
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.md-toolbar .var-pick, .q-row .var-pick { width: auto; flex: none; max-width: 190px; height: 30px; padding: 0 8px; font-size: 12.5px; }
.link-form, .link-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.link-card { margin-bottom: 8px; }
.link-card .q-row .input { height: 34px; }
.link-form .q-row .input:not(select), .link-card .q-row .input:not(select) { flex: 1; min-width: 0; }
.field small.field-error { color: var(--danger); }
.input.invalid { border-color: var(--danger); }
.qr-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 14px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text); font-size: 12.5px; }
.qr-notice[hidden] { display: none; }
.bot-preview { margin: 0 0 14px; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.bp-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); margin-bottom: 6px; }
.bp-bubble { max-width: 92%; padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.bp-empty { color: var(--text-3); font-style: italic; }
.bot-preview .bp-chips { justify-content: flex-start; margin-top: 6px; }

/* Bot mesajındaki bağlantılar (sohbet görünümü, test penceresi, önizleme): metin içi bağlantı ve balondaki bağlantı butonları */
.msg-text a.msg-link, .sim-msg a.msg-link { color: var(--brand-ink); font-weight: 600; }
.msg-actions { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 2px; white-space: normal; }
.msg-action { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 12px; border-radius: 8px; background: var(--brand); color: var(--brand-text); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.msg-action::after { content: "↗"; font-size: 11px; }
.msg-action:hover { filter: brightness(1.08); }
.sim-composer { display: flex; gap: 6px; }

/* ---------------------------------------------------------------- Chatbot: "API'ye sor" adımı */
.f-api svg { color: #7c3aed; }
.api-summary { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.api-sum-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.api-sum-line code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-badge { flex: none; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; background: #64748b; }
.api-badge.m-get { background: #16a34a; }
.api-badge.m-post { background: #d97706; }
.api-badge.m-put, .api-badge.m-patch { background: #2563eb; }
.api-badge.m-delete { background: #dc2626; }
.api-keys code { font-size: 11.5px; }

.dialog.api-dialog { width: min(1180px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.api-dialog .dialog-head small { display: block; margin-top: 2px; }
.api-dialog .dialog-body.api-body { max-height: calc(100dvh - 170px); display: flex; flex-direction: column; gap: 12px; }
.api-note { display: block; font-size: 12px; color: var(--text-3); line-height: 1.5; }
.api-empty { padding: 14px; font-size: 12.5px; color: var(--text-3); line-height: 1.55; }
.api-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.api-urlbar { display: flex; gap: 8px; align-items: stretch; }
.api-urlbar .api-method-select { flex: none; width: 104px; font-weight: 700; }
.api-urlbar .api-url { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.api-urlbar .api-send { flex: none; min-width: 96px; }
.api-urltools { margin-top: -4px; }
.api-url-warn { font-size: 12px; color: var(--warn); }
.api-url-warn.error { color: var(--danger); }
.api-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.api-pane { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.api-pane h4, .api-rules h4 { font-size: 13.5px; }
.api-tabs { flex-wrap: wrap; }
.api-tabbody { display: flex; flex-direction: column; gap: 8px; }
.api-tabbody h5 { font-size: 12px; margin-top: 4px; color: var(--text-2); }
.api-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.api-row > .input { flex: 1 1 140px; min-width: 0; height: 32px; }
.api-row > .api-key { flex: 0 1 170px; }
.api-row > .var-pick { flex: none; width: 54px; height: 32px; padding: 0 6px; }
.api-row > code { flex: none; }
.api-hint { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; padding: 6px 8px; border-radius: var(--radius-sm); }
.api-hint.warn { background: var(--warn-soft); }
.api-hint[hidden] { display: none; }
.api-secret-dots { color: var(--text-3); letter-spacing: .1em; }
.api-secrets { display: flex; flex-direction: column; gap: 6px; }
.api-secrets small { color: var(--text-3); margin-left: auto; }
.api-json-status { font-size: 12px; color: var(--ok); }
.api-json-status.error { color: var(--danger); }
.api-tabbody textarea.api-mono { min-height: 180px; }
.api-sample { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.api-sample.used { color: var(--text); font-weight: 600; }
.api-sample .input { height: 32px; }
.api-facts { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.api-alert { margin: 0; }
.api-curl textarea { min-height: 96px; }
.api-response { min-height: 220px; }
.api-res-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.api-status { padding: 3px 9px; border-radius: 6px; border: 0; font-weight: 700; font-size: 12.5px; color: #fff; background: #64748b; cursor: pointer; }
.api-status.s2 { background: #16a34a; }
.api-status.s3 { background: #2563eb; }
.api-status.s4 { background: #d97706; }
.api-status.s5 { background: #dc2626; cursor: default; }
.api-outcome { font-weight: 600; color: var(--text); }
.api-res-pane { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); padding: 8px; }
.api-pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.api-headers { width: 100%; border-collapse: collapse; font-size: 12px; }
.api-headers th, .api-headers td { text-align: left; vertical-align: top; padding: 3px 6px; border-bottom: 1px solid var(--border); word-break: break-all; }
.api-headers th { width: 36%; color: var(--text-2); font-weight: 600; }
.api-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: 12.5px; }
.api-pick .q-row { margin-left: auto; }
.api-pick-val { color: var(--text-2); overflow-wrap: anywhere; }
.json-tree { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.jt-node > summary { cursor: pointer; list-style-position: outside; margin-left: 14px; }
.jt-children { margin-left: 14px; padding-left: 8px; border-left: 1px dashed var(--border); }
.jt-pick, .jt-leaf { display: inline-flex; align-items: baseline; gap: 2px; max-width: 100%; padding: 1px 4px; border: 0; border-radius: 4px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.jt-leaf { display: flex; margin-left: 14px; }
.jt-pick:hover, .jt-leaf:hover { background: var(--surface-3); }
.jt-pick.picked, .jt-leaf.picked { background: var(--brand-soft); outline: 1px solid var(--brand); }
.jt-key { color: var(--text-2); flex: none; }
.jt-type { color: var(--text-3); }
.jt-val { overflow-wrap: anywhere; }
.jt-string { color: var(--ok); }
.jt-number { color: #1d4ed8; }
.jt-boolean { color: #9333ea; }
@media (prefers-color-scheme: dark) {
  .jt-number { color: #93c5fd; }
  .jt-boolean { color: #d8b4fe; }
}
.jt-null { color: var(--text-3); }
.jt-more { margin-left: 14px; color: var(--text-3); }
.api-rules { display: flex; flex-direction: column; gap: 10px; }
.api-rule { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.api-rule.chosen { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(34, 197, 94, .18); }
.api-rule-fixed { background: var(--surface-2); }
.api-rule-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.api-rule-head .input { flex: 1 1 160px; min-width: 0; max-width: 280px; height: 30px; }
.api-rule-head small { color: var(--text-3); }
.api-match { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: auto; }
.api-match.on { color: var(--ok); }
.api-match.near { color: var(--warn); }
.api-match.off { color: var(--text-3); font-weight: 500; }
.api-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.api-cond .input { height: 30px; }
.api-cond select.input { width: auto; flex: none; }
.api-cond input.input { flex: 1 1 140px; min-width: 0; }
.api-cond-word { flex: none; width: 34px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.api-rule .field { margin-bottom: 0; }
.api-rule .bot-preview { margin-bottom: 0; }
@media (max-width: 900px) {
  .api-grid { grid-template-columns: 1fr; }
  .api-urlbar { flex-wrap: wrap; }
  .api-urlbar .api-url { flex-basis: 100%; order: 3; }
  .api-sample { grid-template-columns: 1fr; }
}

/* Duyarlı yerleşim */
@media (max-width: 1360px) {
  .live { --list-w: 260px; --info-w: 270px; }
  .bot-body { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .live { --list-w: 230px; --info-w: 240px; }
}
@media (max-width: 860px) {
  .resizer-x { display: none; }
  .live, .live.has-chat:not(.info-closed) { grid-template-columns: 1fr; }
  .live[data-pane="list"] .chat-pane, .live[data-pane="list"] .info-pane { display: none; }
  .live[data-pane="chat"] .conv-list, .live[data-pane="chat"] .info-pane { display: none; }
  .live[data-pane="info"] .conv-list, .live[data-pane="info"] .chat-pane { display: none; }
  .live[data-pane="info"] .info-pane { display: flex !important; }
  .bot-body { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 1fr) auto; }
  .bot-side { border-left: 0; border-top: 1px solid var(--border); max-height: 55vh; }
  .app { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; grid-template-areas: "top" "nav" "main"; }
  .sidenav, .app.nav-collapsed .sidenav { flex-direction: row; overflow-x: auto; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-item, .app.nav-collapsed .nav-item { flex: none; height: 34px; padding: 0 10px; }
  .app.nav-collapsed .nav-label { display: inline; }
  .nav-toggle { display: none; }
  .brand-name, .user-chip-text { display: none; }
  .live { grid-template-columns: 1fr; }
  .live[data-pane="list"] .chat-pane { display: none; }
  .live[data-pane="chat"] .conv-list { display: none; }
  .mobile-only { display: inline-flex; }
  .page { padding: 16px; }
  .msg { max-width: 86%; }
  .field-row, .field-row.triple { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 10px; }
  /* Logo yaklaşık 4:1: dar ekranda sağdaki durum / bildirim / çıkış düğmelerine yer kalsın (yatay taşma olmasın) */
  .topbar .brand-logo { height: 20px; }
  #btn-logout { padding: 0 8px; }
  .chat-head-actions .btn-sm { padding: 0 8px; }
}
