/* ═══════════════════════════════════════════════════════════════════════
   HERMES FIRE CONTROL — design system
   Dark mission-control: near-black slate, mono data readouts,
   amber = armed / staging, emerald = go / long, rose = no-go / short.
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg:        #07090d;
  --bg-raise:  #0c1016;
  --panel:     #11161f;
  --panel-2:   #161c27;
  --line:      #1d2430;
  --line-soft: #161c26;
  --text:      #d7dee8;
  --text-dim:  #8b95a5;
  --text-mute: #56607080;
  --mute:      #566070;

  --amber:   #fbbf24;
  --amber-d: #b45309;
  --green:   #34d399;
  --green-d: #065f46;
  --red:     #fb7185;
  --red-d:   #9f1239;
  --cyan:    #38bdf8;
  --violet:  #a78bfa;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r: 10px;
  --r-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-color: #2a3342 var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Faint engineering-grid backdrop */
body.desk-body {
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.018) 1px, transparent 1px);
  background-size: 36px 36px;
}

.mono   { font-family: var(--mono); }
.dim    { color: var(--text-dim); }
.right  { text-align: right; }
.up     { color: var(--green); }
.down   { color: var(--red); }
.flat   { color: var(--text-dim); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232b39; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── layout ─────────────────────────────────────────────────────────── */

.desk {
  max-width: 1640px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.section-label .lamp { width: 7px; height: 7px; border-radius: 50%; }

/* ── panels ─────────────────────────────────────────────────────────── */

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-raise) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}

.panel-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── system bar ─────────────────────────────────────────────────────── */

.sysbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 20px;
  margin: 0 -20px 4px;
  background: rgba(7, 9, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  color: #fff;
}
.brand .glyph {
  color: var(--amber);
  font-size: 13px;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}
.brand small {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--amber);
}

.sys-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.sys-item b { color: var(--text); font-weight: 600; }

.lamp {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mute);
  flex: none;
}
.lamp.ok    { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
.lamp.warn  { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.lamp.err   { background: var(--red);   box-shadow: 0 0 8px rgba(251, 113, 133, 0.8); }
.lamp.pulse { animation: lampPulse 2s ease-in-out infinite; }

@keyframes lampPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.sys-spacer { flex: 1; }

.sys-clock {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.05em;
}

.phase-chip {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.phase-chip.rth   { color: var(--green); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.07); }
.phase-chip.pre,
.phase-chip.after { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.07); }

.tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  text-transform: uppercase;
}
.tag-admin { color: var(--cyan); border-color: rgba(56,189,248,.4); }
.tag-user  { color: var(--text-dim); }
.tag-dry   { color: var(--amber); border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.06); }
.tag-live  { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.06); }
.tag-ver   { color: var(--violet); border-color: rgba(167,139,250,.4); }
.tag-router       { color: var(--dim);   border-color: rgba(148,163,184,.35); }

/* backtest parameter dials */
.bt-params { border: 1px solid #1d2430; border-radius: 4px; padding: 10px 12px; margin-top: 8px; }
.bt-params-note { font-size: 10.5px; margin-bottom: 10px; }
.bt-params-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}
.bt-param-group { display: flex; flex-direction: column; gap: 8px; }
.bt-param-group-name {
  font-size: 10px; letter-spacing: .12em; color: var(--violet);
  border-bottom: 1px solid #1d2430; padding-bottom: 3px;
}
.bt-param {
  border: 1px solid #1d2430; border-radius: 4px; padding: 7px 9px;
  display: flex; flex-direction: column; gap: 4px;
}
.bt-param.overridden { border-color: rgba(251,191,36,.55); background: rgba(251,191,36,.04); }
.bt-param-head { display: flex; align-items: baseline; gap: 8px; font-size: 11px; }
.bt-param-head .dim { margin-left: auto; font-size: 9.5px; }
.bt-param-ctl { display: flex; align-items: center; gap: 8px; }
.bt-param-ctl input[type="range"] { flex: 1; accent-color: var(--violet); min-width: 0; }
.bt-param-val { font-size: 11px; min-width: 52px; text-align: right; }
.bt-param-help { font-size: 9.5px; line-height: 1.45; }
.bt-param-clear {
  background: none; border: none; color: var(--amber); cursor: pointer;
  font: inherit; font-size: 12px; padding: 0 2px;
}
.bt-params-foot { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.bt-params-foot .bt-run-overrides { flex: 1; min-width: 280px; }
.bt-switch { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.bt-switch input { accent-color: var(--green); }

/* manual stop (blotter open rows) */
.btn-exit {
  background: transparent; color: var(--red);
  border: 1px solid rgba(248,113,113,.5); border-radius: 3px;
  font: inherit; font-size: 10px; letter-spacing: .08em;
  padding: 1px 8px; margin-left: 8px; cursor: pointer;
}
.btn-exit:hover { background: rgba(248,113,113,.12); }
.btn-exit.arm {
  background: var(--red); color: #0b0f17; font-weight: 700;
  animation: exit-arm-blink 0.6s step-start infinite;
}
.btn-exit.inflight { opacity: .6; cursor: wait; }
.exit-err { color: var(--red); font-weight: 700; margin-left: 4px; cursor: help; }
@keyframes exit-arm-blink { 50% { opacity: .65; } }
.router-trend     { color: var(--green); border-color: rgba(74,222,128,.45); }
.router-mixed     { color: var(--amber); border-color: rgba(251,191,36,.45); }
.router-chop      { color: var(--red);   border-color: rgba(248,113,113,.45); }

a.sys-link {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all .15s;
}
a.sys-link:hover { color: var(--text); border-color: #2c3648; }

/* ── fire-control grid ──────────────────────────────────────────────── */

.fc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 16px;
}

.fc-card {
  position: relative;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-raise) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0;
  overflow: hidden;
  transition: border-color .4s, box-shadow .4s;
}
.fc-card.armed {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 32px rgba(251, 191, 36, 0.07), inset 0 0 40px rgba(251, 191, 36, 0.02);
}
.fc-card.engaged {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.07), inset 0 0 40px rgba(56, 189, 248, 0.02);
}

.fc-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.fc-ticker {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
}
.fc-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.fc-vwap {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.fc-dist { font-family: var(--mono); font-size: 12px; font-weight: 600; }
.fc-mode {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--mute);
}
.fc-mode.scanning { color: var(--text-dim); }
.fc-mode.armed    { color: var(--amber); border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.08); animation: lampPulse 1.6s ease-in-out infinite; }
.fc-mode.engaged  { color: var(--cyan);  border-color: rgba(56,189,248,.5);  background: rgba(56,189,248,.08); }

.fc-body { padding: 14px 16px 16px; display: grid; gap: 14px; }

/* arming rail: NEUTRAL → BIASED → ARMED → FIRE */
.rail { display: flex; gap: 6px; }
.rail-seg {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 7px 0 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--mute);
  background: rgba(255, 255, 255, 0.012);
  position: relative;
  transition: all .3s;
}
.rail-seg.done   { color: var(--text-dim); border-color: #2a3342; background: rgba(255,255,255,.03); }
.rail-seg.active { color: #0b0e14; font-weight: 800; }
.rail-seg.active.s-neutral { color: var(--text-dim); border-color: #34405a; background: #1a2230; }
.rail-seg.active.s-biased  { background: linear-gradient(180deg, #67e8f9, #38bdf8); border-color: var(--cyan); box-shadow: 0 0 16px rgba(56,189,248,.35); }
.rail-seg.active.s-armed   { background: linear-gradient(180deg, #fde68a, #fbbf24); border-color: var(--amber); box-shadow: 0 0 18px rgba(251,191,36,.45); animation: lampPulse 1.4s ease-in-out infinite; }
.rail-seg.active.s-fire    { background: linear-gradient(180deg, #6ee7b7, #34d399); border-color: var(--green); box-shadow: 0 0 18px rgba(52,211,153,.5); }

/* conviction gauge */
.gauge { display: grid; gap: 5px; }
.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.gauge-labels b { color: var(--text); font-size: 12px; }
.gauge-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: #0a0e15;
  border: 1px solid var(--line);
  overflow: visible;
}
.gauge-fill {
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 0%;
  border-radius: 5px;
  background: linear-gradient(90deg, #1f2a3d, var(--cyan));
  transition: width .6s cubic-bezier(.4, 0, .2, 1), background .4s;
}
.gauge-fill.hot  { background: linear-gradient(90deg, #92610e, var(--amber)); box-shadow: 0 0 12px rgba(251,191,36,.45); }
.gauge-fill.over { background: linear-gradient(90deg, #065f46, var(--green)); box-shadow: 0 0 12px rgba(52,211,153,.5); }
.gauge-thr {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 2px;
  background: var(--red);
  box-shadow: 0 0 6px rgba(251, 113, 133, 0.8);
}
.gauge-thr::after {
  content: 'THR';
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.1em;
}

/* go / no-go gate lights */
.gates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gate {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.012);
}
.gate-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--mute);
}
.gate-val { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text); }
.gate-sub { font-family: var(--mono); font-size: 9px; color: var(--mute); }

/* engaged-mode strip */
.engage-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--r-sm);
  background: rgba(56, 189, 248, 0.04);
}
.engage-cell { display: grid; gap: 2px; }
.engage-cell .k {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mute);
}
.engage-cell .v { font-family: var(--mono); font-size: 13px; font-weight: 600; }

/* card sparkline */
.fc-spark { height: 190px; width: 100%; }
.fc-spark-empty {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.12em;
}

/* narrative line under the card */
.fc-narrative {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--line-soft);
  padding: 9px 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── log terminal ───────────────────────────────────────────────────── */

.term {
  background: #05070a;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.term-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-raise);
  border-bottom: 1px solid var(--line);
}
.term-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}
.term-head .spacer { flex: 1; }
.term-btn, .term-input, .term-select {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s;
}
.term-btn:hover { color: var(--text); border-color: #2c3648; }
.term-btn.active { color: var(--amber); border-color: rgba(251,191,36,.5); }
.term-input { cursor: text; width: 180px; }
.term-input:focus { outline: none; border-color: var(--cyan); color: var(--text); }

.term-body {
  height: 320px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
}
.log-line { display: flex; gap: 10px; white-space: pre-wrap; word-break: break-word; }
.log-ts   { color: var(--mute); flex: none; }
.log-lvl  { flex: none; width: 52px; font-weight: 700; }
.log-msg  { color: #aeb9c9; }
.lvl-INFO    .log-lvl { color: var(--cyan); }
.lvl-WARNING .log-lvl { color: var(--amber); }
.lvl-ERROR   .log-lvl, .lvl-CRITICAL .log-lvl { color: var(--red); }
.lvl-DEBUG   .log-lvl { color: var(--mute); }
.lvl-WARNING .log-msg { color: #e8d29a; }
.lvl-ERROR   .log-msg, .lvl-CRITICAL .log-msg { color: #f3b3bd; }
.log-line.hl-fire  .log-msg { color: var(--green); font-weight: 600; }
.log-line.hl-exit  .log-msg { color: var(--amber); font-weight: 600; }

/* ── P&L desk ───────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.seg button {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-right: 1px solid var(--line);
  padding: 6px 13px;
  cursor: pointer;
  transition: all .15s;
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: rgba(255,255,255,.03); }
.seg button.active {
  color: #0b0e14;
  background: linear-gradient(180deg, #fde68a, var(--amber));
  font-weight: 700;
}
.filter-bar select, .filter-bar input[type="date"] {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 9px;
  color-scheme: dark;
}
.filter-bar .spacer { flex: 1; }

.btn-ghost {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text); border-color: #2c3648; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.stat-card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-raise) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 15px;
  display: grid;
  gap: 4px;
}
.stat-k {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--mute);
  text-transform: uppercase;
}
.stat-v { font-family: var(--mono); font-size: 21px; font-weight: 700; color: var(--text); }
.stat-s { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }

.chart-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
}
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box { height: 300px; width: 100%; }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.pill {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.pill-long  { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.06); }
.pill-short { color: var(--red);   border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.06); }
.pill-ver   { color: var(--violet); border-color: rgba(167,139,250,.35); }
.pill-open  { color: var(--amber); border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.07); }

/* open trades pinned to the top of the blotter */
.row-open td { background: rgba(251,191,36,.03); }

/* ── backtest lab ───────────────────────────────────────────────────── */

.bt-row { cursor: pointer; }
.bt-row-active td { background: rgba(167,139,250,.06); }
.bt-row-active td:first-child { box-shadow: inset 2px 0 0 var(--violet); }
.pill-golden {
  color: var(--amber);
  border-color: rgba(251,191,36,.5);
  background: rgba(251,191,36,.08);
}
.bt-check { accent-color: var(--violet); cursor: pointer; }
.panel-title-flex { display: flex; align-items: center; gap: 8px; }
.panel-title-flex .spacer { flex: 1; }

/* new-run launcher */
.bt-run-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 0 4px;
}
.bt-run-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9.5px;
  letter-spacing: .08em;
  color: var(--dim);
}
.bt-run-form .term-input, .bt-run-form .term-select { width: 150px; }
.bt-run-form .bt-run-overrides { flex: 1; min-width: 260px; }
.bt-run-form .bt-run-overrides .term-input { width: 100%; }
#bt-run-go:disabled { opacity: .45; cursor: wait; }
.bt-job { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.bt-job-head { display: flex; align-items: center; gap: 10px; }
.bt-job-head .spacer { flex: 1; }
.bt-job-log {
  margin: 8px 0 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 10px;
  background: #0a0e14;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-word;
}

/* account strip */
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

/* generic buttons */
.btn-danger {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--red);
  background: rgba(251, 113, 133, 0.06);
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  cursor: pointer;
}
.btn-danger:hover { background: rgba(251, 113, 133, 0.14); }

/* flash messages */
.flash {
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}
.flash-err { color: var(--red);   background: rgba(251,113,133,.07); border: 1px solid rgba(251,113,133,.3); }
.flash-ok  { color: var(--green); background: rgba(52,211,153,.07);  border: 1px solid rgba(52,211,153,.3); }

/* ── auth pages ─────────────────────────────────────────────────────── */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(251, 191, 36, 0.05), transparent),
    linear-gradient(rgba(56, 189, 248, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-raise) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 36px 32px;
  display: grid;
  gap: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.auth-brand { text-align: center; display: grid; gap: 6px; }
.auth-glyph {
  font-size: 26px;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.8);
}
.auth-brand h1 {
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #fff;
}
.auth-brand h1 span { color: var(--amber); }
.auth-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: var(--mute);
}

.auth-form { display: grid; gap: 9px; }
.auth-form label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 6px;
}
.auth-form input {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  transition: border-color .15s;
}
.auth-form input:focus { outline: none; border-color: var(--amber); }
.auth-form button {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #0b0e14;
  background: linear-gradient(180deg, #fde68a, var(--amber));
  border: none;
  border-radius: var(--r-sm);
  padding: 11px;
  margin-top: 12px;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.auth-form button:hover { filter: brightness(1.08); }
.auth-form button:active { transform: scale(0.985); }

.auth-foot {
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.auth-foot a { color: var(--amber); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* admin */
.admin-wrap { max-width: 980px; margin: 40px auto; padding: 0 20px; display: grid; gap: 18px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; }
.admin-head h1 {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.2em;
  color: #fff;
}
.admin-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }

/* connection-lost banner */
.conn-banner {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--red);
  background: rgba(20, 8, 12, 0.95);
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: 999px;
  padding: 8px 18px;
  display: none;
}
.conn-banner.show { display: block; animation: lampPulse 1.6s ease-in-out infinite; }
