/* V-CORTEX SELECT (public/cortex.js). Uses the app's theme tokens so every theme works; Cortex accent is a neon violet. */
#panel-cortex { --cx-acc: #a78bfa; --cx-acc-2: #22d3ee; --cx-tint: rgba(167, 139, 250, 0.12); --cx-glow: 0 0 0 1px rgba(167, 139, 250, .35), 0 8px 28px rgba(124, 58, 237, .18); }
#cxBox { max-width: 860px; margin: 0 auto; }
.cx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin: -4px 0 12px; border-radius: 16px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); box-shadow: var(--card-shadow); position: relative; overflow: hidden; }
.cx-head::after { content: ''; position: absolute; inset: auto -20% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(167, 139, 250, .18), transparent); pointer-events: none; }
.cx-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--cx-acc); background: var(--cx-tint); flex: none; box-shadow: var(--cx-glow); }
.cx-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 22px; letter-spacing: .05em; line-height: 1; color: var(--ink);
  background: linear-gradient(90deg, var(--ink), var(--cx-acc)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cx-sub { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin-top: 3px; }
.cx-shadow { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .1em; padding: 6px 10px; border-radius: 999px; color: var(--cx-acc); background: var(--cx-tint); border: 1px solid rgba(167, 139, 250, .35); }

.cx-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.cx-kpi { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.cx-kpi-v { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.cx-kpi-v small { font-size: 15px; color: var(--ink-faint); }
.cx-kpi-l { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cx-tabs { display: flex; gap: 6px; margin-bottom: 12px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.cx-tab { flex: 1; padding: 9px 6px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-dim); font: 700 13px 'Barlow', sans-serif; cursor: pointer; }
.cx-tab.on { background: var(--cx-tint); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .4); }

.cx-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cx-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 16px; text-align: left; cursor: pointer; min-width: 0;
  background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); color: var(--ink); font-family: 'Barlow', sans-serif; transition: transform .12s, box-shadow .12s; }
.cx-card:active { transform: scale(.98); }
.cx-card.on { box-shadow: var(--cx-glow); border-color: var(--cx-acc); }
.cx-card.empty { opacity: .7; }
.cx-card-l { font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 800; letter-spacing: .08em; }
.cx-t-guvenli .cx-card-l, .cx-htier.cx-t-guvenli { color: var(--win); }
.cx-t-dengeli .cx-card-l, .cx-htier.cx-t-dengeli { color: var(--cx-acc-2); }
.cx-t-genis .cx-card-l, .cx-htier.cx-t-genis { color: var(--cx-acc); }
.cx-card-s { font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.cx-card-v { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cx-card-n { font-size: 11.5px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cx-dim { color: var(--ink-faint); }
.cx-card .cx-pill { margin-top: 4px; }

.cx-detail { border-radius: 16px; background: var(--surface); border: 1px solid var(--border); padding: 10px; margin-bottom: 10px; }
.cx-dsum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.cx-dsum div { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.cx-dsum small { display: block; font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-dsum b { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; }
.cx-leg { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 6px; }
.cx-leg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-dim); }
.cx-lg { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.cx-lgname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-lglogo { width: 16px; height: 16px; object-fit: contain; flex: none; }
.cx-flag { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; flex: none; }
.cx-time { flex: none; font-variant-numeric: tabular-nums; }
.cx-teams { display: flex; align-items: center; gap: 6px; margin: 7px 0; font-weight: 700; font-size: 14px; }
.cx-team { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.cx-team:last-child { justify-content: flex-end; text-align: right; flex-direction: row-reverse; }
.cx-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tlogo { width: 22px; height: 22px; object-fit: contain; flex: none; }
.cx-noimg { display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--ink-dim); font-size: 10px; font-weight: 800; }
.cx-vs { color: var(--ink-faint); flex: none; }
.cx-pickrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cx-pick { font-weight: 800; font-size: 12.5px; padding: 5px 9px; border-radius: 8px; background: var(--cx-tint); color: var(--ink); border: 1px solid rgba(167, 139, 250, .35); }
.cx-num { display: inline-flex; flex-direction: column; font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 16px; line-height: 1; padding: 0 4px; font-variant-numeric: tabular-nums; }
.cx-num small { font-family: 'Barlow', sans-serif; font-size: 9.5px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.cx-why { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 7px; font-size: 11.5px; color: var(--ink-dim); line-height: 1.35; }
.cx-why > span:last-child { flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-eng { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 3px 6px; border-radius: 6px; background: var(--surface-3); color: var(--ink-dim); white-space: nowrap; }
.cx-e-safe { color: var(--win); background: color-mix(in srgb, var(--win) 14%, transparent); }
.cx-e-value { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cx-e-expert { color: var(--cx-acc-2); background: rgba(34, 211, 238, .12); }
.cx-e-cons { color: var(--cx-acc); background: var(--cx-tint); }
.cx-e-port { color: var(--ink); background: linear-gradient(90deg, rgba(167, 139, 250, .25), rgba(34, 211, 238, .25)); }
.cx-foot, .cx-meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.4; }
.cx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 2px; }
.cx-disc { font-size: 11px; color: var(--ink-faint); margin: 10px 2px 4px; line-height: 1.4; }
.cx-note { padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-dim); font-size: 13px; margin-bottom: 10px; border: 1px dashed var(--border); }
.cx-none { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; margin-bottom: 10px; background: linear-gradient(135deg, var(--surface-2), var(--surface)); border: 1px solid var(--border); }
.cx-none b { font-size: 15px; }
.cx-none span { font-size: 12.5px; color: var(--ink-dim); }
.cx-none small { font-size: 11.5px; color: var(--ink-faint); }
.cx-sec { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); margin: 14px 2px 6px; }
.cx-sec small { font-family: 'Barlow', sans-serif; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; color: var(--ink-faint); }
.cx-box { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); padding: 8px 10px; }

.cx-pill { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.cx-won { color: var(--win); background: color-mix(in srgb, var(--win) 15%, transparent); }
.cx-lost { color: var(--loss); background: color-mix(in srgb, var(--loss) 15%, transparent); }
.cx-pend { color: var(--draw); background: color-mix(in srgb, var(--draw) 15%, transparent); }
.cx-void { color: var(--ink-dim); background: var(--surface-3); }

.cx-mini { font: 700 11.5px 'Barlow', sans-serif; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.cx-mini:disabled { opacity: .6; cursor: default; }
.cx-btn { font: 800 13px 'Barlow', sans-serif; padding: 10px 18px; border-radius: 11px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(90deg, #7c3aed, #06b6d4); }

.cx-recs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.cx-rec { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.cx-rec-l { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--ink-dim); }
.cx-rec b { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; }
.cx-rec small { font-size: 10.5px; color: var(--ink-faint); line-height: 1.3; }
.cx-hrow { border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 6px; overflow: hidden; }
.cx-hrow.on { border-color: var(--cx-acc); }
.cx-hrow .cx-detail { border: 0; border-radius: 0; margin: 0; padding-top: 0; }
.cx-hhead { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; background: transparent; color: var(--ink); font: 600 13px 'Barlow', sans-serif; cursor: pointer; text-align: left; }
.cx-hdate { color: var(--ink-dim); font-size: 12px; flex: none; min-width: 72px; }
.cx-htier { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; letter-spacing: .06em; flex: none; }
.cx-hinfo { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cx-erow { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cx-erow:last-of-type { border-bottom: 0; }
.cx-ename { grid-row: span 2; }
.cx-estat { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cx-estat b { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; }
.cx-estat small { font-size: 11px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-bar { position: relative; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: visible; }
.cx-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #22d3ee); }
.cx-bar em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); border-radius: 1px; }
.cx-byeng { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; font-size: 11px; color: var(--ink-faint); }
.cx-rel { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding: 6px 2px 0; }
.cx-relc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.cx-relb { position: relative; flex: 1; width: 100%; max-width: 30px; border-radius: 6px 6px 2px 2px; background: var(--surface-3); overflow: hidden; }
.cx-relb i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, #7c3aed, #22d3ee); }
.cx-relb em { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--ink); }
.cx-relc small { font-size: 10px; color: var(--ink-faint); }
.cx-wrow, .cx-mrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cx-wrow:last-child, .cx-mrow:last-child { border-bottom: 0; }
.cx-wrow small, .cx-mrow small { font-size: 11.5px; color: var(--ink-faint); }
.cx-mrow small { flex-basis: 100%; }
.cx-mv { font-weight: 800; font-variant-numeric: tabular-nums; }
.cx-ms { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-dim); }
.cx-ms-active { color: var(--win); background: color-mix(in srgb, var(--win) 15%, transparent); }
.cx-ms-rejected { color: var(--ink-faint); }

.cx-form .cx-box { display: flex; flex-direction: column; }
.cx-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--ink); }
.cx-f:last-child { border-bottom: 0; }
.cx-in { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cx-in input { width: 76px; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font: 700 14px 'Barlow', sans-serif; text-align: right; }
.cx-in input:focus { outline: none; border-color: var(--cx-acc); box-shadow: 0 0 0 2px var(--cx-tint); }
.cx-in em { font-style: normal; font-size: 11px; color: var(--ink-faint); min-width: 30px; }
.cx-tierset { padding: 6px 0 4px; border-bottom: 1px solid var(--border); }
.cx-tierset:last-child { border-bottom: 0; }
.cx-tierset > b { font-family: 'Barlow Condensed', sans-serif; letter-spacing: .06em; font-size: 14px; }
.cx-tierset > b small { font-family: 'Barlow', sans-serif; font-weight: 500; color: var(--ink-faint); letter-spacing: 0; }
.cx-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

@media (max-width: 520px) {
  .cx-head { padding: 10px 12px; }
  .cx-title { font-size: 18px; white-space: nowrap; }
  .cx-shadow { padding: 5px 8px; font-size: 9.5px; }
  .cx-card { padding: 10px 8px; }
  .cx-card-v { font-size: 24px; }
  .cx-card-l { font-size: 13px; letter-spacing: .05em; }
  .cx-kpi-v { font-size: 22px; }
  .cx-recs { grid-template-columns: 1fr; }
  .cx-rec { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
  .cx-dsum b { font-size: 17px; }
  .cx-teams { font-size: 13px; }
  .cx-erow { grid-template-columns: 86px 1fr; }
}
