/* Ters Arena — konsol teması. Renk = profil, çizgi/etiket = yön (Normal düz, Ters kesikli). */
:root {
  --bg: #0d1219;
  --bg-2: #0a0f15;
  --panel: #131a24;
  --panel-2: #192230;
  --panel-3: #1f2a3a;
  --line: #243040;
  --line-2: #2e3c4f;
  --text: #e7edf4;
  --text-2: #b7c2d0;
  --muted: #8a97a8;
  --long: #22c986;
  --short: #ff5a6e;
  --warn: #f3b33d;
  --live: #b58cff;
  --accent: #4ea1ff;
  --accent-2: #2d7ff0;
  --radius: 12px;
  --radius-s: 8px;
  --nav-w: 196px;
  --top-h: 60px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; min-width: 0; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: var(--text-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pos { color: var(--long); }
.neg { color: var(--short); }
.err { color: var(--short); }
.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; max-width: 72ch; }
.count { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 4px; }

/* ── Üst çubuk ─────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 0 16px; background: rgba(13,18,25,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; letter-spacing: -0.02em; }
.mark { width: 26px; height: 26px; }
.mark path { fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.mk-up { stroke: var(--accent); }
.mk-dn { stroke: var(--short); opacity: 0.9; }
.engine { display: flex; align-items: center; gap: 12px; min-width: 0; }
.power {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer;
  display: grid; place-items: center; transition: background .2s, box-shadow .3s, border-color .2s;
}
.power svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.power.on { border-color: rgba(34,201,134,.6); background: rgba(34,201,134,.12); box-shadow: 0 0 0 4px rgba(34,201,134,.08); }
.power.on svg { stroke: var(--long); }
.power.busy { border-color: rgba(78,161,255,.6); background: rgba(78,161,255,.12); animation: pulse 1.4s ease-in-out infinite; }
.power.busy svg { stroke: var(--accent); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(78,161,255,.25);} 50% { box-shadow: 0 0 0 8px rgba(78,161,255,0);} }
.engine-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.engine-state { font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.engine-state.run { color: var(--long); }
.engine-state.busy { color: var(--accent); }
.engine-state.stop { color: var(--muted); }
.engine-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--line-2); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 106.8; stroke-dashoffset: 106.8; transition: stroke-dashoffset 1s linear, stroke .3s; stroke-linecap: round; }
.ring span { font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.live-ctl { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(138,151,168,.15); }
.live-dot.on { background: var(--live); box-shadow: 0 0 0 3px rgba(181,140,255,.25); }
.live-ctl select { width: auto; background: transparent; border: 0; font-weight: 600; max-width: 150px; padding: 2px 0; }
.top-right { display: flex; align-items: center; gap: 10px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--short); transition: background .3s; }
.conn.on { background: var(--long); }

/* Segment anahtarı */
.seg { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--bg-2); }
.seg button { border: 0; background: transparent; white-space: nowrap; flex: none; color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12.5px; transition: background .15s, color .15s; }
.seg button.active { background: var(--panel-3); color: var(--text); }
.seg.small button { padding: 3px 9px; font-size: 12px; }
#sideSeg button.active[data-side="follow"] { background: rgba(78,161,255,.18); color: #9ccbff; }
#sideSeg button.active[data-side="inverse"] { background: rgba(255,90,110,.18); color: #ffa3ad; }
.live-ctl.off { opacity: .7; }

/* Ticker ve uyarılar */
.ticker-wrap { border-bottom: 1px solid var(--line); background: var(--bg-2); overflow: hidden; }
.ticker { display: flex; gap: 22px; padding: 6px 16px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-size: 12.5px; }
.ticker::-webkit-scrollbar { display: none; }
.ticker span { color: var(--muted); flex: none; }
.ticker b { color: var(--text); margin-left: 6px; font-weight: 600; transition: color .4s; }
.ticker b.up { color: var(--long); }
.ticker b.dn { color: var(--short); }
.warnings { display: flex; flex-direction: column; gap: 6px; padding: 0 16px; }
.warn-box { margin-top: 10px; padding: 9px 12px; border: 1px solid rgba(243,179,61,.35); background: rgba(243,179,61,.08); color: #f7d08a; border-radius: var(--radius-s); font-size: 12.5px; }

/* ── Kabuk ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: calc(100vh - var(--top-h)); }
.nav { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); padding: 14px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: var(--muted); padding: 9px 12px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.nav button i { font-style: normal; width: 18px; text-align: center; font-size: 15px; opacity: .8; }
.nav button:hover { background: var(--panel); color: var(--text-2); }
.nav button.active { background: var(--panel-2); color: var(--text); }
main { padding: 16px; min-width: 0; }
.tab { display: none; }
.tab.active { display: block; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h2 { padding-top: 3px; }

/* Düğmeler ve girdiler */
.btn { border: 1px solid var(--accent-2); background: var(--accent-2); color: #fff; padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; font-weight: 700; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.tiny { padding: 3px 8px; font-size: 11.5px; }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: transparent; border-color: rgba(255,90,110,.5); color: #ff8b98; }
.btn.danger:hover { background: rgba(255,90,110,.12); }
.btn.ok { background: rgba(34,201,134,.16); border-color: rgba(34,201,134,.5); color: var(--long); }
input, select, textarea { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 8px 10px; color: var(--text); width: 100%; transition: border-color .15s; }
input.small, select.small { padding: 5px 9px; font-size: 12.5px; width: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { resize: vertical; min-height: 90px; line-height: 1.45; font-size: 12.5px; }
select option { background: var(--panel-2); }
.search { max-width: 260px; padding: 7px 11px; }

/* Etiketler */
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.tag.long { background: rgba(34,201,134,.15); color: var(--long); }
.tag.short { background: rgba(255,90,110,.15); color: var(--short); }
.tag.hold { background: rgba(138,151,168,.15); color: var(--muted); }
.tag.close { background: rgba(243,179,61,.15); color: var(--warn); }
.badge { display: inline-block; white-space: nowrap; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--panel-3); color: var(--text-2); }
.badge.red { background: rgba(255,90,110,.18); color: #ff8b98; }
.badge.green { background: rgba(34,201,134,.18); color: var(--long); }
.badge.violet { background: rgba(181,140,255,.18); color: var(--live); }
.side-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; }
.side-chip i { width: 14px; height: 0; border-top: 2px solid var(--c, var(--accent)); }
.side-chip.inverse i { border-top-style: dashed; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Maliyet çubuğu */
.cost-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); font-size: 12.5px; color: var(--muted); }
.cost-strip b { color: var(--text); font-weight: 700; }
.cost-strip .edit { margin-left: auto; }
.cost-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.cost-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* ── Arena kartları ──────────────────────────────────────────────────── */
.arena { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-bottom: 14px; }
.acard { --c: var(--accent); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden; }
.acard::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.acard.off { opacity: .6; }
.acard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.acard-head h3 { color: var(--text); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.acard-head .model { color: var(--muted); font-size: 12px; font-weight: 500; }
.acard-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.side { padding: 10px 12px; border-radius: var(--radius-s); background: var(--bg-2); border: 1px solid var(--line); }
.side.inverse { border-style: dashed; }
.side .lbl { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.side .eq { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.side .ret { font-weight: 700; font-size: 13px; }
.side .mini { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.side .mini .sep { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 3px 0; }
.side .mini .net { color: var(--text); font-weight: 700; }
.side .mini b { color: var(--text-2); font-weight: 600; text-align: right; white-space: nowrap; }
.vs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 56px; }
.vs-mid .vs-lbl { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.tug { width: 10px; height: 90px; border-radius: 999px; background: var(--line); position: relative; overflow: hidden; }
.tug i { position: absolute; left: 0; right: 0; transition: top .6s cubic-bezier(.2,.8,.2,1), height .6s cubic-bezier(.2,.8,.2,1), background .3s; }
.tug .up { top: 50%; bottom: auto; background: var(--accent); }
.tug .dn { top: 50%; background: var(--short); }
.tug-txt { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; }
.vs.stack { grid-template-columns: 1fr; }
.vs.stack .vs-mid { flex-direction: row; justify-content: space-between; gap: 10px; padding: 2px 4px; }
.vs.stack .tug { width: 100%; height: 8px; flex: 1; }
.vs.stack .tug i { top: 0; bottom: 0; height: auto; }
.vs.stack .tug .up { left: 50%; right: auto; }
.vs.stack .tug .dn { right: 50%; left: auto; }
.vs.stack .tug-txt { white-space: nowrap; }
.vs.stack .tug-txt br { display: none; }
.acard-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.acard-foot .ai-err { color: var(--short); }
.num { transition: color .5s; }
.num.flash-up { color: var(--long); }
.num.flash-dn { color: var(--short); }

/* Tablolar */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); font-size: 11.5px; position: sticky; top: 0; background: var(--panel); }
.tbl td { padding: 7px 8px; border-bottom: 1px solid rgba(36,48,64,.6); vertical-align: top; }
.tbl tr:hover td { background: rgba(255,255,255,.015); }
.tbl td.txt { white-space: normal; min-width: 180px; max-width: 420px; }
.tbl .exec { font-size: 11.5px; color: var(--muted); white-space: normal; }
.empty { color: var(--muted); padding: 10px 4px; font-size: 13px; }

/* Grafik */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; font-size: 12px; }
.legend label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }
.legend input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.legend i { width: 16px; height: 0; border-top: 2px solid; }
.legend i.dash { border-top-style: dashed; }
.chart-wrap { position: relative; height: 280px; }
canvas { width: 100%; height: 100%; display: block; }
.tip { position: absolute; display: none; pointer-events: none; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 6px 9px; font-size: 11.5px; line-height: 1.4; z-index: 2; white-space: nowrap; }

/* Yön isabeti */
.eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.eval-card { --c: var(--accent); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--bg-2); }
.eval-card h3 { color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.eval-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; margin: 5px 0; font-size: 12px; }
.bar { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; position: relative; }
.bar div { height: 100%; background: var(--c); border-radius: 999px; transition: width .6s ease; }
.bar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); opacity: .6; }
.verdict { font-size: 11.5px; color: var(--muted); margin: 2px 0 6px; }

/* Kararlar */
.cycles { display: flex; flex-direction: column; gap: 8px; }
.cycle { --c: var(--accent); background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--radius-s); }
.cycle-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; cursor: pointer; font-size: 12.5px; }
.cycle-head .when { font-weight: 700; }
.cycle-head .pname { color: var(--c); font-weight: 700; }
.cycle-body { display: none; padding: 0 12px 12px; border-top: 1px solid var(--line); }
.cycle.open .cycle-body { display: block; }
.cycle.skipped { opacity: .65; }
.cycle.skipped .cycle-head { padding: 6px 12px; }
.pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.5; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; max-height: 420px; overflow: auto; }

/* Profiller */
.profiles { display: grid; gap: 12px; }
.pcard { --c: var(--accent); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative; }
.pcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); border-radius: 12px 0 0 12px; }
.pcard.off { opacity: .65; }
.pcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pcard-head .pname { font-weight: 800; font-size: 15px; }
.pcard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.pcard-grid label, .field label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.pcard .prompt { margin-top: 10px; }
.pcard .prompt textarea { min-height: 180px; }
.pcard .prompt details { margin-top: 8px; }
.pcard summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.pcard-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.pcard-actions .spacer { flex: 1; }
.color-dots { display: inline-flex; gap: 4px; }
.color-dots button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.color-dots button.active { border-color: #fff; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; margin: 0; cursor: pointer; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--long); }
.switch input:checked::after { transform: translateX(14px); }
.vars { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.vars code { color: var(--text-2); background: var(--bg-2); padding: 1px 4px; border-radius: 4px; }
.tool-out { margin-top: 10px; }
.tool-out:empty { display: none; }
.check { display: grid; grid-template-columns: 18px auto 1fr; gap: 8px; font-size: 12.5px; padding: 3px 0; }

/* Ayarlar */
.settings-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.reset-box { display: inline-flex; gap: 6px; align-items: center; }
.reset-box input { width: 130px; }
.settings { display: grid; gap: 10px; }
.sgroup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sgroup summary { padding: 11px 14px; cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sgroup summary::-webkit-details-marker { display: none; }
.sgroup summary::after { content: '＋'; color: var(--muted); font-weight: 400; }
.sgroup[open] summary::after { content: '－'; }
.sgroup summary .n { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: auto; margin-right: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 4px 14px 14px; }
.field.wide { grid-column: 1 / -1; }
.field > label { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); }
.field .switch { display: inline-flex; justify-content: flex-start; gap: 8px; margin-top: 4px; }
.field.changed label { color: var(--warn); }
.field .help { color: var(--muted); font-size: 11.5px; margin-top: 4px; line-height: 1.4; }
.field .reset { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0; }
.field .reset:hover { color: var(--text); }
.field.hide { display: none; }
.save-bar { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; z-index: 40; display: flex; align-items: center; gap: 10px; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 10px 8px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s; max-width: calc(100vw - 24px); }
.save-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#saveMsg { font-size: 12.5px; }

/* Replay */
.replay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.replay-form label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.replay-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* Loglar */
.logs { font-size: 12px; line-height: 1.6; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; max-height: 75vh; overflow: auto; }
.logs div { white-space: pre-wrap; word-break: break-word; }
.logs .warn { color: var(--warn); }
.logs .error { color: var(--short); }
.logs .info { color: var(--text-2); }

/* Toast ve modal */
.toasts { position: fixed; right: 14px; top: calc(var(--top-h) + 10px); z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 28px)); }
.toast { background: var(--panel-3); border: 1px solid var(--line-2); border-left-width: 3px; padding: 10px 12px; border-radius: var(--radius-s); font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: toastIn .25s cubic-bezier(.2,.8,.2,1); }
.toast.ok { border-left-color: var(--long); }
.toast.error { border-left-color: var(--short); }
.toast.warn { border-left-color: var(--warn); }
.toast.info { border-left-color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.modal { position: fixed; inset: 0; background: rgba(5,8,12,.7); backdrop-filter: blur(4px); z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow: auto; }
.modal-box { position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; width: min(960px, 100%); }
.modal-box h3 { margin: 14px 0 6px; }
.modal-x { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }

/* ── Giriş sayfası ───────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, rgba(78,161,255,.12), transparent 60%), var(--bg); }
.login-box { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.login-box .brand { margin-bottom: 18px; font-size: 18px; }
.login-box .mark { width: 32px; height: 32px; }
.login-box p { color: var(--muted); margin: 0 0 16px; font-size: 13px; }
.login-box form { display: grid; gap: 12px; }
.login-box .err { min-height: 18px; font-size: 12.5px; }
.login-box .btn { padding: 11px; }

/* ── Mobil ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --top-h: 96px; }
  .top { grid-template-columns: auto 1fr auto; grid-template-rows: 48px 40px; gap: 0 8px; padding: 0 10px; align-content: start; }
  .live-ctl { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; border-radius: var(--radius-s); margin-bottom: 6px; }
  .live-ctl select { max-width: 60vw; }
  .top-right { display: flex; grid-column: 3; grid-row: 1; }
  #btnLogout { display: none; }
  .top .brand-name { display: none; }
  .engine { gap: 8px; }
  .engine-txt { display: none; }
  #btnRun { display: none; }
  .seg button { padding: 4px 10px; font-size: 12px; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(13,18,25,.94); backdrop-filter: blur(12px); z-index: 30; overflow-x: auto; }
  .nav button { flex: 1; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: 10px; width: auto; min-width: 0; justify-content: center; }
  .nav button i { width: auto; font-size: 17px; }
  main { padding: 12px 12px 86px; }
  .arena { grid-template-columns: 1fr; }
  .acard-head { align-items: flex-start; }
  .acard-head h3 { flex-wrap: wrap; row-gap: 2px; }
  .acard-head h3 .model { flex-basis: 100%; padding-left: 17px; }
  .vs { gap: 8px; }
  .side { padding: 9px 10px; }
  .side .eq { font-size: 20px; }
  .chart-wrap { height: 220px; }
  .panel { padding: 12px; }
  .save-bar { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .toasts { top: auto; bottom: calc(72px + env(safe-area-inset-bottom)); right: 10px; }
  .fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .ring { width: 40px; height: 40px; }
  .side .mini { font-size: 12px; gap: 3px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
