/* Design A (approved 2026-08-26): the visual vocabulary of ../gan/public/app.css,
   Lato with hierarchy by weight, white header, 12px sections, 44px controls.
   UI teal is always --teal-fill (white on it passes AA); brand teal only in the mark. */
:root {
  --teal: #00a7b5; --teal-dark: #008a96; --teal-text: #00707a; --teal-fill: #00707a; --teal-light: #e5f4f7;
  --gold: #ebb700; --gold-dark: #8b6d00; --gold-light: #fff8e1;
  --coral: #d4603a; --coral-dark: #a3432a; --coral-light: #fdf0eb;
  --ink: #1e1e1e; --body: #53565a; --border: #7c7f82; --line: #e1e4e6; --bg: #f4f7f8;
  --success: #1f6b45; --success-light: #eaf5ef;
  --warn: #8b6d00; --warn-light: #fff5d6;
  --error: #c4342d; --error-light: #fdeceb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; font-family: Lato, "Helvetica Neue", Arial, sans-serif; font-size: 15px; color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1 { margin: 0; font-size: 26px; font-weight: 900; color: var(--ink); }
p { margin: 0; line-height: 1.5; }
a { color: var(--teal-text); }
a:hover { color: var(--ink); }

/* Environment banner (buildout decision 7): on every page; prod is red. */
.envbar { padding: 8px 24px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
.envbar.training { background: var(--teal-light); color: var(--teal-text); border-bottom: 2px solid var(--teal-fill); }
.envbar.prod { background: var(--error); color: #fff; border-bottom: 3px solid #8a1f19; }

/* Header */
.top { height: 56px; padding: 0 24px; display: flex; align-items: center; gap: 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 18px; }
.brand img { display: block; width: 28px; height: 28px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 6px; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--body); }
.nav a[aria-current="page"] { background: var(--teal-light); color: var(--teal-text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who form { display: inline; }
.btn.link { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--teal-text); font-size: 14px; text-decoration: underline; cursor: pointer; }

/* Page */
.wrap { max-width: 720px; width: 100%; margin: 0 auto; padding: 24px 24px 40px; display: flex; flex-direction: column; gap: 20px; }
.wrap.narrow { max-width: 520px; }
.wrap.form { max-width: 980px; }
.wrap.wide { max-width: 1180px; }
.titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.titlebar p { margin-top: 6px; font-size: 14px; }
.section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.section h2 { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-text); padding-bottom: 10px; border-bottom: 2px solid var(--teal-light); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack.dev { padding-top: 16px; border-top: 1px dashed #ccc; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 8px; }
label, legend { font-size: 15px; font-weight: 700; color: var(--ink); }
.req { color: var(--coral-dark); font-weight: 700; font-size: 12px; }
.hint, .muted { font-size: 13px; color: var(--body); }
input, select { height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; width: 100%; }
input.code { height: 56px; font-size: 28px; letter-spacing: 6px; text-align: center; }
input:focus-visible, select:focus-visible, .btn:focus-visible, .check:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.85); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-weight: 400; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal-fill); }
.check:hover { border-color: var(--teal-dark); }
.check:has(input:checked) { background: var(--teal-light); border: 2px solid var(--teal-fill); color: var(--teal-text); font-weight: 700; padding: 0 13px 0 11px; }
.sub { padding: 12px 14px; background: var(--teal-light); border-radius: 8px; display: flex; flex-direction: column; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--teal-fill); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); }
.btn.secondary { background: #fff; color: var(--teal-text); border-color: var(--teal-dark); }
.btn.secondary:hover { background: var(--teal-light); }
.btn.quiet { background: #fff; color: var(--body); border-color: var(--border); }
.btn.quiet:hover { color: var(--ink); background: var(--bg); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* Alerts */
.alert { border-radius: 12px; padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; color: var(--ink); }
.alert svg { flex: none; }
.alert.ok { background: var(--success-light); border: 1px solid var(--success); }
.alert.ok b { color: var(--success); }
.alert.warn { background: var(--warn-light); border: 1px solid var(--warn); }
.alert.error { background: var(--error-light); border: 1px solid var(--error); flex-direction: column; gap: 4px; }
.alert ul { margin: 0; padding-left: 18px; }
.receipt { font-size: 13px; color: var(--body); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px; }

/* Pills */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 12px; background: var(--teal-light); color: var(--teal-text); white-space: nowrap; }
.pill.ok { background: var(--success-light); color: var(--success); }
.pill.bad { background: var(--error-light); color: #a12b25; }
.pill.warn { background: var(--gold-light); color: var(--gold-dark); }
.pill.meta { background: #f0f1f2; color: var(--body); }

/* Tables */
.tablewrap { overflow-x: auto; }
table.list { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.list th { padding: 12px 14px; background: #f9fafb; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--body); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.list td { padding: 12px 14px; border-bottom: 1px solid #eef0f2; vertical-align: middle; color: var(--ink); }
table.list tr:last-child td { border-bottom: 0; }
/* List filters: search and active pills above the table, a funnel per facet
   column opening one shared checklist panel. */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 0 1 320px; min-width: 200px; color: var(--body); }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.toolbar .search input { height: 40px; font-size: 14px; padding-left: 38px; }
.toolbar .active { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .count { margin-left: auto; font-size: 13px; color: var(--body); white-space: nowrap; }
.toolbar .count strong { color: var(--ink); }
.pill.filter { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; height: 30px; border: 0; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; }
.pill.filter:hover { background: var(--teal-fill); color: #fff; }
.pill.filter svg { flex: none; }
table.list th.facet { padding: 0; }
table.list th.facet button { display: inline-flex; align-items: center; gap: 6px; height: 100%; min-height: 40px; padding: 12px 14px; border: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--body); cursor: pointer; }
table.list th.facet button svg { color: #a0a3a6; }
table.list th.facet button:hover, table.list th.facet button[aria-expanded="true"] { color: var(--ink); }
table.list th.facet button.on, table.list th.facet button.on svg { color: var(--teal-text); }
.facet-pop { position: fixed; z-index: 50; width: 240px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(30, 30, 30, 0.12); display: flex; flex-direction: column; gap: 2px; }
.facet-pop label { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 6px; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
.facet-pop label:hover { background: var(--bg); }
.facet-pop input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal-fill); }
.facet-pop .n { margin-left: auto; font-size: 13px; color: var(--body); font-variant-numeric: tabular-nums; }
table.list .rowlink { font-weight: 700; }
.datetime { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--body); }
.tablefoot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; font-size: 13px; }
.tablefoot a { font-weight: 700; }
.tablefoot .note { margin-left: auto; }
.empty { padding: 28px 14px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 760px) {
  .top { padding: 0 16px; }
  .wrap { padding: 16px 16px 40px; }
  .who span:first-child { display: none; }
}

/* Per-step outcomes on the run page. */
.outcomes { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.outcomes li { padding: 10px 12px; border: 1px solid var(--line, #e3e5e8); border-radius: 8px; line-height: 1.5; }
.outcomes .pill { margin-right: 6px; }
