/* PX Data operations overview. Platform X brand tokens first; see
   docs/UI_DESIGN.md. */
@font-face {
  font-family: "Fira Sans";
  src: url("assets/fonts/FiraSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("assets/fonts/FiraSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --primary-main: #0068a5; --primary-dark: #004e82; --primary-light: #42a5f5;
  --secondary-main: #607d8b; --secondary-dark: #455a64; --secondary-light: #90a4ae;
  --background: #ffffff; --surface: #ebebeb;
  --text-primary: #212121; --text-secondary: #666666; --text-disabled: #9e9e9e;
  --text-inverted: #ffffff;
  --success: #2e7d32; --info: #0288d1; --error: #d32f2f; --warning: #ef6c00;
  /* Additional approved Platform X accents from the compact brand palette. */
  --brand-blue-accent: #179fdb; --brand-surface: #f0f3f5; --brand-grey: #575756;
  --cta-orange: #fa931d; --cta-green: #4caf50; --cta-pink: #db3486;
  --font-text: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-logo: "Fira Sans", system-ui, sans-serif;

  --bg: var(--background); --panel: var(--background); --panel-2: var(--surface);
  --text: var(--text-primary); --muted: var(--text-secondary); --faint: var(--text-disabled);
  --line: rgb(96 125 139 / 30%);
  --accent: var(--primary-main); --accent-hover: var(--primary-dark);
  --accent-soft: rgb(0 104 165 / 10%);
  /* Exact CTA colours are used for controls and indicators. Darker semantic
     text variants retain contrast on the light background. */
  --ok: var(--success); --ok-indicator: var(--cta-green);
  --warn: var(--warning); --warn-indicator: var(--cta-orange);
  --bad: var(--error); --bad-indicator: var(--cta-pink);
  --idle: var(--secondary-main); --idle-bg: rgb(96 125 139 / 10%);
  --radius: 12px; --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font-text);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Keep the public welcome screen inside the visual viewport. Its content may
   scroll on a small display, but the document itself must not expose an empty
   strip below the split-screen background. */
body.welcome-open {
  display: flex; flex-direction: column;
  position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden;
  background: linear-gradient(to right, var(--primary-main) 0 33.333%, var(--bg) 33.333% 100%);
}
body.welcome-open #welcome {
  flex: 1 1 0; width: 100%; height: auto; min-height: 0; margin: 0;
  overflow-y: auto; overscroll-behavior: contain;
}

/* --- header and tabs ------------------------------------------------------ */
#app-chrome { position: sticky; top: 0; z-index: 20; }
header {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--primary-main); color: var(--text-inverted);
  border-bottom: 1px solid var(--primary-dark); box-shadow: var(--shadow);
}
.title { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: block; width: 116px; height: auto; }
h1 { font-family: var(--font-logo); font-size: 18px; font-weight: 400; margin: 0; letter-spacing: -0.02em; }
h2, h3 { letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 700; margin: 0; }
.meta { display: flex; align-items: center; gap: 10px; color: rgb(255 255 255 / 80%); font-size: 13px; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--primary-dark); background: var(--text-inverted); border-radius: 999px; padding: 2px 8px; }
header button, header button.quiet { color: var(--text-inverted); border-color: rgb(255 255 255 / 60%); background: transparent; }
header button:hover, header button.quiet:hover { color: var(--primary-dark); background: var(--text-inverted); border-color: var(--text-inverted); }
.tabs { display: flex; gap: 2px; padding: 0 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); padding: 10px 12px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--text-inverted); background: var(--primary-dark); filter: none; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
/* Tabs are links (open in a new browser tab); same look as the buttons were. */
.tabs a { display: inline-block; text-decoration: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 10px 12px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text-inverted); background: var(--primary-dark); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* --- layout ----------------------------------------------------------------- */
main { padding: 20px 24px 40px; display: grid; gap: 16px; max-width: 1440px; margin: 0 auto; }
@media (max-width: 640px) { main, header { padding-left: 16px; padding-right: 16px; } .tabs { padding: 0 8px; } }
section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.section-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
section > h2 { margin-bottom: 10px; }
.narrow { max-width: 520px; width: 100%; margin: 0 auto; }
#welcome { display: grid; gap: 16px; padding-top: 48px; }
#welcome {
  grid-template-columns: minmax(300px, 2fr) minmax(360px, 4fr); gap: 0; padding: 0;
  max-width: none; align-items: center;
}
.welcome-brand {
  align-self: stretch; grid-row: 1 / span 2; display: grid; place-content: center; gap: 8px;
  min-height: 420px; padding: 40px; color: var(--text-inverted);
  background: var(--primary-main) url("assets/login-bg.png") center / cover no-repeat;
  font-size: 16px;
}
.welcome-brand img { width: min(260px, 80%); height: auto; }
#welcome > section { width: min(520px, calc(100% - 48px)); }
@media (max-width: 760px) {
  body.welcome-open { background: var(--bg); }
  #welcome { grid-template-columns: 1fr; align-items: start; }
  .welcome-brand { grid-row: auto; min-height: 150px; place-content: center start; padding: 28px; }
  .welcome-brand img { width: 210px; }
  #welcome > section { margin: 28px auto; }
}

/* --- controls --------------------------------------------------------------- */
button {
  font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 4px; padding: 8px 22px; cursor: pointer; line-height: 1.2; text-transform: none;
}
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; }
button.quiet { background: transparent; color: var(--accent); border-color: var(--line); }
button.quiet:hover { border-color: var(--accent); filter: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 8px 10px; min-width: 0;
}
input[type=search] { width: 240px; max-width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#admin-views { justify-self: start; }
/* A registration just sent (faint) or refused (red), above its table's rows. */
tr.row-pending td, tr.action-note.sending td, tr.action-note.done td { opacity: 0.55; font-style: italic; }
tr.row-failed td, tr.action-note.failed td { background: rgb(213 0 0 / 6%); }
tr.row-failed td:first-child, tr.action-note.failed td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.action-note .actions.inline { display: inline-flex; gap: 6px; margin-left: 8px; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px;
  max-height: 220px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.choices label.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: normal; }
.choices label.check.all { grid-column: 1 / -1; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; }
.segmented button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--panel);
  color: var(--muted); padding: 7px 12px; font-weight: 500; }
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--text-inverted); background: var(--primary-dark); }
.segmented button.active { color: var(--text-inverted); background: var(--primary-main); }
.integration-overview p { margin: 4px 0 0; }
.empty-note { color: var(--muted); padding: 12px 0 0; }
#database-integration-sections { display: grid; gap: 16px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
#language { padding: 4px 8px; }

/* --- summary chips ---------------------------------------------------------- */
.summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 18px; }
.summary .count { color: var(--muted); margin-right: 6px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metric-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); }
.metric-card .label, .metric-card .hint { color: var(--muted); font-size: 12px; }
.metric-card strong { color: var(--primary-dark); font-size: 24px; font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 10px; cursor: pointer; background: var(--panel); color: var(--text); font-weight: 500; }
.chip:hover { filter: none; border-color: var(--accent); }
.chip b { font-weight: 650; }
.chip.active { border-color: var(--accent); background: var(--accent-soft); }
.truncated-error { display: block; max-width: 36ch; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; cursor: help; }

/* --- tables ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 500; font-size: 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; }
tr.empty td { color: var(--faint); text-align: center; padding: 18px; }
tr.dataset { cursor: default; }
.dataset-link { appearance: none; border: 0; background: none; color: var(--accent); padding: 0;
  font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.dataset-link:hover { color: var(--accent-hover); background: none; text-decoration: underline; }
tr.expanded td { border-bottom: none; background: var(--panel-2); }
tr.notes td { white-space: normal; padding: 2px 10px 14px; background: var(--panel-2); color: var(--muted); font-size: 12px; }
tr.notes ul { margin: 0 0 10px; padding-left: 18px; }
.sub { color: var(--muted); font-size: 12px; }
.none { color: var(--faint); }
.bad-text { color: var(--bad); }

/* --- status ----------------------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.s-OK::before { background: var(--ok-indicator); }
.s-SUSPENDED::before, .s-FAILED::before, .s-STUCK::before, .s-DRIFT::before { background: var(--bad-indicator); }
.s-RECONCILE::before, .s-LAGGING::before { background: var(--warn-indicator); }
.s-SUSPENDED, .s-FAILED, .s-STUCK, .s-DRIFT { color: var(--bad); font-weight: 600; }
.s-RECONCILE, .s-LAGGING { color: var(--warn); }
.s-PAUSED, .s-NOT_SCHEDULED { color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.window { display: inline-block; background: var(--idle-bg); border-radius: 6px; padding: 1px 7px; margin: 1px 4px 1px 0; font-size: 12px; }

/* --- progress ----------------------------------------------------------------- */
.bar { display: inline-block; width: 120px; height: 6px; background: var(--idle-bg); border-radius: 3px;
  overflow: hidden; vertical-align: middle; margin-right: 8px; }
.bar span { display: block; height: 100%; background: var(--accent); }

/* --- row actions -------------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
td button { font-size: 12px; padding: 3px 9px; }
td.row-actions { width: 1%; text-align: right; }
td.row-actions .actions { justify-content: flex-end; flex-wrap: nowrap; }
.connection-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
@media (hover: hover) {
  td.row-actions .actions { opacity: 0; transition: opacity 0.12s; }
  tr:hover td.row-actions .actions, td.row-actions .actions:focus-within { opacity: 1; }
}
.action-menu { display: inline-block; position: relative; }
.action-menu > summary { display: inline-grid; place-items: center; width: 32px; height: 32px;
  color: var(--accent); border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  list-style: none; background: var(--panel); }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary:hover, .action-menu[open] > summary { border-color: var(--accent); background: var(--accent-soft); }
.action-menu > summary svg { width: 20px; height: 20px; fill: currentColor; }
.action-menu-panel { position: fixed; z-index: 12; min-width: 210px; max-height: calc(100vh - 16px); overflow-y: auto;
  display: grid; padding: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 18%); }
.action-menu-panel button, td .action-menu-panel button { width: 100%; padding: 8px 10px; border: 0;
  background: transparent; color: var(--text); text-align: left; font-weight: 500; }
.action-menu-panel button:hover { color: var(--text-inverted); background: var(--primary-dark); }

/* --- dialog, toast, forms ----------------------------------------------------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text);
  width: min(480px, calc(100vw - 32px)); padding: 20px; box-shadow: 0 12px 40px rgb(0 0 0 / 25%); }
dialog::backdrop { background: rgb(10 14 20 / 45%); }
dialog label, .narrow label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 13px; }
dialog textarea, dialog input, dialog select, .narrow input, .narrow select { width: 100%; }
.action-warning { padding: 10px 12px; color: var(--text); background: rgb(250 147 29 / 12%);
  border-left: 3px solid var(--warn); border-radius: 4px; }
dialog.long-form { width: min(780px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px);
  overflow-y: auto; }
dialog.long-form #action-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px; }
dialog.long-form .dialog-buttons { position: sticky; bottom: -20px; z-index: 1; margin: 12px -20px -20px;
  padding: 12px 20px 20px; background: var(--panel); border-top: 1px solid var(--line); }
.action-field { min-width: 0; }
@media (max-width: 680px) { dialog.long-form #action-fields { grid-template-columns: 1fr; } }
.dialog-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
dialog.drawer { width: min(760px, calc(100vw - 32px)); max-width: none; height: 100dvh; max-height: 100dvh;
  margin: 0 0 0 auto; border-radius: 0; border-width: 0 0 0 1px; padding: 20px;
  overflow-y: auto; }
.drawer-head { position: sticky; top: -20px; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin: -20px -20px 16px; padding: 16px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer-head .icon-button { flex: none; }
.dataset-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin-bottom: 16px; }
.dataset-detail-grid > div { padding: 10px 12px; background: var(--panel-2); border-radius: 8px; }
.drawer-actions { display: flex; justify-content: flex-end; margin: 12px 0 16px; }
@media (max-width: 640px) {
  dialog.drawer { width: 100vw; }
  .dataset-detail-grid { grid-template-columns: 1fr; }
}
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); z-index: 3; }
.toast.bad { border-left-color: var(--bad); }
/* Shown as a popover (top layer): reset the UA popover box. */
.toast:popover-open { inset: auto 16px 16px auto; margin: 0; color: var(--text); }
.pill.requested { background: var(--accent-soft); color: var(--accent); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--muted); }
.message { padding: 24px 16px; color: var(--muted); text-align: center; }

/* --- home: first sight ----------------------------------------------------- */
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.activity-counts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
#activity th:nth-child(1) { width: 38%; }
#activity th:nth-child(2) { width: 24%; }
#activity th:nth-child(3) { width: 20%; }
#activity tbody tr { cursor: pointer; }
.tile { text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 4px; }
.tile:hover { border-color: var(--accent); filter: none; }
.tile .label { color: var(--muted); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.tile .label::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--idle); }
.tile .value { font-size: 32px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.tile .hint { color: var(--faint); font-size: 12px; }
.tile.p-running .label::before { background: var(--accent); }
.tile.p-waiting .label::before { background: var(--warn-indicator); }
.tile.p-failed .label::before { background: var(--bad-indicator); }
.tile.p-failed .value { color: var(--bad); }
.tile.p-done .label::before { background: var(--ok-indicator); }
.attention, .source-list { list-style: none; margin: 0; padding: 0; }
.attention li, .source-list li { display: flex; gap: 12px; align-items: baseline; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child, .source-list li:last-child { border-bottom: none; }
.attention li { cursor: pointer; }
.attention .why { color: var(--muted); font-size: 12px; white-space: normal; }
.attention .more, .empty-note { color: var(--faint); font-size: 13px; }
.phase { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; background: var(--idle-bg); color: var(--muted); }
.phase.p-running { background: var(--accent-soft); color: var(--accent); }
.phase.p-waiting { color: var(--warn); }
.phase.p-failed { color: var(--bad); }
.phase.p-done { color: var(--ok); }

pre.secret { background: var(--panel-2); border: 1px solid var(--line); padding: 12px; border-radius: 8px;
  max-width: 60ch; overflow-x: auto; user-select: all; }
.stack { margin: 4px 0 10px; }
.stack h3 { font-size: 13px; margin: 0 0 6px; color: var(--bad); font-weight: 600; }
.stack h3.resolved { color: var(--muted); }
.run-timings { margin: 6px 0 12px; }
.run-timings h3 { font-size: 13px; margin: 0 0 6px; font-weight: 600; }
.run-timings td, .run-timings th { padding: 4px 8px; white-space: nowrap; }
.stack table { width: auto; }
.stack td { padding: 3px 12px 3px 0; border: 0; }
.error-text b { font-weight: 600; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 12px 0 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.notes-list { margin: 8px 0; padding-left: 18px; color: var(--text); font-size: 13px; }
.notes-list li { margin: 3px 0; }
#draft-columns input:not([type=checkbox]), #draft-columns select { width: 100%; min-width: 120px; }
.form-grid.wide { grid-column: 1 / -1; margin: 0; }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); font-weight: 600; }
button.danger:hover { background: var(--bad); color: #fff; filter: none; }
.halt-banner { background: var(--warn); color: #fff; padding: 10px 32px; display: grid; gap: 6px; }
.halt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.halt-line button { background: #fff; color: var(--warn); border-color: #fff; margin-left: auto; }
@media (max-width: 640px) { .halt-banner { padding: 10px 16px; } }
h3.step { font-size: 14px; margin: 18px 0 8px; }
.table-wrap.short { max-height: 280px; overflow-y: auto; }
p.note { margin: 0 0 8px; color: var(--accent); font-size: 13px; }
.progress { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 13px; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.picker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.picker label { color: var(--muted); font-size: 13px; }
.picker select { min-width: 260px; }
.config-view { margin: 16px 0 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (max-width: 640px) { .config-view { margin: 12px 0 0; padding: 14px; } }
.facts { display: grid; gap: 12px 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 8px 0 12px; }
.facts .sub { display: block; margin-bottom: 2px; }
tr.muted td { color: var(--muted); }
details.rules { margin: 6px 0 12px; font-size: 13px; }
details.rules summary { cursor: pointer; color: var(--accent); }
.changes { margin: 8px 0 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.changes h3 { margin: 0 0 6px; font-size: 14px; }
.name-cell { display: grid; gap: 4px; min-width: 200px; }
.term-hint { font-size: 12px; line-height: 1.35; }
.warn-text { color: var(--warn, #f5a524); }
.help { max-width: 920px; line-height: 1.55; }
.help h2 { margin: 28px 0 8px; font-size: 18px; }
.help section:first-of-type h2 { margin-top: 8px; }
.help code { font-size: 13px; }
.help-toc { font-size: 13px; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.help-table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.help-table th, .help-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.help dt { font-weight: 600; margin-top: 10px; }
.help dd { margin: 2px 0 0 0; color: var(--muted); }
.help section { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.help { max-width: 1000px; }
.help a { color: var(--accent); text-decoration: none; }
.help a:hover { text-decoration: underline; }
.help-table { table-layout: auto; }
.help-table td, .help-table th { white-space: normal; }
.phase.p-onboarding_failed { color: var(--bad); }
/* Shelved: a grey row, not a transparent one -- opacity would also make the
   row's action menu (a child) see-through. */
tr.dataset.muted td { background: var(--panel-2); color: var(--muted); }
tr.dataset.muted .dataset-link { color: var(--muted); }
/* The refresh button turns while the page waits for the server. */
button.busy::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px;
  vertical-align: -1px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { button.busy::before { animation: none; } }

/* Fixed column widths: columns keep their width whatever a refresh brings. */
.table-wrap > table { table-layout: fixed; min-width: 760px; }
.table-wrap > table td { white-space: normal; overflow-wrap: anywhere; }
.table-wrap > table td.row-actions { width: auto; }
td.row-actions .actions { flex-wrap: wrap; }
#consumables th:nth-child(1) { width: 50%; } #consumables th:nth-child(2) { width: 20%; }
#datasets th:nth-child(1) { width: 24%; } #datasets th:nth-child(2) { width: 14%; }
#datasets th:nth-child(3) { width: 17%; } #datasets th:nth-child(4) { width: 10%; }
#datasets th:nth-child(5) { width: 8%; } #datasets th:nth-child(6) { width: 13.5%; }
#runs th:nth-child(1) { width: 34%; } #runs th:nth-child(2) { width: 10%; }
#runs th:nth-child(3) { width: 12%; } #runs th:nth-child(4) { width: 16%; }
#executions th:nth-child(1) { width: 40%; } #executions th:nth-child(2) { width: 20%; }
#sources th:nth-child(1) { width: 18%; } #sources th:nth-child(2) { width: 12%; }
#sources th:nth-child(3) { width: 24%; } #sources th:nth-child(4) { width: 28%; }
#plans th:nth-child(1) { width: 34%; } #plans th:nth-child(2) { width: 14%; } #plans th:nth-child(3) { width: 22%; }
#connections th:nth-child(1) { width: 18%; } #connections th:nth-child(2) { width: 14%; }
#connections th:nth-child(3) { width: 14%; } #connections th:nth-child(4) { width: 18%; }
#connections th:nth-child(5) { width: 16%; }
#discovery-schemas th:nth-child(1), #discovery-objects th:nth-child(1) { width: 36px; }
#discovery-schemas th:nth-child(3), #discovery-schemas th:nth-child(4) { width: 18%; }
#discovery-objects th:nth-child(2) { width: 32%; } #discovery-objects th:nth-child(3) { width: 10%; }
#discovery-objects th:nth-child(4) { width: 12%; } #discovery-objects th:nth-child(5) { width: 16%; }
#draft-runs th:nth-child(1) { width: 16%; } #draft-runs th:nth-child(2) { width: 34%; }
#draft-runs th:nth-child(3) { width: 16%; } #draft-runs th:nth-child(4) { width: 18%; }
#drafts th:nth-child(1) { width: 30%; } #drafts th:nth-child(2) { width: 12%; }
#drafts th:nth-child(3) { width: 10%; } #drafts th:nth-child(4) { width: 20%; } #drafts th:nth-child(5) { width: 12%; }
#draft-columns th:nth-child(1) { width: 16%; } #draft-columns th:nth-child(2) { width: 10%; }
#draft-columns th:nth-child(3) { width: 7%; } #draft-columns th:nth-child(4) { width: 27%; }
#draft-columns th:nth-child(5) { width: 9%; } #draft-columns th:nth-child(6) { width: 15%; }
#glossary th:nth-child(1) { width: 24%; } #glossary th:nth-child(2) { width: 54%; } #glossary th:nth-child(3) { width: 16%; }
#glossary th:last-child, #glossary td:last-child { width: 48px; text-align: right; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }
.pager button:disabled { opacity: .45; cursor: default; }
.icon-button { min-width: 36px; width: 36px; height: 36px; padding: 6px; color: var(--primary); background: transparent; border-color: transparent; }
.icon-button:hover { background: var(--surface-alt); border-color: var(--border); }
.icon-button svg { display: block; width: 20px; height: 20px; fill: currentColor; }
#keys th:nth-child(1) { width: 26%; } #keys th:nth-child(2) { width: 16%; } #keys th:nth-child(3) { width: 38%; }
#requests th:nth-child(1) { width: 22%; } #requests th:nth-child(2) { width: 26%; }
#requests th:nth-child(3) { width: 18%; } #requests th:nth-child(4) { width: 18%; }
#audit th:nth-child(1) { width: 15%; } #audit th:nth-child(2) { width: 17%; } #audit th:nth-child(3) { width: 14%; }
#audit th:nth-child(4) { width: 18%; } #audit th:nth-child(5) { width: 8%; }
.phase { white-space: nowrap; }
.chip.empty { opacity: 0.55; }
.choices label.check:has(input:disabled) { opacity: 0.5; }
th.pick, td.pick { width: 28px; padding-right: 0; }
.bulk-bar { min-height: 0; margin: 4px 0 8px; gap: 8px; align-items: center; }
.bulk-bar:empty { display: none; }
dialog.bulk { width: min(760px, calc(100vw - 32px)); }
dialog.bulk .bulk-list { max-height: 220px; overflow-y: auto; margin: 8px 0; padding-left: 20px; }
dialog.bulk #bulk-results .table-wrap { max-height: 50vh; overflow-y: auto; }
dialog.bulk #bulk-body > * + * { margin-top: 8px; }
