/* Jarvis arayüzü
   Renkler: gece (zemin), derin (yüzey), hat (çizgi), buz (Jarvis), kehribar (sunucuda iş yapıyor / onay), al (tehlike) */
:root {
  --gece: #07121f;
  --derin: #0c1d30;
  --derin-2: #11263d;
  --hat: #1c3954;
  --hat-2: #2b5275;
  --buz: #8be9ff;
  --buz-2: #4fb3cf;
  --kehribar: #ffb547;
  --al: #ff5d73;
  --yesil: #74e3b5;
  --metin: #dceaf6;
  --soluk: #87a1b9;
  --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --top: 56px;
  --side: 264px;
  --panel: 320px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--gece);
  color: var(--metin);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--buz); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--buz); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(139, 233, 255, .28); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- iskelet ---------- */
.app {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--panel);
  grid-template-rows: var(--top) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ---------- üst çubuk ---------- */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--hat);
  background: var(--gece);
  position: relative;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name {
  font-size: 21px;
  font-weight: 300;
  font-stretch: 125%;
  letter-spacing: .06em;
  color: var(--metin);
}
.link-state {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--soluk);
  box-shadow: 0 0 0 3px rgba(135, 161, 185, .12);
}
.link-state.on { background: var(--yesil); box-shadow: 0 0 0 3px rgba(116, 227, 181, .14); }
.link-state.off { background: var(--al); box-shadow: 0 0 0 3px rgba(255, 93, 115, .14); }

.gauges { display: flex; gap: 18px; margin-left: 12px; }
.gauge { display: flex; align-items: center; gap: 7px; font-stretch: 75%; font-variant-numeric: tabular-nums; }
.gauge svg { width: 26px; height: 26px; transform: rotate(-90deg); }
.gauge .track { stroke: var(--hat); }
.gauge .val { stroke: var(--buz); transition: stroke-dashoffset .6s ease, stroke .3s; }
.gauge.warn .val { stroke: var(--kehribar); }
.gauge.hot .val { stroke: var(--al); }
.gauge-text { display: flex; flex-direction: column; line-height: 1.05; }
.gauge-text b { font-weight: 600; font-size: 15px; }
.gauge-text span { font-size: 12px; color: var(--soluk); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.clock { font-stretch: 75%; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--soluk); margin-right: 8px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--soluk);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--derin); color: var(--metin); }
.icon-btn .badge {
  position: absolute; top: 5px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px;
  background: var(--kehribar); color: #1b1200;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
  font-stretch: 75%;
}
.only-narrow { display: none; }

/* ---------- sol: sohbetler ---------- */
.sidebar {
  border-right: 1px solid var(--hat);
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--gece);
}
.new-chat {
  margin: 14px 14px 8px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hat-2);
  border-radius: 10px;
  color: var(--metin);
  transition: border-color .15s, background .15s;
}
.new-chat:hover { border-color: var(--buz-2); background: var(--derin); }
.conv-list { overflow-y: auto; padding: 4px 8px 16px; flex: 1; }
.conv-group { font-size: 13px; color: var(--soluk); font-stretch: 80%; padding: 14px 10px 4px; }
.conv {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
  color: var(--soluk);
}
.conv:hover { background: var(--derin); color: var(--metin); }
.conv.active { background: var(--derin-2); color: var(--metin); }
.conv-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.conv .busy { width: 7px; height: 7px; border-radius: 50%; background: var(--kehribar); animation: pulse 1.2s infinite; }
.conv-del { opacity: 0; color: var(--soluk); padding: 2px; border-radius: 6px; }
.conv:hover .conv-del, .conv.active .conv-del { opacity: .8; }
.conv-del:hover { color: var(--al); opacity: 1; }
.conv-del svg.i { width: 17px; height: 17px; }
.side-foot { border-top: 1px solid var(--hat); padding: 12px 18px calc(12px + var(--safe-b)); font-size: 13px; color: var(--soluk); font-stretch: 85%; }

/* ---------- orta sahne ---------- */
.stage {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 22%, rgba(79, 179, 207, .10), transparent 70%),
    var(--gece);
}
.core-wrap {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  height: 92px;
  padding: 6px 20px 0;
  transition: height .55s cubic-bezier(.2, .8, .2, 1);
}
.core-wrap canvas { width: 80px; height: 80px; flex: none; }
.core-status { min-width: 0; }
.core-status b { display: block; font-weight: 500; font-size: 17px; font-stretch: 90%; }
.core-status span { display: block; font-size: 14px; color: var(--soluk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }

.stage.is-empty .core-wrap { height: min(50vh, 440px); flex-direction: column; gap: 4px; padding-top: 18px; }
.stage.is-empty .core-wrap canvas { width: min(40vh, 340px); height: min(40vh, 340px); }
.stage.is-empty .core-status { text-align: center; }

.transcript {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 20px 24px;
  scroll-behavior: smooth;
}
.thread { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.welcome { max-width: 640px; margin: 0 auto; text-align: center; }
.welcome h1 { font-size: 30px; font-weight: 400; font-stretch: 110%; margin: 0 0 6px; letter-spacing: .01em; }
.welcome p { color: var(--soluk); margin: 0 0 22px; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestion {
  padding: 8px 14px;
  border: 1px solid var(--hat-2);
  border-radius: 999px;
  color: var(--metin);
  font-size: 15px;
  transition: border-color .15s, background .15s;
}
.suggestion:hover { border-color: var(--buz-2); background: var(--derin); }

/* mesajlar */
.msg { position: relative; min-width: 0; }
.msg.user { align-self: flex-end; max-width: min(86%, 620px); }
.msg.user .bubble {
  background: var(--derin-2);
  border: 1px solid var(--hat);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.user .via-voice { display: flex; justify-content: flex-end; align-items: center; gap: 5px; font-size: 12.5px; color: var(--soluk); margin-top: 4px; font-stretch: 85%; }
.msg.user .via-voice svg.i { width: 14px; height: 14px; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; }
.att-thumb { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--hat); background: var(--derin); }
.att-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--hat); border-radius: 8px;
  font-size: 13.5px; color: var(--soluk); background: var(--derin);
  max-width: 240px;
}
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip svg.i { width: 15px; height: 15px; }

.msg.assistant { padding-left: 16px; border-left: 1px solid rgba(139, 233, 255, .32); }
.msg.assistant.streaming { border-left-color: var(--buz); }
.msg.assistant .md + .md { margin-top: 8px; }
.msg-actions { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg.assistant:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-actions button { padding: 5px 7px; border-radius: 7px; color: var(--soluk); display: flex; align-items: center; gap: 5px; font-size: 13px; }
.msg-actions button:hover { background: var(--derin); color: var(--metin); }
.msg-actions svg.i { width: 16px; height: 16px; }
.note { color: var(--soluk); font-size: 14px; font-style: italic; margin-top: 6px; }
.error-card {
  border: 1px solid rgba(255, 93, 115, .5);
  background: rgba(255, 93, 115, .07);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  margin-top: 6px;
}

/* markdown */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .7em; }
.md h1, .md h2, .md h3, .md h4 { font-weight: 600; font-stretch: 95%; line-height: 1.25; margin: 1.1em 0 .45em; }
.md h1 { font-size: 1.3em; } .md h2 { font-size: 1.18em; } .md h3, .md h4 { font-size: 1.05em; }
.md ul, .md ol { margin: 0 0 .7em; padding-left: 1.4em; }
.md li { margin: .2em 0; }
.md li::marker { color: var(--buz-2); }
.md blockquote { margin: 0 0 .7em; padding: 2px 0 2px 14px; border-left: 2px solid var(--hat-2); color: var(--soluk); }
.md code { font-family: var(--mono); font-size: .88em; background: var(--derin-2); border: 1px solid var(--hat); border-radius: 5px; padding: .08em .35em; }
.md hr { border: 0; border-top: 1px solid var(--hat); margin: 1em 0; }
.md table { border-collapse: collapse; margin: 0 0 .8em; font-size: .94em; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--hat); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--derin); font-weight: 600; }
.codeblock { margin: 0 0 .8em; border: 1px solid var(--hat); border-radius: 10px; overflow: hidden; background: #081626; }
.codeblock-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--hat); font-size: 13px; color: var(--soluk); font-stretch: 85%; }
.codeblock-head button { padding: 3px 8px; border-radius: 6px; color: var(--soluk); font-size: 13px; }
.codeblock-head button:hover { background: var(--derin-2); color: var(--metin); }
.codeblock pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.5; }
.codeblock pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--buz); animation: blink 1s steps(2) infinite; }

/* araç satırları */
.tool { margin: 6px 0; }
.tool-head {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--hat);
  border-radius: 9px;
  background: rgba(12, 29, 48, .6);
  text-align: left;
  font-size: 14px;
  color: var(--soluk);
}
.tool-head:hover { border-color: var(--hat-2); color: var(--metin); }
.tool-head svg.i { width: 17px; height: 17px; }
.tool-name { font-stretch: 85%; color: var(--metin); white-space: nowrap; }
.tool-detail { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soluk); }
.tool-state { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.tool.running .tool-head { border-color: rgba(255, 181, 71, .55); }
.tool.running .tool-state::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 181, 71, .3); border-top-color: var(--kehribar); animation: spin .8s linear infinite; }
.tool.ok .tool-state { color: var(--yesil); }
.tool.error .tool-state { color: var(--al); }
.tool.ok .tool-state svg.i, .tool.error .tool-state svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.tool-out {
  display: none;
  margin: 4px 0 0;
  padding: 10px 12px;
  max-height: 320px; overflow: auto;
  border: 1px solid var(--hat); border-radius: 9px;
  background: #081626;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
  color: #b9cde0;
}
.tool.open .tool-out { display: block; }

/* ---------- onay kartı ---------- */
.confirm-dock { max-width: 800px; width: 100%; margin: 0 auto; padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.confirm {
  border: 1px solid var(--kehribar);
  background: #1a1709;
  background: color-mix(in srgb, var(--kehribar) 8%, var(--gece));
  border-radius: 14px;
  padding: 14px 16px;
  animation: rise .25s ease-out;
}
.confirm-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--kehribar); }
.confirm pre { margin: 10px 0 12px; padding: 10px 12px; background: rgba(0, 0, 0, .3); border-radius: 8px; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 200px; overflow: auto; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--hat-2);
  font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--derin-2); }
.btn.amber { background: var(--kehribar); border-color: var(--kehribar); color: #1b1200; }
.btn.amber:hover { background: #ffc46e; }
.btn.primary { background: var(--buz); border-color: var(--buz); color: #04202b; }
.btn.primary:hover { background: #b0f1ff; }
.btn.danger { color: var(--al); border-color: rgba(255, 93, 115, .45); }

/* ---------- yazma alanı ---------- */
.composer-wrap { flex: none; padding: 8px 20px calc(16px + var(--safe-b)); }
.composer {
  max-width: 800px; margin: 0 auto;
  border: 1px solid var(--hat-2);
  border-radius: 18px;
  background: var(--derin);
  padding: 8px 8px 8px 6px;
  transition: border-color .2s;
}
.composer:focus-within { border-color: var(--buz-2); }
.composer.drag { border-color: var(--buz); border-style: dashed; }
.pending-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 6px 8px; }
.pending-atts:empty { display: none; }
.pending-atts .att-chip button { color: var(--soluk); display: grid; }
.pending-atts .att-chip button:hover { color: var(--al); }
.pending-atts .att-chip.uploading { opacity: .6; }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea {
  flex: 1;
  min-height: 44px; max-height: 40vh;
  resize: none;
  border: 0; outline: 0;
  background: transparent;
  padding: 10px 6px;
  line-height: 1.45;
  font-size: 16px;
}
.composer textarea::placeholder { color: #5f7a93; }
.round {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--soluk);
  flex: none;
  transition: background .15s, color .15s, box-shadow .2s;
}
.round:hover { background: var(--derin-2); color: var(--metin); }
.round.send { background: var(--buz); color: #04202b; }
.round.send:hover { background: #b0f1ff; color: #04202b; }
.round.send:disabled { background: var(--hat); color: var(--soluk); cursor: default; }
.round.stop { background: var(--al); color: #2a0008; }
.round.mic { color: var(--buz); border: 1px solid rgba(139, 233, 255, .4); }
.round.mic.live { background: var(--buz); color: #04202b; box-shadow: 0 0 0 6px rgba(139, 233, 255, .16), 0 0 0 12px rgba(139, 233, 255, .07); }
.round.mic.speaking { border-color: var(--buz); box-shadow: 0 0 0 5px rgba(139, 233, 255, .12); }
.composer-hint { max-width: 800px; margin: 6px auto 0; font-size: 12.5px; color: #5f7a93; text-align: center; font-stretch: 85%; }

/* ---------- sağ panel ---------- */
.panel {
  border-left: 1px solid var(--hat);
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--gece);
}
.tabs { display: flex; gap: 4px; padding: 12px 12px 6px; }
.tab {
  flex: 1;
  padding: 7px 6px;
  border-radius: 8px;
  color: var(--soluk);
  font-size: 14.5px;
  font-stretch: 90%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab:hover { color: var(--metin); }
.tab[aria-selected="true"] { background: var(--derin-2); color: var(--metin); }
.tab .count { font-size: 12px; color: var(--soluk); font-variant-numeric: tabular-nums; }
.tab-body { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
[hidden] { display: none !important; }
.tab-body[hidden] { display: none; }
.empty { color: var(--soluk); font-size: 14.5px; padding: 18px 6px; line-height: 1.5; }
.item {
  padding: 10px 12px;
  border: 1px solid var(--hat);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(12, 29, 48, .45);
}
.item.off { opacity: .55; }
.item-top { display: flex; align-items: flex-start; gap: 8px; }
.item-title { flex: 1; min-width: 0; font-size: 15px; overflow-wrap: anywhere; }
.item-meta { font-size: 13px; color: var(--soluk); margin-top: 3px; font-stretch: 88%; }
.item-meta .kind { color: var(--buz-2); }
.item-meta .kind.run { color: var(--kehribar); }
.item-actions { display: flex; gap: 2px; flex: none; }
.item-actions button { padding: 4px; border-radius: 6px; color: var(--soluk); display: grid; }
.item-actions button:hover { background: var(--derin-2); color: var(--metin); }
.item-actions button.del:hover { color: var(--al); }
.item-actions svg.i { width: 17px; height: 17px; }
.item.unread { border-color: rgba(255, 181, 71, .45); }
.item.link { cursor: pointer; }
.item.link:hover { border-color: var(--hat-2); }
.mem-form { display: flex; gap: 6px; margin-bottom: 12px; }
.mem-form input {
  flex: 1; min-width: 0;
  padding: 8px 11px;
  border: 1px solid var(--hat-2); border-radius: 9px;
  background: var(--derin); outline: 0;
  font-size: 15px;
}
.mem-form input:focus { border-color: var(--buz-2); }
.panel-head-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.text-btn { color: var(--buz); font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.text-btn:hover { background: var(--derin); }

/* ---------- ayarlar ---------- */
dialog.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: min(86vh, 760px);
  padding: 0;
  border: 1px solid var(--hat-2);
  border-radius: 18px;
  background: var(--derin);
  color: var(--metin);
}
dialog.sheet::backdrop { background: rgba(3, 8, 14, .7); backdrop-filter: blur(3px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px 22px; }
.sheet-head h2 { margin: 0; font-size: 21px; font-weight: 500; font-stretch: 105%; }
.sheet-body { padding: 4px 22px 22px; overflow-y: auto; max-height: calc(min(86vh, 760px) - 64px); }
.field { padding: 14px 0; border-bottom: 1px solid var(--hat); }
.field:last-child { border-bottom: 0; }
.field-label { font-weight: 500; margin-bottom: 3px; }
.field-help { font-size: 14px; color: var(--soluk); margin-bottom: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label {
  position: relative;
  flex: 1 1 140px;
  padding: 9px 12px;
  border: 1px solid var(--hat-2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.seg label:hover { border-color: var(--buz-2); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: var(--buz); background: rgba(139, 233, 255, .07); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--buz); outline-offset: 2px; }
.seg b { display: block; font-weight: 500; font-size: 15px; }
.seg small { display: block; font-size: 12.5px; color: var(--soluk); font-stretch: 85%; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; }
.switch-row span { font-size: 15px; }
.switch-row small { display: block; color: var(--soluk); font-size: 13px; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: var(--hat); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--soluk); transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--buz-2); }
.switch input:checked + i::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + i { outline: 2px solid var(--buz); outline-offset: 2px; }
.usage { font-variant-numeric: tabular-nums; font-stretch: 85%; color: var(--soluk); font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- modeller ---------- */
.model-list { display: flex; flex-direction: column; gap: 8px; }
.model-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
  padding: 12px 12px 12px 10px;
  border: 1px solid var(--hat-2); border-radius: 12px;
  background: rgba(7, 18, 31, .35);
}
.model-card.active { border-color: var(--buz); background: rgba(139, 233, 255, .05); }
.mc-pick { position: relative; width: 22px; height: 22px; margin-top: 2px; cursor: pointer; }
.mc-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mc-pick .dot { position: absolute; inset: 2px; border-radius: 50%; border: 2px solid var(--hat-2); }
.mc-pick input:checked + .dot { border-color: var(--buz); box-shadow: inset 0 0 0 4px var(--derin), inset 0 0 0 9px var(--buz); }
.mc-pick input:focus-visible + .dot { outline: 2px solid var(--buz); outline-offset: 2px; }
.mc-body { min-width: 0; }
.mc-title { font-weight: 500; }
.mc-sub { font-size: 13.5px; color: var(--soluk); overflow-wrap: anywhere; }
.mc-sub .muted { color: #6a859e; }
.mc-model { display: inline-block; max-width: 100%; vertical-align: bottom; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-txt { color: var(--kehribar); }
.caps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.cap { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--hat-2); color: var(--soluk); font-stretch: 85%; white-space: nowrap; }
.cap.ok { border-color: rgba(116, 227, 181, .5); color: var(--yesil); }
.cap.no { border-color: rgba(255, 93, 115, .45); color: var(--al); }
.cap.unk { border-style: dashed; }
.mc-test { font-size: 13px; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; color: var(--soluk); }
.mc-test svg.i { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.mc-test.ok svg.i { color: var(--yesil); }
.mc-test.no { color: var(--al); }
.mc-actions { display: flex; flex-direction: column; gap: 6px; }
.btn.small { padding: 5px 10px; font-size: 13.5px; border-radius: 8px; }
.model-form { margin-top: 12px; padding: 14px; border: 1px solid var(--buz-2); border-radius: 14px; background: rgba(7, 18, 31, .45); }
.model-form[hidden] { display: none; }
.form-title { font-weight: 600; margin-bottom: 8px; }
.fld { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; margin: 8px 0 2px; }
.fld > span { font-size: 14.5px; color: var(--metin); }
.fld input, .fld select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--hat-2); border-radius: 9px;
  background: var(--gece); color: var(--metin); outline: 0; font-size: 15px;
}
.fld input:focus, .fld select:focus { border-color: var(--buz-2); }
.fld-help { font-size: 12.5px; color: var(--soluk); margin: 2px 0 4px 140px; overflow-wrap: anywhere; }
.fld-help.src { color: #6a859e; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0 0 140px; }
.caps-form { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hat); }
.caps-title { font-weight: 500; font-size: 14.5px; }
.caps-form > .fld-help { margin-left: 0; }
.form-err { color: var(--al); min-height: 20px; font-size: 14px; margin-top: 8px; }
.row-btns.end { justify-content: flex-end; }

/* ---------- araç günlüğü ---------- */
dialog.sheet.wide { width: min(760px, calc(100vw - 24px)); }
.log-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.log-row { border: 1px solid var(--hat); border-radius: 10px; background: rgba(7, 18, 31, .4); }
.log-row summary { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 4px 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; list-style: none; }
.log-row summary::-webkit-details-marker { display: none; }
.log-time { color: var(--soluk); font-stretch: 85%; }
.log-name { font-weight: 500; }
.log-status { font-size: 12.5px; color: var(--soluk); }
.log-conv { grid-column: 2 / -1; color: var(--soluk); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row.st-done .log-status { color: var(--yesil); }
.log-row.st-error .log-status, .log-row.st-interrupted .log-status { color: var(--al); }
.log-row.st-denied .log-status, .log-row.st-skipped .log-status { color: var(--kehribar); }
.log-meta { font-size: 12.5px; color: var(--soluk); padding: 0 12px; overflow-wrap: anywhere; }
.log-row pre { margin: 6px 12px 10px; padding: 8px 10px; max-height: 220px; overflow: auto; background: #081626; border: 1px solid var(--hat); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- bildirim baloncukları ---------- */
.toasts { position: fixed; top: calc(var(--top) + 10px); right: 14px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
@media (min-width: 1181px) { .toasts { right: calc(var(--panel) + 14px); } }
.toast {
  pointer-events: auto;
  border: 1px solid var(--hat-2);
  border-left: 3px solid var(--buz);
  background: var(--derin-2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14.5px;
  animation: rise .25s ease-out;
}
.toast b { display: block; font-weight: 600; }
.toast.warn { border-left-color: var(--kehribar); }
.toast.err { border-left-color: var(--al); }
.toast button { margin-top: 6px; }

.scrim { display: none; }

/* ---------- giriş sayfası ---------- */
.login {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse 60% 50% at 50% 35%, rgba(79, 179, 207, .12), transparent 70%), var(--gece);
}
.login-card { width: min(360px, 100%); text-align: center; }
.login-card canvas { width: 190px; height: 190px; display: block; margin: 0 auto 10px; }
.login-card h1 { font-size: 30px; font-weight: 300; font-stretch: 125%; letter-spacing: .06em; margin: 0 0 4px; }
.login-card p { color: var(--soluk); margin: 0 0 22px; }
.login-card input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--hat-2); border-radius: 12px;
  background: var(--derin); outline: 0;
  font-size: 17px;
  text-align: center;
  letter-spacing: .1em;
}
.login-card input:focus { border-color: var(--buz); }
.login-card .btn { width: 100%; margin-top: 10px; padding: 12px; }
.login-err { color: var(--al); min-height: 24px; margin-top: 10px; font-size: 15px; }

/* ---------- hareket ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- dar ekranlar ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: var(--side) minmax(0, 1fr); }
  .panel {
    position: fixed; top: var(--top); right: 0; bottom: 0;
    width: min(var(--panel), 88vw);
    z-index: 40;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .app.panel-open .panel { transform: none; }
  .only-narrow.panel-btn { display: grid; }
  .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; background: rgba(3, 8, 14, .6); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .app.panel-open .scrim, .app.side-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 820px) {
  :root { --top: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--top); left: 0; bottom: 0;
    width: min(var(--side), 84vw);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .app.side-open .sidebar { transform: none; }
  .only-narrow { display: grid; }
  .gauges, .clock { display: none; }
  .topbar { gap: 8px; padding: 0 6px; }
  .brand-name { font-size: 19px; }
  .core-wrap { height: 76px; padding-top: 4px; }
  .core-wrap canvas { width: 64px; height: 64px; }
  .stage.is-empty .core-wrap { height: min(42vh, 330px); }
  .stage.is-empty .core-wrap canvas { width: min(32vh, 250px); height: min(32vh, 250px); }
  .transcript { padding: 6px 14px 18px; }
  .composer-wrap { padding: 6px 10px calc(10px + var(--safe-b)); }
  .confirm-dock { padding: 0 10px; }
  .composer-hint { display: none; }
  .welcome h1 { font-size: 25px; }
  .suggestion:nth-child(n+4) { display: none; }
  .msg.user { max-width: 90%; }
  .msg.assistant { padding-left: 12px; }
  .msg-actions { opacity: 1; }
  .conv-del { opacity: .7; }
  .model-card { grid-template-columns: auto minmax(0, 1fr); }
  .mc-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .fld { grid-template-columns: 1fr; gap: 4px; }
  .fld-help, .check { margin-left: 0; }
  .log-row summary { grid-template-columns: minmax(0, 1fr) auto; }
  .log-time, .log-conv { grid-column: 1 / -1; }
  .log-status { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}

.route-note { color: var(--kehribar); font-size: 13px; margin: 4px 0 8px; }
.mc-auto { margin: 8px 0 0; font-size: 13.5px; }

/* Model Merkezi */
.mc-sec { border-top: 1px solid var(--hat); padding: 14px 0 6px; }
.mc-sec:first-child { border-top: 0; padding-top: 4px; }
.mc-sec h3 { margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.mc-budget { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mc-meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--soluk); }
.mc-meter-top b { color: inherit; font-weight: 500; color: #dbe8f4; }
.bar { height: 6px; border-radius: 3px; background: var(--hat); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--yesil); }
.bar.warn i { background: var(--kehribar); } .bar.no i { background: var(--al); }
.mc-chart { margin-top: 12px; }
.mc-chart svg { width: 100%; height: 110px; display: block; border-bottom: 1px solid var(--hat); }
.mc-chart svg.empty { height: 24px; }
.mc-chart-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--soluk); margin: 4px 0; }
.mc-chart rect { fill: var(--buz); opacity: .8; }
.table-wrap { overflow-x: auto; }
.mc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mc-table th { text-align: left; font-weight: 500; color: var(--soluk); padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid var(--hat); }
.mc-table td { padding: 8px; border-bottom: 1px solid var(--hat); vertical-align: top; white-space: nowrap; }
.mc-table td small { display: block; color: var(--soluk); font-size: 12px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.mc-table tr.active td:first-child b { color: var(--buz); }
.mc-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mc-checks li { display: grid; grid-template-columns: 18px 170px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 14px; }
.mc-checks li span { color: var(--soluk); overflow-wrap: anywhere; }
.mc-checks li.ok svg { color: var(--yesil); } .mc-checks li.no svg { color: var(--al); } .mc-checks li.warn svg { color: var(--kehribar); }
.mc-checks svg { width: 16px; height: 16px; margin-top: 2px; }
.mc-tools .fld { grid-template-columns: 200px minmax(0, 1fr); }
.cap.warn { border-color: var(--kehribar); color: var(--kehribar); }
@media (max-width: 640px) {
  .mc-budget { grid-template-columns: 1fr; }
  .mc-checks li { grid-template-columns: 18px minmax(0, 1fr); }
  .mc-checks li span { grid-column: 2; }
  .mc-tools .fld { grid-template-columns: 1fr; }
  .mc-table thead { display: none; }
  .mc-table, .mc-table tbody, .mc-table tr, .mc-table td { display: block; width: 100%; }
  .mc-table tr { border: 1px solid var(--hat); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; }
  .mc-table td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; white-space: normal; }
  .mc-table td::before { content: attr(data-label); color: var(--soluk); flex: none; }
  .mc-table td[data-label="Model"] { display: block; }
  .mc-table td[data-label="Model"]::before { content: none; }
  .mc-table td small { max-width: none; }
}
