/* The operator page and the Lab status line (Scout Lab PR 3). Tokens only —
   style.css defines them for light and both dark paths — so the page follows
   the app's theme without a palette of its own. Phone: the blocks stack. */

#operator-view { display: none; }
#app.view-operator #operator-view, .lab-shell #operator-view { display: flex; flex-direction: column; gap: 16px; padding: 24px; overflow-y: auto; min-height: 0; }

.op-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.op-top h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.op-top .op-refresh { margin-left: auto; }

.op-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.op-block { min-width: 0; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 14px; background: var(--card); color: var(--ink); }
#op-certification, #op-evidence, #op-attention { grid-column: 1 / -1; }
.op-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.op-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.op-head .op-open { margin-left: auto; }
.op-note, .op-dim { color: var(--ink-dim); font-size: 13px; }
.op-dim { margin: 0; }
.op-warn { color: var(--err); }
.op-mono, .op-block code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.op-big { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.op-foot { margin: 8px 0 0; color: var(--ink-dim); font-size: 12.5px; }

.op-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 8px; font-size: 13.5px; }
.op-kv dt { color: var(--ink-dim); }
.op-kv dd { margin: 0; overflow-wrap: anywhere; }

.op-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.op-list li { overflow-wrap: anywhere; }
.op-attn li { padding: 8px 10px; border: 1px solid var(--edge); border-radius: 10px; background: var(--card-2); }

.op-table-wrap { overflow-x: auto; }
.op-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.op-table th { text-align: left; font-weight: 600; color: var(--ink-dim); padding: 4px 8px 6px 0; border-bottom: 1px solid var(--edge); }
.op-table td { vertical-align: top; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--edge); }
.op-model + .op-model { margin-top: 4px; }
.op-reg { display: inline-block; padding: 0 6px; border-radius: 999px; border: 1px solid var(--edge-2); font-size: 11.5px; color: var(--ink-dim); }
.op-reg-certified { color: var(--sage); border-color: currentColor; }

.op-area { border-top: 1px solid var(--edge); padding: 6px 0; }
.op-area summary { cursor: pointer; font-size: 13.5px; }
.op-evidence { margin: 6px 0 0; font-size: 13px; }
.op-evidence dt { margin-top: 8px; }
.op-evidence dd { margin: 2px 0 0; color: var(--ink-dim); overflow-wrap: anywhere; }
.op-tag { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 1px solid currentColor; }
.op-tag-unverified { color: var(--honey); }
.op-tag-measured { color: var(--sage); }

/* The Lab line, where the certification controls were on the model list. */
.lab-line { padding: 8px 12px; font-size: 12.5px; color: var(--ink-dim); border-top: 1px solid var(--edge); }
.lab-line-open { color: var(--ink-dim); }

@media (max-width: 720px) {
  #app.view-operator #operator-view, .lab-shell #operator-view { padding: 16px; }
  .op-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .op-block, .op-area summary { transition: none; animation: none; }
}

/* Scout Lab's shell (lab.html): a bar of three places over the operator page. */
.lab-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); }
.lab-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 10px 16px; border-bottom: 1px solid var(--edge); background: var(--card); }
.lab-brand { font-weight: 600; margin-right: 10px; }
.lab-nav-item { padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink-dim); font: inherit; font-size: 14px; cursor: pointer; }
.lab-nav-item:hover { color: var(--ink); border-color: var(--edge); }
.lab-nav-item.active { color: var(--ink); border-color: var(--edge-2); }
.lab-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.lab-shell #operator-view[hidden] { display: none; }
.lab-key { max-width: 440px; margin: 48px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.lab-key[hidden] { display: none; }
.lab-key h1 { margin: 0; font-size: 22px; }
.lab-key-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-dim); }
.lab-key-row input { padding: 8px 10px; border: 1px solid var(--edge-2); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; }

/* Scout Lab's terminal (lab-terminal.js, PR 4): a monospace log over an input
   line. Tokens only, so light and both dark paths follow the app's theme; on a
   phone the buttons wrap under the input and the log takes what height is left. */
.term-view { display: flex; flex-direction: column; gap: 10px; padding: 24px; min-height: 0; flex: 1 1 auto; }
.term-view[hidden] { display: none; }
.term-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.term-top h1 { margin: 0; font-size: 22px; font-weight: 600; color: var(--ink); }
.term-msg { margin: 0; font-size: 13px; }
.term-msg[hidden], .term-start[hidden] { display: none; }
.term-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.term-out {
  flex: 1 1 auto; min-height: 240px; max-height: 70vh; margin: 0; padding: 12px 14px; overflow: auto;
  border: 1px solid var(--edge); border-radius: 12px; background: var(--card); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.term-in { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; }
.term-prompt { color: var(--ink-dim); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.term-line {
  flex: 1 1 260px; min-width: 0; padding: 8px 10px; border: 1px solid var(--edge-2); border-radius: 8px;
  background: var(--card); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
}
.term-line:disabled { opacity: .6; }
.term-in .ghost:disabled { opacity: .5; cursor: not-allowed; }
.term-clock { min-height: 1.2em; font-size: 12.5px; }
/* The one quiet line under the two Open buttons when Scout's computer is a target. */
.term-bill { margin: 0; font-size: 12.5px; }
.term-bill[hidden], .term-open-computer[hidden] { display: none; }

@media (max-width: 720px) {
  .term-view { padding: 16px; }
  .term-out { min-height: 180px; max-height: 55vh; font-size: 12.5px; }
  /* 16px stops iOS zooming the page when the input takes focus. */
  .term-line { flex-basis: 100%; font-size: 16px; }
}

/* Scout Lab's Results view (lab-results.js, PR 5): the run list, one run's
   tables, and the models compared. Tokens only, so light and both dark paths
   follow the app's theme. Figures use tabular numbers so a column of costs
   lines up. On a phone every table row stacks into a block of labelled values
   (each cell carries its column's name in data-label), so no table scrolls
   sideways under a thumb. Nothing here moves, so reduced motion has nothing
   to stop beyond the buttons' own transitions. */
.lr-view { display: flex; flex-direction: column; gap: 16px; padding: 24px; overflow-y: auto; min-height: 0; }
.lr-view[hidden] { display: none; }
.lr-body { display: flex; flex-direction: column; gap: 16px; }
.lr-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.lr-back[hidden] { display: none; }
.lr-sources { margin: 0; }
.lr-table td { font-variant-numeric: tabular-nums; }
.lr-table td:first-child { font-weight: 500; overflow-wrap: anywhere; }
.lr-open { text-align: left; font-weight: 600; }
.lr-verdict { font-weight: 600; }
.lr-v-pass { color: var(--sage); }
.lr-v-fail, .lr-v-error { color: var(--err); }
.lr-v-inconclusive, .lr-v-not-run { color: var(--honey); }
.lr-notrun li { overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .lr-view { padding: 16px; }
  .lr-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lr-table, .lr-table tbody, .lr-table tr, .lr-table td { display: block; width: 100%; }
  .lr-table tr { padding: 8px 0; border-bottom: 1px solid var(--edge); }
  .lr-table td { display: grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 8px; padding: 2px 0; border-bottom: 0; }
  .lr-table td::before { content: attr(data-label); color: var(--ink-dim); }
}

@media (prefers-reduced-motion: reduce) {
  .lr-view button { transition: none; }
}

/* Scout Lab's OpenUI try (openui-try.js). OpenUI's own stylesheet is global;
   its components render inside .oui-surface, and nothing here restyles Scout. */
.oui-form { display: flex; flex-direction: column; gap: 10px; }
.oui-label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; color: var(--ink); }
.oui-question { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 10px; background: var(--card); color: var(--ink); resize: vertical; }
.oui-run { align-self: flex-start; }
.oui-confirm { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.oui-confirm[hidden], .oui-msg[hidden], .oui-status[hidden], .oui-raw[hidden] { display: none; }
.oui-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .oui-grid { grid-template-columns: minmax(0, 1fr); } }
.oui-col { display: flex; flex-direction: column; gap: 10px; }
.oui-col-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.oui-col-body { min-width: 0; overflow-x: auto; }
.oui-surface { min-width: 0; }
.oui-raw { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; }
.oui-cost, .oui-total { font-variant-numeric: tabular-nums; }
.oui-total { margin: 0; font-weight: 600; color: var(--ink); }
.oui-toggle { align-self: flex-start; }
.oui-past-item { text-align: left; overflow-wrap: anywhere; }
