/*
 * Operator app styles. Tokens and components taken from the approved design canvas
 * (https://claude.ai/artifact/8xmSdFn7PADJVpbW2trqBq). Desktop-first; must hold at 1280 px.
 */

/* ---- Fonts (served from @fontsource packages, see src/web/static.ts) ---- */
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
}

/* ---- Tokens ---- */
:root {
  --ground: #f3f4f1;
  --nav: #ebece6;
  --surface: #ffffff;
  --surface-sunk: #f7f8f5;
  --ink: #17191e;
  --ink-2: #3f454e;
  --ink-3: #4e545e;
  --muted: #5b616b;
  --line: #dddfd8;
  --line-soft: #e6e7e1;
  --line-strong: #c9ccc3;

  --accent: #1d4e89;
  --accent-hover: #153a68;
  --accent-soft: #e5ecf6;

  /* Status */
  --running-bg: #e5ecf6;
  --running-fg: #1d4e89;
  --awaiting-bg: #eee8f8;
  --awaiting-fg: #5a3e9e;
  --held-bg: #fcefd2;
  --held-fg: #7a4b00;
  --done-bg: #e3f1e3;
  --done-fg: #23612f;
  --blocked-bg: #ecebe7;
  --blocked-fg: #3f454e;
  --failed-bg: #fbe4e1;
  --failed-fg: #9b2c22;
  --ok: #2f7a3f;
  --danger-line: #b8453a;
  --marker-bg: #ffe27a;
  --marker-fg: #3d3000;
  --notice-bg: #fff6d6;
  --notice-fg: #5c4400;

  /* Models (the product owner's pipeline page) */
  --opus-bg: #eeedfe;
  --opus-fg: #534ab7;
  --opus-line: #afa9ec;
  --sonnet-bg: #e1f5ee;
  --sonnet-fg: #0f6e56;
  --sonnet-line: #5dcaa5;
  --haiku-bg: #faeeda;
  --haiku-fg: #7a4b00;
  --haiku-line: #fac775;
  --none-bg: #f1efe8;
  --none-fg: #4e4d49;
  --none-line: #b4b2a9;

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Source Serif 4", Georgia, serif;

  --radius: 6px;
  --radius-card: 8px;
}

/* ---- Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.muted {
  color: var(--muted);
}
.num {
  font-variant-numeric: tabular-nums;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- App frame ---- */
.app {
  display: flex;
  min-height: 100vh;
  min-width: 1280px;
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nav {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 14px 20px;
  background: var(--nav);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  text-decoration: none;
  color: var(--ink);
}
.nav-brand:hover {
  color: var(--ink);
}
.nav-brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-brand-sub {
  font-size: 12px;
  color: var(--muted);
}
.nav-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}
.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--line);
}
.nav-item-label {
  flex: 1;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--held-fg);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}
.nav-spacer {
  flex: 1;
}
.worker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  border-radius: var(--radius);
  background: #f6f7f3;
  border: 1px solid var(--line);
}
.worker-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.worker-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--ok);
}
.worker-dot.is-stopped {
  background: var(--danger-line);
}
.worker-detail {
  font-size: 12px;
  color: var(--muted);
}
.nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 0 10px;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---- Page header ---- */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 40px 20px;
  border-bottom: 1px solid var(--line);
}
.page-header.has-tabs {
  padding-bottom: 0;
}
.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.page-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 14px;
  color: var(--ink-3);
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb a {
  text-decoration: none;
}
.page-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 40px 40px;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tab[aria-selected="true"] {
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.tab-count {
  font-size: 12px;
  color: var(--muted);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 14px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: #ffffff;
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  font-weight: 400;
}
.btn-quiet:hover {
  border-color: transparent;
  background: rgba(0, 0, 0, 0.04);
}
.btn-danger {
  border-color: transparent;
  background: transparent;
  color: var(--failed-fg);
}
.btn-danger:hover {
  border-color: transparent;
  background: var(--failed-bg);
  color: var(--failed-fg);
}
.btn-small {
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  border-color: var(--line-strong);
  background: var(--line-soft);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: 44px;
  padding: 0;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}
.card-pad {
  padding: 20px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.split {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}
.rail {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Forms ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-size: 14px;
  font-weight: 500;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.error-text {
  font-size: 13px;
  color: var(--failed-fg);
}
.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 400 14px var(--sans);
}
.textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
.input.mono,
.textarea.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger-line);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
fieldset.card {
  margin: 0;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
fieldset.card > legend {
  padding: 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.checkbox-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.checkbox-row input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

/* ---- Tables ---- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: top;
}
.table.compact td {
  padding: 8px 10px;
  font-size: 13px;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: 20px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 20px;
}
.table .right {
  text-align: right;
}
.cell-title {
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ---- Chips ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
.chip-sm {
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 11.5px;
}
.chip-running {
  background: var(--running-bg);
  color: var(--running-fg);
}
.chip-awaiting {
  background: var(--awaiting-bg);
  color: var(--awaiting-fg);
}
.chip-held {
  background: var(--held-bg);
  color: var(--held-fg);
}
.chip-done {
  background: var(--done-bg);
  color: var(--done-fg);
}
.chip-blocked,
.chip-discarded {
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
.chip-failed {
  background: var(--failed-bg);
  color: var(--failed-fg);
}
.chip-layer-1 {
  background: var(--done-bg);
  color: var(--done-fg);
}
.chip-layer-2 {
  background: var(--running-bg);
  color: var(--running-fg);
}
.chip-layer-3 {
  background: var(--held-bg);
  color: var(--held-fg);
}
.chip-layer-4 {
  background: var(--failed-bg);
  color: var(--failed-fg);
}

.model {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--none-line);
  background: var(--none-bg);
  color: var(--none-fg);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.model-opus {
  border-color: var(--opus-line);
  background: var(--opus-bg);
  color: var(--opus-fg);
}
.model-sonnet {
  border-color: var(--sonnet-line);
  background: var(--sonnet-bg);
  color: var(--sonnet-fg);
}
.model-haiku {
  border-color: var(--haiku-line);
  background: var(--haiku-bg);
  color: var(--haiku-fg);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 400 13px var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.filter[aria-pressed="true"],
.filter[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

/* ---- Notices ---- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 14px;
}
.notice-warn {
  background: var(--notice-bg);
  color: var(--notice-fg);
}
.notice-error {
  background: var(--failed-bg);
  color: var(--failed-fg);
}
.provisional {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--notice-bg);
  color: var(--notice-fg);
  font-size: 12.5px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 40px;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
}

/* ---- Progress bar ---- */
.bar {
  height: 4px;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bar-lg {
  height: 6px;
  border-radius: 3px;
}

/* ---- Login ---- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-inner {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.login-brand {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.login-tagline {
  font-size: 15px;
  color: var(--ink-3);
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}
.login-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Phase 02: clients and client setup ---- */
.grow {
  flex: 1;
  min-width: 0;
}
fieldset.bare {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.new-client {
  position: relative;
}
.new-client > summary {
  list-style: none;
}
.new-client > summary::-webkit-details-marker {
  display: none;
}
.new-client-form {
  position: absolute;
  right: 0;
  top: 52px;
  z-index: 10;
  width: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 32px rgba(23, 25, 30, 0.12);
}
.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}
.cta-error {
  grid-column: 1 / -1;
  margin-top: -6px;
}
.checklist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
/* Readiness panel: pending is neutral, not an error; the form has not been saved yet. */
.checklist .is-pending {
  color: var(--ink-2);
}
.checklist .is-pending::before {
  content: "○";
  margin-right: 8px;
  color: var(--muted);
}
.checklist .is-done {
  color: var(--muted);
}
.checklist .is-done::before {
  content: "✓";
  margin-right: 8px;
  color: var(--done-fg);
  font-weight: 600;
}
.bar > .ready-fill {
  background: var(--held-fg);
}
.bar > .ready-fill.is-complete {
  background: var(--ok);
}
.versions {
  margin: 0;
  padding: 0;
  list-style: none;
}
.versions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.versions li:last-child {
  border-bottom: 0;
}
.add-sources {
  display: flex;
  gap: 24px;
  padding: 20px 24px;
}
.layer-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.layer-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}
.swatch-1 {
  background: var(--ok);
}
.swatch-2 {
  background: var(--accent);
}
.swatch-3 {
  background: #b07a12;
}
.swatch-4 {
  background: var(--danger-line);
}
.block-row {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.block-row:last-child {
  border-bottom: 0;
}
.block-letter {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
}
.rule-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.rule-items li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-id {
  width: 24px;
  font-size: 12px;
}
.item-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- Phase 03: pautas, runs, drawer, inbox, registry ---- */
.pauta-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.key-hint {
  font-size: 13px;
  color: var(--ink-2);
}
.key-ok {
  color: var(--done-fg);
}
.key-warn {
  color: var(--held-fg);
}
.pauta-extra > summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  width: max-content;
}
.status-detail {
  max-width: 320px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.run-meta {
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
}

/* Stage list */
.stage-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.stage-row {
  padding: 12px 20px;
  border-bottom: 1px solid #eeefea;
}
.stage-row:last-child {
  border-bottom: 0;
}
.stage-row.is-running {
  background: #f4f7fc;
}
.stage-row.is-waiting {
  background: #f6f2fc;
}
.stage-row.is-failed {
  background: #fdf3f1;
}
.stage-row.is-pending {
  color: var(--muted);
}
.stage-grid {
  display: grid;
  grid-template-columns: 28px 28px minmax(0, 1fr) 170px 90px 90px;
  align-items: center;
  gap: 12px;
}
.stage-num {
  color: var(--muted);
}
.stage-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
a.stage-name:hover {
  color: var(--accent);
  text-decoration: underline;
}
.stage-row.is-pending .stage-name {
  color: var(--ink-2);
}
.stage-code {
  font-size: 11.5px;
  color: var(--muted);
}
.stage-detail {
  margin: 8px 0 0 68px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-hover);
}
.stage-detail.is-error {
  color: var(--failed-fg);
}
.stage-routing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 20px;
  padding: 8px 12px 8px 68px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--muted);
}
.spin {
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spin {
    animation: none;
  }
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px 12px;
  font-size: 13.5px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-2);
}

/* Article */
.article {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 48px 64px 56px;
  font-family: var(--serif);
  color: #1c1e22;
}
.article-notice {
  font-family: var(--sans);
}
.answer-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  border-radius: var(--radius-card);
  background: #f4f7fc;
  border: 1px solid #d3deee;
}
.answer-block p {
  font-size: 18px;
  line-height: 1.65;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.answer-block .eyebrow {
  color: var(--accent);
}
.article-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 18px;
  line-height: 1.7;
}
.article-body h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.article-body h2 {
  margin-top: 14px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 600;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 600;
}
.article-body ul,
.article-body ol {
  margin: 0;
  padding-left: 24px;
}
.marker {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--marker-bg);
  color: var(--marker-fg);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  outline: 1px dashed #b08a00;
}
.cite {
  font-family: var(--mono);
  font-size: 11px;
  vertical-align: super;
  text-decoration: none;
  margin-left: 2px;
}
.serif {
  font-family: var(--serif);
}
.score {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
}
.verdict-publicar {
  background: var(--done-bg);
  color: var(--done-fg);
  font-weight: 600;
}
.verdict-corrigir {
  background: var(--held-bg);
  color: var(--held-fg);
}
.verdict-reescrever {
  background: var(--blocked-bg);
  color: var(--blocked-fg);
}
.verdict-segurar {
  background: var(--failed-bg);
  color: var(--failed-fg);
}
.block-bar {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.cited {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
}
.cited li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.stack-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.stack-dl div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stack-dl dt {
  color: var(--muted);
}
.stack-dl dd {
  margin: 0;
}

/* Drawer */
.drawer-root {
  position: fixed;
  inset: 0;
  z-index: 50;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 25, 30, 0.42);
}
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(23, 25, 30, 0.18);
  overflow-y: auto;
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.drawer-attempts {
  display: flex;
  gap: 6px;
  padding: 14px 28px 0;
}
.drawer-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.drawer-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-meta dt {
  color: var(--muted);
}
.drawer-meta dd {
  margin: 0;
}
.drawer-body {
  padding: 18px 28px 24px;
}
.drawer-body summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}
.code {
  margin: 8px 0 0;
  padding: 16px 18px;
  max-height: 480px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--ink);
  color: #e6e8ec;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Inbox */
.inbox {
  display: flex;
  flex: 1;
  min-height: 0;
}
.inbox-list {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 20px 24px 40px;
  border-right: 1px solid var(--line);
}
.inbox-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.inbox-item:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.inbox-item[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.inbox-item-title {
  font-size: 14.5px;
  font-weight: 600;
}
.inbox-item-line {
  font-size: 13px;
  color: var(--ink-2);
}
.inbox-detail {
  flex: 1;
  min-width: 0;
  padding: 24px 40px 40px;
}
.decision {
  width: 320px;
  flex-shrink: 0;
  align-self: flex-start;
}
.correction.is-blocking {
  border-color: var(--danger-line);
}
.quote {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-sunk);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.outline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.outline li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid #eeefea;
}
.outline li:last-child {
  border-bottom: 0;
}
.marker-chip {
  background: var(--notice-bg);
  color: var(--notice-fg);
}
.tab.is-current {
  font-weight: 600;
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ---- Help: tooltips and the guide (docs/ux/audit-2026-09.md) ---- */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}
.tip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 12px;
}
.tip-trigger {
  width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  font: 600 11px var(--sans);
  cursor: help;
}
.tip-trigger:hover,
.tip-trigger:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.tip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font: 400 12.5px / 1.45 var(--sans);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s;
}
/* Table cards clip overflow for their rounded corners; let tooltips out and round the header. */
.table-card:has(.tip) {
  overflow: visible;
}
.table-card:has(.tip) thead tr:first-child th:first-child {
  border-top-left-radius: var(--radius-card);
}
.table-card:has(.tip) thead tr:first-child th:last-child {
  border-top-right-radius: var(--radius-card);
}
/* Header tooltips open downward, into the table. */
:where(th) .tip-bubble {
  top: calc(100% + 8px);
  bottom: auto;
}
:where(th.right) .tip-bubble {
  left: auto;
  right: 0;
  transform: none;
}
.tip-below-end > .tip-bubble {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
  transform: none;
}
.tip:hover > .tip-bubble,
.tip:focus-within > .tip-bubble,
.tip:focus > .tip-bubble {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .tip-bubble {
    transition: none;
  }
}
.guide-toc {
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
}
.guide {
  max-width: 980px;
}
.guide-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.55;
}
.guide-defs {
  margin: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 10px 20px;
  font-size: 14px;
}
.guide-defs dt {
  font-weight: 600;
}
.guide-defs dd {
  margin: 0;
  color: var(--ink-2);
}
.table-wrap {
  overflow-x: auto;
}
.next-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-steps ol {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.step-done {
  color: var(--done-fg);
  text-decoration: line-through;
}
.decision-help {
  margin: -4px 0 4px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Fontes tab: vouch for a source (docs/product/internal-app.md §5.2) */
.source-actions {
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.source-verify {
  gap: 6px;
  flex-wrap: nowrap;
}
.source-verify .select {
  height: 30px;
  width: auto;
  padding-block: 0;
  font-size: 13px;
}
