/* Vegapunk Desk — bileşenler. Sınıf adları components.js ile aynıdır.
   Kurallar: gradyan yok, dinlenen öğede gölge yok, 11 px altı metin yok, renk yalnızca durumda ve veride. */

/* ======================================================================
   Düğmeler
   ====================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r-control);
  font-size: var(--fs-14); line-height: 1; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-lg { height: var(--control-h-lg); padding: 0 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--control); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-ghost { color: var(--muted); padding: 0 8px; }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.btn-danger { background: var(--surface); border-color: var(--critical); color: var(--critical); }
.btn-danger:hover:not(:disabled) { background: var(--critical-bg); }
.btn-icon { width: var(--control-h); padding: 0; color: var(--muted); }
.btn-icon:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--raised); border-color: var(--border); color: var(--faint);
}
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.btn-row.end { justify-content: flex-end; }

/* metin bağlantısı gibi düğme */
.link-btn { color: var(--accent); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ======================================================================
   Rozet, durum noktası, avatar
   ====================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 20px; padding: 0 6px; border-radius: var(--r-chip);
  font-size: var(--fs-12); line-height: 1; font-weight: 500; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-ink);
}
.badge .i { width: 12px; height: 12px; stroke-width: 2.25; }
.badge.is-critical { background: var(--critical-bg); color: var(--critical-ink); }
.badge.is-warning  { background: var(--warning-bg);  color: var(--warning-ink); }
.badge.is-success  { background: var(--success-bg);  color: var(--success-ink); }
.badge.is-info     { background: var(--info-bg);     color: var(--info-ink); }
.badge.is-neutral  { background: var(--neutral-bg);  color: var(--neutral-ink); }
.badge.is-outline  { background: transparent; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted); }

.verified { animation: fade-in var(--dur-2) var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.status-dot { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--faint);
}
.status-dot[data-state="up"]::before { background: var(--success); }
.status-dot[data-state="degraded"]::before { background: var(--warning); }
.status-dot[data-state="down"]::before { background: var(--critical); }
.status-dot[data-state="suspended"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  font-size: var(--fs-12); line-height: 1; font-weight: 600;
  background: var(--tone-6-bg); color: var(--tone-6-ink);
}
.avatar.sm { width: 24px; height: 24px; }
.avatar.lg { width: 36px; height: 36px; font-size: var(--fs-13); }
.avatar[data-tone="1"] { background: var(--tone-1-bg); color: var(--tone-1-ink); }
.avatar[data-tone="2"] { background: var(--tone-2-bg); color: var(--tone-2-ink); }
.avatar[data-tone="3"] { background: var(--tone-3-bg); color: var(--tone-3-ink); }
.avatar[data-tone="4"] { background: var(--tone-4-bg); color: var(--tone-4-ink); }
.avatar[data-tone="5"] { background: var(--tone-5-bg); color: var(--tone-5-ink); }
.avatar .presence {
  position: relative;
}
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap[data-online]::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 0 2px var(--surface);
}

/* ======================================================================
   Sayfa başlığı, panel, anahtar-değer
   ====================================================================== */
.page-head {
  display: flex; align-items: flex-start; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-5) var(--s-6) var(--s-4);
}
.page-head-text { flex: 1 1 280px; min-width: 0; }
.crumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted);
  margin-bottom: 4px;
}
.crumb a, .crumb button { color: var(--muted); }
.crumb a:hover, .crumb button:hover { color: var(--text); }
.page-title { font-size: var(--fs-22); line-height: var(--lh-22); letter-spacing: -.01em; }
.page-sub { margin-top: 4px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

.context-strip {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: 6px var(--s-6); background: var(--raised); border-bottom: 1px solid var(--border);
  font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted);
}
.context-strip strong { color: var(--text); font-weight: 500; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  min-width: 0;
}
.panel-head {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--rule);
}
.panel-title { flex: 1; min-width: 0; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; }
.panel-meta { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.panel-body { padding: var(--s-3) var(--s-4) var(--s-4); }
.panel-body.flush { padding: 0; }
.panel-foot {
  display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end; flex-wrap: wrap;
  padding: var(--s-3) var(--s-4); border-top: 1px solid var(--rule);
}

.section-label {
  font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 500; color: var(--muted);
  margin-bottom: var(--s-2);
}

.kv { display: flex; flex-direction: column; }
.kv-row {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  min-height: 30px; padding: 4px 0;
}
.kv-row + .kv-row { border-top: 1px solid var(--rule); }
.kv.plain .kv-row + .kv-row { border-top: 0; }
.kv-key { flex: none; max-width: 48%; color: var(--muted); font-size: var(--fs-13); line-height: var(--lh-13); }
.kv-val {
  flex: 1; min-width: 0; text-align: right;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  overflow-wrap: anywhere;
}
.kv-val .mono { font-size: var(--fs-13); }

/* ======================================================================
   Sekmeler, segment
   ====================================================================== */
.tabs {
  display: flex; gap: var(--s-5); align-items: stretch;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s-6);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; color: var(--muted); white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); font-weight: 500; }
.tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px 2px 0 0;
}
.tab-count { color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 400; }
.tab .i { color: var(--faint); }
.tabs.compact { padding: 0; gap: var(--s-4); }
.tabs.compact .tab { height: 34px; font-size: var(--fs-13); }

/* biletin araç sekmeleri: kapatılabilir */
.tool-tabs {
  display: flex; align-items: stretch; gap: 2px;
  padding: var(--s-2) var(--s-4) 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto; scrollbar-width: none;
}
.tool-tabs::-webkit-scrollbar { display: none; }
.tool-tab {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 6px 0 10px;
  border-radius: var(--r-control) var(--r-control) 0 0;
  color: var(--muted); font-size: var(--fs-13); white-space: nowrap;
}
.tool-tab:hover { background: var(--hover); color: var(--text); }
.tool-tab.is-active { background: var(--raised); color: var(--text); font-weight: 500; }
.tool-tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent);
}
.tool-tab-close {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-chip);
  color: var(--faint);
}
.tool-tab-close:hover { background: var(--active); color: var(--text); }
.tool-tab-add { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; color: var(--faint); font-size: var(--fs-13); }
.tool-tab-add:hover { color: var(--text); }

.segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  background: var(--raised); border-radius: var(--r-control);
}
.segmented button {
  height: 28px; padding: 0 10px; border-radius: 5px; border: 1px solid transparent;
  font-size: var(--fs-13); color: var(--muted); white-space: nowrap;
}
.segmented button.is-active,
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; border-color: var(--border); }

/* ======================================================================
   Form
   ====================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field + .field { margin-top: var(--s-4); }
.field-label { font-size: var(--fs-13); line-height: var(--lh-13); font-weight: 500; }
.field-help { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.field-error { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--critical); }
.input, .select, .textarea {
  width: 100%; height: var(--control-h-lg); padding: 0 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--control); border-radius: var(--r-control);
  font-size: var(--fs-14);
}
.textarea { height: auto; min-height: 84px; padding: 8px 10px; line-height: var(--lh-14); resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); border-radius: var(--r-control); }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23565d64' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-search {
  display: flex; align-items: center; gap: 8px;
  height: var(--control-h); padding: 0 10px;
  border: 1px solid var(--control); border-radius: var(--r-control); background: var(--surface);
  color: var(--faint); min-width: 0;
}
.input-search input { flex: 1; min-width: 0; border: 0; background: transparent; height: 100%; font-size: var(--fs-13); color: var(--text); }
.input-search input::placeholder { color: var(--faint); }
.input-search input:focus-visible { outline: none; }
.input-search:focus-within { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }

.toolbar {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-3) var(--s-6);
}
.toolbar .spacer { flex: 1; }
.toolbar-count { font-size: var(--fs-13); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ======================================================================
   Tablo
   ====================================================================== */
.table-wrap { overflow-x: auto; min-width: 0; }
.table { width: 100%; font-size: var(--fs-14); }
.table th {
  height: 36px; padding: 0 var(--s-3);
  font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); font-weight: 400;
  white-space: nowrap; vertical-align: bottom; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.table td {
  height: 44px; padding: 6px var(--s-3);
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.table th:first-child, .table td:first-child { padding-left: var(--s-6); }
.table th:last-child, .table td:last-child { padding-right: var(--s-6); }
.table.inset th:first-child, .table.inset td:first-child { padding-left: var(--s-4); }
.table.inset th:last-child, .table.inset td:last-child { padding-right: var(--s-4); }
.table tr.is-selected td { background: var(--active); }
.table tbody tr:hover td { background: var(--hover); }
.table tr.is-selected:hover td { background: var(--active); }
.table td.mono, .table .mono { font-size: var(--fs-13); }
.table td.wrap-any { overflow-wrap: anywhere; }
.table .cell-sub { display: block; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); margin-top: 2px; }
.table td.actions { width: 1%; white-space: nowrap; text-align: right; }

/* ======================================================================
   Listeler
   ====================================================================== */
.list { display: flex; flex-direction: column; }
.list-row {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3);
  width: 100%; padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.list-row:hover { background: var(--hover); }
.list-row.is-selected { background: var(--active); }
.list-row.is-selected::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent);
}
.list-row-title {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-weight: 400;
}
.list-row-title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.is-unread .list-row-title { font-weight: 600; }
.list-row.is-unread .list-row-title::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none;
}
.list-row-time { font-size: var(--fs-12); line-height: var(--lh-14); color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-row-time.is-warning { color: var(--warning); font-weight: 500; }
.list-row-time.is-critical { color: var(--critical); font-weight: 500; }
.list-row-sub {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  font-size: var(--fs-13); line-height: var(--lh-13); color: var(--muted);
}
.list-row-sub > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

/* ======================================================================
   Boş durum, kilit notu, kullanım çubuğu, SLA, sabır
   ====================================================================== */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
  padding: var(--s-8) var(--s-6); text-align: center; color: var(--muted);
}
.empty .i { width: 24px; height: 24px; color: var(--faint); margin-bottom: 4px; }
.empty-title { color: var(--text); font-weight: 500; }
.empty p { max-width: 44ch; }
.empty.inline { padding: var(--s-4); align-items: flex-start; text-align: left; }
.empty.dashed { border: 1px dashed var(--control); border-radius: var(--r-card); }

.locked-note { max-width: 420px; margin: auto; }
.locked-note .i { width: 28px; height: 28px; }

.meter { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meter-track { height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.meter-fill {
  display: block; height: 100%; width: var(--value, 0%);
  border-radius: 999px; background: var(--chart-1);
}
.meter.is-warning .meter-fill { background: var(--warning); }
.meter.is-critical .meter-fill { background: var(--critical); }
.meter-labels { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-labels strong { color: var(--text); font-weight: 500; }

.sla { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-13); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla.is-warning { color: var(--warning); font-weight: 500; }
.sla.is-breached { color: var(--critical); font-weight: 500; }

.patience { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--fs-13); color: var(--muted); white-space: nowrap; }
.patience-track { width: 80px; height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.patience-fill { display: block; height: 100%; width: var(--value, 100%); background: var(--faint); border-radius: 999px; transition: width var(--dur-2) var(--ease); }
.patience.is-warning { color: var(--warning); }
.patience.is-warning .patience-fill { background: var(--warning); }
.patience.is-low { color: var(--critical); }
.patience.is-low .patience-fill { background: var(--critical); }

/* ======================================================================
   Bilet mesajı, kanıt iliştirme, kanıt tepsisi
   ====================================================================== */
.thread { display: flex; flex-direction: column; }
.msg { padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.msg:last-child { border-bottom: 0; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--s-2); }
.msg-author { font-weight: 600; }
.msg-role { font-size: var(--fs-12); color: var(--muted); }
.msg-time { margin-left: auto; font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-body { max-width: 72ch; overflow-wrap: anywhere; }
.msg-body p + p { margin-top: var(--s-2); }
.msg.is-agent { border-left: 2px solid var(--accent); padding-left: var(--s-3); }
.msg.is-internal {
  background: var(--warning-bg); border: 0; border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); margin: var(--s-3) 0;
}
.msg-note { font-size: var(--fs-12); font-weight: 500; color: var(--warning-ink); }
.msg.is-system { color: var(--muted); font-size: var(--fs-13); padding: var(--s-2) 0; border-bottom: 0; text-align: center; }

/* müşterinin eklediği şey (beyan): iliştirilebilir satırlar */
.attachment {
  margin-top: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden;
}
.attachment-head { display: flex; align-items: center; gap: 6px; padding: 6px var(--s-3); background: var(--raised); font-size: var(--fs-12); color: var(--muted); }
.attachment-line { position: relative; display: flex; align-items: center; gap: var(--s-2); padding: 4px var(--s-3); font: var(--fs-13) / 20px var(--mono); }
.attachment-line + .attachment-line { border-top: 1px solid var(--rule); }
.attachment-line .line-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* İliştir düğmesi: üstüne gelince görünür, dokunmatikte hep görünür. Doğruluk göstermez. */
.pin {
  flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 8px; border-radius: var(--r-chip);
  font-size: var(--fs-12); font-weight: 500; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  opacity: 0; transition: opacity var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.pin .i { width: 13px; height: 13px; }
.pin:hover:not(:disabled) { color: var(--text); background: var(--hover); }
.pin:focus-visible { opacity: 1; }
.pin.is-pinned { opacity: 1; }
.pin:disabled { color: var(--faint); }
.pin.icon-only { width: 24px; padding: 0; justify-content: center; }
:is(.kv-row, .attachment-line, .log-line, .term-block, .term-line, .timeline-item, .table tr, .pinnable):hover .pin,
:is(.kv-row, .attachment-line, .log-line, .term-block, .term-line, .timeline-item, .table tr, .pinnable):focus-within .pin { opacity: 1; }
/* Dokunmatikte: önce satıra dokunup seç, iliştir düğmesi yalnızca seçili satırda görünür */
@media (hover: none) {
  .pin { display: none; }
  .is-selected > .pin, .is-selected .pin, .log-selected .pin { display: inline-flex; opacity: 1; }
}
/* İliştirilmiş öğe: yalnızca nötr iğne simgesi. Renk, dolgu, çizgi değişmez (doğruluk ipucu yok). */
.pin-flag { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-12); line-height: 1; white-space: nowrap; }
.pin-flag .i { width: 13px; height: 13px; }

.evidence-tray {
  padding: var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--border);
}
.evidence-tray-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.evidence-tray-head strong { color: var(--text); font-weight: 500; }
.evidence-tray-head .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.evidence-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-2); }
.evidence-item {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; min-height: 52px; padding: 8px 32px 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
}
.evidence-source { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-text { font: var(--fs-12) / 18px var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: var(--r-chip); display: grid; place-items: center; color: var(--faint); }
.evidence-remove:hover { background: var(--hover); color: var(--text); }
.evidence-item.is-empty {
  background: transparent; border: 1px dashed var(--control);
  align-items: center; justify-content: center; padding: 8px 10px;
  color: var(--faint); font-size: var(--fs-12);
}
.evidence-tray-hint { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); margin-top: var(--s-2); }
.evidence-tray.compact .evidence-slots { display: none; }
.evidence-tray.readonly { padding: 0; border: 0; }

/* ======================================================================
   Yanıt editörü, radyo kartı, aktarım formu, mentor
   ====================================================================== */
.composer { border-top: 1px solid var(--border); background: var(--surface); min-width: 0; }
.composer-tabs { padding: 0 var(--s-6); }
.composer-body { padding: var(--s-3) var(--s-6) var(--s-2); }
.composer-foot {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-2) var(--s-6) var(--s-4);
}
.composer-foot .note { flex: 1 1 200px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.composer-auto {
  position: relative;
  background: var(--raised); border-radius: var(--r-card);
  padding: var(--s-3) var(--s-4); padding-top: 28px;
  overflow-wrap: anywhere;
}
.composer-auto-label { position: absolute; top: 8px; right: var(--s-3); font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.composer-auto p + p { margin-top: var(--s-2); }
.done-list { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-3); }
.done-item { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--fs-13); line-height: var(--lh-13); min-width: 0; }
.done-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.done-text { min-width: 0; overflow-wrap: anywhere; }

.choice-list { display: flex; flex-direction: column; gap: var(--s-2); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.choice-card {
  position: relative; display: flex; gap: var(--s-3); align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-card);
  background: var(--surface); cursor: pointer; min-width: 0;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.choice-card:hover { border-color: var(--control); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card .choice-mark {
  flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%;
  border: 1.5px solid var(--control); background: var(--surface);
}
.choice-card .choice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice-card .choice-title { display: block; font-weight: 500; }
.choice-card .choice-sub { display: block; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); margin-top: 3px; }
.choice-card:has(input:checked), .choice-card.is-selected {
  border-color: var(--text); background: var(--raised);
}
.choice-card:has(input:checked) .choice-mark, .choice-card.is-selected .choice-mark {
  border-color: var(--text); box-shadow: inset 0 0 0 3px var(--surface); background: var(--text);
}
.choice-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-card:has(input:disabled), .choice-card.is-disabled { opacity: .55; cursor: not-allowed; }
.choice-card .choice-struck { text-decoration: line-through; }

.transfer { display: flex; flex-direction: column; gap: var(--s-4); }
.transfer-note { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }

.mentor { display: flex; flex-direction: column; gap: var(--s-2); }
.mentor-steps { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.mentor-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--control); }
.mentor-dot.is-used { background: var(--muted); box-shadow: none; }

/* ======================================================================
   Log görüntüleyici (seviye kuralı), terminal
   ====================================================================== */
.logview {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--term-bg); color: var(--term-text);
  border-radius: var(--r-card); overflow: hidden;
}
.logview-head {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: 8px var(--s-3); border-bottom: 1px solid var(--term-border);
  font: var(--fs-12) / var(--lh-12) var(--mono); color: var(--term-dim);
}
.logview-head .path { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.logview-lines { flex: 1; min-height: 120px; overflow: auto; padding: 4px 0; user-select: text; }
.log-line {
  position: relative;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 22px; padding: 1px var(--s-3) 1px 14px;
  font: var(--fs-13) / 20px var(--mono);
  white-space: pre; cursor: default;
}
.log-line:hover { background: var(--term-raised); }
.log-line.is-selected { background: var(--term-select); }
.log-ts { flex: none; color: var(--term-dim); }
.log-host { flex: none; color: var(--term-dim); }
.log-msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logview.wrap .log-line { white-space: pre-wrap; align-items: flex-start; }
.logview.wrap .log-msg { overflow-wrap: anywhere; }
/* Renk yalnızca seviyeden; bütün satırlara aynı kural. "Önemli satır" vurgusu yok. */
.log-line[data-level="error"] .log-msg { color: var(--term-crit); }
.log-line[data-level="error"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--term-crit); }
.log-line[data-level="warn"] .log-msg { color: var(--term-warn); }
.log-line[data-level="warn"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--term-warn); }
.log-line[data-level="debug"] .log-msg { color: var(--term-dim); }
.log-line .pin { background: var(--term-raised); color: var(--term-dim); border-color: var(--term-border); }
.log-line .pin:hover { color: var(--term-text); background: var(--term-select); }
.log-line .pin-flag, .term-line .pin-flag, .term-block .pin-flag { color: var(--term-dim); }
.logview-foot {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: 8px var(--s-3); border-top: 1px solid var(--term-border);
  font-size: var(--fs-12); line-height: var(--lh-12); color: var(--term-dim); font-variant-numeric: tabular-nums;
}
.log-selected {
  border-top: 1px solid var(--term-border); padding: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.log-selected-label { font-size: var(--fs-12); color: var(--term-dim); display: flex; align-items: center; gap: var(--s-2); }
.log-selected-label .pin { opacity: 1; margin-left: auto; }
.log-selected-text { font: var(--fs-13) / 20px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.term {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--term-bg); color: var(--term-text);
  border-radius: var(--r-card); overflow: hidden;
  font: var(--fs-13) / 20px var(--mono);
}
.term-out { flex: 1; min-height: 160px; overflow: auto; padding: var(--s-3) var(--s-4); user-select: text; }
.term-block { position: relative; padding: 2px 0 var(--s-2); }
.term-block > .pin { position: absolute; top: 0; right: 0; background: var(--term-raised); color: var(--term-dim); border-color: var(--term-border); }
.term-cmd { white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 88px; }
.term-prompt { color: var(--term-ok); }
.term-line { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 32px; }
.term-line .pin { position: absolute; right: 0; top: -2px; background: var(--term-raised); color: var(--term-dim); border-color: var(--term-border); }
.term-line:hover { background: var(--term-raised); }
.term-input-row {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4); border-top: 1px solid var(--term-border);
}
.term-input-row input {
  flex: 1; min-width: 0; height: 32px; border: 0; background: transparent;
  color: var(--term-text); font: var(--fs-13) / 20px var(--mono);
}
.term-input-row input:focus-visible { outline: none; }
.term-input-row:focus-within { box-shadow: inset 0 0 0 1px var(--term-key); }
.term-hints {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  padding: 6px var(--s-4) var(--s-3); font: var(--fs-12) / var(--lh-12) var(--font); color: var(--term-dim);
}
.term-hint {
  font: var(--fs-12) / 20px var(--mono); color: var(--term-text);
  padding: 0 6px; border-radius: var(--r-chip); background: var(--term-raised);
}
.term-hint:hover { background: var(--term-select); }

/* ======================================================================
   Sohbet (ekip) ve canlı sohbet balonu
   ====================================================================== */
.chat-msg { display: flex; gap: var(--s-3); padding: var(--s-2) 0; min-width: 0; }
.chat-msg-main { flex: 1; min-width: 0; }
.chat-msg-head { display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.chat-msg-author { font-weight: 600; }
.chat-msg-time { font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-msg-context { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); margin-top: 2px; }
.chat-msg-text { overflow-wrap: anywhere; margin-top: 2px; max-width: 72ch; }
.chat-msg.is-continued { padding-top: 0; }
.chat-msg.is-continued .avatar, .chat-msg.is-continued .chat-msg-head { visibility: hidden; height: 0; }
.chat-day {
  display: flex; align-items: center; gap: var(--s-3); margin: var(--s-3) 0;
  font-size: var(--fs-12); color: var(--muted);
}
.chat-day::before, .chat-day::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.chat-card { margin-top: var(--s-2); }

.bubbles { display: flex; flex-direction: column; gap: var(--s-3); }
.bubble-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 78%; }
.bubble-row.is-self { align-self: flex-end; align-items: flex-end; }
.bubble-meta { font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.bubble {
  padding: 8px 12px; border-radius: var(--r-card);
  background: var(--raised); overflow-wrap: anywhere;
}
.bubble-system { align-self: center; font-size: var(--fs-12); color: var(--muted); }
.typing { display: inline-flex; gap: 3px; padding: 10px 12px; background: var(--raised); border-radius: var(--r-card); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: typing 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

/* ======================================================================
   Gelen çağrı kartı ve görüşme paneli (yüzen)
   ====================================================================== */
.call-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  padding: var(--s-4);
  animation: rise var(--dur-2) var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.call-queue { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.call-name { margin-top: var(--s-2); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 600; }
.call-number { font: var(--fs-13) / var(--lh-13) var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.call-wait { margin-top: 4px; font-size: var(--fs-12); color: var(--warning); font-variant-numeric: tabular-nums; }
.call-actions { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.call-actions .btn { flex: 1; height: var(--touch); border-radius: var(--r-card); }
.btn-answer { background: var(--success); color: #fff; }
.btn-answer:hover { background: #17673f; }
.call-live-head { display: flex; align-items: center; gap: var(--s-2); }
.call-live-head .call-timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--success); font-weight: 500; }
.call-transcript { margin-top: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); max-height: 220px; overflow-y: auto; }
.call-line { font-size: var(--fs-14); }
.call-line .who { font-weight: 600; margin-right: 4px; }
.call-line.is-self .who { color: var(--accent); }
.call-tools { display: flex; gap: var(--s-2); margin-top: var(--s-3); flex-wrap: wrap; }
@media (max-width: 767px) {
  .call-card { border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: var(--s-5) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom)); }
  .call-actions .btn { height: 56px; }
}

/* ======================================================================
   Toast, diyalog, rehber kutusu
   ====================================================================== */
.toast {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  padding: 12px 40px 12px 16px;
  animation: rise var(--dur-2) var(--ease);
}
.toast::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--faint); }
.toast.is-success::before { background: var(--success); }
.toast.is-critical::before { background: var(--critical); }
.toast.is-warning::before { background: var(--warning); }
.toast.is-info::before { background: var(--accent); }
.toast-title { font-weight: 600; }
.toast-text { color: var(--muted); font-size: var(--fs-13); line-height: var(--lh-13); margin-top: 2px; }
.toast-action { margin-top: var(--s-2); }
.toast-close { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: var(--r-chip); display: grid; place-items: center; color: var(--faint); }
.toast-close:hover { background: var(--hover); color: var(--text); }

.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  margin: auto; padding: 0; border: 0; border-radius: var(--r-sheet);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-float);
  overscroll-behavior: contain;
}
.dialog.wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--scrim); }
.dialog-inner { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-6) var(--s-3); }
.dialog-title { flex: 1; font-size: var(--fs-18); line-height: var(--lh-18); }
.dialog-body { padding: 0 var(--s-6) var(--s-4); overflow-y: auto; }
.dialog-body > * + * { margin-top: var(--s-3); }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-3) var(--s-6) var(--s-5); border-top: 1px solid var(--rule); }
.dialog.static { display: block; position: static; box-shadow: none; border: 1px solid var(--border); width: 100%; max-width: 560px; margin: 0; }

.coach-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.coach-ring {
  position: absolute; border-radius: var(--r-card);
  box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px var(--scrim);
  pointer-events: none;
}
.coach {
  position: absolute; width: min(300px, calc(100vw - 32px)); pointer-events: auto;
  background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
  padding: var(--s-4);
  animation: rise var(--dur-2) var(--ease);
}
.coach.static { position: relative; animation: none; }
.coach-title { font-weight: 600; }
.coach-text { margin-top: 4px; color: var(--muted); }
.coach-foot { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.coach-step { flex: 1; font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ======================================================================
   Zaman çizelgesi, grafik
   ====================================================================== */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  position: relative;
  display: grid; grid-template-columns: 92px 14px minmax(0, 1fr) auto; gap: 0 var(--s-2); align-items: start;
  padding: 6px 0;
}
.timeline-time { font: var(--fs-12) / 20px var(--mono); color: var(--muted); }
.timeline-dot { position: relative; height: 100%; }
.timeline-dot::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--control); }
.timeline-dot::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: -12px; width: 1px; background: var(--rule); }
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-text { min-width: 0; overflow-wrap: anywhere; }
.timeline-sub { display: block; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); margin-top: 2px; }

.chart { width: 100%; min-width: 0; }
.chart-box { position: relative; height: var(--chart-h, 200px); padding: 8px 8px 24px 48px; }
.chart-plot { position: relative; width: 100%; height: 100%; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.alt { stroke: var(--muted); }
.chart .threshold { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .event-line { stroke: var(--text); stroke-width: 1; }
.chart-yaxis { position: absolute; left: 0; top: 8px; bottom: 24px; width: 40px; }
.chart-y { position: absolute; right: 0; top: var(--y); transform: translateY(-50%); font-size: var(--fs-12); line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-xaxis { position: absolute; left: 48px; right: 8px; bottom: 0; height: 18px; }
.chart-x { position: absolute; left: var(--x); transform: translateX(-50%); font-size: var(--fs-12); line-height: 18px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-x.is-start { transform: none; } .chart-x.is-end { transform: translateX(-100%); }
.chart-note { position: absolute; font-size: var(--fs-12); line-height: 16px; white-space: nowrap; background: var(--surface); padding: 0 4px; }
.chart-note.is-threshold { right: 0; top: var(--y); transform: translateY(-120%); color: var(--muted); }
.chart-note.is-event { left: var(--x); top: 0; color: var(--text); }
.chart-legend { display: flex; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-12); color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend span::before { content: ""; width: 14px; height: 2px; background: var(--chart-1); }
.chart-legend span.alt::before { background: var(--muted); }

/* ======================================================================
   Vaka kartı, yetkinlik, özet şeridi
   ====================================================================== */
.case-card { display: flex; flex-direction: column; gap: var(--s-5); }
.case-head { display: flex; align-items: flex-start; gap: var(--s-3); flex-wrap: wrap; }
.case-head-text { flex: 1 1 260px; min-width: 0; }
.case-id { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.case-title { font-size: var(--fs-18); line-height: var(--lh-18); margin-top: 2px; }
.case-cause { font-size: var(--fs-16); line-height: var(--lh-16); }
.case-section-title { font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 500; color: var(--muted); margin-bottom: var(--s-2); }
.case-evidence { display: flex; flex-direction: column; gap: 6px; }
.case-ev {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: var(--s-2); align-items: start;
  padding: 8px 10px; border-radius: var(--r-card); border: 1px solid var(--rule);
}
.case-ev .i { margin-top: 2px; color: var(--muted); }
.case-ev.is-key { background: var(--raised); border-color: transparent; box-shadow: inset 2px 0 0 var(--accent); }
.case-ev.is-key .i { color: var(--success); }
.case-ev.is-missed { border-style: dashed; border-color: var(--control); }
.case-ev-source { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.case-ev-text { font: var(--fs-13) / 20px var(--mono); overflow-wrap: anywhere; }
.case-ev-text mark { background: var(--accent-soft); color: var(--text); border-radius: 2px; padding: 0 2px; }
.case-ev-why { font-size: var(--fs-13); line-height: var(--lh-13); color: var(--muted); margin-top: 2px; }
.path-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: var(--s-3); align-items: baseline; padding: 6px 0; }
.path-row + .path-row { border-top: 1px solid var(--rule); }
.path-label { font-size: var(--fs-13); color: var(--muted); }
.path-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.path-steps .sep { color: var(--faint); }
.path-meta { font-size: var(--fs-12); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.learning { font-size: var(--fs-16); line-height: var(--lh-16); }
.case-mistakes { display: flex; flex-direction: column; gap: 6px; }
.case-mistakes li { list-style: none; padding-left: 14px; position: relative; color: var(--text); }
.case-mistakes li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 2px; background: var(--faint); }
.scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-card); }
.score { padding: var(--s-3) var(--s-4); min-width: 0; }
.score + .score { border-left: 1px solid var(--border); }
.score-label { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.score-value { margin-top: 4px; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 500; }

.skill { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.skill + .skill { border-top: 1px solid var(--rule); }
.skill-head { display: flex; align-items: baseline; gap: var(--s-2); }
.skill-name { flex: 1; min-width: 0; }
.skill-level { font-size: var(--fs-12); color: var(--muted); }
.skill-value { font-variant-numeric: tabular-nums; font-weight: 500; min-width: 28px; text-align: right; }
.skill-track { position: relative; height: 6px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.skill-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--value, 0%); background: var(--chart-1); border-radius: 999px; }
.skill-gain { position: absolute; top: 0; bottom: 0; left: var(--from, 0%); width: var(--delta, 0%); background: var(--success); opacity: .45; }
.skill-loss { position: absolute; top: 0; bottom: 0; left: var(--to, 0%); width: var(--delta, 0%); background: var(--warning); opacity: .45; }
.skill-delta { font-size: var(--fs-12); font-weight: 500; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }
.skill-delta.is-up { color: var(--success); }
.skill-delta.is-down { color: var(--warning); }
.skill-delta.is-flat { color: var(--faint); }

.stat-strip { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-card); }
.stat { padding: var(--s-4) var(--s-5); min-width: 0; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-label { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--muted); }
.stat-value { margin-top: 6px; font-size: var(--fs-28); line-height: var(--lh-28); font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-value small { font-size: var(--fs-14); color: var(--muted); margin-left: 2px; }
.stat-sub { margin-top: 2px; font-size: var(--fs-12); color: var(--muted); }

.progress { display: flex; flex-direction: column; gap: 6px; }

/* ======================================================================
   Telefon ve tablet uyarlamaları (bileşen düzeyi)
   ====================================================================== */
@media (max-width: 1023px) {
  .page-head { padding: var(--s-4) var(--s-4) var(--s-3); }
  .tabs, .toolbar, .evidence-tray, .composer-tabs, .composer-body, .composer-foot, .context-strip { padding-left: var(--s-4); padding-right: var(--s-4); }
  .table th:first-child, .table td:first-child { padding-left: var(--s-4); }
  .table th:last-child, .table td:last-child { padding-right: var(--s-4); }
}
@media (max-width: 767px) {
  .page-title { font-size: 20px; line-height: 26px; }
  .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .evidence-slots { grid-template-columns: minmax(0, 1fr); }
  .scores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score:nth-child(3) { border-left: 0; }
  .score:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat-value { font-size: 24px; line-height: 30px; }
  .timeline-item { grid-template-columns: 74px 14px minmax(0, 1fr); }
  .timeline-item > .pin { grid-column: 3; justify-self: start; margin-top: 4px; }
  .path-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .bubble-row { max-width: 88%; }
  .btn, .segmented button, .input-search { min-height: 36px; }
  .list-row { padding: 14px var(--s-4); }
  /* tablolar iki satırlı listeye döner */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { position: relative; padding: 10px var(--s-4); border-bottom: 1px solid var(--rule); }
  .table.stack td { height: auto; padding: 0 !important; border: 0; text-align: left; }
  .table.stack td + td { margin-top: 2px; font-size: var(--fs-13); color: var(--muted); }
  .table.stack td[data-label]::before { content: attr(data-label) " · "; color: var(--faint); }
  .table.stack td.actions { position: absolute; top: 10px; right: var(--s-4); width: auto; margin: 0; }
  .table.stack td.lead { padding-right: 96px !important; color: var(--text); font-size: var(--fs-14); }
}

/* ======================================================================
   Ek: araç sekmesi düğmesi, div tabanlı diyalog, küçük yardımcılar
   ====================================================================== */
.tool-tab { padding: 0; }
.tool-tab > .tool-tab-btn { height: 100%; padding: 0 4px 0 10px; color: inherit; font: inherit; }
button.tool-tab { padding: 0 10px; }
.tool-tab.is-locked { padding: 0 10px; color: var(--faint); cursor: not-allowed; }
.tool-tab.is-locked:hover { background: transparent; color: var(--faint); }

#dialog-root:empty { display: none; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 90; background: var(--scrim); }
div.dialog { position: fixed; inset: 0; z-index: 91; height: fit-content; display: flex; flex-direction: column; overflow: hidden; }
div.dialog.static { position: relative; inset: auto; z-index: auto; }
.dialog.is-tehlike .dialog-title { color: var(--critical-ink); }

.term-dim { color: var(--term-dim); }
.case-ev-text.plain { font-family: var(--font); font-size: var(--fs-14); }
.kv-key.with-icon { display: flex; align-items: center; gap: var(--s-2); max-width: none; color: var(--text); }
.input-search.grow { flex: 1 1 320px; }
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); }
.center { text-align: center; }
.tool-frame-body.no-nav { grid-template-columns: minmax(0, 1fr); }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }
.interpret { margin-top: var(--s-3); }

.log-selected .btn-ghost { color: var(--term-dim); }
.log-selected .btn-ghost:hover { color: var(--term-text); background: var(--term-raised); }
.bubble-row.is-self .bubble { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.choice-card .choice-mark { box-sizing: border-box; }

.auto-done { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.auto-done-title { font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 500; color: var(--muted); margin-bottom: var(--s-1); }
