/* Scanner console — graphite + signal.
   Colour is data here: teal is interactive, green/red/amber only ever report
   a real outcome. Nothing decorative is coloured. */

:root {
  --ink:        #0f1519;
  --surface:    #18212a;
  --surface-2:  #1f2b35;
  --line:       #2b3a47;
  --line-soft:  #223039;
  --text:       #ccd8e2;
  --muted:      #7e909f;
  --accent:     #4cc4c0;
  --accent-dim: #2a6e6c;
  --pass:       #57b874;
  --fail:       #e26a6a;
  --warn:       #d9a441;

  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --r: 4px;
  --gap: 18px;
}

* { box-sizing: border-box; }

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

body.page {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

.mono { font-family: var(--mono); }
.is-hidden { display: none !important; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.link:hover { border-bottom-color: var(--accent); }
.link--quiet { color: var(--muted); border-bottom-color: transparent; font-family: var(--mono); font-size: 12px; }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- sign-in */
.page--gate { display: grid; place-items: center; padding: 24px; }

.gate { width: 100%; max-width: 460px; }
.gate__title {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  margin: 10px 0 12px;
  letter-spacing: -0.01em;
}
.gate__lede { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.gate__form { display: grid; gap: 14px; }

.help { margin-top: 28px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.help__summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.help__steps { color: var(--muted); font-size: 13px; padding-left: 18px; }

/* -------------------------------------------------------------- topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.topbar__brand { display: grid; gap: 2px; }
.topbar__user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }

/* -------------------------------------------------------------- layout */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 28px;
  padding: 26px 22px 60px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding: 20px 16px 48px; }
  .panel--form { position: static; }
}

.panel--form { position: sticky; top: 22px; }
.panel__title {
  font-size: 13px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

/* -------------------------------------------------------------- fields */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: 13px; font-weight: 500; }
.field__opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.field__hint { color: var(--muted); font-size: 12px; margin: 0; }
.field__input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  width: 100%;
}
.field__input--mono { font-family: var(--mono); font-size: 13px; }
.field__input::placeholder { color: #5c6d7a; }
.field__input:focus { border-color: var(--accent); outline: none; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.check input { margin-top: 3px; accent-color: var(--accent); }

.more { margin: 4px 0 16px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.more__summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.more__body { padding-top: 14px; }

/* ------------------------------------------------------------- buttons */
.btn {
  font: inherit;
  font-size: 13px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 16px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent-dim); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #eafcfb; font-weight: 500; }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #06201f; }
.btn--ghost { background: transparent; }
.btn--wide { width: 100%; }
.btn--sm { padding: 4px 10px; font-size: 12px; }

/* ------------------------------------------------------------ notices */
.notice {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding: 6px 0 6px 10px;
  margin: 12px 0 0;
}
.notice--error { color: var(--fail); border-left-color: var(--fail); }
.empty { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- runs */
.run {
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}
.run__head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.run__ident { flex: 1; min-width: 0; display: grid; gap: 2px; }
.run__key { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run__meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Signature: the status rail. It pulses only while work is actually happening. */
.run__rail { width: 3px; align-self: stretch; min-height: 30px; border-radius: 2px; background: var(--line); flex: none; }
.run--running .run__rail { background: var(--accent); animation: rail 1.1s ease-in-out infinite; }
.run--passed  .run__rail { background: var(--pass); }
.run--failed  .run__rail,
.run--error   .run__rail,
.run--timeout .run__rail { background: var(--fail); }
.run--cancelled .run__rail { background: var(--warn); }
@keyframes rail { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .run--running .run__rail { animation: none; } }

.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.run--running .badge { color: var(--accent); border-color: var(--accent-dim); }
.run--passed .badge { color: var(--pass); border-color: var(--pass); }
.run--failed .badge, .run--error .badge, .run--timeout .badge { color: var(--fail); border-color: var(--fail); }
.run--cancelled .badge { color: var(--warn); border-color: var(--warn); }

/* Signature: the gate band. The verdict takes the full width of the card. */
.gateband { padding: 14px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.gateband__verdict { margin: 0 0 10px; font-size: 14px; font-weight: 500; }
.run--passed .gateband { box-shadow: inset 3px 0 0 var(--pass); }
.run--failed .gateband, .run--error .gateband, .run--timeout .gateband { box-shadow: inset 3px 0 0 var(--fail); }
.run--passed .gateband__verdict { color: var(--pass); }
.run--failed .gateband__verdict, .run--error .gateband__verdict, .run--timeout .gateband__verdict { color: var(--fail); }

.conds { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; margin-bottom: 10px; }
.conds td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.conds td:first-child { color: var(--text); }
.conds td:last-child { text-align: right; color: var(--fail); }

.log {
  margin: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  background: #0b1116;
  color: #9fb3c2;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ------------------------------------------------------ tabs + commands */
.tabs { display: flex; gap: 4px; margin: -6px 0 18px; border-bottom: 1px solid var(--line-soft); }
.tab {
  font: inherit;
  font-size: 13px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 7px 12px;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.field__hint--lede { margin-bottom: 18px; }

.cmd__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 6px;
}
.cmd { position: relative; }
.cmd__body {
  margin: 0;
  padding: 12px 62px 12px 13px;
  background: #0b1116;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: #9fb3c2;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.cmd__copy { position: absolute; top: 8px; right: 8px; }
.cmd__copy.is-done { color: var(--pass); border-color: var(--pass); }
