:root {
  --bg: #f4f5f3;
  --card: #ffffff;
  --ink: #1b1f23;
  --muted: #6b7280;
  --line: #e2e5e1;
  --accent: #1f4e79;
  --pos: #1f7a4d;
  --neg: #b3372b;
  --warn: #9a6700;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { background: #f7f8f6; border: 1px solid var(--line); padding: 8px 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
header.top { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: #111827; color: #e5e7eb; }
header.top .brand { color: #fff; font-weight: 700; font-size: 16px; }
header.top nav { display: flex; gap: 14px; align-items: center; }
header.top nav a, header.top nav button.link { color: #cbd5e1; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
header.top nav a:hover, header.top nav button.link:hover { color: #fff; text-decoration: none; }
header.top .clock { margin-left: auto; color: #9ca3af; font-size: 12px; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 20px 40px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
h1 { font-size: 22px; margin: 6px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h1 code, h2 code { font-weight: 400; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 14px 0; }
.card-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.narrow { max-width: 360px; margin: 12vh auto; }
body.login { display: block; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #e5e7eb; color: #374151; text-transform: uppercase; letter-spacing: .03em; }
.badge.active, .badge.accepted, .badge.passed { background: #dcfce7; color: #166534; }
.badge.paused, .badge.noop { background: #fef3c7; color: #92400e; }
.badge.rejected, .badge.blown, .badge.archived { background: #fee2e2; color: #991b1b; }
.flash { padding: 8px 12px; border-radius: 6px; margin: 10px 0; border: 1px solid; }
.flash.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash.warn { background: #fffbeb; border-color: #fde68a; color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.kv td:first-child { color: var(--muted); width: 40%; }
table.kv.three td:nth-child(odd) { color: var(--muted); width: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.acct { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fbfbfa; }
.acct-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
svg.equity { display: block; margin: 4px 0 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
form.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; align-items: end; }
form.form-grid .wide, form.form-grid fieldset { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #374151; }
label.check { flex-direction: row; align-items: center; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; width: 100%; }
textarea.mono { width: 100%; }
button, a.button { font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; display: inline-block; }
button:hover, a.button:hover { filter: brightness(1.08); text-decoration: none; }
button.danger { background: #fff; color: var(--neg); border-color: var(--neg); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 18px; align-items: center; }
form.inline { display: inline; }
form.filters { display: flex; gap: 12px; align-items: end; margin-bottom: 12px; }
form.filters label { width: 200px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
details summary { cursor: pointer; color: var(--accent); }
pre.tg { font-size: 12px; }
.danger-zone { border-color: #fecaca; }
