/* Sohbet gorunumu (public/app-sohbet.js): oturum panelinde Sohbet | Terminal anahtari, mesajlar, araclar, izin/soru karti,
   mesaj kutusu. Renkler ortak tokenlardan (style.css, isler.css :root); --line, --muted, --faint burada yeniden tanimlanmaz. */

/* ---------- anahtar (panel basligi) */
.vk { display: inline-flex; flex: none; padding: 2px; gap: 2px; border-radius: 8px; background: var(--panel-2); }
.vk button { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: background-color .15s var(--ease-out), color .15s var(--ease-out); }
.vk button i { font-size: 14px; }
.vk button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--line); }
.vk button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .vk button:not([aria-pressed="true"]):hover { color: var(--text); } }
.vk button:active { transform: scale(.97); }
@container (max-width: 760px) { .vk .tl { display: none; } .vk button { padding: 0 7px; } }
/* Dar baslikta secili gorunumun adi yazili kalir; sohbet kipinde baslikta yer oldugu icin ikisi de. */
@container (min-width: 300px) and (max-width: 1020px) { .term-tools .vk button[aria-pressed="true"] .tl { display: inline; } }
@container (min-width: 340px) and (max-width: 1020px) { .term-wrap.chat-on:not(.pane) .term-tools .vk .tl { display: inline; } }
/* Sohbet kipinde terminale ozel dugmeler gizli: kopyalama ve sira mesaj kutusunda */
.term-wrap.chat-on .term-tools .copyb, .term-wrap.chat-on .term-tools .lastcode, .term-wrap.chat-on .term-tools .qadd { display: none; }

/* ---------- yerlesim */
.chat { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--term-bg); }
.cm-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.cm-col { max-width: 780px; margin: 0 auto; padding: 18px 24px 16px; }
.term-wrap.pane .cm-col { padding: 12px 14px 8px; }
.cm-b.cm-in { animation: cm-in .22s var(--ease-out) both; }
@keyframes cm-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .cm-b.cm-in { animation: none; } }
.cm-older { display: flex; align-items: center; gap: 6px; margin: 0 auto 14px; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted); font-size: 12px; cursor: pointer; }
.cm-older:disabled { opacity: .5; }
.cm-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 64px 0 24px; color: var(--muted); text-align: center; }
.cm-empty i { font-size: 28px; color: var(--faint); margin-bottom: 4px; }
.cm-empty b { color: var(--text); font-weight: 600; }
.cm-new { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 6px; height: 30px;
  padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font-size: 12.5px; box-shadow: var(--shadow); cursor: pointer; }

/* ---------- mesajlar */
.cm-u { display: flex; flex-direction: column; align-items: flex-end; margin: 18px 0 12px; }
.cm-ub { max-width: min(86%, 640px); padding: 9px 13px; border-radius: 16px 16px 5px 16px; background: var(--panel-2); color: var(--text);
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-ub.long { max-height: 260px; overflow: hidden; mask-image: linear-gradient(180deg, #000 70%, transparent); }
.cm-u.q .cm-ub, .cm-u.p .cm-ub { background: transparent; border: 1px dashed var(--line-2, var(--line)); color: var(--muted); }
.cm-ui { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cm-at { display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11px; color: var(--faint); min-height: 15px; }
.cm-u:not(.q):not(.p) .cm-at { opacity: 0; transition: opacity .15s; }
.cm-u:hover .cm-at { opacity: 1; }
.cm-more { margin-top: 4px; border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; cursor: pointer; }
.cm-qx { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; }
.cm-qx:hover { background: var(--panel-2); color: var(--bad); }
.cm-a { margin: 4px 0 12px; font-size: 14.5px; line-height: 1.62; }
.cm-a.rp p { margin: 0 0 10px; }
.cm-a.rp .rp-h { font-size: 15.5px; margin-top: 20px; }
.cm-a.rp .rp-h.s { font-size: 14.5px; color: var(--text); }
.cm-a.rp .rp-h::before { display: none; }
.cm-a .rp-c { font-size: 12.5px; }
.cm-sep { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--faint); font-size: 12px; }
.cm-sep::before, .cm-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cm-n { display: flex; align-items: baseline; gap: 6px; margin: 8px 0; font-size: 12.5px; color: var(--muted); }
.cm-n i { position: relative; top: 2px; font-size: 14px; flex: none; }
.cm-n b { font-weight: 500; flex: none; }
.cm-nt { min-width: 0; overflow-wrap: anywhere; }
.cm-n.apierr, .cm-n.apierr i { color: var(--bad); }
.cm-n.retry i { color: var(--warn); }
.cm-n.event .cm-nt { color: var(--faint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-cmd { margin: 14px 0; }
.cm-cmd code { display: inline-block; max-width: 100%; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); font: 12.5px/1.5 "Geist Mono", ui-monospace, monospace;
  color: var(--text); overflow-wrap: anywhere; }
.cm-cmd-p { color: var(--ok); margin-right: 4px; }
.cm-cmd-a { color: var(--muted); }
.cm-cmd.err code { color: var(--bad); }

/* Mesaj eylemleri: cevabin (turun son metni) ve senin mesajinin altinda Kopyala, Duzenle, saat. Uzerine gelince gorunur;
   en son mesajda ve dokunmatikte hep gorunur. */
.cm-acts { display: flex; align-items: center; gap: 2px; margin: -4px 0 14px -6px; min-height: 26px; opacity: 0; transition: opacity .15s var(--ease-out); }
.cm-acts.u { justify-content: flex-end; margin: 2px -4px 0 0; }
.cm-acts .cm-at { margin: 0 6px; }
.cm-acts.u .cm-at { order: -1; }
.cm-b:hover .cm-acts, .cm-b:focus-within .cm-acts, .cm-b:last-child .cm-acts { opacity: 1; }
@media (hover: none) { .cm-acts { opacity: 1; } }
.cm-u:not(.q):not(.p) .cm-acts .cm-at { opacity: 1; }
.cm-act { display: inline-flex; align-items: center; gap: 5px; height: 26px; min-width: 26px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer; transition: background-color .15s var(--ease-out), color .15s var(--ease-out); }
.cm-act i { font-size: 15px; }
.cm-act.done { color: var(--ok); }
@media (hover: hover) and (pointer: fine) { .cm-act:hover { background: var(--panel-2); color: var(--text); } }
.cm-act:active { transform: scale(.96); }
.cm-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
.cm-a.end { margin-bottom: 6px; }

/* ---------- araclar */
.cm-g0, .cg-b { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px; }
.cg-b { margin: 2px 0 0 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.cm-g { margin: 4px 0 8px; }
.cm-g > summary, .ct-h { display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 8px; margin: 0 -8px; border-radius: 7px; list-style: none;
  font-size: 13px; color: var(--muted); cursor: default; }
.cm-g > summary::-webkit-details-marker, .ct-h::-webkit-details-marker { display: none; }
.cm-g > summary, details.ct > .ct-h { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .cm-g > summary:hover, details.ct > .ct-h:hover { background: var(--panel-2); } }
.cm-g > summary:focus-visible, details.ct > .ct-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-i { font-size: 15px; flex: none; color: var(--faint); }
.ct-n { flex: none; color: var(--text); font-weight: 500; }
.ct-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px "Geist Mono", ui-monospace, monospace; color: var(--muted); }
.ct-s { flex: none; font-size: 12px; color: var(--faint); }
.ct-dc { display: inline-flex; gap: 5px; flex: none; font: 12px "Geist Mono", ui-monospace, monospace; }
.ct-dc .ad { color: var(--ok); }
.ct-dc .rm { color: var(--bad); }
.ct-st { display: inline-grid; place-items: center; flex: none; margin-left: auto; width: 18px; height: 18px; }
.ct-st i { font-size: 15px; }
.ct-st.err { color: var(--bad); }
.ct-st.deny { color: var(--warn); }
.ct-st.wait { color: var(--accent); }
.ct-c { flex: none; font-size: 12px; color: var(--faint); transition: transform .18s var(--ease-out); }
.ct-st + .ct-c { margin-left: 2px; }
.ct-h > .ct-c:only-of-type { margin-left: auto; }
details[open] > summary > .ct-c { transform: rotate(90deg); }
.cg-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cg-e { flex: none; font-size: 12px; color: var(--bad); }
.cm-g > summary > .ct-c { margin-left: auto; }
.ct.wait > .ct-h { background: var(--accent-soft); }
.ct-b { margin: 2px 0 8px 22px; display: flex; flex-direction: column; gap: 6px; }
.ct-deny { font-size: 12.5px; color: var(--warn); }
.cm-code, .cm-out { margin: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); max-height: 320px; overflow: auto;
  font: 12px/1.55 "Geist Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.cm-code { background: var(--panel-2); border-color: transparent; }
.cm-out.err { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.cm-skip { display: block; margin: 4px 0; color: var(--faint); font-style: italic; }
/* Katli cikti (CHT_FOLD): ilk satirlar, altta yapisik "Tamamini goster" seridi. Acikken tum metin, uzunsa kendi icinde kayar.
   Katliyken satir kirilmaz, uzun satir yana kayar: her satir tek sira, kutu tam satir yuksekliginde biter (dar pencerede satir ortasindan kesilmez).
   Solma kutunun degil seridin parcasi: kutunun icinde olsa yana kayan metinle birlikte kayardi. */
.cm-fold { display: flex; flex-direction: column; min-width: 0; }
.cm-fold > .cm-out { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.cm-fold:not(.open) > .cm-out { max-height: none; overflow: auto hidden; overscroll-behavior-x: contain; white-space: pre; overflow-wrap: normal; }
.cm-fold:not(.open) .cm-rest { display: none; }
.cm-fold.open > .cm-out { max-height: min(70vh, 900px); }
.cm-fold-b { position: relative; display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 8px 8px; background: color-mix(in srgb, var(--text) 8%, var(--panel-2)); color: var(--text); font-size: 12.5px; text-align: left; cursor: pointer;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out); }
.cm-fold:not(.open) > .cm-fold-b::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 40px; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--panel) 72%, transparent)); }
.cm-fold-b i { flex: none; font-size: 15px; color: color-mix(in srgb, var(--accent) 65%, var(--text)); }
.cm-fold-b > span:first-of-type { flex: none; font-weight: 600; }
.cm-fold-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: color-mix(in srgb, var(--text) 78%, var(--panel-2)); }
.cm-fold-n::before { content: "·"; margin-right: 6px; }
.cm-out.err + .cm-fold-b { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
@media (hover: hover) and (pointer: fine) { .cm-fold-b:hover { background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); } }
.cm-fold-b:active { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.cm-fold-b:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (pointer: coarse), (max-width: 600px) { .cm-fold-b { min-height: 44px; font-size: 13.5px; } }
.cm-diff { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 360px; background: var(--panel); font: 12px/1.5 "Geist Mono", ui-monospace, monospace; }
.cm-df { display: grid; grid-template-columns: 38px 14px 1fr; min-width: max-content; }
.cm-df-n { padding-right: 6px; text-align: right; color: var(--faint); user-select: none; }
.cm-df-s { color: var(--faint); user-select: none; }
.cm-df-t { white-space: pre; padding-right: 10px; }
.cm-df.ad { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.cm-df.ad .cm-df-s { color: var(--ok); }
.cm-df.rm { background: color-mix(in srgb, var(--bad) 11%, transparent); }
.cm-df.rm .cm-df-s { color: var(--bad); }
.cm-df-gap { padding: 2px 10px; color: var(--faint); background: var(--panel-2); font-size: 11.5px; }

/* ---------- soru, plan, yapilacaklar */
.cm-q, .cm-plan, .cm-todo { margin: 10px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cm-q-h, .cm-todo-h { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.cm-q-h i, .cm-todo-h i { font-size: 15px; color: var(--accent); }
.cm-q-h .sp { flex: 1; }
.cm-q-s { font-weight: 400; color: var(--faint); }
.cm-q.st-run, .cm-plan.st-run { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cq + .cq { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cq-h { display: inline-block; margin-bottom: 4px; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); font-size: 11.5px; color: var(--muted); }
.cq-q { font-size: 14px; line-height: 1.5; color: var(--text); }
.cq-a { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.cq-a i { position: relative; top: 2px; flex: none; font-size: 15px; color: var(--ok); }
.cq-a.no { font-weight: 400; color: var(--muted); }
.cq-a.no i { color: var(--faint); }
.cm-plan .rp { margin: 0; font-size: 13.5px; }
.cm-todo ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.cm-todo li { display: flex; gap: 7px; font-size: 13px; line-height: 1.45; color: var(--text); }
.cm-todo li i { position: relative; top: 2px; flex: none; font-size: 15px; color: var(--faint); }
.cm-todo li.completed { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.cm-todo li.completed i { color: var(--ok); }
.cm-todo li.in_progress i { color: var(--accent); }

/* ---------- canli durum */
.cm-work { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 10px 0 6px; font-size: 13px; color: var(--muted); }
.cm-work b { font-weight: 500; color: var(--text); }
.cm-work span[data-since] { font-variant-numeric: tabular-nums; color: var(--faint); }
.cm-now { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; white-space: nowrap; color: var(--muted); }
.cm-now::before { content: "·"; margin-right: 1px; color: var(--faint); }
.cm-now i { flex: none; font-size: 14px; color: var(--faint); }
.cm-now-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 12px "Geist Mono", ui-monospace, monospace; color: var(--faint); }
.cm-dots { display: inline-flex; gap: 3px; }
.cm-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: cm-dot 1.2s ease-in-out infinite; }
.cm-dots i:nth-child(2) { animation-delay: .15s; }
.cm-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cm-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }
.cm-spin { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); border-top-color: var(--accent); animation: cm-spin .8s linear infinite; }
@keyframes cm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cm-dots i, .cm-spin { animation-duration: 3s; } }
.cm-warn { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, transparent);
  font-size: 13px; color: var(--text); }
.cm-warn > i { flex: none; font-size: 16px; color: var(--warn); }
.cm-warn > span { flex: 1; min-width: 0; }
.cm-warn.dead { background: var(--panel-2); }
.cm-warn.dead > i { color: var(--muted); }
.cm-warn .btn { height: 28px; flex: none; }

/* ---------- izin / soru karti */
/* Kart yazma kutusunun ustunde (cm-foot); uzun kart kendi icinde kayar, mesaj kutusu hep gorunur. */
.cm-foot .cm-card { max-width: 780px; margin: 0 auto; }
.cm-foot .cm-card-in { margin: 0 0 8px; max-height: min(46vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
/* Izin bekleyen arac satirindaki dugmeler */
.ct-perm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ct-perm .btn { height: 28px; font-size: 12.5px; }
.ct-perm-k { font-size: 11.5px; color: var(--faint); }
.cm-card-in { margin: 12px 0 8px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 14px; background: var(--panel);
  box-shadow: 0 10px 30px -18px rgb(30 30 25 / .35); animation: cm-in .22s var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .cm-card-in { animation: none; } }
.cm-card-in.perm { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.cm-card-h { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cm-card-h i { font-size: 17px; color: var(--accent); }
.cm-card-in.perm .cm-card-h i { color: var(--warn); }
.cm-card-h b { font-weight: 600; }
.cm-card-t { color: var(--muted); }
.cm-card-q { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text); }
.cm-card-b { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); max-height: 220px; overflow: auto;
  font: 12px/1.55 "Geist Mono", ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.cm-opts { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
.cm-opt { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel);
  text-align: left; font-size: 13.5px; color: var(--text); cursor: pointer; transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out), transform .1s; }
@media (hover: hover) and (pointer: fine) { .cm-opt:hover { border-color: var(--accent); background: var(--accent-soft); } .cm-opt.no:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, transparent); } }
.cm-opt:active { transform: scale(.99); }
.cm-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cm-opt:disabled { opacity: .55; cursor: default; }
.cm-opt.pri { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.cm-on { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--panel-2); font: 500 11.5px "Geist Mono", ui-monospace, monospace; color: var(--muted); }
.cm-opt.pri .cm-on { background: var(--accent); color: #fff; }
.cm-cb { flex: none; font-size: 17px; color: var(--accent); }
.cm-ol { display: flex; flex-direction: column; min-width: 0; }
.cm-ol b { font-weight: 500; overflow-wrap: anywhere; }
.cm-ol span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.cm-opt-in { display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 10px; border: 1px dashed var(--line); border-radius: 9px; }
.cm-opt-in input { flex: 1; min-width: 0; height: 30px; border: 0; background: transparent; font-size: 13.5px; outline: none; }
.cm-opt-in .btn { height: 30px; }
.cm-card-f { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cm-card-f .sp { flex: 1; }
.cm-card-f .btn { height: 30px; font-size: 12.5px; }
.cm-card-x { font-size: 12px; color: var(--faint); }

/* ---------- mesaj kutusu */
.cm-foot { flex: none; padding: 8px 24px 14px; }
.term-wrap.pane .cm-foot { padding: 6px 12px 10px; }
.cm-comp { position: relative; max-width: 780px; margin: 0 auto; padding: 8px 8px 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 10px 28px -20px rgb(0 0 0 / .4); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.cm-comp:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.cm-chips { padding: 2px 0 6px; }
.cm-comp textarea { display: block; width: 100%; min-height: 24px; max-height: 220px; padding: 4px 2px; border: 0; background: transparent; resize: none; outline: none;
  font: 14px/1.5 "Geist", ui-sans-serif, system-ui, sans-serif; color: var(--text); }
.cm-comp textarea::placeholder { color: var(--faint); }
/* Tasan metin: ince cubuk (macOS'te de gorunur) ve alta dogru solma; sona inince solma kalkar. */
.cm-comp textarea::-webkit-scrollbar { width: 6px; }
.cm-comp textarea::-webkit-scrollbar-track { background: transparent; }
.cm-comp textarea::-webkit-scrollbar-thumb { border-radius: 3px; background: color-mix(in srgb, var(--muted) 75%, transparent); }
@supports not selector(::-webkit-scrollbar) { .cm-comp textarea { scrollbar-width: thin; } }
.cm-comp textarea.over { -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent); mask-image: linear-gradient(#000 calc(100% - 24px), transparent); }
.cm-comp textarea:disabled { cursor: not-allowed; }
/* "Devami var": solan kenarin ustunde, sagda kucuk hap; tiklayinca metnin sonuna iner. */
.cm-tm { position: relative; height: 0; }
.cm-tmore { position: absolute; right: 14px; bottom: 2px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border: 1px solid var(--line);
  border-radius: 99px; background: var(--panel-2); color: var(--text); font: 500 11.5px/1 "Geist", ui-sans-serif, system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 4px 12px -6px rgb(0 0 0 / .5); transition: transform .12s var(--ease-out), border-color .15s var(--ease-out); }
.cm-tmore i { font-size: 12px; }
.cm-tmore:active { transform: scale(.96); }
.cm-tmore:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .cm-tmore:hover { border-color: var(--accent); } }
.cm-saved { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cm-saved i { font-size: 13px; color: var(--ok); }
.cm-saved[hidden] { display: none; }
.cm-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cm-bar .sp { flex: 1; }
.cm-hint { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.cm-hint .hl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Durum seridi: model, effort (tiklanir), context halkasi, izin modu. */
.cm-meta { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.cm-mt { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font: 500 12px/1 "Geist", ui-sans-serif, system-ui, sans-serif; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cm-mt i { font-size: 13px; }
button.cm-mt { cursor: pointer; transition: background-color .15s var(--ease-out), color .15s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { button.cm-mt:hover { background: var(--panel-2); color: var(--text); } }
button.cm-mt:active { transform: scale(.97); }
button.cm-mt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cm-ef.next { color: var(--accent); }
.cm-efn { font-size: 11px !important; }
.cm-ctx svg { flex: none; transform: rotate(-90deg); }
.cm-ctx circle { fill: none; stroke-width: 2.2; }
.cm-ctx .bg { stroke: var(--line); }
.cm-ctx .fg { stroke: var(--accent); stroke-linecap: round; }
.cm-ctx.warn .fg { stroke: var(--warn); }
.cm-ctx.bad .fg { stroke: var(--bad); }
.cm-ctx.bad { color: var(--bad); }
.cm-ctxn { color: var(--faint); }
.cm-efmenu { position: absolute; bottom: calc(100% - 6px); z-index: 5; min-width: 200px; max-width: 260px; padding: 5px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); box-shadow: var(--shadow); animation: cm-in .16s var(--ease-out) both; }
.cm-efmenu .h { padding: 5px 9px 3px; font-size: 11.5px; font-weight: 600; color: var(--faint); }
.cm-efmenu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.cm-efmenu button i { font-size: 14px; color: var(--faint); }
.cm-efmenu button[aria-checked="true"] i { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .cm-efmenu button:hover { background: var(--panel-2); } }
.cm-efmenu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cm-efmenu .f { padding: 6px 9px 4px; font-size: 11.5px; line-height: 1.4; color: var(--faint); border-top: 1px solid var(--line); margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .cm-efmenu { animation: none; } }
.cm-stop { height: 30px; font-size: 12.5px; }
.cm-send { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer;
  transition: transform .1s, filter .15s; }
.cm-send i { font-size: 17px; }
.cm-send:hover { filter: brightness(1.08); }
.cm-send:active { transform: scale(.95); }
.cm-send:disabled { opacity: .4; cursor: default; }
.cm-send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@container (max-width: 720px) { .cm-hint .hl { display: none; } }
@container (max-width: 420px) { .cm-ctxn, .cm-meta > .cm-mt:first-child:not(button) { display: none; } }
@container (max-width: 340px) { .cm-saved .tl { display: none; } }

/* ---------- alttaki terminal cekmecesi (sohbet kipinde .term sohbetin altinda) */
.term-wrap.drawer-on > .term-tools { order: 0; }
.term-wrap.drawer-on > .chat { order: 1; }
.term-wrap.drawer-on > .cm-dr { order: 2; }
.term-wrap.drawer-on > .term { order: 3; flex: none; height: var(--cm-dr-h, 36%); min-height: 120px; }
.term-wrap.drawer-on > .chat .cm-new { bottom: 96px; }
.cm-dr { position: relative; display: flex; align-items: center; gap: 7px; flex: none; height: 30px; padding: 0 6px 0 12px; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 12px; cursor: row-resize; user-select: none; touch-action: none; }
.cm-dr[hidden] { display: none; }
.cm-dr b { font-weight: 600; color: var(--text); }
.cm-dr i { font-size: 14px; }
.cm-dr .sp { flex: 1; }
.cm-dr-k { font: 11px "Geist Mono", ui-monospace, monospace; color: var(--faint); }
.cm-dr .icon-btn { width: 24px; height: 24px; cursor: pointer; }
.cm-dr-grip { position: absolute; left: 50%; top: 4px; width: 32px; height: 3px; margin-left: -16px; border-radius: 2px; background: var(--line-2, var(--line)); }
@media (hover: hover) and (pointer: fine) { .cm-dr:hover .cm-dr-grip { background: var(--muted); } }
.cm-dr.drag .cm-dr-grip { background: var(--accent); }
.cm-drb[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
/* Model ve dusunme duzeyi menusu (app-sohbet.js chtModelMenu): ortak secici (model-secim.css) ve Uygula. */
.cm-msmenu { min-width: 300px; max-width: min(380px, calc(100vw - 32px)); padding: 6px 6px 8px; }
.cm-msmenu .b { padding: 6px 9px 2px; }
.cm-msmenu .b .msec { width: 100%; }
.cm-msmenu .a { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 9px 0; }
.cm-msmenu .a button { display: inline-flex; justify-content: center; width: auto; height: 30px; padding: 0 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12.5px; }
.cm-msmenu .a button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cm-msmenu .a button.primary i { color: #fff; }
@media (hover: hover) and (pointer: fine) { .cm-msmenu .a button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); } }
