/* Operator console: a work column of numbered steps beside a sticky Runs panel; teal for the tool, amber for test storage, red only for Move. */
:root {
  --bg: #f3f5f6;
  --surface: #ffffff;
  --sunken: #eef2f3;
  --ink: #15212b;
  --muted: #5a6875;
  --line: #d6dde2;
  --accent: #0b6a64;
  --accent-ink: #ffffff;
  --accent-soft: #dcefeb;
  --warn: #8a5300;
  --warn-soft: #f8ead2;
  --danger: #b42318;
  --danger-soft: #fbe4e1;
  --good: #1f7a3e;
  --good-soft: #def2e4;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1418; --surface: #151d23; --sunken: #10181d; --ink: #e4eaee; --muted: #9aa8b3; --line: #29343c;
    --accent: #4fc0b4; --accent-ink: #062320; --accent-soft: #0f2f2c;
    --warn: #e6a95a; --warn-soft: #33250f; --danger: #f2827a; --danger-soft: #3a1714; --good: #6fcf8f; --good-soft: #12301d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }

button, .button {
  font: inherit; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.ghost, .button.ghost { background: transparent; }
.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="text"], input[type="search"], input[type="number"], input[type="date"], select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 7px; min-height: 34px; padding: 0 9px; min-width: 0;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand strong { display: block; font-size: 16px; }
.brand span { color: var(--muted); font-size: 13px; }
.mark { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--accent) 0 50%, var(--accent-soft) 50% 100%); border: 1px solid var(--accent); }
.account { display: flex; gap: 12px; align-items: center; }
.who { text-align: right; }
.who strong { display: block; font-size: 14px; }
.who span { color: var(--muted); font-size: 12.5px; }

.notice { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); }

.welcome { display: grid; place-items: center; padding: 64px 16px; }
.welcome-card { max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.welcome-card h1 { font-size: 24px; }
.welcome-card p { color: var(--muted); }
.welcome-card .button { justify-self: start; }

.workspace { max-width: 1480px; margin: 0 auto; padding-block: 16px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); min-height: 40px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr) 420px; }
  .runs { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
}
.steps { display: grid; gap: 16px; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 14px; min-width: 0; align-content: start; }
.card > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card > header h2 { margin-right: auto; }
.step { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.hint { color: var(--muted); font-size: 14px; }
.status { color: var(--muted); font-size: 14px; min-height: 1.5em; }
.error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.drop { display: grid; gap: 2px; place-items: center; text-align: center; padding: 22px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--sunken); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop span { color: var(--muted); font-size: 13px; }

.file-info { display: grid; gap: 12px; }
.facts { margin: 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 4.5em minmax(0, 1fr); gap: 8px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; }
.pickers { display: flex; gap: 12px; flex-wrap: wrap; }
.pickers label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pickers select { min-width: 200px; max-width: 100%; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.filter { border: 1px solid var(--line); border-radius: 9px; padding: 10px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.filter.active { border-color: var(--accent); background: var(--accent-soft); }
.filter legend, .filter .name { font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.filter .name small { color: var(--muted); font-weight: 400; font-family: var(--mono); font-size: 11.5px; }
.filter .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.filter .pair input { width: 100%; }
.filter input[type="search"] { width: 100%; }
.choices { display: grid; gap: 2px; max-height: 150px; overflow: auto; }
.choices label { display: flex; gap: 6px; align-items: center; font-size: 13.5px; min-width: 0; }
.choices label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.choices label small { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }

.tally { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tally strong { color: var(--ink); }
.table-scroll { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 9px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th, .grid td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.grid th { position: sticky; top: 0; background: var(--sunken); font-weight: 600; color: var(--muted); z-index: 1; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid .path { font-family: var(--mono); font-size: 12.5px; }
.grid th.path-col, .grid td.path-col { background: var(--accent-soft); }
.grid.compact td { white-space: normal; overflow-wrap: anywhere; max-width: 260px; }
.grid tr:last-child td { border-bottom: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

.actions { display: grid; gap: 10px; }
.action { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: center; }
.action span { color: var(--muted); font-size: 14px; }
@media (max-width: 560px) { .action { grid-template-columns: minmax(0, 1fr); } }
.confirm { display: grid; gap: 10px; padding: 14px; border-radius: 10px; background: var(--danger-soft); }
.confirm label { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }

.run-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.run-list button { width: 100%; justify-content: space-between; text-align: left; font-weight: 500; padding: 8px 10px; min-height: 0; }
.run-list button[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.run-list .label { display: grid; min-width: 0; }
.run-list .label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.run-list .label small { color: var(--muted); font-size: 12px; }
.run-detail { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.run-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.run-message { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.pill.running, .pill.queued, .pill.stopping { background: var(--accent-soft); color: var(--accent); }
.pill.succeeded { background: var(--good-soft); color: var(--good); }
.pill.failed { background: var(--danger-soft); color: var(--danger); }
.pill.stopped, .pill.interrupted { background: var(--warn-soft); color: var(--warn); }
.progress { display: grid; gap: 4px; }
.bar { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s ease; }
.progress p { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.counts div { background: var(--sunken); border-radius: 8px; padding: 6px 9px; display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.counts dt { color: var(--muted); }
.counts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.counts .bad dd { color: var(--danger); }
.counts .ok dd { color: var(--good); }
.log summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.log pre { margin: 8px 0 0; max-height: 260px; overflow: auto; background: var(--sunken); border-radius: 8px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.results { display: grid; gap: 8px; }
.results label { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.search input { min-width: min(100%, 320px); }

@media (prefers-reduced-motion: reduce) { .bar span { transition: none; } }

.open-card { max-width: 920px; width: 100%; }
.open-card h1 { font-size: 22px; overflow-wrap: anywhere; }
.open-card code { overflow-wrap: anywhere; }
