/* New look (Sade + game-card logic): light, Geist, one surface, hairlines, colour only where it means something. */
:root {
  --bg: #ECEDF1;
  --paper: #FFFFFF;
  --soft: #F6F7F9;
  --chip: #F1F2F5;
  --ink: #0E1014;
  --ink2: #2A2E36;
  --muted: #5F6571;
  --faint: #8A909B;
  --line: #E3E5EA;
  --line2: #D5D8DE;
  --green: #12A672;
  --red: #D93A3F;
  --gold: #C77700;
  --blue: #2F4BFF;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.bar { display: flex; align-items: center; gap: 20px; padding: 18px 32px; font-size: 15px; color: var(--muted); }
.bar b { color: var(--ink); font-weight: 600; }
.bar .grow { flex: 1; }
.panel { background: var(--paper); border-radius: 24px; padding: 24px 26px; min-width: 0; }
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 500; font-size: 16px; cursor: pointer; background: var(--chip); color: var(--ink); white-space: nowrap; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.white { background: #fff; box-shadow: inset 0 0 0 1px var(--line2); }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1.5px #F0C4C5; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13.5px; background: var(--chip); color: var(--muted); }
.pill.dark { background: var(--ink); color: #fff; }
.pill.go { background: #E6F6EF; color: #0E7A52; }
.pill.bad { background: #FDECEA; color: #A7372D; }
.pill.ask { background: #FFF6E0; color: #8A5A00; }
.pill.run { background: #EEF1FF; color: #2A3FC4; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 99; font-size: 15px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.sq { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--role, var(--ink)); flex: none; }
.live { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); display: inline-block; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.seg-tabs { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 999px; }
.seg-tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); font-size: 15px; }
.seg-tabs button.on { background: var(--ink); color: #fff; }

/* ---------- agent definition card ---------- */
.tag { font: 500 11px var(--mono); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.t-kod { background: var(--ink); color: #fff; }
.t-tal { background: var(--chip); color: var(--muted); }
.t-sabit { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.t-own { background: #E5F4FB; color: #0B6E99; }
.def { display: flex; flex-direction: column; gap: 14px; }
.def-head { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 28px; align-items: end; }
.def-id { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.def-sq { width: 12px; height: 12px; border-radius: 4px; background: var(--role); }
.def-title { display: flex; align-items: baseline; gap: 16px; }
.def-title h2 { font-size: 48px; letter-spacing: -0.045em; }
.def-name { border: 0; background: transparent; font-size: 24px; color: var(--muted); letter-spacing: -0.02em; padding: 2px 0; min-width: 0; width: 260px; border-bottom: 1.5px dashed var(--line2); }
.def.show .def-name { border-bottom-color: transparent; }
.def-tag { margin: 0; font-size: 16px; color: var(--ink2); max-width: 60ch; line-height: 1.4; }
.def-legend { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.def-legend span:not(.tag) { margin-right: 8px; }
.def-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.def.nowatch .def-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.def-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.def-box { background: var(--paper); border-radius: 20px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.def-h { display: flex; align-items: baseline; gap: 10px; }
.def-h b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; flex: 1; }
.def-count { font: 500 12px var(--mono); color: var(--muted); }
.def textarea, .def input[type=text], .def .def-name { font-size: 16px; }
.def textarea { width: 100%; border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; background: var(--soft); resize: vertical; line-height: 1.45; min-height: 0; }
.def.show textarea { border-color: transparent; resize: none; field-sizing: content; }
.def textarea.is-empty { color: var(--faint); }
.def-box.never textarea { background: #FDF6F5; }
.def-io { display: grid; grid-template-columns: 50px 1fr; gap: 4px 10px; font-size: 14.5px; line-height: 1.4; }
.def-io span:nth-child(odd) { color: var(--muted); }
.def-fixed { display: grid; grid-template-columns: 50px 1fr; gap: 4px 10px; font-size: 13.5px; padding-top: 10px; border-top: 1px solid var(--line); }
.def-fixed span:nth-child(odd) { color: var(--muted); }
.def-fixed .mono { font-size: 12.5px; }
.segs { display: grid; gap: 5px; }
.segs.n2 { grid-template-columns: repeat(2, 1fr); }
.segs.n3 { grid-template-columns: repeat(3, 1fr); }
.segs.n5 { grid-template-columns: repeat(5, 1fr); }
.segs button { border: 0; border-radius: 10px; min-height: 42px; padding: 6px 8px; background: var(--chip); color: var(--muted); font-size: 14px; line-height: 1.2; cursor: pointer; }
.segs button.on { background: var(--ink); color: #fff; }
.def.show .segs button { cursor: default; }
.def-skills, .def-vibes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip2 { border: 0; border-radius: 999px; padding: 8px 13px; background: var(--chip); color: var(--muted); font-size: 14px; cursor: pointer; }
.chip2.on { background: var(--ink); color: #fff; }
.chip2.add { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line2); color: var(--ink); border: 0; }
.chip2:disabled { opacity: .4; cursor: not-allowed; }
.def.show .chip2 { cursor: default; }
.real, .rule2 { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 0; background: var(--soft); border-radius: 12px; padding: 10px 12px; cursor: pointer; width: 100%; }
.def.show .real, .def.show .rule2 { cursor: default; }
.tog { width: 36px; height: 20px; border-radius: 999px; background: var(--line2); position: relative; flex: none; margin-top: 2px; transition: background .15s; }
.tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.real.on .tog, .rule2.on .tog { background: var(--ink); }
.real.on .tog::after, .rule2.on .tog::after { transform: translateX(16px); }
.real-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.real-t b { font: 500 14px var(--mono); }
.real-t em, .rule2 em { font-style: normal; font-size: 12.5px; color: var(--muted); display: block; }
.real-t span { font-size: 13.5px; color: var(--ink2); }
.rule2 b { font-size: 15px; font-weight: 600; display: block; }
.def-rules { display: flex; flex-direction: column; gap: 6px; }
.def-locks { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; }
.def-pal { display: flex; gap: 8px; }
.sw { position: relative; width: 48px; height: 48px; border-radius: 12px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); cursor: pointer; display: grid; place-items: center; }
.sw.add { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line2); color: var(--muted); }
.sw input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.sw-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; font-size: 13px; line-height: 1; padding: 0; cursor: pointer; }
.def-cc { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cc-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--soft); position: relative; }
.cc-row b { font-size: 15px; }
.cc-row span { font-size: 14px; color: var(--muted); }
.cc-row.edit input, .cc-row.edit textarea { width: 100%; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: #fff; font-size: 15px; }
.cc-row.edit input { padding-right: 36px; font-weight: 600; }
.cc-x { position: absolute; top: 14px; right: 18px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line2); background: #fff; cursor: pointer; padding: 0; }
.def-watch { background: var(--paper); border-radius: 20px; padding: 18px 20px; gap: 0; }
.def-watch .def-h { margin-bottom: 8px; }
.def-watch .def-h span { font-size: 12.5px; }
.def-watch .w { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-top: 1px solid var(--line); }
.def-watch .w:first-of-type { border-top: 0; }
.def-watch .w b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.def-watch .w span { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 1100px) {
  .def-grid { grid-template-columns: 1fr 1fr; }
  .def-watch { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .def-head { grid-template-columns: 1fr; }
  .def-legend { flex-wrap: wrap; }
  .def-title { flex-direction: column; gap: 4px; }
  .def-title h2 { font-size: 34px; }
  .def-name { width: 100%; font-size: 20px; }
  .def-grid, .def.nowatch .def-grid { grid-template-columns: 1fr; }
}

/* ---------- A/B try-out panel (tryout.js) ---------- */
.try { display: flex; flex-direction: column; gap: 16px; }
.try-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.try-k { font-size: 15px; color: var(--muted); }
.try-q { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; max-width: 36ch; }
.try-in { font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; max-width: 560px; }
.try-in span { display: block; font-size: 12.5px; color: var(--faint); margin-bottom: 2px; }
.try-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.try-col { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.try-col header { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.try-who { font: 500 12.5px var(--mono); color: var(--faint); }
.try-col header b { font-size: 22px; letter-spacing: -0.02em; }
.try-body { display: flex; flex-direction: column; gap: 8px; min-height: 260px; }
.try-big { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.try-lab { font-size: 13px; color: var(--muted); margin-top: 6px; }
.try-list { margin: 0; padding-left: 20px; font-size: 16px; line-height: 1.45; }
.try-list.check { list-style: "✓  "; }
.try-text { font-size: 15.5px; line-height: 1.5; white-space: pre-wrap; color: var(--ink); max-height: 360px; overflow: hidden; }
.try-sw { display: flex; gap: 6px; }
.try-sw span { flex: 1; height: 56px; border-radius: 10px; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.try-sw em { position: absolute; bottom: -18px; left: 0; font: 400 11px var(--mono); font-style: normal; color: var(--faint); }
.try-sw + .try-text { margin-top: 18px; }
.try-frame { height: 440px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); position: relative; background: #fff; }
.try-frame iframe { border: 0; width: 200%; height: 200%; transform: scale(0.5); transform-origin: 0 0; position: absolute; inset: 0; }
.try-verdict { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.try-verdict.go { color: var(--green); }
.try-verdict.bad { color: var(--red); }
.try-verdict.ask { color: var(--gold); }
.try-verdict.ok { color: var(--muted); }
.try-scores div { display: grid; grid-template-columns: 150px 30px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; align-items: baseline; }
.try-scores i { font: 600 20px var(--mono); font-style: normal; }
.try-scores i.low { color: var(--red); }
.try-scores span { color: var(--muted); }
.try-flag { padding: 10px 12px; border-radius: 12px; font-size: 15px; }
.try-flag.bad { background: #fdecea; color: #a7372d; }
.try-flag.ask { background: #fff6e0; color: #8a5a00; }
.try-wait { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--muted); padding: 40px 0; }
.try-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.try-err { color: var(--red); }
.try-foot { display: flex; gap: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.try-empty { color: var(--muted); font-size: 18px; padding: 24px 0; }

/* Try-out with history (tryout.js) */
.try-head2 { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.try-smp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.try-desc { width: 100%; font-size: 14px; color: var(--muted); }
.try-cols.n1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.try-cols.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.try-cols.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.try-col.newest { box-shadow: 0 0 0 2px var(--ink); }
.try-col header { gap: 6px; }
.try-who { display: flex; justify-content: space-between; gap: 8px; }
.try-ch { display: flex; flex-wrap: wrap; gap: 4px; }
.try-ch span { font-size: 12.5px; background: #FFF6E0; color: #6B4A00; border-radius: 8px; padding: 3px 8px; }
.try-ch span.muted { background: transparent; color: var(--muted); padding: 3px 0; }
.try-text.sm { font-size: 14.5px; max-height: 160px; }
.try-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.try-chip { display: inline-flex; gap: 5px; align-items: baseline; background: var(--soft, #F3F4F6); border-radius: 10px; padding: 5px 9px; font-size: 13px; color: var(--muted); }
.try-chip b { font: 600 15px var(--mono); color: var(--ink); }
.try-fonts { display: flex; flex-wrap: wrap; gap: 6px; }
.try-fonts span { font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.try-more summary { font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 6px; }
.try-cols.n3 .try-verdict { font-size: 34px; }
.try-cols.n3 .try-scores div { grid-template-columns: 110px 24px 1fr; font-size: 13.5px; }
.try-cols.n3 .try-col { padding: 16px; }
.a-smp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tbox { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #FFF6E0; border-radius: 16px; padding: 12px 14px; margin: 10px 0; flex-wrap: wrap; }
.tbox b { display: block; font-size: 16px; }
.tbox .muted { font-size: 14px; }
.tbox-r { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Agents: cards on the left, the chosen agent's settings stacked in a scrolling pane on the right. */
.alay { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.alay.fill { height: calc(100dvh - var(--fill-top, 90px)); min-height: 520px; }
.rail { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.acard { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: var(--paper); border-radius: 18px; padding: 12px 14px 13px; border-left: 5px solid var(--role); transition: box-shadow .15s, transform .15s; }
.acard:hover { transform: translateX(2px); }
.acard:focus-visible { outline: 3px solid var(--role); outline-offset: 2px; }
.acard.on { box-shadow: inset 0 0 0 2px var(--role), 0 6px 18px rgba(14, 16, 20, .08); }
.acard.dim { opacity: .6; }
.ac-top { display: flex; align-items: center; gap: 10px; }
.ac-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--role); color: #fff; }
.ac-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ac-t b { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.ac-t em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.ac-st { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--soft, #F3F4F6); color: var(--muted); white-space: nowrap; }
.ac-st.now { background: var(--role); color: #fff; }
.ac-st.ok { background: #E6F6EF; color: #0E7A52; }
.ac-sum { font-size: 13.5px; line-height: 1.38; color: var(--ink2); }
.apane { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.ascroll { flex: 1; min-height: 0; overflow-y: auto; border-radius: 20px; scroll-behavior: auto; }
/* One column, top to bottom. */
.stacked .def-grid, .stacked .def.nowatch .def-grid { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.stacked .def-head { grid-template-columns: 1fr auto; }
.stacked .def-title h2 { font-size: 36px; }
.stacked .def-tag { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .alay, .alay.fill { grid-template-columns: 1fr; height: auto; }
  .rail { flex-direction: row; overflow-x: auto; }
  .acard { min-width: 220px; }
  .ascroll { overflow: visible; }
}
