/* Asistan — tek, profesyonel tema.
 * Sakin bir iletişim/asistan ürünü: açık zemin, indigo vurgu (zekâyı ima eder),
 * yumuşak gölgeler, net tipografi. */

:root {
  --bg:          #f3f4f8;
  --surface:     #ffffff;
  --surface-2:   #f7f8fb;
  --surface-3:   #eef0f5;
  --border:      #e5e7ef;
  --border-2:    #d6dae4;
  --text:        #1a2030;
  --text-dim:    #697086;
  --text-faint:  #98a0b2;
  --accent:      #4f46e5;
  --accent-2:    #7c6cf0;
  --accent-soft: #edecfe;
  --accent-ring: rgba(79, 70, 229, 0.18);
  --ok:          #129c6b;
  --warn:        #e08a1e;
  --danger:      #dc2f34;
  --bubble-in:   #ffffff;
  --bubble-out:  #ecebfe;
  --grad:        linear-gradient(135deg, #6d5cf5 0%, #4f46e5 100%);
  --shadow-sm:   0 1px 2px rgba(20, 28, 60, 0.06);
  --shadow-md:   0 4px 16px rgba(20, 28, 60, 0.08);
  --shadow-lg:   0 24px 60px rgba(20, 28, 60, 0.20);
  --r:           12px;
  --r-sm:        9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.muted, .dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); }

/* Terminal döneminden kalan öğeleri gizle (tek tema) */
.crt, .gate-logo, #input-cursor, .cursor-blink,
#btn-theme, .prompt, .cmd-echo { display: none !important; }

/* --------------------------------- Üst bar -------------------------------- */

.statusbar, .topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: none;
}

.seg { display: flex; align-items: center; gap: 7px; padding: 0; border: none; font-size: 13px; color: var(--text-dim); }
.seg-path { display: none; }

/* Marka */
.seg-host, .brand {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.seg-host::before, .brand::before {
  content: "";
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--grad);
  box-shadow: var(--shadow-sm);
  flex: none;
}

/* Gizlilik rozeti */
.seg-mode {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
  background: rgba(18, 156, 107, 0.10);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: help;
  letter-spacing: 0;
  text-transform: none;
}

.seg-fill { flex: 1; }

.seg-conn { font-size: 12.5px; color: var(--text-faint); }
.seg-conn::before { content: "●"; margin-right: 5px; color: var(--text-faint); font-size: 9px; }
.seg-conn.open { color: var(--ok); }
.seg-conn.open::before { color: var(--ok); }
.seg-conn.closed { color: var(--danger); }
.seg-clock { font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.seg-switch { font-size: 12.5px; color: var(--text-dim); cursor: pointer; gap: 6px; }
.seg-switch input { accent-color: var(--accent); }

/* Üst bar butonları / linkler */
.seg-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.seg-btn:hover { background: var(--surface-3); color: var(--text); }

/* Günlük özet = asistan vurgulu buton */
#btn-digest {
  color: #fff;
  background: var(--grad);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
#btn-digest:hover { filter: brightness(1.05); background: var(--grad); color: #fff; }

/* --------------------------------- Yerleşim ------------------------------- */

.layout { display: grid; grid-template-columns: 340px 1fr; flex: 1; min-height: 0; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap {
  display: flex;
  align-items: center;
  margin: 4px 14px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
}
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
#search { flex: 1; padding: 9px 0; background: none; border: none; color: var(--text); font: inherit; font-size: 13.5px; outline: none; }
#search::placeholder { color: var(--text-faint); }

.tabs { display: flex; gap: 6px; padding: 0 14px 10px; }
.tab {
  flex: 1;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

.pill {
  background: var(--warn);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.pill[data-zero="1"] { display: none; }

.list { flex: 1; overflow-y: auto; min-height: 0; padding: 0 8px 8px; }

.row {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
}
.row:hover { background: var(--surface-2); }
.row.active { background: var(--accent-soft); }

.star { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.star::before { content: none; }

.row-body { flex: 1; min-width: 0; }
.row-top { display: flex; align-items: baseline; gap: 8px; }
.row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.row.active .row-name { color: var(--accent); }
.row-time { font-size: 11.5px; color: var(--text-faint); flex: none; }
.row-preview { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.row-badge {
  flex: none;
  background: var(--warn);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.row-badge::before, .row-badge::after { content: none; }

.list-empty { padding: 30px 20px; text-align: center; color: var(--text-dim); font-size: 13px; line-height: 1.7; }

/* --------------------------------- Sohbet --------------------------------- */

.chat { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 60px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: none;
}
.chat-head-main { flex: 1; min-width: 0; }
.chat-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-head h2::before { content: none; }
#chat-sub { font-size: 12px; color: var(--text-faint); }
.chat-head-actions { display: flex; gap: 8px; }

.btn {
  padding: 7px 13px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

.messages { flex: 1; overflow-y: auto; padding: 20px 24px 24px; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
.messages > *:first-child { margin-top: auto; }

.placeholder { margin: auto; text-align: center; max-width: 380px; color: var(--text-dim); }
.placeholder pre { display: none; }
.placeholder .big { font-size: 34px; }

.daysep {
  align-self: center;
  margin: 16px 0 10px;
  padding: 3px 12px;
  background: var(--surface-3);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.daysep::before, .daysep::after { content: none; }

.msg {
  max-width: min(600px, 76%);
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--bubble-in);
  border: 1px solid var(--border);
  align-self: flex-start;
  box-shadow: var(--shadow-sm);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg + .msg { margin-top: 2px; }
.msg.out { background: var(--bubble-out); border-color: transparent; align-self: flex-end; }

.msg-sender { font-size: 12px; font-weight: 650; color: var(--accent); margin-bottom: 2px; }
.msg-sender::before, .msg-sender::after { content: none; }
.msg-quote {
  border-left: 3px solid var(--accent);
  padding: 3px 0 3px 9px;
  margin: 2px 0 5px;
  font-size: 12.5px;
  color: var(--text-dim);
  max-height: 3.4em; overflow: hidden;
}
.msg-text { white-space: pre-wrap; font-size: 14px; }
.msg-kind { display: inline-block; font-size: 12px; color: var(--text-dim); background: var(--surface-3); border-radius: 6px; padding: 2px 8px; margin: 2px 0; }
.msg-time { font-size: 10.5px; color: var(--text-faint); text-align: right; margin-top: 3px; }
.msg-time::before, .msg-time::after { content: none; }
.msg img, .msg video { max-width: 100%; max-height: 340px; border-radius: 10px; display: block; margin: 3px 0; }
.msg audio { width: 260px; margin: 3px 0; }
.msg.new { animation: pop .4s ease-out; }
@keyframes pop { from { transform: translateY(4px); opacity: 0; } }

.hit-chat { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 3px; }
.load-more { align-self: center; margin-bottom: 10px; }

/* -------------------------------- Composer -------------------------------- */

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex: none;
}
.composer[hidden] { display: none; }
#msg-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
#msg-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
#msg-input::placeholder { color: var(--text-faint); }
#msg-input:disabled { opacity: .5; }

.btn-send { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; }
.btn-send:hover { filter: brightness(1.05); color: #fff; }
.btn-send:disabled { opacity: .5; pointer-events: none; }

.btn-suggest { color: var(--accent); border-color: var(--border-2); font-weight: 600; }
.btn-suggest:hover { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-suggest:disabled { opacity: .55; pointer-events: none; }

.send-error { color: var(--danger); font-size: 12px; padding: 4px 20px 8px; background: var(--surface); }

/* -------------------------------- AI paneli ------------------------------- */

.ai-panel {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(26, 32, 48, 0.42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.ai-panel[hidden] { display: none; }
.ai-box {
  width: min(720px, 100%);
  max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ai-cmd { flex: 1; font-size: 15px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-cmd::before { content: "✦ "; color: var(--accent); }
.ai-close { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); cursor: pointer; padding: 4px 10px; font-size: 14px; }
.ai-close:hover { border-color: var(--danger); color: var(--danger); }
.ai-body { padding: 20px; overflow-y: auto; font-size: 14px; line-height: 1.65; white-space: pre-wrap; color: var(--text); }
.ai-body .h { color: var(--accent); font-weight: 700; margin-top: 4px; }
.ai-body .meta { color: var(--text-faint); font-size: 12px; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.ai-working { color: var(--accent); font-weight: 500; }
.ai-working::after { content: " ●●●"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { opacity: .3 } 50% { opacity: 1 } 100% { opacity: .3 } }
.ai-error { color: var(--danger); }

.key-input {
  display: block; width: 100%;
  margin: 8px 0 0;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit; font-size: 14px;
  outline: none;
}
.key-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.key-input::placeholder { color: var(--text-faint); }
select.key-input { -webkit-appearance: none; appearance: none; cursor: pointer; }

/* SSS düzenleme satırları */
.faq-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px; align-items: start;
  margin-top: 8px;
}
.faq-row .key-input { margin: 0; }
.faq-row .faq-a { resize: vertical; min-height: 42px; }
.faq-row .faq-del { padding: 8px 12px; align-self: stretch; color: var(--text-faint); }
.faq-row .faq-del:hover { border-color: var(--danger); color: var(--danger); }
@media (max-width: 560px) {
  .faq-row { grid-template-columns: 1fr; }
  .faq-row .faq-del { justify-self: end; }
}

/* --------------------------------- Gate ----------------------------------- */

.gate { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate[hidden] { display: none; }
.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
  padding: 34px 38px;
  text-align: center;
  max-width: 440px;
}
.gate-card h1 { margin: 0 0 6px; font-size: 19px; font-weight: 700; }
.gate-card img { width: 250px; height: 250px; border-radius: 12px; background: #fff; padding: 8px; margin: 16px 0 6px; border: 1px solid var(--border); }
.steps { text-align: left; color: var(--text-dim); font-size: 13px; padding-left: 20px; margin: 12px 0 0; line-height: 1.9; }
.steps b { color: var(--text); }
#gate-spinner {
  width: 26px; height: 26px; margin: 18px auto 0;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; color: transparent; font-size: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gate-code {
  font-size: 26px; letter-spacing: 5px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 14px; margin: 14px 0 4px; user-select: all;
}

/* ------------------------------- Kaydırma --------------------------------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Sohbet başlığındaki geri butonu (yalnız mobil) */
.btn-back {
  display: none; flex: none; width: 34px; height: 34px; margin-right: 4px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--text-dim); font-size: 22px; line-height: 1; cursor: pointer; align-items: center; justify-content: center;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 760px) {
  /* Üst bar: etiketler gizli, ikonlar kalır — hepsi sığar */
  .statusbar { gap: 7px; padding: 0 10px; height: 54px; }
  .topbtn { padding: 8px 9px; }
  .topbtn .lbl { display: none; }
  .brand { font-size: 0; gap: 0; }
  .brand .brand-mark { font-size: 12px; }
  .conn-label { display: none; }
  .conn-chip { padding: 6px 8px; }
  .ghost-badge { font-size: 0; gap: 0; padding: 6px 8px; }
  .ghost-badge .ghost-ico { font-size: 13px; }

  /* Tek sütun: liste VEYA sohbet */
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-direction: column; min-height: 0; }
  .chat { display: none; }
  body.chat-open .sidebar { display: none; }
  body.chat-open .chat { display: flex; }
  .btn-back { display: inline-flex; }

  .chat-head { padding: 10px 12px; }
  .chat-head-actions .btn { padding: 6px 8px; font-size: 12px; }
  .messages { padding: 14px 12px 18px; }
  .composer { padding: 10px 12px; gap: 8px; }
  .stage { padding: 10px 12px 0; }
  .canned-pop { left: 12px; right: 12px; bottom: 70px; width: auto; }
  .icon-btn { width: 38px; height: 38px; }
}

/* Reklam-referral bloğu — sohbet başlığının altında */
.ad-banner {
  padding: 12px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
  border-left: 4px solid var(--accent);
}
.ad-banner[hidden] { display: none; }
.ad-banner-h { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.ad-banner-d { font-size: 13.5px; color: var(--text); margin-top: 3px; }
.ad-banner-link { display: inline-block; margin-top: 5px; font-size: 12.5px; font-weight: 600; }

.ad-banner-row { display: flex; gap: 12px; align-items: flex-start; }
.ad-banner-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--border); background: var(--surface); }
.ad-banner-txt { flex: 1; min-width: 0; }
.ad-banner-d a { color: var(--accent); text-decoration: underline; word-break: break-all; }

/* Composer textarea — otomatik büyür */
textarea#msg-input {
  resize: none;
  line-height: 1.45;
  max-height: 160px;
  overflow-y: auto;
  min-height: 42px;
  font-family: inherit;
}
.composer { align-items: flex-end; }

/* ======================= v2: profesyonel arayüz ========================== */

/* Marka rozeti (◆) — tüm başlıklarda tutarlı */
.brand::before, .seg-host::before { content: none; }
.brand { gap: 8px; }
.brand-mark, .gate-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--grad); color: #fff; font-size: 12px;
  box-shadow: var(--shadow-sm); flex: none;
}
.settings-brand .brand-mark { width: 22px; height: 22px; font-size: 10px; }

/* Bağlantı çipi: nokta + etiket */
.conn-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 999px; cursor: default;
}
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.conn-chip.up   { color: var(--ok);     background: rgba(18,156,107,.09);  border-color: rgba(18,156,107,.22); }
.conn-chip.up   .conn-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(18,156,107,.18); }
.conn-chip.wait { color: var(--warn);   background: rgba(224,138,30,.09);  border-color: rgba(224,138,30,.22); }
.conn-chip.wait .conn-dot { background: var(--warn); animation: pulse 1.2s infinite; }
.conn-chip.down { color: var(--danger); background: rgba(220,47,52,.08);   border-color: rgba(220,47,52,.22); }
.conn-chip.down .conn-dot { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* Gizlilik rozeti */
.ghost-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ok);
  background: rgba(18,156,107,.10); padding: 5px 10px; border-radius: 999px; cursor: help;
}

/* Üst bar butonları */
.topbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-dim); background: none; border: 1px solid transparent;
  padding: 8px 12px; border-radius: var(--r-sm); cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.topbtn:hover { background: var(--surface-3); color: var(--text); }
.topbtn .ico { font-size: 14px; line-height: 1; }
.topbtn.primary { color: #fff; background: var(--grad); box-shadow: var(--shadow-sm); }
.topbtn.primary:hover { filter: brightness(1.05); color: #fff; }
.topbtn.icononly { font-size: 18px; padding: 6px 10px; color: var(--text-dim); }

/* Hesap menüsü */
.acct { position: relative; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 160px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column;
}
.acct-menu[hidden] { display: none; }
.acct-menu a { padding: 9px 12px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.acct-menu a:hover { background: var(--surface-3); }

/* Arama ikonu (artık görünür) */
.search-prefix { color: var(--text-faint); font-size: 15px; }

/* Boş sohbet yer tutucu */
.placeholder .ph-icon { font-size: 40px; opacity: .5; margin-bottom: 10px; }

/* Açılış splash + gate markası */
.boot {
  position: fixed; inset: 0; z-index: 90; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.boot.done { display: none; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.boot-logo {
  width: 60px; height: 60px; border-radius: 16px; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: var(--shadow-md);
}
.boot-name { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.boot-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin .8s linear infinite; margin-top: 4px;
}
@keyframes spin { to { transform: rotate(360deg) } }
.gate-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; margin-bottom: 12px; }

/* -------------------- Composer: ekle / hazır cevap ------------------------ */
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 18px; cursor: pointer; color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center; transition: .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Sahnelenen medya şeridi */
.stage { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 20px 0; background: var(--surface); }
.stage[hidden] { display: none; }
.stage-cell { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.stage-cell img, .stage-cell video { width: 100%; height: 100%; object-fit: cover; }
.stage-rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(20,28,60,.72); color: #fff; border: none; cursor: pointer; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.stage-rm:hover { background: var(--danger); }

/* Hazır cevap popover (composer üstünde) */
.canned-pop {
  position: absolute; left: 20px; bottom: 74px; z-index: 40;
  width: min(360px, calc(100% - 40px)); max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px;
}
.canned-pop[hidden] { display: none; }
.canned-item { display: block; width: 100%; text-align: left; background: none; border: none; border-radius: 9px; padding: 10px 12px; cursor: pointer; }
.canned-item:hover { background: var(--surface-3); }
.canned-item-title { font-weight: 650; font-size: 13.5px; color: var(--text); }
.canned-item-prev { font-size: 12px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canned-empty { padding: 14px; font-size: 13px; color: var(--text-dim); text-align: center; }

/* ------------------------------ Ayarlar modalı --------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(26,32,48,.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.modal[hidden] { display: none; }
.settings-card {
  width: min(920px, 100%); height: min(640px, 88vh);
  display: grid; grid-template-columns: 220px 1fr;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
}
.settings-nav { background: var(--surface-2); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.settings-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 4px 10px 14px; }
.set-tab {
  display: flex; align-items: center; gap: 10px; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-dim); background: none; border: none; text-align: left;
  padding: 10px 12px; border-radius: 9px; cursor: pointer; transition: .15s;
}
.set-tab:hover { background: var(--surface-3); color: var(--text); }
.set-tab.active { background: var(--accent-soft); color: var(--accent); }
.set-tab .ico { font-size: 15px; }
.settings-main { position: relative; overflow-y: auto; padding: 26px 28px; }
.settings-close {
  position: absolute; top: 16px; right: 18px; width: 30px; height: 30px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; font-size: 14px;
}
.settings-close:hover { border-color: var(--danger); color: var(--danger); }
.set-pane[hidden] { display: none; }
.set-head { margin-bottom: 16px; }
.set-head h3 { margin: 0 0 5px; font-size: 18px; font-weight: 700; color: var(--text); }
.set-head p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* Genel: anahtar satırı + bilgi kartı */
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.switch-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.switch-title { font-weight: 650; font-size: 14px; color: var(--text); }
.switch-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.info-card { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(18,156,107,.06); border: 1px solid rgba(18,156,107,.18); }

/* Hazır cevap yönetim kartları */
.canned-sets { display: flex; flex-direction: column; gap: 14px; }
.canned-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.canned-card .canned-title { margin: 0 0 8px; font-weight: 600; }
.canned-card .canned-text { margin: 0 0 10px; resize: vertical; }
.canned-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.canned-img { position: relative; width: 68px; height: 68px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.canned-img img { width: 100%; height: 100%; object-fit: cover; }
.canned-addimg {
  width: 68px; height: 68px; border-radius: 9px; border: 1px dashed var(--border-2);
  background: var(--surface); color: var(--text-dim); cursor: pointer; font-size: 12px; font-weight: 600;
}
.canned-addimg:hover { border-color: var(--accent); color: var(--accent); }
.canned-delset { color: var(--text-dim); font-size: 12.5px; }
.canned-delset:hover { border-color: var(--danger); color: var(--danger); }

/* Ayarlar panolarında ortak alan aralıkları */
.set-pane .key-input { margin-top: 6px; }
.set-pane .btn { margin-top: 4px; }

@media (max-width: 720px) {
  .settings-card { grid-template-columns: 1fr; height: 92vh; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .settings-brand { display: none; }
  .set-tab { white-space: nowrap; }
}
