/* Operator console styling.
 *
 * Deliberately small and dependency-free. This is an internal tool for a
 * handful of people editing prose that shapes every recommendation the
 * product makes — legibility of the text being edited matters more than
 * anything visual around it.
 */

:root {
  color-scheme: light;

  /* Forest, fresh green and oversized type, shared with the customer app
   * (runmode/web/src/styles.css): white paper, forest ink, lime for actions, mint
   * for panels. Light only. */
  --bg: #ffffff;
  --panel: #edf2eb;
  --text: #14201c;
  --muted: #5b6b64;
  --border: #dfe6e0;
  --forest: #123a2f;
  --accent: #17553f;
  --accent-text: #ffffff;
  --lime: #c8f26a;
  --error: #c2412d;
  --error-bg: #fbeeeb;
  --ok: #2f8f5b;
  --info: #2b7a8f;
  --warn-bg: #fdf6dc;
  --warn-border: #ead68a;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--forest);
  color: #ffffff;
}

/* The wordmark, then the product area in the brand's mono label voice. */
.bar h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.bar h1 .area {
  margin-left: 0.6rem;
  color: var(--lime);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.panel h2 {
  margin: 0 0 0.35rem;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  color: var(--error);
}

/* ---------------------------------------------------------------- */
/* Archetype list                                                    */
/* ---------------------------------------------------------------- */

.list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
}

.card-name {
  font-weight: 600;
}

.card-key {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.card-note {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  flex: none;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* An archetype with no pack sections looks configured and would give an
 * agent nothing to work with. Say so on the card rather than making
 * someone notice a zero. */
.tag.empty {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--text);
}

/* A connection card is information, not a button: nothing opens. */
.card.static {
  cursor: default;
}

.card.static:hover {
  border-color: var(--border);
}

/* `needs_reauthorization` is the one state an operator cannot clear;
 * it gets the error colour so it is not read as "retrying". */
.tag.blocked {
  border-color: var(--error);
  color: var(--error);
}

.card-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--error);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------- */
/* Section editor                                                    */
/* ---------------------------------------------------------------- */

.section {
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.section-name {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

textarea {
  display: block;
  width: 100%;
  min-height: 14rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font-mono);
  resize: vertical;
}

textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--lime);
  border-radius: 999px;
  background: var(--lime);
  color: var(--forest);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.section-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.section-status.saved {
  color: var(--ok);
}

.section-status.failed {
  color: var(--error);
}

/* A conflict is not a transient error — someone else's edit is in the
 * file, and reloading is the only correct next step. It gets a block of
 * its own rather than a line of status text. */
.conflict {
  margin-top: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--error);
  border-radius: 6px;
  background: var(--error-bg);
  font-size: 0.9rem;
}

.dirty .section-name::after {
  content: " • unsaved";
  color: var(--muted);
  font-weight: 400;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: 26rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 6px 24px rgb(18 58 47 / 16%);
  font-size: 0.9rem;
}

.toast.bad {
  border-color: var(--error);
  color: var(--error);
}

/* ---------------------------------------------------------------- */
/* Decisions                                                         */
/* ---------------------------------------------------------------- */

.nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: 1rem;
}

.nav-link {
  background: none;
  border: 1px solid transparent;
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.75;
}

.nav-link:hover,
.nav-link:focus-visible {
  opacity: 1;
}

.nav-link.active {
  opacity: 1;
  border-color: currentColor;
}

.ask {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin: 1rem 0 0.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 18rem;
}

.field span {
  font-size: 0.85rem;
  opacity: 0.75;
}

.field select,
.field input {
  font: inherit;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(128, 128, 128, 0.45);
  background: transparent;
  color: inherit;
}

.field input:disabled,
.field select:disabled {
  opacity: 0.5;
}

/* The nine nodes. A list rather than a progress bar: during a
   seven-minute wait the useful question is which specialist is
   thinking, not what fraction is done. */
.stages {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.35rem;
}

.stages li {
  padding: 0.4rem 0.6rem;
  border-left: 3px solid rgba(128, 128, 128, 0.3);
  opacity: 0.55;
}

.stages li.done {
  opacity: 1;
  border-left-color: var(--ok);
}

.stages li.current {
  opacity: 1;
  border-left-color: var(--accent);
  font-weight: 600;
}

.checks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.checks li {
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--ok);
  font-size: 0.9rem;
}

.checks li.bad {
  border-left-color: var(--error);
}

/* The recommendation, above the verdict on it.
 *
 * `headline` is the only place in the console where a line is set larger
 * than body text: it is the answer to the question the operator asked,
 * and until 2026-09-17 this slot held the Verifier's verdict instead. */
.headline {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Residual risks and live objections. A neutral rule rather than the
 * green and red of `.checks` — these are not pass/fail, they are what
 * the recommendation is carrying with it. */
.risks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.risks li {
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--warn-border);
  background: var(--warn-bg);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}

/* The figures the recommendation rests on.
 *
 * Set apart from the prose above them because they are the one part of
 * the screen the model did not write: it named a calculation, our code
 * looked the number up. `compared` is a figure about an option the run
 * did *not* pick — the comparison, dimmed so it cannot be misread as the
 * recommendation's own. */
.cites {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.cites li {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.cites li.compared {
  border-left-color: var(--border);
}

.cite-figure {
  display: block;
  font-weight: 600;
}

.cite-option {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.cite-why {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
}

/* The expression the Verifier recomputes. Monospace and wrapped rather
 * than truncated: a figure whose arithmetic is cut off mid-line is back
 * to being a number to trust. */
.cite-expression {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

/* A published question set, shown read-only under its version line. */
.section pre {
  overflow: auto;
  max-height: 24rem;
  font-size: 0.8rem;
  white-space: pre;
}
