/* ── Lead Finder ──────────────────────────────────────────────
   Dashboard shell on an editorial light palette: warm paper
   ground, white cards, ink text, one vermillion signal.
   Instrument Serif for headings, Sora for chrome, JetBrains
   Mono for every value the actor will actually receive.
   Contrast is the point — nothing drops below AA.
   ─────────────────────────────────────────────────────────── */

:root {
  --paper:      #f2efe7;
  --panel:      #ffffff;
  --panel-alt:  #faf8f3;
  --line:       #ddd6c6;
  --line-soft:  #ebe5d8;

  --ink:        #17140f;   /* 18.4:1 on white */
  --dim:        #565146;   /*  7.9:1 */
  --faint:      #6f695c;   /*  5.5:1 */

  --signal:     #bc2e0e;   /*  5.9:1 */
  --signal-ink: #ffffff;
  --signal-soft:#fbeeea;
  --signal-line:#f0c9bd;
  --signal-deep:#8f2309;

  --good:       #2f6b45;
  --bad:        #b3261e;
  --amber:      #8a5a06;

  --display: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --ui: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r: 4px;
  --shadow: 0 1px 2px rgba(35, 28, 16, .05), 0 8px 22px -14px rgba(35, 28, 16, .2);
  --side-w: 264px;
}

* { box-sizing: border-box; }

/* Components below set an explicit display, which would otherwise beat the UA
   stylesheet's [hidden] rule and leave "hidden" elements on screen. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--signal); color: var(--signal-ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

svg { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── Sign-in gate ─────────────────────────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--paper);
}

.gate__card {
  width: min(400px, 100%);
  display: grid; gap: 14px;
  padding: clamp(26px, 4vw, 38px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  animation: rise .6s cubic-bezier(.16, 1, .3, 1) both;
}

.gate__eyebrow, .card__num, .field__hint, .cost__label {
  font-family: var(--mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: .17em; text-transform: uppercase;
}

.gate__eyebrow { color: var(--signal); margin: 0; }

.gate__title, .side__name {
  font-family: var(--display); font-weight: 400;
  letter-spacing: -.015em; line-height: .95; margin: 0;
}

.gate__title { font-size: clamp(44px, 8vw, 60px); }
.gate__title em, .side__name em { font-style: italic; color: var(--signal); }
.gate__note { color: var(--dim); font-size: 14px; margin: 0 0 4px; }
.gate__error { color: var(--bad); font-size: 13px; min-height: 1.2em; margin: 0; font-weight: 500; }

/* ── Shell ────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 4px; }

.side__mark {
  width: 30px; height: 30px; flex: none;
  color: var(--signal);
  display: grid; place-items: center;
}
.side__mark svg { width: 100%; height: 100%; }
.side__name { font-size: 25px; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; }

.nav__label {
  margin: 16px 8px 6px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .19em; text-transform: uppercase; color: var(--faint);
}
.nav__label:first-child { margin-top: 0; }

.nav__item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 9px 10px;
  background: none; border: 0;
  border-radius: var(--r);
  color: var(--dim);
  font-family: var(--ui); font-size: 14.5px; text-align: left;
  cursor: pointer;
  transition: background .16s, color .16s;
}

.nav__item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav__item:hover { background: var(--panel-alt); color: var(--ink); }

.nav__item.is-active {
  background: var(--signal-soft);
  color: var(--signal-deep);
  font-weight: 500;
}
.nav__item.is-active svg { opacity: 1; color: var(--signal); }

.nav__badge {
  margin-left: auto;
  font-family: var(--mono); font-size: 10.5px; font-style: normal;
  color: var(--faint);
  background: var(--panel-alt);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  padding: 1px 7px;
}

.side__status { display: grid; gap: 6px; padding: 0 2px; }

.statchip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--panel-alt);
  color: var(--dim);
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .08em;
}

.statchip::before {
  content: ''; width: 6px; height: 6px; flex: none;
  border-radius: 50%; background: var(--good);
}
.statchip--off { color: var(--faint); }
.statchip--off::before { background: var(--faint); }

.side__foot { display: grid; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.side__legal { margin: 0; font-size: 11px; line-height: 1.5; color: var(--faint); }

.side__scrim {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(23, 20, 15, .38);
  animation: fade .2s ease both;
}

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.linkbtn {
  background: none; border: 0; padding: 0;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.linkbtn:hover { color: var(--signal); border-bottom-color: var(--signal); }
.linkbtn--right { margin-left: auto; }
.linkbtn--bad:hover { color: var(--bad); border-bottom-color: var(--bad); }

/* ── Main column ──────────────────────────────────────────── */

.main { min-width: 0; padding: 0 clamp(16px, 2.4vw, 32px) 56px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0 18px;
  margin-bottom: 20px;
  background: linear-gradient(var(--paper) 78%, rgba(242, 239, 231, 0));
  border-bottom: 1px solid var(--line);
}

.topbar__burger {
  display: none;
  width: 38px; height: 38px; flex: none;
  align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--ink); cursor: pointer;
}
.topbar__burger svg { width: 18px; height: 18px; }

.topbar__titles { min-width: 0; }

.topbar__title {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(26px, 3vw, 34px); line-height: 1.1;
  letter-spacing: -.015em;
}

.topbar__crumb { margin: 2px 0 0; font-size: 13.5px; color: var(--dim); }
.topbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ── Stat cards ───────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.statcard {
  display: grid; gap: 5px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  animation: rise .6s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--d, 0ms);
}

.statcard__val {
  font-family: var(--display); font-size: 34px; line-height: 1;
  letter-spacing: -.015em; color: var(--ink);
}
.statcard__val--signal { color: var(--signal); }

.statcard__key {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .15em; text-transform: uppercase; color: var(--faint);
}

.statcard__sub { font-size: 12px; color: var(--dim); }

/* ── Views & cards ────────────────────────────────────────── */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.cols--runs { grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); }
.col { display: grid; gap: 18px; min-width: 0; }
.col--watch { position: sticky; top: 104px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: clamp(17px, 2vw, 24px);
  min-width: 0;
  animation: rise .6s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--d, 0ms);
}

.card__head {
  display: flex; align-items: baseline; gap: 11px;
  padding-bottom: 13px; margin-bottom: 17px;
  border-bottom: 1px solid var(--line-soft);
}

.card__num { color: var(--signal); }

.card__title {
  font-family: var(--display); font-weight: 400;
  font-size: 23px; letter-spacing: -.01em; margin: 0;
}

.card__meta {
  margin-left: auto;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
}

.card__lede { margin: -6px 0 16px; font-size: 13.5px; color: var(--dim); line-height: 1.55; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Ask ──────────────────────────────────────────────────── */

.ask { display: grid; gap: 12px; }

.ask__input {
  width: 100%; resize: vertical; min-height: 78px;
  padding: 13px 15px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--display); font-size: 21px; line-height: 1.35;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.ask__input::placeholder { color: var(--faint); font-style: italic; }
.ask__input:focus {
  outline: none; background: var(--panel);
  border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft);
}

.ask__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ask__examples { display: flex; gap: 6px; flex-wrap: wrap; }

.example {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 100px; padding: 5px 12px;
  color: var(--dim); font-family: var(--ui); font-size: 12.5px;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.example:hover { color: var(--signal); border-color: var(--signal); background: var(--signal-soft); }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 17px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s, transform .12s, box-shadow .18s;
}

.btn:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost:hover:not(:disabled) { color: var(--signal); border-color: var(--signal); background: var(--signal-soft); }

.btn--go {
  background: var(--signal); border-color: var(--signal);
  color: var(--signal-ink); font-weight: 700;
}
.btn--go:hover:not(:disabled) {
  background: #a52709; border-color: #a52709;
  box-shadow: 0 6px 18px -6px rgba(188, 46, 14, .5);
}

.btn--big { padding: 13px 30px; font-size: 12px; }

.spinner {
  display: none; width: 12px; height: 12px;
  border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.btn.is-busy .spinner { display: block; }
.btn.is-busy { pointer-events: none; opacity: .75; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fields ───────────────────────────────────────────────── */

.fields { display: grid; gap: 15px; }
.fields--advanced { margin-top: 15px; padding-top: 17px; border-top: 1px dashed var(--line); }
.fieldgroup { display: grid; gap: 11px; }

.fieldgroup__label {
  margin: 0;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .19em; text-transform: uppercase; color: var(--faint);
}
.fieldgroup__label::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.fieldrow { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; min-width: 0; }

.field__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--dim);
}
.field__hint { color: var(--faint); font-weight: 500; }
.field.is-filled .field__label { color: var(--ink); }

/* The moment the model fills a field, it flashes — that's the whole thesis. */
.field.just-set > .js-control { animation: flash 1s cubic-bezier(.16, 1, .3, 1); }

@keyframes flash {
  0%   { box-shadow: 0 0 0 0 rgba(188, 46, 14, .45); border-color: var(--signal); }
  100% { box-shadow: 0 0 0 10px rgba(188, 46, 14, 0); }
}

.control {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 42px; padding: 5px 8px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: text;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.control:focus-within {
  background: var(--panel);
  border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft);
}

.control__input {
  flex: 1 1 90px; min-width: 70px;
  background: none; border: 0; outline: none;
  color: var(--ink); font-family: var(--mono); font-size: 12.5px;
  padding: 5px 3px;
}
.control__input::placeholder { color: var(--faint); font-family: var(--ui); font-size: 12.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 9px;
  background: var(--signal-soft);
  border: 1px solid var(--signal-line);
  border-radius: 3px;
  color: var(--signal-deep);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; line-height: 1.35;
  animation: pop .3s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: var(--cd, 0ms);
}

@keyframes pop {
  from { opacity: 0; transform: scale(.88) translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

.chip--neg {
  background: #f3f1ec; border-color: var(--line); color: var(--dim);
  text-decoration: line-through; text-decoration-color: var(--faint);
}

.chip__x {
  background: none; border: 0; padding: 0;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  color: var(--faint); cursor: pointer;
  font-size: 15px; line-height: 1; border-radius: 2px;
  transition: color .15s, background .15s;
}
.chip__x:hover { color: #fff; background: var(--bad); }

.menu {
  position: absolute; top: calc(100% + 5px); left: -1px; right: -1px; z-index: 60;
  max-height: 264px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 16px 40px -12px rgba(35, 28, 16, .3);
  padding: 4px;
}

.menu__opt {
  /* Block, not flex — an option is built from several text nodes around the
     highlighted match, and space-between would fling them to opposite edges. */
  display: block; width: 100%; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 8px 9px;
  background: none; border: 0; border-radius: 2px;
  color: var(--dim); font-family: var(--mono); font-size: 12px; cursor: pointer;
}
.menu__opt:hover, .menu__opt.is-active { background: var(--signal-soft); color: var(--ink); }
.menu__opt mark { background: none; color: var(--signal); font-weight: 700; }
.menu__empty { padding: 12px 10px; color: var(--faint); font-size: 13px; font-family: var(--ui); }

.menu__more {
  padding: 8px 10px; margin-top: 3px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
}

.select {
  width: 100%; height: 42px;
  padding: 0 34px 0 11px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink); font-family: var(--mono); font-size: 12.5px;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236f695c' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }

input[type="password"], input[type="text"], input[type="number"] {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink); font-family: var(--mono); font-size: 13px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

input[type="password"]:focus, input[type="text"]:focus, input[type="number"]:focus {
  outline: none; background: var(--panel);
  border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft);
}

.disclosure {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 15px; padding: 0;
  background: none; border: 0;
  color: var(--faint);
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  transition: color .18s;
}
.disclosure:hover { color: var(--signal); }

.disclosure__caret {
  width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.disclosure[aria-expanded="true"] .disclosure__caret { transform: rotate(90deg); }

/* ── Radio group ──────────────────────────────────────────── */

.radios { display: grid; gap: 8px; }

.radio {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-alt);
  cursor: pointer;
  transition: border-color .16s, background .16s;
}

.radio:hover { border-color: var(--faint); }
.radio input { position: absolute; opacity: 0; width: 0; height: 0; }

.radio__dot {
  flex: none; width: 16px; height: 16px; margin-top: 2px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--panel);
  display: grid; place-items: center;
  transition: border-color .16s;
}

.radio__dot::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); transform: scale(0);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1);
}

.radio input:checked ~ .radio__dot { border-color: var(--signal); }
.radio input:checked ~ .radio__dot::after { transform: scale(1); }
.radio:has(input:checked) { border-color: var(--signal); background: var(--signal-soft); }
.radio input:focus-visible ~ .radio__dot { outline: 2px solid var(--signal); outline-offset: 2px; }

.radio--off { opacity: .5; cursor: not-allowed; }
.radio--off:hover { border-color: var(--line); }

.radio__body { display: grid; gap: 2px; }
.radio__name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.radio__note { font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* ── Run bar ──────────────────────────────────────────────── */

.runbar { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.countfield { display: grid; gap: 5px; width: 118px; }
.countfield__label { font-size: 13px; font-weight: 500; color: var(--dim); }
.cost { display: grid; gap: 2px; margin-right: auto; }
.cost__val { font-family: var(--display); font-size: 31px; line-height: 1; color: var(--ink); }
.cost__label { color: var(--faint); }

/* ── Notes ────────────────────────────────────────────────── */

.note {
  margin: 0; padding: 12px 14px;
  border-left: 3px solid var(--signal);
  background: var(--signal-soft);
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13.5px; line-height: 1.55; color: var(--ink);
  animation: rise .4s cubic-bezier(.16, 1, .3, 1) both;
}

.note--bad { border-left-color: var(--bad); background: #fdeeed; }
.note--warn { border-left-color: var(--amber); background: #fdf4e3; }
.note ul { margin: 8px 0 0; padding-left: 18px; color: var(--dim); font-size: 13px; }
.note li { margin-bottom: 4px; }

.note__head {
  display: block; margin-bottom: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
}

/* ── Live run ─────────────────────────────────────────────── */

.live { display: grid; grid-template-columns: minmax(0, 1fr); gap: 17px; }

.empty { display: grid; gap: 5px; justify-items: center; padding: 40px 10px; text-align: center; }
.empty p { margin: 0; color: var(--faint); font-size: 14px; }
.empty__hint { font-size: 12.5px !important; }
.empty__glyph { width: 58px; color: var(--line); margin-bottom: 10px; }
.empty__glyph svg { width: 100%; height: auto; stroke-width: 1.2; }

.runhead { display: flex; align-items: baseline; gap: 11px; flex-wrap: wrap; }

.runhead__label {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--ink); word-break: break-all;
}

.badge {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px; border: 1px solid currentColor;
}

.badge--running { color: var(--signal); background: var(--signal-soft); }
.badge--succeeded { color: var(--good); background: #eef6f0; }
.badge--failed, .badge--aborted { color: var(--bad); background: #fdeeed; }
.badge--queued, .badge--aborting { color: var(--amber); background: #fdf4e3; }

.stage { margin: 0; font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

.progress { height: 6px; background: var(--line-soft); border-radius: 100px; overflow: hidden; }

.progress__bar {
  height: 100%; background: var(--signal); border-radius: 100px;
  transition: width .5s cubic-bezier(.16, 1, .3, 1);
}

.progress.is-live .progress__bar {
  background-image: linear-gradient(100deg,
    rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .55) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 46px 100%;
  animation: sweep 1.1s linear infinite;
}

@keyframes sweep { to { background-position: 46px 0; } }
.progress.is-indeterminate .progress__bar { opacity: .4; }

.stats--inline {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 1px; margin: 0;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  overflow: hidden;
}

.stats--inline .statcard {
  border: 0; border-radius: 0; box-shadow: none; padding: 13px 14px; animation: none;
}
.stats--inline .statcard__val { font-size: 27px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tablewrap {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: auto;
  max-height: 390px;
}
.tablewrap--tall { max-height: min(58vh, 620px); }

table { border-collapse: collapse; width: 100%; font-size: 12.5px; }

thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--panel-alt); text-align: left;
  padding: 10px 12px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--faint);
  white-space: nowrap; border-bottom: 1px solid var(--line);
}

.th--check { width: 38px; }
th input[type="checkbox"], td input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--signal); cursor: pointer; }

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim); white-space: nowrap;
  max-width: 230px; overflow: hidden; text-overflow: ellipsis;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--signal-soft); color: var(--ink); }
tbody tr.is-picked td { background: var(--signal-soft); }
tbody td:first-child { color: var(--ink); }
tbody td.td--name { color: var(--ink); font-weight: 500; }
td.is-mono { font-family: var(--mono); font-size: 11.5px; }
td .yes { color: var(--good); font-weight: 700; }

.tablefoot {
  margin: 0;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .09em;
  color: var(--faint); text-transform: uppercase;
}

/* ── Directory ────────────────────────────────────────────── */

.dirbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dirbar__search { flex: 1 1 260px; }
.dirbar__city { width: 190px; }

.dirsel {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--signal-soft);
  border: 1px solid var(--signal-line);
  border-radius: var(--r);
  animation: rise .3s cubic-bezier(.16, 1, .3, 1) both;
}

.dirsel__count {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--signal-deep); margin-right: auto;
}

.pager { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.pager__at {
  margin-right: auto;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  color: var(--faint); text-transform: uppercase;
}

/* ── History ──────────────────────────────────────────────── */

.history { list-style: none; margin: 0; padding: 0; display: grid; }

.history__item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 12px 8px;
  background: none; border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 2px solid transparent;
  text-align: left; cursor: pointer;
  color: var(--dim); font-family: var(--ui); font-size: 13.5px;
  transition: background .16s, border-color .16s, padding .16s;
}

.history__item:hover { background: var(--panel-alt); padding-left: 12px; }
.history__item.is-active {
  background: var(--signal-soft); border-left-color: var(--signal);
  color: var(--ink); padding-left: 12px;
}

.history__dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.history__name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 12px;
}

.history__count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.history__empty { color: var(--faint); font-size: 14px; padding: 10px 0; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1180px) {
  .cols, .cols--runs { grid-template-columns: 1fr; }
  .col--watch { position: static; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(var(--side-w), 84vw);
    height: 100dvh;
    transform: translateX(-101%);
    transition: transform .26s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 0 44px rgba(35, 28, 16, .2);
  }
  .side.is-open { transform: none; }
  .topbar__burger { display: inline-flex; }
}

@media (max-width: 560px) {
  .fieldrow { grid-template-columns: 1fr; }
  .dirbar__city { width: 100%; }
  .runbar { gap: 14px; }
  .cost { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
