:root {
  --bg: #0f1117; --panel: #fff; --ink: #1a1d26; --muted: #6b7280;
  --line: #e5e7eb; --brand: #fe2c55; --brand2: #25f4ee; --ok: #16a34a;
  --warn: #d97706; --bad: #dc2626; --chip: #f3f4f6;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink); background: #f6f7f9; display: flex; min-height: 100vh; }

/* sidebar */
.sidebar { width: 230px; background: var(--bg); color: #cbd2e0; min-height: 100vh;
  display: flex; flex-direction: column; position: sticky; top: 0; }
.brand { font-size: 17px; font-weight: 700; color: #fff; padding: 20px 18px; letter-spacing: .2px; }
.brand span { background: linear-gradient(90deg, var(--brand), var(--brand2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
#nav { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
#nav button { background: none; border: 0; color: #aeb6c6; text-align: left;
  padding: 11px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; }
#nav button:hover { background: #1b1f2a; color: #fff; }
#nav button.active { background: var(--brand); color: #fff; }
.status-box { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #8b93a5;
  border-top: 1px solid #1b1f2a; }
.status-box code { color: #cbd2e0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--bad); }

/* main */
.main { flex: 1; padding: 26px 32px; max-width: 1200px; }
h1 { margin: 0 0 4px; font-size: 22px; }
h3 { margin: 0 0 12px; font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); margin-top: 16px; }
.grid2 .card { margin-top: 0; }

label { display: block; font-size: 12px; font-weight: 600; color: #374151;
  margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand2); border-color: transparent; }
textarea { resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > div { flex: 1; }
.checks { display: flex; gap: 18px; margin: 12px 0; }
.checks label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.checks input { width: auto; }

button.primary, .btn { display: inline-block; border: 0; border-radius: 8px; cursor: pointer;
  padding: 10px 16px; font: inherit; font-weight: 600; text-decoration: none; }
button.primary { background: var(--brand); color: #fff; margin-top: 14px; }
button.primary:hover { filter: brightness(1.05); }
.btn { background: var(--chip); color: var(--ink); border: 1px solid var(--line); }
.btn:hover { background: #e9ebef; }
.btn.danger { color: var(--bad); }
.api-hint { margin-top: 10px; font-size: 11px; color: var(--muted); }

.logs { background: #0b0e14; color: #9ce0a6; border-radius: 8px; padding: 12px;
  height: 360px; overflow: auto; white-space: pre-wrap; font-size: 12px;
  font-family: ui-monospace, Consolas, monospace; }
.results-head { display: flex; justify-content: space-between; align-items: center; }

.table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fafafa; position: sticky; top: 0; font-size: 12px; color: #4b5563; }
td.title { white-space: normal; max-width: 360px; }
tr:hover td { background: #fafafe; }
.pill { padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.run { background: #dbeafe; color: #1e40af; }
.pill.queued { background: #fef3c7; color: #92400e; }
.pill.failed { background: #fee2e2; color: #991b1b; }

.pill.deal { background: #fee2e2; color: #b91c1c; }
td.vcell { white-space: normal; max-width: 320px; }
details.variants summary { cursor: pointer; font-size: 12px; color: var(--brand); }
details.variants .vrow { padding: 3px 0 0; font-size: 12px; }
details.variants .vname { display: inline-block; min-width: 120px; color: #4b5563; }
details.variants s { color: var(--muted); }

ol.steps { margin: 6px 0 16px; padding-left: 22px; font-size: 13px; line-height: 1.6; }
ol.steps li { margin-bottom: 5px; }
#kalo-cookie-inline { margin: -4px 0 12px; font-size: 12px; }
#kalo-cookie-inline .btn { padding: 2px 8px; margin-left: 6px; }

code.pid { font-size: 11.5px; color: #4b5563; background: var(--chip); border-radius: 5px;
  padding: 2px 6px; cursor: pointer; }
code.pid:hover { background: #dbeafe; color: #1e40af; }

/* cookie gate — shown above a run form while its cookie is missing */
.cookie-gate { display: none; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.cookie-gate .btn { margin-left: 8px; padding: 4px 10px; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }

.sess-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sess-item small { color: var(--muted); }
.tag { display: inline-block; background: var(--chip); border-radius: 6px; padding: 1px 7px;
  margin: 2px 3px 0 0; font-size: 11px; }
.tag.bad { background: #fee2e2; color: #991b1b; }

.toast { position: fixed; bottom: 22px; right: 22px; background: #111827; color: #fff;
  padding: 12px 18px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.cfg-field { margin-bottom: 10px; }
.cfg-actions { margin-top: 12px; }
img.thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
a.pl { color: var(--brand); text-decoration: none; }

/* docs */
.doc { max-width: 900px; }
.doc h3 { margin-top: 4px; }
.doc p, .doc li, .doc td { color: #374151; }
.doc pre.code { position: relative; background: #0b0e14; color: #e6edf3;
  border-radius: 8px; padding: 14px; margin: 8px 0 18px; overflow: auto;
  font: 12.5px/1.55 ui-monospace, Consolas, monospace; white-space: pre; }
.doc .base { color: #25f4ee; }
.copybtn { position: absolute; top: 8px; right: 8px; background: #1f2937;
  color: #cbd5e1; border: 0; border-radius: 6px; padding: 4px 9px;
  font-size: 11px; cursor: pointer; }
.copybtn:hover { background: #374151; }
.endpoint { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
