:root {
  color-scheme: dark;
  --bg: #0d0d12; --panel: #15151d; --panel2: #1b1b25; --line: #2a2a37; --fg: #ececf3; --muted: #9a9aab;
  --accent: #8f7bff; --accent2: #6e54ff; --ok: #3ccf8e; --bad: #ff6b6b; --warn: #f5b84b;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: .86em; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }

.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(13,13,18,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 800; color: #fff; flex: none; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; font-size: .8rem; color: var(--muted); font-family: var(--mono); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.pill.live .dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(60,207,142,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(60,207,142,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,142,0); } }

main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 40px; }
section { margin-top: 34px; scroll-margin-top: 76px; }
.hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 26px 0 12px; letter-spacing: -.01em; }
.hero p { max-width: 820px; color: #cfcfdb; margin: 0 0 10px; }
.watch { font-size: .92rem; margin-top: 12px !important; }
.disclosure { font-size: .88rem; color: var(--muted) !important; border-left: 3px solid var(--accent2); padding-left: 12px; }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 1.3rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .82rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.card.empty { color: var(--muted); }
.card h3 { font-size: 1rem; margin-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--muted); min-width: 140px; }
.field.grow { flex: 1 1 160px; }
input, select { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: inherit; min-height: 42px; }
input:focus, select:focus { outline: 2px solid var(--accent2); outline-offset: 1px; }
.btn { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 16px; font: 600 .92rem system-ui, sans-serif; cursor: pointer; min-height: 42px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 5px 10px; min-height: 30px; font-size: .8rem; }

/* agent card */
.agent-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.agent-grid > div { min-width: 0; }
[hidden] { display: none !important; }
.verdict { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-weight: 700; font-size: .85rem; }
.badge.ok { background: rgba(60,207,142,.14); color: var(--ok); } .badge.bad { background: rgba(255,107,107,.13); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel2); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; } .stat span { font-size: .78rem; color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed; }
.kv td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; white-space: normal; }
.kv td:first-child { color: var(--muted); width: 38%; }
.kv a, .kv .mono { word-break: break-all; }
.bars { display: grid; gap: 6px; margin-top: 8px; }
.bar { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.bar i { display: block; height: 7px; border-radius: 4px; background: var(--panel2); overflow: hidden; }
.bar i::after { content: ""; display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.bar.neg i::after { background: var(--bad); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
#index tbody tr { cursor: pointer; } #index tbody tr:hover { background: var(--panel2); }
tr.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: rgba(143,123,255,.25); } to { background: transparent; } }
.status { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; }
.s-Open { background: rgba(245,184,75,.15); color: var(--warn); }
.s-Delivered { background: rgba(143,123,255,.18); color: var(--accent); }
.s-Released { background: rgba(60,207,142,.14); color: var(--ok); }
.s-Refunded, .s-Disputed { background: rgba(255,107,107,.13); color: var(--bad); }
.s-Cancelled { background: rgba(154,154,171,.14); color: var(--muted); }
.jobref { font-family: var(--mono); font-size: .84rem; font-weight: 600; color: var(--fg); }
.jobref.v2 { color: var(--accent); }
tr.sep td { white-space: normal; background: var(--panel2); color: var(--muted); font-size: .8rem; padding: 7px 12px; }
.txs a { margin-right: 8px; font-family: var(--mono); font-size: .8rem; }
.contracts td:first-child { color: var(--muted); }
.contracts td:last-child { white-space: normal; } .contracts .mono { word-break: break-all; }

/* hire */
.hire { display: grid; grid-template-columns: 250px 1fr; gap: 16px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: s; position: relative; padding: 11px 12px 11px 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 11px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--panel2); color: var(--muted); }
.steps li b { display: block; font-size: .92rem; } .steps li span { font-size: .78rem; color: var(--muted); }
.steps li.active { border-color: var(--accent); } .steps li.active::before { background: var(--accent2); color: #fff; }
.steps li.done::before { content: "✓"; background: rgba(60,207,142,.2); color: var(--ok); }
.hire-body { display: grid; gap: 14px; min-width: 0; }
.presets { display: grid; gap: 10px; margin-bottom: 14px; }
.preset { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: var(--panel2); }
.preset:has(input:checked) { border-color: var(--accent); }
.preset input { min-height: 0; padding: 0; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent2); }
.preset b { font-size: .92rem; } .preset p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.preset .mono { color: var(--muted); font-size: .72rem; word-break: break-all; }
.log { font-family: var(--mono); font-size: .8rem; display: grid; gap: 6px; }
.log .line { display: grid; grid-template-columns: 62px 1fr; gap: 10px; word-break: break-word; }
.log .t { color: var(--muted); }
.log .big { font-family: system-ui, sans-serif; font-size: .95rem; padding: 8px 0; }
.wallet-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.deliverable { margin-top: 6px; }
.deliverable table { font-size: .8rem; } .deliverable td { padding: 5px 8px; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font-size: .88rem; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; }
#toast.show { opacity: 1; }
footer { max-width: 1120px; margin: 30px auto 0; padding: 20px 20px 40px; color: var(--muted); font-size: .84rem; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .agent-grid, .hire { grid-template-columns: minmax(0, 1fr); }
  .steps { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .steps li { min-width: 170px; }
}
@media (max-width: 560px) {
  .top { padding: 10px 12px; } .brand small { display: none; }
  .pill { display: none; }
  main { padding: 4px 14px 30px; }
  .row .btn { width: 100%; } .field { min-width: 0; flex: 1 1 100%; }
  .kv td:first-child { white-space: normal; width: 34%; word-break: normal; }
  .contracts td:first-child { white-space: normal; width: 34%; }
}
