/* ==========================================================================
   AI Arena — KINGO signals → AI decision → Normal vs Ters (mirror) accounts.
   Same flight-deck language as styles.css: violet = AI, cyan = Normal, dashed = Ters, dotted = Reddedilenler.
   ========================================================================== */
.rail button.ro { background: transparent; border: 0; border-right: 1px solid var(--line2); cursor: pointer; font-family: var(--display); }
.rail .ro.ai-on .v { color: var(--violet); } .rail .ro.ai-busy .v { color: var(--amber); } .rail .ro.ai-err .v { color: var(--coral); }
.ai-bar .ai-bar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-bar #ai-master-label { letter-spacing: .08em; font-size: 15px; }
.ai-warn { margin-top: 8px; padding: 6px 9px; border: 1px solid rgba(255,181,71,.45); background: var(--amber-bg); color: var(--amber); border-radius: var(--r2); font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.ai-subnav { display: flex; margin: 0 0 10px; border: 1px solid var(--line2); border-radius: var(--r); overflow-x: auto; background: rgba(10,16,32,.75); scrollbar-width: none; }
.ai-subnav::-webkit-scrollbar { display: none; }
.ai-subnav button { flex: 1 1 auto; background: transparent; border: 0; border-right: 1px solid var(--line2); color: var(--dim); padding: 8px 12px; font: 700 13px var(--display); letter-spacing: .06em; cursor: pointer; white-space: nowrap; }
.ai-subnav button:last-child { border-right: 0; }
.ai-subnav button.active { color: var(--cyan); background: var(--cyan-bg); box-shadow: inset 0 -2px 0 var(--cyan); }
.ai-sub { display: none; } .ai-sub.active { display: block; }
.ai-explain { margin: 0 2px 10px; line-height: 1.5; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r2); overflow: hidden; }
.seg button { background: transparent; border: 0; border-right: 1px solid var(--line2); color: var(--dim); padding: 3px 9px; font: 700 12px var(--display); cursor: pointer; }
.seg button:last-child { border-right: 0; } .seg button.active { color: var(--cyan); background: var(--cyan-bg); }

/* ---------- arena cards: Normal | mirror | Ters ---------- */
#ai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 10px; margin-bottom: 10px; }
.acard { --c: var(--cyan); position: relative; background: rgba(10,16,32,.9); border: 1px solid var(--line); border-top: 2px solid var(--c); border-radius: var(--r); padding: 10px 12px; }
.acard.off { opacity: .6; }
.acard.base { --c: #c8d3ea; }
.acard-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.acard-head h3 { margin: 0; font-size: 16px; letter-spacing: .06em; display: flex; align-items: center; gap: 7px; }
.acard-head .model { font: 500 11.5px var(--mono); color: var(--dim); }
.acard-head .grow { flex: 1; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--c); box-shadow: 0 0 8px var(--c); }
.vs { display: grid; grid-template-columns: 1fr 74px 1fr; gap: 8px; align-items: stretch; }
.sbox { background: rgba(15,24,41,.7); border: 1px solid var(--line); border-radius: var(--r2); padding: 8px 9px; min-width: 0; }
.sbox.inverse { border-style: dashed; }
.sbox.paused { border-color: rgba(255,92,122,.5); }
.sbox .sh { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.sbox .sh b { font-size: 13px; letter-spacing: .1em; }
.sbox .eq { font: 600 19px/1.15 var(--mono); margin: 3px 0 1px; }
.sbox .ret { font: 600 13px var(--mono); }
.sbox .kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin-top: 6px; font-size: 12px; }
.sbox .kv span { color: var(--dim); } .sbox .kv b { font: 500 12px var(--mono); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.vs-mid .lbl { font: 700 10px var(--display); letter-spacing: .2em; color: var(--dim); }
.tug { position: relative; width: 10px; height: 120px; background: var(--deck3); border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.tug::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 1px; background: var(--line3); }
.tug i { position: absolute; left: 0; right: 0; height: var(--h, 0); }
.tug i.up { bottom: 50%; background: linear-gradient(0deg, rgba(79,216,255,.25), var(--cyan)); }
.tug i.dn { top: 50%; background: linear-gradient(180deg, rgba(143,123,255,.25), var(--violet)); }
.vs-mid .txt { font: 600 11.5px/1.25 var(--display); color: var(--ink2); }
.acard .strip { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink2); }
.acard .strip span { white-space: nowrap; } .acard .strip em { font-style: normal; color: var(--dim); margin-right: 4px; }
.acard .strip b { font-family: var(--mono); font-weight: 500; }
.acard .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 7px; font-size: 11.5px; color: var(--dim); }
.acard .foot .grow { flex: 1; }
.verdict { margin-top: 8px; padding: 6px 9px; border-radius: var(--r2); font-size: 12.5px; background: rgba(21,33,58,.6); border-left: 3px solid var(--line3); }
.verdict.inverse { border-left-color: var(--violet); } .verdict.follow { border-left-color: var(--cyan); }
@media (max-width: 640px) {
  .vs { grid-template-columns: 1fr; }
  .vs-mid { flex-direction: row; } .tug { width: 100%; height: 10px; }
  .tug::after { left: 50%; right: auto; top: -3px; bottom: -3px; width: 1px; height: auto; }
  .tug i { height: auto; width: var(--h, 0); }
  .tug i.up { top: 0; bottom: 0; right: 50%; left: auto; background: linear-gradient(270deg, rgba(79,216,255,.25), var(--cyan)); }
  .tug i.dn { top: 0; bottom: 0; left: 50%; right: auto; background: linear-gradient(90deg, rgba(143,123,255,.25), var(--violet)); }
}

/* ---------- equity legend ---------- */
.ai-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: -2px 0 8px; font-size: 12px; }
.ai-legend label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink2); }
.ai-legend label.off { opacity: .4; }
.ai-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; }
.ai-legend i.dash { border-top-style: dashed; } .ai-legend i.dot { border-top-style: dotted; }
#ai-eq-chart { height: 280px; }

/* ---------- decisions ---------- */
.dec { display: inline-block; padding: 0 6px; border-radius: 3px; font: 700 11px/1.6 var(--display); letter-spacing: .05em; white-space: nowrap; background: var(--deck3); color: var(--ink2); }
.dec.enter { background: var(--mint-bg); color: var(--mint); box-shadow: inset 0 0 0 1px rgba(46,230,166,.35); }
.dec.skip { background: rgba(255,255,255,.05); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line2); }
.dec.close { background: var(--violet-bg); color: var(--violet); box-shadow: inset 0 0 0 1px rgba(143,123,255,.4); }
.dec.hold { background: var(--cyan-bg); color: var(--cyan); }
.dec.err { background: var(--coral-bg); color: var(--coral); }
.dec.pend { background: var(--amber-bg); color: var(--amber); }
.dec.dim { color: var(--dim); }
.tag-ai { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 3px; font: 700 10.5px/1.5 var(--display); letter-spacing: .05em; color: var(--violet); background: var(--violet-bg); box-shadow: inset 0 0 0 1px rgba(143,123,255,.4); vertical-align: middle; }
.acc-chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 13px; white-space: nowrap; }
.acc-chip i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.acc-chip i.inverse { background: transparent !important; border: 2px dashed; }
.acc-chip i.skipped { border-radius: 50%; opacity: .75; }
.reason { max-width: 440px; white-space: normal; font-family: var(--display); font-size: 12.5px; color: var(--ink2); line-height: 1.35; }

/* ---------- AI call log ---------- */
.ai-calls { display: flex; flex-direction: column; gap: 4px; max-height: 640px; overflow: auto; }
.call-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 9px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line3)); border-radius: var(--r2); background: rgba(15,24,41,.6); cursor: pointer; font-size: 12.5px; }
.call-row:hover { border-color: var(--line3); background: rgba(21,33,58,.7); }
.call-row .when { font: 500 12px var(--mono); color: var(--ink2); }
.call-row .pname { font-weight: 700; letter-spacing: .04em; }
.call-row .err { color: var(--coral); }
.call-row .decs { display: flex; flex-wrap: wrap; gap: 3px; }

/* ---------- AI accuracy ---------- */
.ai-eval-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 10px; }
.ai-eval { border: 1px solid var(--line); border-top: 2px solid var(--c, var(--line3)); border-radius: var(--r2); padding: 8px 10px; background: rgba(15,24,41,.55); }
.ai-eval h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.ai-eval .rows { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 12.5px; }
.ai-eval .rows span { color: var(--dim); } .ai-eval .rows b { font: 500 12.5px var(--mono); }
.ai-eval .note { margin-top: 6px; font-size: 12px; color: var(--ink2); line-height: 1.4; }

/* ---------- profile editor ---------- */
.pcard { --c: var(--cyan); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: var(--r); background: rgba(10,16,32,.9); padding: 10px 12px; margin-bottom: 10px; }
.pcard.off { opacity: .7; }
.pcard-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pcard-head .pname { font-size: 16px; font-weight: 700; letter-spacing: .05em; }
.pcard-head .grow { flex: 1; }
.color-dots { display: inline-flex; gap: 4px; }
.color-dots button { width: 16px; height: 16px; border-radius: 3px; border: 1px solid rgba(255,255,255,.15); cursor: pointer; padding: 0; }
.color-dots button.active { outline: 2px solid #fff; outline-offset: 1px; }
.pcard textarea { width: 100%; min-height: 200px; font: 12px/1.45 var(--mono); }
.pcard .ptabs { display: flex; gap: 6px; margin: 8px 0 6px; flex-wrap: wrap; align-items: center; }
.pcard .vars { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.pcard .vars code { color: var(--cyan); cursor: pointer; }
.pcard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.pcard .acts .grow { flex: 1; }
.badge.violet { background: var(--violet-bg); color: var(--violet); box-shadow: inset 0 0 0 1px rgba(143,123,255,.4); }

/* ---------- dialog + settings ---------- */
.dlg.wide { width: min(1100px, calc(100vw - 20px)); }
.dlg-scroll { overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 var(--mono); background: var(--deck); border: 1px solid var(--line); border-radius: var(--r2); padding: 9px 10px; max-height: 480px; overflow: auto; color: var(--ink2); margin: 0; }
.pre.short { max-height: 220px; }
.ai-sect { border: 1px solid var(--line); border-radius: var(--r2); padding: 8px 10px 10px; background: rgba(15,24,41,.45); margin-bottom: 10px; }
.ai-sect > h4 { margin: 0 0 4px; font-size: 14px; letter-spacing: .06em; }
.ai-sect > .ai-help { margin: 0 0 8px; line-height: 1.4; }
.ai-sect .bool-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 19px; }
.ai-sect .bool-field label.check { padding-top: 0; white-space: normal; font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 7px; }
.ai-sect .bool-field label.check input { margin: 0; flex: none; }
.ai-sect .bool-field .hint { margin: 0 0 0 22px; white-space: normal; }
.ai-sect textarea { width: 100%; min-height: 160px; font: 12px/1.45 var(--mono); }
.ai-sect .lock { color: var(--amber); font-size: 11px; }
